🔧 Generate scripts with cmake

This commit is contained in:
Edgar 2020-10-19 12:48:06 +00:00 committed by GitHub
parent ce83235137
commit 76a08be0ef
12 changed files with 48 additions and 16 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
tmp

View File

@ -2,4 +2,4 @@
Some bashscripts for installing devtools on Ubuntu
`curl "https://raw.githubusercontent.com/AnotherFoxGuy/ci-scripts/main/install-lastversion.sh" | sudo bash`
`curl "https://raw.githubusercontent.com/AnotherFoxGuy/ci-scripts/main/install-conan.sh" | sudo bash`

View File

@ -1,6 +1,5 @@
#!/bin/bash
set -eu
cd /tmp/
lastversion Kitware/CMake --assets --filter sh -d
sh $(find . -name "cmake-*-Linux-x86_64.sh") --exclude-subdir --prefix=/usr/local
wget "https://github.com/Kitware/CMake/releases/download/v3.18.4/cmake-3.18.4-Linux-x86_64.sh" -nv -O /tmp/cmake.sh
sh /tmp/cmake.sh --exclude-subdir --prefix=/usr/local

View File

@ -1,6 +1,5 @@
#!/bin/bash
set -eu
cd /tmp/
lastversion conan-io/conan --assets --filter deb -d
dpkg -i $(find . -name "conan-ubuntu-64*.deb")
wget "https://dl.bintray.com/conan/installers/conan-ubuntu-64_1_30_2.deb" -nv -O /tmp/conan.deb
dpkg -i /tmp/conan.deb

View File

@ -1,5 +0,0 @@
#!/bin/bash
set -eu
wget "https://github.com/AnotherFoxGuy/ci-scripts/raw/main/lastversion" -O "/tmp/lastversion"
install -m 755 "/tmp/lastversion" "/usr/local/bin/"

View File

@ -1,8 +1,7 @@
#!/bin/bash
set -eu
cd /tmp/
mkdir -p /tmp/sccache
lastversion mozilla/sccache --assets --filter linux -d
tar xvzf $(find . -name "sccache-*.tar.gz") --strip 1 -C /tmp/sccache
wget "https://github.com/mozilla/sccache/releases/download/0.2.13/sccache-0.2.13-x86_64-unknown-linux-musl.tar.gz" -nv -O /tmp/sccache.tar.gz
tar xvzf /tmp/sccache.tar.gz --strip 1 -C /tmp/sccache
install -m 755 /tmp/sccache/sccache /usr/local/bin/

Binary file not shown.

11
makefile Normal file
View File

@ -0,0 +1,11 @@
CMD := cmake
SCRIPT := -P update.cmake
cmake:
$(CMD) -DTOOL=cmake -DREPO="Kitware/CMake" $(SCRIPT)
conan:
$(CMD) -DTOOL=conan -DREPO="conan-io/conan" $(SCRIPT)
sccache:
$(CMD) -DTOOL=sccache -DREPO="mozilla/sccache" $(SCRIPT)

View File

@ -0,0 +1,5 @@
#!/bin/bash
set -eu
wget "https://github.com/Kitware/CMake/releases/download/v@VERSION@/cmake-@VERSION@-Linux-x86_64.sh" -nv -O /tmp/cmake.sh
sh /tmp/cmake.sh --exclude-subdir --prefix=/usr/local

View File

@ -0,0 +1,5 @@
#!/bin/bash
set -eu
wget "https://dl.bintray.com/conan/installers/conan-ubuntu-64_@VERSION_UNDERSCORE@.deb" -nv -O /tmp/conan.deb
dpkg -i /tmp/conan.deb

View File

@ -0,0 +1,7 @@
#!/bin/bash
set -eu
mkdir -p /tmp/sccache
wget "https://github.com/mozilla/sccache/releases/download/@VERSION@/sccache-@VERSION@-x86_64-unknown-linux-musl.tar.gz" -nv -O /tmp/sccache.tar.gz
tar xvzf /tmp/sccache.tar.gz --strip 1 -C /tmp/sccache
install -m 755 /tmp/sccache/sccache /usr/local/bin/

11
update.cmake Normal file
View File

@ -0,0 +1,11 @@
message("TOOL \"${TOOL}\" REPO \"${REPO}\"")
file(DOWNLOAD "https://github-get-latest-version.anotherfoxguy.workers.dev/${REPO}" "tmp/${TOOL}-version")
file(READ "tmp/${TOOL}-version" VERSION_DIRTY)
string(REGEX REPLACE /[^0-9\\.]/ "" VERSION ${VERSION_DIRTY})
string(REPLACE "." "_" VERSION_UNDERSCORE ${VERSION})
message("Latest VERSION ${VERSION}")
configure_file("templates/install-${TOOL}.sh.in" install-${TOOL}.sh @ONLY)