├── .gitignore ├── LICENSE ├── README.md ├── build-static.sh ├── checknew.sh ├── helper.sh ├── lib ├── env.sh ├── main.sh ├── readyaml.sh └── regexlook.sh ├── source ├── curl-static │ ├── build.sh │ └── pkg.yml ├── dppm-static │ ├── build.sh │ └── pkg.yml ├── git-static │ ├── build.sh │ └── pkg.yml ├── mattermost-static │ ├── build.sh │ └── pkg.yml ├── minetest-static │ ├── build.sh │ └── pkg.yml ├── php-static │ ├── build.sh │ └── pkg.yml ├── python-static │ ├── Setup.local │ ├── build.sh │ └── pkg.yml ├── ruby-static │ ├── build.sh │ └── pkg.yml ├── tidb-static │ ├── build.sh │ └── pkg.yml └── transmission-static │ ├── build.sh │ └── pkg.yml └── upload-to-bintray.sh /.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | ISC License 2 | 3 | Copyright (c) 2017 Julien Reichardt 4 | 5 | Permission to use, copy, modify, and distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # apps-static 2 | 3 | ### Standalone portable applications 4 | 5 | #### Static applications, portable across all Linuxes. Builds for x86, x86-64, armhf and arm64. 6 | 7 | ## Purpose 8 | 9 | - No root permissions needed 10 | 11 | - Using the latest release of an application 12 | 13 | - Don't potentially mess up your system - no dependencies 14 | 15 | - Portable across all Linuxes 16 | 17 | ## Get the application 18 | 19 | You can use the `helper.sh` script that will download the package in the actual directory. 20 | 21 | `wget -qO-` can be replaced by `curl -s` 22 | 23 | To list available packages: 24 | 25 | `wget -qO- https://raw.githubusercontent.com/DFabric/apps-static/master/helper.sh` 26 | 27 | Change `${PACKAGE}` by your chosen package. 28 | 29 | To download the `${PACKAGE}` in the current directory: 30 | 31 | `sh -c "APP=${PACKAGE} $(wget -qO- https://raw.githubusercontent.com/DFabric/apps-static/master/helper.sh)"` 32 | 33 | You can place its subdirectories (e.g. `bin`, `lib`, `share`...) in `/usr/local/` to be reachable globally, or directly use the binnary in `bin`. 34 | 35 | ## Manual download 36 | 37 | Simply download and extract the archive of the application. The path can be `/usr` or whatever you want. 38 | 39 | Replace `${PACKAGE}` by one of the available [here](https://bintray.com/dfabric/apps-static/builds#files) 40 | 41 | `wget -qO- ${URL_PATH} | tar xJf -` 42 | 43 | A `$PACKAGE` folder will be created. 44 | 45 | The binaries you will need are likely to be in the `bin` folder, but other locations like `sbin` depending of the application/library. 46 | 47 | ## Building 48 | 49 | You will need to have [Docker](https://www.docker.com/) installed. An Alpine Linux image is used for the build environment. 50 | 51 | To build a package: 52 | 53 | `./build-static PACKAGE ARCHITECTURES...` 54 | 55 | For example: 56 | 57 | `./build-static dppm-static x86-64,arm64,armhf` 58 | 59 | The sources used for the builds are available in the `source` directory. 60 | 61 | Each program/library have its own `pkg.yml` description file that have: 62 | - the source dependencies (already builded with this tool) 63 | - the Alpine Linux dependencies 64 | - the latest version of it (regex + url) 65 | 66 | The `build-static.sh` list the commands to build the package 67 | 68 | Additional files can also be found depending of the needs. 69 | 70 | The builds are reproducible and their hashes are stored in SHA512SUMS. 71 | 72 | ## Disclaimers 73 | 74 | Features and modules can be missing and/or not functioning like expected. 75 | 76 | The applications aren't specially developed to become static and portable, this is not for the moment very well tested. 77 | 78 | This project is designed to be easily ported to support BSD, Darwin, NT kernels and to be used without Docker. 79 | 80 | 81 | ## License 82 | 83 | Copyright (c) 2017-2018 Julien Reichardt - ISC License 84 | -------------------------------------------------------------------------------- /build-static.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -eu 3 | 4 | # Current directory 5 | DIR=$(cd -P $(dirname $0) && pwd) 6 | cd $DIR 7 | 8 | mkdir -p build 9 | 10 | . lib/env.sh 11 | 12 | usage() { 13 | cat </dev/null ;then 44 | error 'no Docker daemon' "not started or not available for $(whoami)" 45 | fi 46 | 47 | PKG=$1 48 | 49 | case ${2-} in 50 | *,*) parsearch $2;; 51 | aarch64) error 'invalid arch, aarch64' 'do you mean `arm64`?';; 52 | esac 53 | 54 | PKGDIR=$BUILDDIR/$PKG/${2-$ARCH} 55 | 56 | # Check build directory 57 | mkdir -p $PKGDIR 58 | [ "$(ls $PKGDIR 2>/dev/null)" ] && error "$PKGDIR" 'already present, delete it first' 59 | [ -d "source/$PKG" ] || { error "source/$PKG" 'not found.'; } 60 | 61 | # No need of Qemu to run x86 on x86-64 62 | if [ "${2-}" = x86 ] && [ "$ARCH" = x86-64 ]; then 63 | docker_image=i386/alpine:$DTAG 64 | 65 | # Only x86_64 can cross-compile - for now 66 | elif [ "${2-}" ] && [ "$ARCH" != x86-64 ] && [ "$ARCH" != "$2" ] ;then 67 | error "$ARCH" "only x86_64 can cross compile." 68 | 69 | # https://github.com/multiarch/alpine 70 | elif [ "${2-}" ] && [ "${2-}" != "$ARCH" ] ;then 71 | docker_image=multiarch/alpine:$2-$MATAG 72 | # configure binfmt-support on the Docker host 73 | docker pull multiarch/qemu-user-static:register 74 | docker run --rm --privileged multiarch/qemu-user-static:register --reset 75 | else 76 | docker_image=alpine:$DTAG 77 | fi 78 | 79 | # Copy to the build directory 80 | cp -r $DIR/source/$PKG/* $PKGDIR 81 | cp -r $DIR/lib $PKGDIR 82 | 83 | docker pull $docker_image 84 | 85 | delete_build() { 86 | rm -r $PKGDIR 87 | info "build directory $PKGDIR deleted" 88 | } 89 | 90 | docker_args="-it --rm -v $PKGDIR:$CONTAINERDIR -w $CONTAINERDIR -e PKG=$PKG" 91 | 92 | if $DEV ;then 93 | info "You're actually on dev mode, you may need to run: 94 | sh lib/main.sh" 95 | docker run $docker_args -e DEV=true $docker_image /bin/sh 96 | else 97 | docker run $docker_args -e PKG=$PKG $docker_image /bin/sh lib/main.sh || true 98 | 99 | package=$(cd $PKGDIR; ls -d ${PKG}_*_${KERNEL}_${2-$ARCH}*) || { 100 | error "$PKGDIR" "build not found" 101 | delete_build 102 | exit 1 103 | } 104 | 105 | if [ "$package" ] && [ -d build/$package ] ;then 106 | error "$DIR/build/$package" "file already existing" 107 | delete_build 108 | exit 1 109 | elif [ "$package" ] && mv -f "$PKGDIR/$package" "$DIR/build" ;then 110 | info "Your build is now at '$DIR/build/$package'" 111 | delete_build 112 | cd $DIR/build 113 | touch SHA512SUMS 114 | sed -i "/.*${PKG}_.*_${KERNEL}_${2-$ARCH}\.tar\.xz/d" SHA512SUMS 115 | sha512sum $package >> SHA512SUMS 116 | sort -k2 SHA512SUMS -o SHA512SUMS 117 | else 118 | error "$PKGDIR/$package" "an error occured when moving to $DIR/build" 119 | delete_build 120 | exit 1 121 | fi 122 | fi 123 | -------------------------------------------------------------------------------- /checknew.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -eu 3 | 4 | cd $(pwd)/$(dirname $0) 5 | 6 | usage() { 7 | cat </dev/null ;then 29 | download() { [ "${2-}" ] && curl -\#L "$1" -o "$2"; } 30 | getstring() { curl -Ls $@; } 31 | elif hash wget 2>/dev/null ;then 32 | download() { [ "${2-}" ] && wget "$1" -O "$2"; } 33 | getstring() { wget -qO- $@; } 34 | else 35 | error 'curl or wget not found' 'you need to install either one of them' 36 | fi 37 | 38 | usage() { 39 | cat <&2; exit 1; } 39 | -------------------------------------------------------------------------------- /lib/main.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -eu 3 | 4 | # Loading environment variables 5 | . lib/env.sh 6 | 7 | DIR=$PWD 8 | 9 | # Clean on exit 10 | # Launch on dev mode if you don't wan't to have the clean 11 | if ! $DEV ;then 12 | clean() { 13 | info "Deleting $DIR/* on the container" 14 | cd $DIR 15 | # Clean the build directory 16 | [ "${PACKAGE-}" ] && [ -f $PACKAGE.tar.xz ] && mv $PACKAGE.tar.xz .. 17 | rm -rf * 18 | [ "${PACKAGE-}" ] && [ -f ../$PACKAGE.tar.xz ] && mv ../$PACKAGE.tar.xz . 19 | } 20 | trap clean EXIT INT QUIT TERM ABRT 21 | fi 22 | 23 | # Libraries 24 | . lib/regexlook.sh 25 | . lib/readyaml.sh 26 | 27 | # Alpine dependencies 28 | info 'Installing system depencies' 29 | apk add --update ca-certificates openssl wget $(readyaml -f pkg.yml deps alpine) $([ $COMPRESS ] && printf xz) 30 | 31 | if [ "$(readyaml -f pkg.yml deps static)" ] ;then 32 | info 'Installing static libraries dependencies' 33 | sha512sums=$(wget -qO- $MIRROR/SHA512SUMS) 34 | for dep in $(readyaml -f pkg.yml deps static) ;do 35 | # Download the depencies, listed on SHA512SUMS 36 | info "Installing $dep" 37 | match="${dep}_.*_$SYSTEM.tar.xz" 38 | package=$(printf '%b' "$sha512sums\n" | grep -om1 "$match") || error "no package match" "$match" 39 | wget "$MIRROR/$package" -O $package 40 | 41 | # Verify shasum 42 | case $(printf "$sha512sums\n "| grep "$package") in 43 | "$(sha512sum $package)") info "SHA512SUMS match for $dep";; 44 | *) error "SHA512SUMS" "don't match for $package";; 45 | esac 46 | tar xJf $package 47 | rm $package 48 | chown -R 0:0 ${dep}_*_$SYSTEM* 49 | cp -rf ${dep}_*_$SYSTEM*/* /usr 50 | rm -rf ${dep}_*_$SYSTEM* 51 | done 52 | fi 53 | 54 | [ "${ver-}" ] || ver=$(regexlook -w "$(readyaml -f pkg.yml version regex)" "$(readyaml -f pkg.yml version src)" | head -1 | tr - .) 55 | [ "${ver-}" ] || error 'ver' 'no version number returned' 56 | 57 | # Create the directory 58 | PACKAGE=${PKG}_${ver}_$SYSTEM 59 | mkdir $PACKAGE 60 | 61 | info "Package to build: $PACKAGE" 62 | 63 | if ! $DEV ;then 64 | info "Starting the build of $PACKAGE" 65 | 66 | # Build from the sources 67 | . ./build.sh 68 | 69 | # Don't keep the root user and group 70 | cd $DIR 71 | chown -R 1000:1000 $PACKAGE 72 | 73 | if $COMPRESS && [ -f build/$PACKAGE.tar.xz ] ;then 74 | error "$DIR/build/$PACKAGE.tar.xz" "the file already exist!" 75 | elif $COMPRESS ;then 76 | info "Compressing $PACKAGE..." 77 | tar cJf $PACKAGE.tar.xz $PACKAGE 78 | rm -rf "$PACKAGE" 79 | info "Compressed to $PACKAGE.tar.xz!" 80 | fi 81 | else 82 | printf "You're on dev mode, run build.sh? [Y/n] " 83 | read yn 84 | case $yn in 85 | n|N) printf "build.sh not runned.\n";; 86 | *) . ./build.sh;; 87 | esac 88 | fi 89 | -------------------------------------------------------------------------------- /lib/readyaml.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -eu 3 | 4 | # Parse yaml file 5 | # Ability to get an object inside an object etc. 6 | 7 | readyaml() { 8 | usage() { 9 | cat </dev/null ;then 8 | getstring() { curl -Ls $@; } 9 | elif hash wget 2>/dev/null ;then 10 | getstring() { wget -qO- $@; } 11 | else 12 | echo "ERROR: curl or wget not found - you need to install either one of them"; exit 1 13 | fi 14 | 15 | regexlook() { 16 | local start= 17 | local end= 18 | local type= 19 | local regex= 20 | local source= 21 | usage() { 22 | cat </dev/null || [ -x "$2" ] 2>/dev/null ;then 46 | type=exec 47 | elif [ -r "$2" ] 2>/dev/null ;then 48 | type=file 49 | else 50 | exit 1 51 | fi;; 52 | esac;; 53 | esac 54 | regex=$(printf '%s' "$1" | sed -e 's|\\\\|\n1|g;s|\\|\n2|g;s|/|\\/|g;s|\n2||g;s|\n1|\\\\|g' -e 's|\]+|\]\\+|g') 55 | shift 56 | source="$@" 57 | # Lookbehind 58 | case $regex in 59 | '(?<='*) start=${regex%%\)*}; start=${start#\(?<=};; 60 | esac 61 | 62 | # Lookforward 63 | case $regex in 64 | *'(?='*\)) end=${regex##*\(?=}; end=${end%\)};; 65 | esac 66 | mid=${regex#*$start\)} 67 | mid=${mid%%\(?=*} 68 | 69 | expr="s/.*$start\($mid\)$end.*/\1/p" 70 | 71 | # Different processing depending of the source type 72 | case $type in 73 | file) sed -n "$expr" $source;; 74 | bin) $source | sed -n "$expr";; 75 | http) getstring $source | sed -n "$expr";; 76 | esac 77 | } 78 | -------------------------------------------------------------------------------- /source/curl-static/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | wget -qO- https://curl.haxx.se/download/curl-$ver.tar.xz | tar xJf - 4 | cd curl-$ver 5 | 6 | ./configure LDFLAGS=-static PKG_CONFIG='pkg-config --static' --prefix='/' \ 7 | --enable-static \ 8 | --enable-ipv6 \ 9 | --enable-unix-sockets \ 10 | --without-libidn \ 11 | --without-libidn2 \ 12 | --disable-ldap \ 13 | --with-pic 14 | 15 | make V=1 -j$(nproc) curl_LDFLAGS=-all-static DESTDIR="$DIR/$PACKAGE" install-strip 16 | -------------------------------------------------------------------------------- /source/curl-static/pkg.yml: -------------------------------------------------------------------------------- 1 | deps: 2 | alpine: 3 | - g++ 4 | - openssl-dev 5 | - openssl-libs-static 6 | - libssh2-dev 7 | - libssh2-static 8 | - make 9 | - zlib-dev 10 | - zlib-static 11 | 12 | version: 13 | src: https://curl.haxx.se/download/?C=M;O=D 14 | regex: (?<=-).*(?=.zip") 15 | -------------------------------------------------------------------------------- /source/dppm-static/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Get old shards to avoid memory exhaustion of the new one 4 | wget -qO- https://github.com/crystal-lang/crystal/releases/download/0.31.1/crystal-0.31.1-1-linux-x86_64.tar.gz | tar -zxf - 5 | mv crystal-0.31.1-1/lib/crystal/bin/shards /usr/local/bin 6 | rm -rf crystal-0.31.1-1 7 | 8 | # Prepare directories 9 | git clone https://github.com/DFabric/dppm 10 | mkdir $PACKAGE/bin 11 | cd dppm 12 | 13 | # Install libraries 14 | shards install --production 15 | crystal spec -p -Dallow_root 16 | 17 | shards build --progress --release --production --static 18 | mv bin ../$PACKAGE 19 | -------------------------------------------------------------------------------- /source/dppm-static/pkg.yml: -------------------------------------------------------------------------------- 1 | deps: 2 | alpine: 3 | - crystal 4 | - g++ 5 | - gc-dev 6 | - git 7 | - llvm5 8 | - llvm5-dev 9 | - llvm5-libs 10 | - llvm5-static 11 | - libevent-dev 12 | - libevent-static 13 | - musl-dev 14 | - openssl-dev 15 | - openssl-libs-static 16 | - pcre-dev 17 | - yaml-dev 18 | - zlib-dev 19 | - zlib-static 20 | 21 | version: 22 | src: https://github.com/DFabric/dppm/commits/master 23 | regex: (?<=datetime=").*(?=T) 24 | -------------------------------------------------------------------------------- /source/git-static/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | wget -qO- https://www.kernel.org/pub/software/scm/git/git-$ver.tar.xz | tar xJf - 4 | cd git-$ver 5 | 6 | ./configure \ 7 | --prefix='/' \ 8 | --without-tcltk \ 9 | NO_GETTEXT=YesPlease \ 10 | NO_SVN_TESTS=YesPlease \ 11 | NO_REGEX=YesPlease \ 12 | USE_LIBPCRE2=YesPlease \ 13 | NO_SYS_POLL_H=1 14 | 15 | # Build & install 16 | make -j$(nproc) LDFLAGS=-static DESTDIR="$DIR/$PACKAGE" install strip 17 | -------------------------------------------------------------------------------- /source/git-static/pkg.yml: -------------------------------------------------------------------------------- 1 | deps: 2 | alpine: 3 | - curl-dev 4 | - curl-static 5 | - g++ 6 | - make 7 | - nghttp2-dev 8 | - nghttp2-static 9 | - openssl-dev 10 | - openssl-libs-static 11 | - zlib-dev 12 | - zlib-static 13 | 14 | version: 15 | src: https://www.git-scm.com 16 | regex: (?<=Notes*/).*(?=.txt) 17 | -------------------------------------------------------------------------------- /source/mattermost-static/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | export GOPATH=/tmp 4 | mattermost_path=$GOPATH/src/github.com/mattermost 5 | 6 | mkdir -p $mattermost_path 7 | cd $mattermost_path 8 | 9 | wget -qO- https://github.com/mattermost/mattermost-webapp/archive/v$ver.tar.gz | tar xzf - 10 | mv mattermost-webapp* mattermost-webapp 11 | cd mattermost-webapp 12 | npm install 13 | cd node_modules/mattermost-redux 14 | npm install || true 15 | npm run build 16 | cd ../.. 17 | npm run build 18 | 19 | cd $mattermost_path 20 | wget -qO- https://github.com/mattermost/mattermost-server/archive/v$ver.tar.gz | tar xzf - 21 | mv mattermost-server* mattermost-server 22 | 23 | export GO111MODULE=on 24 | export LDFLAGS='-extldflags "-static -fuse-ld=bfd"' 25 | cd mattermost-server 26 | make build 27 | cp config/default.json config/config.json 28 | make package 29 | 30 | rm -f dist/mattermost/bin/platform 31 | mv dist/mattermost $DIR/$PACKAGE 32 | -------------------------------------------------------------------------------- /source/mattermost-static/pkg.yml: -------------------------------------------------------------------------------- 1 | deps: 2 | alpine: 3 | - autoconf 4 | - automake 5 | - curl 6 | - gcc 7 | - git 8 | - go 9 | - libpng-dev 10 | - libtool 11 | - make 12 | - musl-dev 13 | - nasm 14 | - nodejs 15 | - npm 16 | - tar 17 | - zip 18 | - zlib-dev 19 | 20 | version: 21 | src: https://docs.mattermost.com/administration/version-archive.html 22 | regex: (?<=Team Edition v)[0-9.]+ 23 | -------------------------------------------------------------------------------- /source/minetest-static/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # https://dev.minetest.net/Compiling_Minetest 4 | wget -qO- https://github.com/minetest/minetest/archive/$ver.tar.gz | tar xzf - 5 | 6 | cd minetest-$ver 7 | 8 | # Build 9 | cmake -DENABLE_CURL=0 \ 10 | -DENABLE_GETTEXT=0 \ 11 | -DBUILD_CLIENT=0 \ 12 | -DBUILD_SERVER=1 \ 13 | -DENABLE_SYSTEM_JSONCPP=1 \ 14 | -DENABLE_LUAJIT=1 \ 15 | -DCMAKE_EXE_LINKER_FLAGS=-static 16 | 17 | make -j$(nproc) DESTDIR="$DIR/$PACKAGE" 18 | mv bin games builtin $DIR/$PACKAGE 19 | -------------------------------------------------------------------------------- /source/minetest-static/pkg.yml: -------------------------------------------------------------------------------- 1 | deps: 2 | alpine: 3 | - cmake 4 | - g++ 5 | - gcc 6 | - gmp-dev 7 | - irrlicht-dev 8 | - irrlicht-static 9 | - jsoncpp-dev 10 | - jsoncpp-static 11 | - luajit-dev 12 | - make 13 | - musl-dev 14 | - openssl-dev 15 | - sqlite-dev 16 | - sqlite-static 17 | - zlib-dev 18 | - zlib-static 19 | 20 | version: 21 | src: https://github.com/minetest/minetest/refs-tags/master?source_action=disambiguate&source_controller=files 22 | regex: (?<=title=")[0-9.]+(?=") 23 | -------------------------------------------------------------------------------- /source/php-static/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | wget -qO- https://secure.php.net/get/php-$ver.tar.xz/from/this/mirror | tar xJf - 4 | cd php-$ver 5 | 6 | ln -s /usr/include/libxml2/libxml/ /usr/include/libxml 7 | 8 | ./configure PHP_LDFLAGS=-all-static LIBS="$(pkg-config --libs --static libcurl)" \ 9 | --prefix='/' \ 10 | --enable-static \ 11 | --enable-cgi \ 12 | --enable-fpm \ 13 | --enable-cli \ 14 | --enable-phpdbg \ 15 | --enable-inline-optimization \ 16 | --disable-debug \ 17 | --disable-rpath \ 18 | --with-pic \ 19 | --enable-bcmath \ 20 | --with-bz2 \ 21 | --enable-calendar \ 22 | --with-cdb \ 23 | --enable-ctype \ 24 | --with-curl \ 25 | --enable-dom \ 26 | --enable-exif \ 27 | --enable-ftp \ 28 | --with-gd \ 29 | --with-freetype-dir \ 30 | --disable-gd-jis-conv \ 31 | --with-jpeg-dir \ 32 | --with-png-dir \ 33 | --with-gdbm \ 34 | --with-iconv \ 35 | --with-icu-dir=/usr \ 36 | --enable-json \ 37 | --enable-mbstring=all \ 38 | --enable-mysqlnd \ 39 | --with-mysqli=mysqlnd \ 40 | --with-pdo-mysql=mysqlnd \ 41 | --with-openssl \ 42 | --with-pcre-regex \ 43 | --enable-pcntl \ 44 | --enable-pdo \ 45 | --with-pdo-mysql=mysqlnd \ 46 | --with-pdo-sqlite \ 47 | --enable-phar \ 48 | --enable-posix \ 49 | --enable-session \ 50 | --enable-shmop \ 51 | --enable-soap \ 52 | --enable-sockets \ 53 | --with-sqlite3 \ 54 | --enable-sysvmsg \ 55 | --enable-sysvsem \ 56 | --enable-sysvshm \ 57 | --enable-xml \ 58 | --enable-xmlreader \ 59 | --with-xmlrpc \ 60 | --enable-wddx \ 61 | --enable-zip \ 62 | --with-zlib \ 63 | --without-db1 \ 64 | --without-db2 \ 65 | --without-db3 \ 66 | --without-qdbm \ 67 | --with-pdo-dblib \ 68 | --enable-opcache 69 | 70 | make -j$(nproc) INSTALL_ROOT="$DIR/$PACKAGE" PHP_LDFLAGS=-all-static 71 | make -j$(nproc) INSTALL_ROOT="$DIR/$PACKAGE" install 72 | 73 | # Strip 74 | strip $DIR/$PACKAGE/bin/php $DIR/$PACKAGE/bin/php-cgi $DIR/$PACKAGE/bin/phpdbg $DIR/$PACKAGE/sbin/php-fpm 75 | -------------------------------------------------------------------------------- /source/php-static/pkg.yml: -------------------------------------------------------------------------------- 1 | deps: 2 | alpine: 3 | - apr-dev 4 | - apr-util-dev 5 | - aspell-dev 6 | - autoconf 7 | - bison 8 | - bzip2-dev 9 | - bzip2-static 10 | - curl-dev 11 | - curl-static 12 | - db-dev 13 | - enchant-dev 14 | - expat-dev 15 | - freetds-dev 16 | - freetype-dev 17 | - freetype-static 18 | - g++ 19 | - gdbm-dev 20 | - gmp-dev 21 | - icu-dev 22 | - icu-static 23 | - libevent-dev 24 | - libevent-static 25 | - libgcrypt-dev 26 | - libgd 27 | - libjpeg-turbo-dev 28 | - libmcrypt-dev 29 | - libpng-dev 30 | - libpng-static 31 | - libssh2-dev 32 | - libtool 33 | - libxml2-dev 34 | - libxslt-dev 35 | - libzip-dev 36 | - make 37 | - mariadb-dev 38 | - net-snmp-dev 39 | - nghttp2-dev 40 | - nghttp2-static 41 | - openldap-dev 42 | - openssl-dev 43 | - openssl-libs-static 44 | - readline-dev 45 | - sqlite-dev 46 | - sqlite-static 47 | - unixodbc-dev 48 | - zlib-dev 49 | - zlib-static 50 | 51 | version: 52 | src: https://secure.php.net/downloads.php 53 | regex: (?<=id="v)7.*(?=" ) 54 | -------------------------------------------------------------------------------- /source/python-static/Setup.local: -------------------------------------------------------------------------------- 1 | *static* 2 | posix -DPy_BUILD_CORE posixmodule.c -DHAVE_SYS_XATTR_H -I/usr/include # posix (UNIX) system calls 3 | errno errnomodule.c # posix (UNIX) errno values 4 | pwd pwdmodule.c # this is needed to find out the user's home dir 5 | # if $HOME is not set 6 | _sre _sre.c # Fredrik Lundh's new regular expressions 7 | _codecs _codecsmodule.c # access to the builtin codecs and codec registry 8 | _weakref _weakref.c # weak references 9 | _functools -DPy_BUILD_CORE _functoolsmodule.c # Tools for working with functions and callable objects 10 | _operator _operator.c # operator.add() and similar goodies 11 | _collections _collectionsmodule.c # Container types 12 | _abc _abc.c # Abstract base classes 13 | itertools itertoolsmodule.c # Functions creating iterators for efficient looping 14 | atexit atexitmodule.c # Register functions to be run at interpreter-shutdown 15 | _signal -DPy_BUILD_CORE signalmodule.c 16 | _stat _stat.c # stat.h interface 17 | time -DPy_BUILD_CORE timemodule.c # -lm # time operations and variables 18 | _thread -DPy_BUILD_CORE _threadmodule.c # low-level threading interface 19 | _locale _localemodule.c # -lintl 20 | _io -DPy_BUILD_CORE -I$(srcdir)/Modules/_io _io/_iomodule.c _io/iobase.c _io/fileio.c _io/bytesio.c _io/bufferedio.c _io/textio.c _io/stringio.c 21 | zipimport -DPy_BUILD_CORE zipimport.c 22 | faulthandler faulthandler.c 23 | _tracemalloc _tracemalloc.c hashtable.c 24 | 25 | _symtable symtablemodule.c 26 | #readline readline.c -I/usr/include/ -I/usr/include/readline -L/usr/lib -lreadline -ltermcap 27 | 28 | array arraymodule.c # array objects 29 | cmath cmathmodule.c _math.c # -lm # complex math library functions 30 | math mathmodule.c _math.c # -lm # math library functions, e.g. sin() 31 | _struct _struct.c # binary structure packing/unpacking 32 | _weakref _weakref.c # basic weak reference support 33 | _random _randommodule.c # Random number generator 34 | _elementtree -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI _elementtree.c # elementtree accelerator 35 | _pickle _pickle.c # pickle accelerator 36 | _datetime _datetimemodule.c # datetime accelerator 37 | _bisect _bisectmodule.c # Bisection algorithms 38 | _heapq _heapqmodule.c # Heap queue algorithm 39 | _asyncio _asynciomodule.c # Fast asyncio Future 40 | 41 | unicodedata unicodedata.c # static Unicode character database 42 | 43 | fcntl fcntlmodule.c # fcntl(2) and ioctl(2) 44 | spwd spwdmodule.c # spwd(3) 45 | grp grpmodule.c # grp(3) 46 | select selectmodule.c # select(2); not on ancient System V 47 | 48 | mmap mmapmodule.c 49 | 50 | _csv _csv.c 51 | 52 | _socket socketmodule.c 53 | 54 | _ssl _ssl.c \ 55 | -DUSE_SSL -I/usr/include -I/usr/include/openssl 56 | -L/usr/lib -lssl -lcrypto 57 | 58 | _crypt _cryptmodule.c # crypt(3); needs -lcrypt on some systems 59 | 60 | termios termios.c # Steen Lumholt's termios module 61 | resource resource.c # Jeremy Hylton's rlimit interface 62 | 63 | _posixsubprocess _posixsubprocess.c # POSIX subprocess module helper 64 | 65 | audioop audioop.c # Operations on audio samples 66 | 67 | _md5 md5module.c 68 | 69 | _sha1 sha1module.c 70 | _sha256 sha256module.c 71 | _sha512 sha512module.c 72 | 73 | _blake2 _blake2/blake2module.c _blake2/blake2b_impl.c _blake2/blake2s_impl.c 74 | 75 | #_tkinter _tkinter.c tkappinit.c -DWITH_APPINIT \ 76 | # *** Uncomment and edit to reflect where your Tcl/Tk libraries are: 77 | #-L/usr/lib \ 78 | # *** Uncomment and edit to reflect where your Tcl/Tk headers are: 79 | #-I/usr/include \ 80 | # *** Uncomment and edit to reflect where your X11 header files are: 81 | #-I/usr/X11R6/include \ 82 | # *** Uncomment and edit for Tix extension only: 83 | #-DWITH_TIX -ltix8.1.8.2 \ 84 | # *** Uncomment and edit for BLT extension only: 85 | #-DWITH_BLT -I/usr/blt/blt8.0-unoff/include -lBLT8.0 \ 86 | # *** Uncomment and edit for PIL (TkImaging) extension only: 87 | # (See http://www.pythonware.com/products/pil/ for more info) 88 | #-DWITH_PIL -I../Extensions/Imaging/libImaging tkImaging.c \ 89 | # *** Uncomment and edit for TOGL extension only: 90 | #-DWITH_TOGL togl.c \ 91 | # *** Uncomment and edit to reflect your Tcl/Tk versions: 92 | #-ltk8.2 -ltcl8.2 \ 93 | # *** Uncomment and edit to reflect where your X11 libraries are: 94 | #-L/usr/X11R6/lib \ 95 | # *** Uncomment these for TOGL extension only: 96 | #-lGL -lGLU -lXext -lXmu \ 97 | # *** Always uncomment this; X11 libraries to link with: 98 | #-lX11 99 | 100 | syslog syslogmodule.c # syslog daemon interface 101 | 102 | #_curses _cursesmodule.c -lcurses -ltermcap 103 | #_curses_panel _curses_panel.c -lpanel -lncurses 104 | 105 | #_dbm _dbmmodule.c -DHAVE_NDBM_H -I/usr/include # dbm(3) may require -lndbm or similar 106 | 107 | _gdbm _gdbmmodule.c -I/usr/include -L/usr/lib -lgdbm 108 | 109 | binascii binascii.c 110 | 111 | parser parsermodule.c 112 | 113 | zlib zlibmodule.c -I/usr/include -I$(srcdir)/Modules/zlib -L/usr/lib -lz 114 | 115 | pyexpat expat/xmlparse.c expat/xmlrole.c expat/xmltok.c pyexpat.c -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI -DXML_DEV_URANDOM 116 | 117 | _multibytecodec cjkcodecs/multibytecodec.c 118 | 119 | _codecs_cn cjkcodecs/_codecs_cn.c 120 | _codecs_hk cjkcodecs/_codecs_hk.c 121 | _codecs_iso2022 cjkcodecs/_codecs_iso2022.c 122 | _codecs_jp cjkcodecs/_codecs_jp.c 123 | _codecs_kr cjkcodecs/_codecs_kr.c 124 | _codecs_tw cjkcodecs/_codecs_tw.c 125 | 126 | # Additional modules 127 | _lzma _lzmamodule.c -I/usr/include -L/usr/lib -llzma 128 | _bz2 _bz2module.c -I/usr/include -L/usr/lib -lbz2 129 | 130 | _json _json.c 131 | _ctypes _ctypes/_ctypes.c _ctypes/callbacks.c _ctypes/callproc.c _ctypes/cfield.c _ctypes/malloc_closure.c _ctypes/stgdict.c \ 132 | -I/usr/include \ 133 | -I$(srcdir)/Modules/_ctypes \ 134 | -L/usr/lib -lffi 135 | _ctypes_test _ctypes/_ctypes_test.c 136 | 137 | MPDIR=$(srcdir)/Modules/_decimal/libmpdec 138 | _decimal _decimal/_decimal.c \ 139 | -I$(srcdir)/$(MPDIR) -DCONFIG_64 -DASM \ 140 | $(MPDIR)/basearith.c \ 141 | $(MPDIR)/crt.c \ 142 | $(MPDIR)/io.c \ 143 | $(MPDIR)/sixstep.c \ 144 | $(MPDIR)/constants.c \ 145 | $(MPDIR)/difradix2.c \ 146 | $(MPDIR)/memory.c \ 147 | $(MPDIR)/transpose.c \ 148 | $(MPDIR)/context.c \ 149 | $(MPDIR)/fnt.c \ 150 | $(MPDIR)/mpdecimal.c \ 151 | $(MPDIR)/convolute.c \ 152 | $(MPDIR)/fourstep.c \ 153 | $(MPDIR)/numbertheory.c 154 | 155 | #_lsprof _lsprof.c 156 | _multiprocessing _multiprocessing/multiprocessing.c _multiprocessing/semaphore.c -I$(srcdir)/Modules 157 | _opcode _opcode.c 158 | _sha3 _sha3/sha3module.c 159 | 160 | SQLITEDIR=$(srcdir)/Modules/_sqlite 161 | UCHAR_MAX=UCHAR_MAX=255 162 | MODULE_NAME=MODULE_NAME='"sqlite3"' 163 | 164 | _sqlite3 -I/usr/include -L/usr/lib -lsqlite3 -lpthread -ldl -D$(UCHAR_MAX) -D$(MODULE_NAME) \ 165 | $(SQLITEDIR)/cache.c \ 166 | $(SQLITEDIR)/connection.c \ 167 | $(SQLITEDIR)/cursor.c \ 168 | $(SQLITEDIR)/microprotocols.c \ 169 | $(SQLITEDIR)/module.c \ 170 | $(SQLITEDIR)/prepare_protocol.c \ 171 | $(SQLITEDIR)/row.c \ 172 | $(SQLITEDIR)/statement.c \ 173 | $(SQLITEDIR)/util.c 174 | 175 | #_testcapi _testcapimodule.c # Python C API test module 176 | _testbuffer _testbuffer.c 177 | _testimportmultiple _testimportmultiple.c 178 | _testmultiphase _testmultiphase.c 179 | -------------------------------------------------------------------------------- /source/python-static/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # From https://wiki.python.org/moin/BuildStatically 4 | wget -qO- https://www.python.org/ftp/python/$ver/Python-$ver.tar.xz | tar xJf - 5 | cd Python-$ver 6 | 7 | ./configure LDFLAGS=-static \ 8 | --prefix='/' \ 9 | --enable-optimizations \ 10 | --enable-ipv6 \ 11 | --with-computed-gotos \ 12 | --with-threads \ 13 | --with-lto \ 14 | --without-ensurepip 15 | 16 | cp ../Setup.local Modules/Setup.local 17 | [ "$ARCH" = arm64 ] && sed -i '/-DASM/d' Modules/Setup.local 18 | 19 | make -j$(nproc) LDFLAGS=-static LINKFORSHARED= DESTDIR="$DIR/$PACKAGE" install 20 | -------------------------------------------------------------------------------- /source/python-static/pkg.yml: -------------------------------------------------------------------------------- 1 | deps: 2 | alpine: 3 | - bzip2-dev 4 | - bzip2-static 5 | - g++ 6 | - gdbm-dev 7 | - libffi-dev 8 | - linux-headers 9 | - make 10 | - openssl-dev 11 | - sqlite-dev 12 | - sqlite-static 13 | - xz-dev 14 | - zlib-dev 15 | 16 | version: 17 | src: https://docs.python.org/3/ 18 | regex: (?<=title>)3.*(?= Documentation) 19 | -------------------------------------------------------------------------------- /source/ruby-static/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | wget -qO- https://cache.ruby-lang.org/pub/ruby/${ver%.*}/ruby-$ver.tar.xz | tar xJf - 4 | 5 | cd ruby-$ver 6 | 7 | # -fomit-frame-pointer makes ruby segfault, see gentoo bug #150413 8 | # In many places aliasing rules are broken; play it safe 9 | # as it's risky with newer compilers to leave it as it is. 10 | export CFLAGS="-fno-omit-frame-pointer -fno-strict-aliasing" 11 | export CPPFLAGS="-fno-omit-frame-pointer -fno-strict-aliasing" 12 | 13 | # ruby saves path to install. we want use $PATH 14 | export INSTALL=install 15 | 16 | # the configure script does not detect isnan/isinf as macros 17 | export ac_cv_func_isnan=yes 18 | export ac_cv_func_isinf=yes 19 | 20 | ./configure LDFLAGS=-static \ 21 | --prefix='/' \ 22 | --with-static-linked-ext \ 23 | --enable-static \ 24 | --enable-threads \ 25 | --disable-shared \ 26 | --disable-install-doc \ 27 | --disable-rpath \ 28 | --with-gdbm 29 | 30 | make -j$(nproc) LDFLAGS=-static DESTDIR="$DIR/$PACKAGE" install 31 | -------------------------------------------------------------------------------- /source/ruby-static/pkg.yml: -------------------------------------------------------------------------------- 1 | deps: 2 | alpine: 3 | - g++ 4 | - gdbm-dev 5 | - libc-dev 6 | - libffi-dev 7 | - linux-headers 8 | - make 9 | - openssl-dev 10 | - readline-dev 11 | - pcre-dev 12 | - yaml-dev 13 | - zlib-dev 14 | 15 | version: 16 | src: https://www.ruby-lang.org/en/downloads/releases/ 17 | regex: (?<=Ruby )[0-9.]+(?=<) 18 | -------------------------------------------------------------------------------- /source/tidb-static/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | export GOPATH=/tmp 4 | mkdir -p $GOPATH/src/github.com/pingcap 5 | cd $GOPATH/src/github.com/pingcap 6 | 7 | # Git is used to have the version in `tidb-server -V` 8 | git clone https://github.com/pingcap/tidb --branch v$ver --depth 1 9 | cd tidb 10 | 11 | export LDFLAGS='-extldflags "-static -fuse-ld=bfd"' 12 | make 13 | 14 | mkdir $DIR/$PACKAGE/bin 15 | mv bin/tidb-server $DIR/$PACKAGE/bin 16 | -------------------------------------------------------------------------------- /source/tidb-static/pkg.yml: -------------------------------------------------------------------------------- 1 | deps: 2 | alpine: 3 | - git 4 | - go 5 | - make 6 | - musl-dev 7 | 8 | version: 9 | src: https://github.com/pingcap/tidb/refs-tags/master?source_action=disambiguate&source_controller=files 10 | regex: (?<=title="v)[0-9.]+(?=") 11 | -------------------------------------------------------------------------------- /source/transmission-static/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | wget -qO- https://github.com/transmission/transmission-releases/raw/master/transmission-$ver.tar.xz | tar xJf - 4 | cd transmission-$ver 5 | 6 | # https://github.com/transmission/transmission/wiki/Building-Transmission 7 | 8 | ./configure LIBCURL_LIBS="$(pkg-config --libs --static libcurl)" \ 9 | --prefix='/' \ 10 | --enable-utp \ 11 | --with-inotify \ 12 | --enable-cli 13 | 14 | # Build & install to /usr/local 15 | make -j$(nproc) LDFLAGS=-all-static DESTDIR="$DIR/$PACKAGE" install-strip 16 | -------------------------------------------------------------------------------- /source/transmission-static/pkg.yml: -------------------------------------------------------------------------------- 1 | deps: 2 | alpine: 3 | - automake 4 | - autoconf 5 | - bsd-compat-headers 6 | - curl-dev 7 | - curl-static 8 | - g++ 9 | - make 10 | - intltool 11 | - libevent-dev 12 | - libevent-static 13 | - libssh2-dev 14 | - nghttp2-dev 15 | - nghttp2-static 16 | - openssl-dev 17 | - openssl-libs-static 18 | - tar 19 | - xz 20 | - zlib-dev 21 | - zlib-static 22 | 23 | version: 24 | src: https://github.com/transmission/transmission/refs-tags/master?source_action=disambiguate&source_controller=files 25 | regex: (?<=title=").*(?=") 26 | -------------------------------------------------------------------------------- /upload-to-bintray.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -eu 2 | 3 | # Script to upload artifacts to Bintray 4 | 5 | BINTRAY_USER_API_KEY=$1 6 | BINTRAY_ORG=dfabric/apps-static 7 | BINTRAY_PACKAGE=builds 8 | BINTRAY_VERSION=latest 9 | 10 | BINTRAY_CONTENT_API=https://api.bintray.com/content/$BINTRAY_ORG 11 | BINTRAY_CONTENT_API_PACKAGE=$BINTRAY_CONTENT_API/$BINTRAY_PACKAGE/$BINTRAY_VERSION 12 | 13 | for package_path in build/*; do 14 | package_name=${package_path##*/} 15 | printf "delete $package_name\n" 16 | curl -u$BINTRAY_USER_API_KEY -X DELETE $BINTRAY_CONTENT_API/$package_name 17 | printf "\npost $package_name\n" 18 | curl -u$BINTRAY_USER_API_KEY -T $package_path $BINTRAY_CONTENT_API_PACKAGE/$package_name 19 | printf "\n\n" 20 | done 21 | 22 | printf "publish to $BINTRAY_CONTENT_API_PACKAGE\n" 23 | curl -u$BINTRAY_USER_API_KEY -X POST $BINTRAY_CONTENT_API_PACKAGE/publish 24 | --------------------------------------------------------------------------------