Skip to content

Commit

Permalink
Revert "Allow install scripts to be used by koreader CI" (#75)
Browse files Browse the repository at this point in the history
* Revert "Use distro luarocks| Install packages globally"

This reverts commit a64fd88.

* Revert "Aloow install scripts to be used by koreader CI"

This reverts commit aa98f38.
  • Loading branch information
Frenzie committed Apr 15, 2022
1 parent 11b62a5 commit ae1cca5
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 11 deletions.
2 changes: 1 addition & 1 deletion docker/ubuntu/baseimage/Dockerfile
Expand Up @@ -17,4 +17,4 @@ RUN chown ko:ko /home/ko/.bashrc
USER ko
WORKDIR /home/ko
RUN ./install_lint.sh
RUN ./install_luarocks.sh "/home/ko"
RUN ./install_luarocks.sh
8 changes: 4 additions & 4 deletions docker/ubuntu/baseimage/install_lint.sh
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

HOME="$1"
HOME=/home/ko

cd $HOME || exit

Expand All @@ -9,15 +9,15 @@ export PATH=${HOME}/local/bin:$PATH
[ ! -d "${HOME}/local/bin" ] && mkdir -p "${HOME}/local/bin"

#install our own updated shellcheck
SHELLCHECK_VERSION="v0.8.0"
SHELLCHECK_VERSION="v0.7.2"
SHELLCHECK_URL="https://github.com/koalaman/shellcheck/releases/download/${SHELLCHECK_VERSION?}/shellcheck-${SHELLCHECK_VERSION?}.linux.x86_64.tar.xz"
if [ "$(shellcheck --version)" != "v0.8.0" ]; then
if ! command -v shellcheck; then
curl -sSL "${SHELLCHECK_URL}" | tar --exclude 'SHA256SUMS' --strip-components=1 -C "${HOME}/local/bin" -xJf -
chmod +x "${HOME}/local/bin/shellcheck"
shellcheck --version
else
echo -e "${ANSI_GREEN}Using system shellcheck."
fi
shellcheck --version

# install shfmt
SHFMT_URL="https://github.com/mvdan/sh/releases/download/v3.4.0/shfmt_v3.4.0_linux_amd64"
Expand Down
31 changes: 25 additions & 6 deletions docker/ubuntu/baseimage/install_luarocks.sh
@@ -1,11 +1,30 @@
#!/usr/bin/env bash

apt-get install --no-install-recommends luarocks
HOME=/home/ko

luarocks install luacov
luarocks install ldoc
cd $HOME || exit

luarocks install lanes # for parallel luacheck
luarocks install luacheck
git clone https://github.com/torch/luajit-rocks.git
pushd luajit-rocks && {
git checkout 2c7496b905f6f972673effda4884766433b7583b
cmake . -DWITH_LUAJIT21=ON -DCMAKE_INSTALL_PREFIX=${HOME}/local
make install
} && popd || exit
rm -rf luajit-rocks

luarocks build https://raw.githubusercontent.com/Olivine-Labs/busted/2e4799e06b865c352baa7f7721e32aedaafd19d6/busted-scm-2.rockspec
mkdir ${HOME}/.luarocks
cp ${HOME}/local/etc/luarocks/config.lua ${HOME}/.luarocks/config.lua

export PATH=$HOME/local/bin:$PATH

echo "wrap_bin_scripts = false" >>${HOME}/.luarocks/config.lua
luarocks --local install luafilesystem
luarocks --local install ansicolors
luarocks --local install busted 2.0.0-1
luarocks --local install luacov
# luasec doesn't automatically detect 64-bit libs
luarocks --local install luasec OPENSSL_LIBDIR=/usr/lib/x86_64-linux-gnu
luarocks --local install luacov-coveralls --server=http://rocks.moonscript.org/dev
luarocks --local install luacheck
luarocks --local install lanes # for parallel luacheck
luarocks --local install ldoc

0 comments on commit ae1cca5

Please sign in to comment.