Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install reqired tlmgr in install script if necessary #215

Merged
merged 12 commits into from Mar 20, 2024
2 changes: 1 addition & 1 deletion steps/discover-repos.rb
Expand Up @@ -102,7 +102,7 @@
puts "Found #{found.count} total repositories in GitHub"

if found.count > opts[:total]
found = found.first(opts[:total]).to_h
found = found.first(opts[:total])
puts "We will use only the first #{opts[:total]} repositories"
end

Expand Down
100 changes: 28 additions & 72 deletions steps/install.sh
Expand Up @@ -47,77 +47,40 @@ if [ -n "${linux}" ]; then
apt-get install -y coreutils
fi

if ! parallel --version >/dev/null 2>&1; then
if [ -n "${linux}" ]; then
apt-get -y install parallel
else
echo "Install 'parallel' somehow"
exit 1
install_or_quit() {
if ! dpkg -s "$1" >/dev/null 2>&1; then
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@howcanunot there is no dpkg in MacOS :)

if [ -n "${linux}" ]; then
apt-get -y install "$1"
else
echo "Install '$1' somehow"
exit 1
fi
fi
fi

if ! bc -v >/dev/null 2>&1; then
}

install_or_quit 'parallel'
install_or_quit 'bc'
install_or_quit 'cloc'
install_or_quit 'jq'
install_or_quit 'xpdf'
install_or_quit 'shellcheck'
install_or_quit 'aspell'
install_or_quit 'xmlstarlet'

if [ ! -f "/usr/local/texlive/$(date +%Y)/bin/x86_64-linux/tlmgr" ]; then
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@howcanunot how about MacOS?

if [ -n "${linux}" ]; then
apt-get install -y bc
wget https://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz && \
zcat < install-tl-unx.tar.gz | tar xf - && \
rm install-tl-unx.tar.gz && \
cd install-tl-$(date +%Y)* && \
perl ./install-tl --scheme=e --no-interaction
else
echo "Install 'GNU bc' somehow"
echo "Install 'texlive-base' somehow"
exit 1
fi
fi

if ! cloc --version >/dev/null 2>&1; then
if [ -n "${linux}" ]; then
apt-get install -y cloc
else
echo "Install 'cloc' somehow"
exit 1
fi
fi

if ! jq --version >/dev/null 2>&1; then
if [ -n "${linux}" ]; then
apt-get install -y jq
else
echo "Install 'jq' somehow"
exit 1
fi
fi

if ! pdftotext -v >/dev/null 2>&1; then
if [ -n "${linux}" ]; then
apt-get install -y xpdf
else
echo "Install 'poppler' somehow"
exit 1
fi
fi

if ! shellcheck --version >/dev/null 2>&1; then
if [ -n "${linux}" ]; then
apt-get install -y shellcheck
else
echo "Install 'shellcheck' somehow"
exit 1
fi
fi

if ! aspell --version >/dev/null 2>&1; then
if [ -n "${linux}" ]; then
apt-get install -y aspell
else
echo "Install 'GNU aspell' somehow"
exit 1
fi
fi

if ! xmlstarlet --version >/dev/null 2>&1; then
if [ -n "${linux}" ]; then
apt-get install -y xmlstarlet
else
echo "Install 'xmlstarlet' somehow"
exit 1
fi
fi
export PATH=/usr/local/texlive/$(date +%Y)/bin/x86_64-linux:$PATH

if [ ! -e "${HOME}/texmf" ]; then
$SUDO tlmgr init-usertree
Expand All @@ -132,14 +95,7 @@ done < <( cut -d' ' -f2 "${root}/../DEPENDS.txt" | uniq )
$SUDO tlmgr --verify-repo=none install "${packages[@]}"
$SUDO tlmgr --verify-repo=none update --no-auto-remove "${packages[@]}" || echo 'Failed to update'

if ! pygmentize -V >/dev/null 2>&1; then
if [ -n "${linux}" ]; then
apt-get install -y python3-pygments
else
echo "Install 'python3-pygments' somehow"
exit 1
fi
fi
install_or_quit 'python3-pygments'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@howcanunot there is no python3-pygments in MacOS when pygmentize is installed


$SUDO python3 -m pip install --upgrade pip
$SUDO python3 -m pip install -r "${LOCAL}/requirements.txt"
Expand Down