Skip to content

Commit

Permalink
Added support for debian:latest & ubuntu:latest
Browse files Browse the repository at this point in the history
  • Loading branch information
exTerEX committed Aug 4, 2024
1 parent 8c230e3 commit 33cdb7a
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 4 deletions.
17 changes: 14 additions & 3 deletions src/cmake/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ echo "Activating feature 'CMake'"

VERSION="${VERSION:-latest}"

# Install curl if not in system
if ! which curl > /dev/null; then
CURLINSTALLED="true"
apt update && apt -y install --no-install-recommends curl ca-certificates
fi

# Fetch the latest release
if [ ${VERSION} = "latest" ]; then
VERSION=$(curl --silent -I https://github.com/Kitware/CMake/releases/latest | awk -F '/' '/^location/ {print substr($NF, 1, length($NF)-1)}')
Expand Down Expand Up @@ -43,9 +49,14 @@ rm man/man1/cmake-gui.1
rm -rf share/applications

# Install CMake
sudo mv -v bin/* /usr/local/bin
sudo mkdir /usr/local/share/man/cmake && sudo mv -v man/* /usr/local/share/man/cmake
sudo mv -v share/* /usr/local/share/
mv -v bin/* /usr/local/bin
mkdir /usr/local/share/man/cmake && sudo mv -v man/* /usr/local/share/man/cmake
mv -v share/* /usr/local/share/

# Remove curl and dependencies if installed by script
if [ ! -Z ${CURLINSTALLED+x} ]; then
apt remove -y curl ca-certificates && apt autoremove -y
fi

# Remove temporary files
cd /tmp && rm -rf ${SOURCEDIR}-${ARCHITECTURE}
24 changes: 23 additions & 1 deletion src/ninja-build/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ echo "Activating feature 'Ninja'"

VERSION="${VERSION:-latest}"

# Install curl if not in system
if ! which curl > /dev/null; then
CURLINSTALLED="true"
apt update && apt -y install --no-install-recommends curl ca-certificates
fi

# Fetch the latest release
if [ ${VERSION} = "latest" ]; then
VERSION=$(curl --silent -I https://github.com/ninja-build/ninja/releases/latest | awk -F '/' '/^location/ {print substr($NF, 1, length($NF)-1)}')
Expand All @@ -26,8 +32,24 @@ SOURCEDIR=ninja-linux.zip # ninja-linux-aarch64.zip if ARM64
# Fetch binaries
curl -JLo ${SOURCE} https://github.com/ninja-build/ninja/releases/download/v${VERSION#v}/ninja-linux.zip

# Install unzip if not in system
if ! which unzip > /dev/null; then
UNZIPINSTALLED="true"
apt update && apt install -y --no-install-recommends unzip
fi

# Unzip binaries
unzip ${SOURCE} && rm ${SOURCE}

# Install CMake
sudo mv -v ninja /usr/local/bin
mv -v ninja /usr/local/bin

# Remove curl and dependencies if installed by script
if [ ! -Z ${CURLINSTALLED+x} ]; then
apt remove -y curl ca-certificates && apt autoremove -y
fi

# Remove unzip and dependencies if installed by script
if [ ! -Z ${UNZIPINSTALLED+x} ]; then
apt remove -y unzip && apt autoremove -y
fi

0 comments on commit 33cdb7a

Please sign in to comment.