From 997916a24e12feb22ae52ad928ce4c54917dbbd8 Mon Sep 17 00:00:00 2001 From: dumol Date: Wed, 4 May 2022 12:20:41 +0300 Subject: [PATCH] Forward-ported fixes from python-package + other updates. (#32) * Use latest pythia version. * Forward-port python-package brink.{conf,sh} updates. * Use latest zlib. * Use latest libffi. * Try using latest available Python 3.8.x packages. * Fixed downloading latest libffi. * Use latest OpenSSL when building. * Back to tried and true Python 3.8.6. This reverts commit ceb021b11845074714f6d0c13d47b03d6ac007f8. * Use our own CentOS 5.11 Docker image. * Also install unzip on CentOS 5. * Updated condition to match CentOS 5 container name. * Grand rename of the brink and build scripts. * Updated GitHub workflows for the grand rename. * Move stray pkgconfig files to their place. * Back to manually installing libffi for CentOS 5. * Added strong Bash checks for building. * Removed scripted OS package management. * Try to fix fallout from removing scripted OS pkg mgmt. * Build xz for Python's lzma module. * Download xz from SourceForge to have it work on CentOS 5. * Try building xz only on generic Linux. * Updated deps checks. * Try building xz on Alpine. * Package management fixes. * More xz build tweaks. * Install required headers on Alpine. * Try building xz on macOS differently. * Accomodate stricter bash checks in functions.sh. * Disabled building shared xz libs. * Changes after own review. * Updated sqlite. * Updated pip and most Python modules. * Try latest cryptography not requiring Rust. * Change after review. Co-authored-by: Adi Roiban * More changes related to PyPI's index_url. * Even more changes related to PyPI's index_url. * Build xz probably needs to be built on all BSD-derived OS'es. * One last change related to PyPI's index_url. Co-authored-by: Adi Roiban --- .github/workflows/bare.yaml | 20 +++--- .github/workflows/docker.yaml | 33 ++++----- README.rst | 10 +-- brink.conf | 13 ---- build.conf | 57 +++++++++++++++ pythia => build.sh | 39 +++++++---- functions.sh | 14 ++-- functions_pythia.sh => functions_build.sh | 9 ++- os_quirks.sh | 20 ++++-- pavement.py | 5 +- pkg_checks.sh | 54 ++++++-------- publish_dist.sh | 1 + pythia.conf | 70 ++++--------------- brink.sh => pythia.sh | 37 +++++----- src/Python-Windows/chevahbs | 2 +- src/Python/chevahbs | 2 +- src/Python/disabled_modules.patch | 3 +- src/bzip2/chevahbs | 2 +- .../test_python_binary_dist.py | 55 +++++---------- src/libedit/chevahbs | 2 +- src/libffi/chevahbs | 10 +-- src/libffi/sha512.sum | 2 +- src/openssl/chevahbs | 4 +- src/openssl/sha512.sum | 2 +- src/sqlite-autoconf/chevahbs | 4 +- src/sqlite-autoconf/sha512.sum | 2 +- src/xz/chevahbs | 37 ++++++++++ src/xz/sha512.sum | 1 + src/zlib/chevahbs | 2 +- src/zlib/sha512.sum | 2 +- 30 files changed, 271 insertions(+), 243 deletions(-) delete mode 100644 brink.conf create mode 100644 build.conf rename pythia => build.sh (91%) rename functions_pythia.sh => functions_build.sh (96%) rename brink.sh => pythia.sh (96%) create mode 100755 src/xz/chevahbs create mode 100644 src/xz/sha512.sum diff --git a/.github/workflows/bare.yaml b/.github/workflows/bare.yaml index 8eb9b2a8..04d953d3 100644 --- a/.github/workflows/bare.yaml +++ b/.github/workflows/bare.yaml @@ -54,7 +54,7 @@ jobs: # Workflow won't be cancelled at the first failed job. fail-fast: false matrix: - runs-on: [ windows-2019, windows-2016 ] + runs-on: [ windows-2022, windows-2019 ] timeout-minutes: 20 # Steps represent a sequence of tasks that will be executed as part of the job @@ -66,10 +66,10 @@ jobs: # Explicitly run our scripts with Bash, not PowerShell (GitHub's default). - name: Build Pythia - run: bash ./pythia build + run: bash ./build.sh build - name: Test Pythia - run: bash ./pythia test + run: bash ./build.sh test # To use an RSA key with SFTPPlus, install upstream OpenSSH package, # which is more finicky in regards to file permissions. @@ -127,14 +127,16 @@ jobs: with: fetch-depth: 2 - - name: Install required packages - run: sudo apt-get install libncurses5-dev + - name: Prepare OS + run: | + sudo apt install libncurses5-dev + sudo apt purge uuid-dev - name: Build Pythia - run: ./pythia build + run: ./build.sh build - name: Test Pythia - run: ./pythia test + run: ./build.sh test - name: Upload testing package run: | @@ -173,10 +175,10 @@ jobs: sudo chmod -v a-r /usr/local/opt/gettext/lib/libintl.* - name: Build Pythia - run: ./pythia build + run: ./build.sh build - name: Test Pythia - run: ./pythia test + run: ./build.sh test - name: Upload testing package run: | diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index 8514a766..7f921a4b 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -30,7 +30,9 @@ jobs: strategy: fail-fast: false matrix: - container: [ 'alpine:3.14', 'centos:8.2.2004', 'centos:5.11' ] + # CentOS 5.11 setup was saved as an image pushed to Docker Hub. See the + # Overview section at https://hub.docker.com/r/proatria/centos for details. + container: [ 'alpine:3.14', 'centos:8.2.2004', 'proatria/centos:5.11-chevah1' ] timeout-minutes: 30 steps: @@ -39,7 +41,8 @@ jobs: if: startsWith(matrix.container, 'alpine') run: | apk upgrade -U - apk add git curl bash openssh-client paxctl + apk add git curl bash gcc make m4 automake libtool patch zlib-dev openssl-dev musl-dev linux-headers lddtree shadow sudo openssh-client paxctl file unzip + apk del util-linux-dev # Stick to CentOS 8.2 as OpenSSL got updated in 8.3 from 1.1.1c to 1.1.1g. - name: CentOS 8.2 setup @@ -48,24 +51,16 @@ jobs: sed -i s/^mirrorlist=/#mirrorlist=/ /etc/yum.repos.d/*.repo sed -i s@^#baseurl=http://mirror.centos.org/\$contentdir/\$releasever/@baseurl=https://vault.centos.org/8.2.2004/@ /etc/yum.repos.d/*.repo yum -y upgrade - yum -y install git curl openssh-clients + yum -y install git curl gcc make m4 automake libtool patch libffi-devel zlib-devel xz-devel ncurses-devel openssl-devel openssh-clients unzip + yum remove -y e2fsprogs-devel libuuid-devel - # Final CentOS 5 version is used to build the generic Linux package. + # Our Chevah Centos 5 image, built for python-package. + # FIXME: Update it to include unzip. - name: CentOS 5.11 setup - if: matrix.container == 'centos:5.11' + if: matrix.container == 'proatria/centos:5.11-chevah1' run: | - sed -i s/^mirrorlist=/#mirrorlist=/ /etc/yum.repos.d/*.repo - sed -i s@^#baseurl=http://mirror.centos.org/centos/\$releasever/@baseurl=http://vault.centos.org/5.11/@ /etc/yum.repos.d/*.repo - yum -y upgrade - # Use http://bin.chevah.com:20443/third-party-stuff/centos5/tuxad/ - # when tuxad.de dissapears, it has the minimum required stuff. - rpm -i http://www.tuxad.de/rpms/tuxad-release-5-1.noarch.rpm - yum -y install curl openssh-clients gcc44 make m4 patch unzip wget - ln -s /usr/bin/gcc44 /usr/local/bin/gcc - wget --mirror --no-parent https://bin.chevah.com:20443/third-party-stuff/centos5/endpoint/ - cd bin.chevah.com:20443/third-party-stuff/centos5/endpoint/ - rpm -i local-perl-*.rpm - rpm -i --nodeps git{-core,}-2.5.0-1.ep.x86_64.rpm + wget https://vault.centos.org/5.11/os/x86_64/CentOS/unzip-5.52-3.el5.x86_64.rpm + rpm -i unzip-5.52-3.el5.x86_64.rpm - name: Clone repo independently run: | @@ -76,12 +71,12 @@ jobs: - name: Build Pythia run: | cd pythia - ./pythia build + ./build.sh build - name: Test Pythia run: | cd pythia - ./pythia test + ./build.sh test # Using `~/` is problematic under Docker, use `/root/`. # Remove key in same step to avoid leaving it on disk if publishing fails. diff --git a/README.rst b/README.rst index 1d601044..16d2652e 100644 --- a/README.rst +++ b/README.rst @@ -6,16 +6,16 @@ A derivative of https://github.com/chevah/python-package/. Building: -* ``./pythia build`` +* ``./build.sh build`` Testing: -* ``./pythia test`` -* ``./pythia compat`` +* ``./build.sh test`` +* ``./build.sh compat`` -Use ``./pythia help`` to discover all available commands. +Use ``./build.sh help`` to discover all available commands. -Note that compat tests are currently only working with the ``python2.7`` branch. +Note that compat tests are currently only working on the ``python2.7`` branch. Supported platforms diff --git a/brink.conf b/brink.conf deleted file mode 100644 index c1ab35c7..00000000 --- a/brink.conf +++ /dev/null @@ -1,13 +0,0 @@ -BASE_REQUIREMENTS='chevah-brink==1.0.2 paver==1.2.4' -PYTHON_CONFIGURATION='default@3.8.6.31955c7' -# For production packages there are 2 options: -BINARY_DIST_URI='https://github.com/chevah/pythia/releases/download' -#BINARY_DIST_URI='https://bin.chevah.com:20443/production' -# For testing packages, make sure this one is the last uncommented instance: -#BINARY_DIST_URI='https://bin.chevah.com:20443/testing' -PIP_INDEX='https://pypi.chevah.com/simple' - -# There are 2 build directories used in this repo: -# * $BUILD_DIR (set as 'build') is used for building this Python package. -# * $CHEVAH_BUILD_DIR is used for Buildbot's Python when building through it. -CHEVAH_BUILD_DIR='build-pythia' diff --git a/build.conf b/build.conf new file mode 100644 index 00000000..fb16f546 --- /dev/null +++ b/build.conf @@ -0,0 +1,57 @@ +# Configuration file for building Pythia. + +# Sub-directories for building from sources and for the final distributable. +BUILD_DIR="build" +DIST_DIR="dist" + +# Python and lib versions. +PYTHON_BUILD_VERSION="3.8.6" +LIBFFI_VERSION="3.4.2" +ZLIB_VERSION="1.2.12" +BZIP2_VERSION="1.0.8" +XZ_VERSION="5.2.5" +# Statically build the BSD libedit on selected platforms to get the +# readline module available without linking to the GPL-only readline libs. +LIBEDIT_VERSION="20170329-3.1" +OPENSSL_VERSION="1.1.1n" +# To match the unusual naming scheme for SQLite downloads, eliminate dots from +# the regular SQLite version, then add 3 zeros. E.g. "3.33.0" -> "3330000". +# When updating this, also update the year in src/sqlite/chevahbs, if needed. +SQLITE_VERSION="3380300" +# These are used by get-pip.py. +PIP_VERSION="22.0.4" +SETUPTOOLS_VERSION="62.1.0" + +# Python modules versions to be used everywhere possible. +CFFI_VERSION="1.15.0" +CRYPTOGRAPHY_VERSION="3.4.8" +SUBPROCESS32_VERSION="3.5.4" +BCRYPT_VERSION="3.2.2" +PSUTIL_VERSION="5.9.0" +SETPROCTITLE_VERSION="1.2.3" + +# pycparser is explicitly installed to work around setuptools auto dependencies. +PYCPARSER_VERSION="2.21" + +# Global flags for building required libs. +BUILD_LIBFFI="no" +BUILD_ZLIB="no" +BUILD_BZIP2="yes" +BUILD_XZ="no" +BUILD_LIBEDIT="yes" +BUILD_OPENSSL="no" +BUILD_SQLITE="yes" + +# List of default Python modules installed using pip. +PIP_LIBRARIES="\ + cffi==${CFFI_VERSION} \ + cryptography==${CRYPTOGRAPHY_VERSION} \ + subprocess32==${SUBPROCESS32_VERSION} \ + bcrypt==${BCRYPT_VERSION} \ + psutil==${PSUTIL_VERSION} \ + setproctitle==${SETPROCTITLE_VERSION} + " +PIP_ARGS="\ + --index-url=${PIP_INDEX_URL} \ + --no-warn-script-location \ + " diff --git a/pythia b/build.sh similarity index 91% rename from pythia rename to build.sh index cc90f807..38e97502 100755 --- a/pythia +++ b/build.sh @@ -2,12 +2,20 @@ # # Pythia's script for building Python. -# Set versions for the software to be built and other defaults. +# Script initialization. +set -o nounset +set -o errexit +set -o pipefail + +# Get PIP_INDEX_URL for PIP_ARGS in build.conf. source pythia.conf +# Set versions for the software to be built and other defaults. +source build.conf + # Import shared and specific code. source ./functions.sh -source ./functions_pythia.sh +source ./functions_build.sh # Git revision to inject into Python's sys.version string through chevahbs # on non-Windows platforms. Also used for compat tests and archived in the dist. @@ -16,18 +24,18 @@ exit_on_error $? 250 # Export the variables needed by the chevahbs scripts and the test phase. export PYTHON_BUILD_VERSION PYTHIA_VERSION -export BUILD_ZLIB BUILD_BZIP2 BUILD_LIBEDIT BUILD_LIBFFI BUILD_OPENSSL +export BUILD_ZLIB BUILD_BZIP2 BUILD_XZ BUILD_LIBEDIT BUILD_LIBFFI BUILD_OPENSSL # OS detection is slow on Windows, only execute it when the file is missing. if [ ! -r ./BUILD_ENV_VARS ]; then - execute ./brink.sh detect_os + execute ./pythia.sh detect_os fi -# Import build env vars as set by brink.sh. +# Import build env vars as set by pythia.sh. source ./BUILD_ENV_VARS # On Unix, use $ARCH to choose between 32bit or 64bit packages. It's possible -# to force a 32bit build on a 64bit machine, e.g. by setting ARCH in brink.sh +# to force a 32bit build on a 64bit machine, e.g. by setting ARCH in pythia.sh # as "x86" instead of "x64" for a certain platform. # $ARCH is also used when "building" Python on Windows and for testing. # $OS is used when patching/configuring/building/testing. @@ -45,7 +53,7 @@ export CC="gcc" export MAKE="make" # $GET_CMD must save to custom filename, which must be appended before the link. # E.g., to use wget, GET_CMD should be "wget --quiet -O". -export GET_CMD="curl --silent --output" +export GET_CMD="curl --silent --location --output" export SHA_CMD="sha512sum --check --status --warn" export TAR_CMD="tar xfz" export ZIP_CMD="unzip -q" @@ -87,12 +95,13 @@ command_build() { # following locations, making sure they are picked up when building Python. # $CFLAGS/$CPPFLAGS is another way to ensure this, but it's not as portable. execute mkdir -p "$INSTALL_DIR"/{include,lib} - export LDFLAGS="-L${INSTALL_DIR}/lib/ ${LDFLAGS}" - export PKG_CONFIG_PATH="${INSTALL_DIR}/lib/pkgconfig/:${PKG_CONFIG_PATH}" + export LDFLAGS="-L${INSTALL_DIR}/lib/ ${LDFLAGS:-}" + export PKG_CONFIG_PATH="${INSTALL_DIR}/lib/pkgconfig/:${PKG_CONFIG_PATH:-}" build_dep $BUILD_LIBFFI libffi $LIBFFI_VERSION build_dep $BUILD_ZLIB zlib $ZLIB_VERSION build_dep $BUILD_BZIP2 bzip2 $BZIP2_VERSION + build_dep $BUILD_XZ xz $XZ_VERSION build_dep $BUILD_LIBEDIT libedit $LIBEDIT_VERSION build_dep $BUILD_SQLITE sqlite-autoconf $SQLITE_VERSION build_dep $BUILD_OPENSSL openssl $OPENSSL_VERSION @@ -130,7 +139,7 @@ build_dep() { export LDFLAGS="-Wl,-rpath,${INSTALL_DIR}/lib/ ${LDFLAGS}" fi # Still needed for building cryptography. - export CPPFLAGS="$CPPFLAGS -I${INSTALL_DIR}/include" + export CPPFLAGS="${CPPFLAGS:-} -I${INSTALL_DIR}/include" fi elif [ $dep_boolean = "no" ]; then (>&2 echo " Skip building $dep_name") @@ -243,17 +252,17 @@ command_compat() { execute rm -rf compat/ execute git clone https://github.com/chevah/compat.git --depth=1 -b master execute pushd compat - # Copy over current brink stuff, as some changes might require it. - execute cp ../../brink.{conf,sh} ./ + # Copy over current pythia stuff, as some changes might require it. + execute cp ../../pythia.{conf,sh} ./ # Patch compat to use the newly-built Python, then copy it to cache/. - echo -e "\nPYTHON_CONFIGURATION=default@${new_python_conf}" >> brink.conf + echo -e "\nPYTHON_CONFIGURATION=default@${new_python_conf}" >> pythia.conf execute mkdir cache execute cp -r ../"$PYTHON_BUILD_DIR" cache/ # Make sure everything is done from scratch in the current dir. unset CHEVAH_CACHE CHEVAH_BUILD # Some tests might still fail due to causes not related to the new Python. - execute ./brink.sh deps - execute ./brink.sh test_ci + execute ./pythia.sh deps + execute ./pythia.sh test_ci execute popd echo "::endgroup::" diff --git a/functions.sh b/functions.sh index 19b9fd81..78de7554 100644 --- a/functions.sh +++ b/functions.sh @@ -4,16 +4,15 @@ # # Check if debugging environment variable is set and initialize with 0 if not. -if [ -z "$DEBUG" ] ; then - DEBUG=0 -fi +DEBUG=${DEBUG-0} help_text_help=\ "Show help for a command." command_help() { - local command=$1 + local command=${1:-} local help_command="help_$command" # Test for a valid help method, otherwise call general help. + set +o errexit type $help_command &> /dev/null if [ $? -eq 0 ]; then $help_command @@ -25,6 +24,7 @@ command_help() { echo -e " $command_name\t${!help_text}" done fi + set -o errexit } # @@ -33,16 +33,17 @@ command_help() { # Select fuctions which are made public. # select_command() { - local command=$1 - shift + local command=${1:-} case $command in "") command_help exit 99 ;; *) + shift # Test for a valid command, otherwise call general help. call_command="command_$command" + set +o errexit type $call_command &> /dev/null if [ $? -eq 0 ]; then $call_command $@ @@ -52,6 +53,7 @@ select_command() { (>&2 echo "Unknown command: ${command}.") exit 98 fi + set -o errexit ;; esac } diff --git a/functions_pythia.sh b/functions_build.sh similarity index 96% rename from functions_pythia.sh rename to functions_build.sh index 35ba6244..a2d9edd9 100644 --- a/functions_pythia.sh +++ b/functions_build.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # -# Pythia-specific functions. +# Pythia-specific build functions. # Global variables. COMMAND="" @@ -102,7 +102,7 @@ chevahbs_build() { build() { # This has the form: "libffi", "zlib", "bzip", "libedit", etc. # It's present in 'src/` and contains `chevahbs`, checksums, patches. - # Also used when downloading the gzipp'ed tarball and unpacking it. + # Also used when downloading the gzipped tarball and unpacking it. project_name="$1" # This has the form: "3.2.1", "1.2.11". etc. project_ver="$2" @@ -212,6 +212,11 @@ cleanup_install_dir() { execute rm -rf "lib/$PYTHON_VERSION/test/" # Remove (mostly OpenSSL) docs and manuals. execute rm -rf share/ + # Move stray pkgconfig/* to lib/pkgconfig/. + if [ -d pkgconfig ]; then + execute mv pkgconfig/* lib/pkgconfig/ + execute rmdir pkgconfig + fi ;; esac execute popd diff --git a/os_quirks.sh b/os_quirks.sh index 7a023b30..f2f455b9 100644 --- a/os_quirks.sh +++ b/os_quirks.sh @@ -25,27 +25,30 @@ case $OS in # It's better to run on minimal Alpine containers. export BUILD_LIBFFI="yes" export BUILD_LIBEDIT="no" + export BUILD_XZ="yes" ;; lnx) # Build as portable as possible, only glibc 2.x should be needed. export BUILD_LIBFFI="yes" export BUILD_ZLIB="yes" + export BUILD_XZ="yes" export BUILD_LIBEDIT="no" # Generic Linux might be an old distro with OpenSSL 0.9.8 libraries. # To avoid linking to local libs, build own OpenSSL libs. export BUILD_OPENSSL="yes" # Generic builds on CentOS 5 have issues with Let's Encrypt certs. - export GET_CMD="curl --silent --insecure --output" + export GET_CMD="curl --silent --insecure --location --output" ;; macos) export CC="clang" export CXX="clang++" - export CFLAGS="$CFLAGS -mmacosx-version-min=10.13" + export CFLAGS="${CFLAGS:-} -mmacosx-version-min=10.13" # setup.py skips building readline by default, as it sets this to # "10.4", and then tries to avoid the broken readline in OS X 10.4. export MACOSX_DEPLOYMENT_TARGET=10.13 # System includes bzip2 libs by default. export BUILD_BZIP2="no" + export BUILD_XZ="yes" # 10.13 and newer come with LibreSSL instead of the old OpenSSL libs. # But 10.13 has version 2.2.7, while cryptography 2.9 requires 2.7. # Therefore, build OpenSSL for both stdlib and cryptography. @@ -59,6 +62,7 @@ case $OS in export BUILD_LIBFFI="yes" # System includes bzip2 libs by default. export BUILD_BZIP2="no" + export BUILD_XZ="yes" # Install package "p5-Digest-SHA" to get shasum binary. export SHA_CMD="shasum --algorithm 512 --check --status --warn" ;; @@ -67,6 +71,7 @@ case $OS in export CXX="clang++" # libffi not available in the base system, only as port/package. export BUILD_LIBFFI="yes" + export BUILD_XZ="yes" export SHA_CMD="sha512 -q -c" ;; sol*) @@ -76,20 +81,21 @@ case $OS in export MAKE="gmake" # Needed for the subprocess32 module. # More at https://github.com/google/python-subprocess32/issues/40. - export CFLAGS="$CFLAGS -DHAVE_DIRFD" + export CFLAGS="${CFLAGS:-} -DHAVE_DIRFD" # Arch-specific bits and paths. if [ "${ARCH%64}" = "$ARCH" ]; then # Some libs (e.g. GMP) need to be informed of a 32bit build. export ABI="32" else export CFLAGS="$CFLAGS -m64" - export LDFLAGS="$LDFLAGS -m64 -L/usr/lib/64 -R/usr/lib/64" + export LDFLAGS="${LDFLAGS:-} -m64 -L/usr/lib/64 -R/usr/lib/64" fi # System includes bzip2 libs by default. export BUILD_BZIP2="no" # Solaris 11 is much more modern, but still has some quirks. # Multiple system libffi libs present, this is a problem in 11.4. export BUILD_LIBFFI="yes" + export BUILD_XZ="yes" # Native tar is not that compatible, but the GNU tar should be present. export TAR_CMD="gtar xfz" ;; @@ -101,10 +107,10 @@ if [ "${OS%sol*}" = "" ]; then export CFLAGS="$CFLAGS -Kpic" elif [ "${OS%fbsd*}" = "" -o "${OS%obsd*}" = "" ]; then # Use PIC (Position Independent Code) on FreeBSD and OpenBSD with Clang. - export CFLAGS="${CFLAGS} -fPIC" + export CFLAGS="${CFLAGS:-} -fPIC" elif [ "$CC" = "gcc" -a ${ARCH%%64} != "$ARCH" ]; then # Use PIC (Position Independent Code) with GCC on 64-bit arches. - export CFLAGS="${CFLAGS} -fPIC" + export CFLAGS="${CFLAGS:-} -fPIC" fi # Get number of useful CPUs, to enable parallel builds where applicable. @@ -127,4 +133,4 @@ case "$OS" in CPUS=$(getconf _NPROCESSORS_ONLN) ;; esac -export MAKE="$MAKE -j${CPUS}" +export MAKE="${MAKE:-} -j${CPUS}" diff --git a/pavement.py b/pavement.py index 57d1d5d4..ce476158 100644 --- a/pavement.py +++ b/pavement.py @@ -26,13 +26,10 @@ SETUP['repository']['name'] = u'pythia' SETUP['test']['package'] = None -SETUP['pypi']['index_url'] = 'http://pypi.chevah.com/simple' +SETUP['pypi']['index_url'] = 'https://bin.chevah.com:20443/pypi/simple' SETUP['repository']['name'] = u'pythia' SETUP['repository']['github'] = 'https://github.com/chevah/pythia' -SETUP['buildbot']['builders_filter'] = u'pythia' -SETUP['buildbot']['server'] = 'buildbot.chevah.com' -SETUP['buildbot']['web_url'] = 'https://buildbot.chevah.com:10433' RUN_PACKAGES = [ 'requests~=2.24', diff --git a/pkg_checks.sh b/pkg_checks.sh index 8b07bbc1..99922fe3 100644 --- a/pkg_checks.sh +++ b/pkg_checks.sh @@ -1,7 +1,6 @@ #!/usr/bin/env bash # # Check for the presence of required packages/commands. -# If possible, install missing ones, typically through sudo. # # This build requires: # * a C compiler, e.g. gcc @@ -16,15 +15,15 @@ # List of OS packages required for building Python/pyOpenSSL/cryptography etc. BASE_PKGS="gcc make m4 automake libtool patch unzip" -DPKG_PKGS="$BASE_PKGS tar diffutils \ - git libssl-dev zlib1g-dev libffi-dev libncurses5-dev" +DEB_PKGS="$BASE_PKGS tar diffutils \ + git zlib1g-dev liblzma-dev libffi-dev libncurses5-dev libssl-dev" RPM_PKGS="$BASE_PKGS tar diffutils \ - git-core openssl-devel zlib-devel libffi-devel ncurses-devel" + git-core libffi-devel zlib-devel xz-devel ncurses-devel openssl-devel" # Alpine's ersatz tar/sha51sum binaries from Busybox are good enough. APK_PKGS="$BASE_PKGS file lddtree \ - git openssl-dev zlib-dev libffi-dev musl-dev paxctl" + git zlib-dev openssl-dev musl-dev linux-headers paxctl" # Windows is special, but package management is possible through Chocolatey. -# Curl, sha512sum, and unzip are bundled with MINGW. +# Some tools are bundled with MINGW: curl, sha512sum, unzip. CHOCO_PKGS="" CHOCO_PRESENT="unknown" @@ -45,7 +44,7 @@ case "$OS" in CHECK_CMD="rpm --query" ;; ubuntu*) - PACKAGES="$DPKG_PKGS" + PACKAGES="$DEB_PKGS" CHECK_CMD="dpkg --status" ;; alpine*) @@ -82,6 +81,9 @@ case "$OS" in ;; esac +# External checks with various exit codes are checked below. +set +o errexit + # If $CHECK_CMD is still "command -v", it's only a check for needed commands. if [ -n "$PACKAGES" ]; then for package in $PACKAGES ; do @@ -96,29 +98,7 @@ fi if [ -n "$MISSING_PACKAGES" ]; then (>&2 echo "Missing required dependencies: $MISSING_PACKAGES.") - if [ $CHOCO_PRESENT = "yes" ]; then - echo "## Installing missing Chocolatey packages... ##" - execute choco install --yes --no-progress $MISSING_PACKAGES - else - case "$OS" in - ubuntu*) - echo "## Installing missing dpkg packages... ##" - execute $SUDO_CMD apt install -y $MISSING_PACKAGES - ;; - rhel*|amzn*) - echo "## Installing missing rpm packages... ##" - execute $SUDO_CMD yum install -y $MISSING_PACKAGES - ;; - alpine*) - echo "## Installing missing apk packages... ##" - execute $SUDO_CMD apk add $MISSING_PACKAGES - ;; - *) - (>&2 echo "Don't know how to install those on the current OS.") - exit 149 - ;; - esac - fi + exit 149 fi if [ -n "$PACKAGES" ]; then @@ -127,6 +107,7 @@ fi # Windows "build" is special, following checks are for other platforms. if [ "$OS" = "win" ]; then + set -o errexit return fi @@ -135,6 +116,7 @@ command -v makeinfo >/dev/null if [ $? -ne 0 ]; then (>&2 echo "# Missing makeinfo, linking it to /bin/true in ~/bin... #") execute mkdir -p ~/bin + execute rm -f ~/bin/makeinfo execute ln -s /bin/true ~/bin/makeinfo export PATH="$PATH:~/bin/" fi @@ -143,16 +125,22 @@ fi echo "# Checking if it's possible to avoid linking to system uuid libs... #" case "$OS" in ubuntu*) - execute $SUDO_CMD apt remove -y uuid-dev + $CHECK_CMD uuid-dev \ + && echo "To not link to uuid libs, run: apt remove -y uuid-dev" ;; rhel*|amzn*) - execute $SUDO_CMD yum remove -y e2fsprogs-devel libuuid-devel + $CHECK_CMD libuuid-devel \ + && echo -n "To not link to uuid libs, run: " \ + && echo "yum remove -y e2fsprogs-devel libuuid-devel" ;; alpine*) $CHECK_CMD util-linux-dev \ - && execute $SUDO_CMD apk del util-linux-dev + && echo "To not link to uuid libs, run: apk del util-linux-dev" ;; *) (>&2 echo "Not guarding against linking to uuid libs on this system!") ;; esac + +# This script is sourced, execution does not end here. +set -o errexit diff --git a/publish_dist.sh b/publish_dist.sh index 2a40a685..31501633 100755 --- a/publish_dist.sh +++ b/publish_dist.sh @@ -32,6 +32,7 @@ $sftp_cmd $sftp_opts ${dest_user}@${dest_server} # Get $DIST_DIR. source pythia.conf +source build.conf # As dist/ is rebuilt on every build, it should only have 1 sub-dir with 1 pkg. upload_dir=$(cd $DIST_DIR && ls -1) diff --git a/pythia.conf b/pythia.conf index ae2d5db5..f963d524 100644 --- a/pythia.conf +++ b/pythia.conf @@ -1,57 +1,13 @@ -# Configuration file for Pythia - -# Sub-directories for building from sources and for the final distributable. -BUILD_DIR="build" -DIST_DIR="dist" - -# Python and lib versions. -PYTHON_BUILD_VERSION="3.8.6" -LIBFFI_VERSION="3.3" -ZLIB_VERSION="1.2.11" -BZIP2_VERSION="1.0.8" -# Statically build the BSD libedit on selected platforms to get the -# readline module available without linking to the GPL-only readline libs. -LIBEDIT_VERSION="20170329-3.1" -OPENSSL_VERSION="1.1.1k" -# To match the unusual naming scheme for SQLite downloads, eliminate dots from -# the regular SQLite version, then add 3 zeros. E.g. "3.33.0" -> "3330000". -# When updating this, also update the year in src/sqlite/chevahbs, if needed. -SQLITE_VERSION="3330000" -# These are used by get-pip.py. -PIP_VERSION="21.1.1" -SETUPTOOLS_VERSION="53.0.0" - -# Python modules versions to be used everywhere possible. -CFFI_VERSION="1.14.3" -CRYPTOGRAPHY_VERSION="3.4.7" -SUBPROCESS32_VERSION="3.5.4" -BCRYPT_VERSION="3.1.7" -PSUTIL_VERSION="5.7.3" -SETPROCTITLE_VERSION="1.1.10" - -# pycparser is explicitly installed to work around setuptools auto dependencies. -PYCPARSER_VERSION="2.20" - -# Global flags for building required libs. -BUILD_LIBFFI="no" -BUILD_ZLIB="no" -BUILD_BZIP2="yes" -BUILD_LIBEDIT="yes" -BUILD_OPENSSL="no" -BUILD_SQLITE="yes" - -# List of default Python modules installed using pip. -PIP_LIBRARIES="\ - cffi==${CFFI_VERSION} \ - cryptography==${CRYPTOGRAPHY_VERSION} \ - subprocess32==${SUBPROCESS32_VERSION} \ - bcrypt==${BCRYPT_VERSION} \ - psutil==${PSUTIL_VERSION} \ - setproctitle==${SETPROCTITLE_VERSION} - " -# Arguments that are sent when using pip. -PIP_ARGS="\ - --index-url=https://pypi.chevah.com/simple \ - --trusted-host=pypi.chevah.com \ - --no-warn-script-location \ - " +BASE_REQUIREMENTS='chevah-brink==1.0.6 paver==1.2.4' +PYTHON_CONFIGURATION='default@3.8.6.3b1a8ba' +# For production packages there are 2 options: +BINARY_DIST_URI='https://github.com/chevah/pythia/releases/download' +#BINARY_DIST_URI='https://bin.chevah.com:20443/production' +# For testing packages, make sure this one is the last uncommented instance: +#BINARY_DIST_URI='https://bin.chevah.com:20443/testing' +PIP_INDEX_URL='https://bin.chevah.com:20443/pypi/simple' + +# There are 2 build directories used in this repo: +# * $BUILD_DIR is used for building libffi / OpenSSL / Python / etc. +# * $CHEVAH_BUILD_DIR is used by the Python that builds the above. +CHEVAH_BUILD_DIR='build-pythia' diff --git a/brink.sh b/pythia.sh similarity index 96% rename from brink.sh rename to pythia.sh index b67946a3..6e1ac6f4 100755 --- a/brink.sh +++ b/pythia.sh @@ -22,14 +22,14 @@ # * CHEVAH_ARCH - CPU type of the current OS # # The build directory is used from CHEVAH_BUILD env, -# then read from brink.conf as CHEVAH_BUILD_DIR, +# then read from pythia.conf as CHEVAH_BUILD_DIR, # and will use a default value if not defined there. # # The cache directory is read the CHEVAH_CACHE env, -# and then read from brink.conf as CHEVAH_CACHE_DIR, +# and then read from pythia.conf as CHEVAH_CACHE_DIR, # and will use a default value if not defined. # -# You can define your own `execute_venv` function in brink.conf with the +# You can define your own `execute_venv` function in pythia.conf with the # command used to execute Python inside the newly virtual environment. # @@ -81,29 +81,29 @@ LOCAL_PYTHON_BINARY_DIST="" OS='not-detected-yet' ARCH='not-detected-yet' -# Initialize default values from brink.conf +# Initialize default values from pythia.conf PYTHON_CONFIGURATION='NOT-YET-DEFINED' PYTHON_VERSION='not.defined.yet' PYTHON_PLATFORM='unknown-os-and-arch' PYTHON_NAME='python3.8' BINARY_DIST_URI='https://github.com/chevah/pythia/releases/download' -PIP_INDEX='https://pypi.chevah.com' +PIP_INDEX_URL='https://pypi.org/simple' BASE_REQUIREMENTS='' # # Check that we have a pavement.py file in the current dir. -# If not, we are out of the source's root dir and brink.sh won't work. +# If not, we are out of the source's root dir and pythia.sh won't work. # check_source_folder() { if [ ! -e pavement.py ]; then (>&2 echo 'No "pavement.py" file found in current folder.') - (>&2 echo 'Make sure you are running "brink.sh" from a source folder.') + (>&2 echo 'Make sure you are running "pythia.sh" from a source folder.') exit 8 fi } # Called to trigger the entry point in the virtual environment. -# Can be overwritten in brink.conf +# Can be overwritten in pythia.conf execute_venv() { ${PYTHON_BIN} $PYTHON3_CHECK -c 'from paver.tasks import main; main()' "$@" } @@ -121,13 +121,13 @@ update_venv() { exit_code=$? set -e if [ $exit_code -ne 0 ]; then - (>&2 echo 'Failed to run the initial "./brink.sh deps" command.') + (>&2 echo 'Failed to run the initial "./pythia.sh deps" command.') exit 7 fi } # Load repo specific configuration. -source brink.conf +source pythia.conf clean_build() { @@ -256,6 +256,7 @@ update_path_variables() { export CHEVAH_OS=${OS} export CHEVAH_ARCH=${ARCH} export CHEVAH_CACHE=${CACHE_FOLDER} + export PIP_INDEX_URL=${PIP_INDEX_URL} } @@ -307,11 +308,13 @@ pip_install() { echo "::group::pip install $1" set +e + # There is a bug in pip/setuptools when using custom build folders. + # See https://github.com/pypa/pip/issues/3564 + rm -rf ${BUILD_FOLDER}/pip-build ${PYTHON_BIN} -m \ pip install \ - --trusted-host pypi.chevah.com \ - --trusted-host deag.chevah.com \ - --index-url=$PIP_INDEX \ + --index-url=$PIP_INDEX_URL \ + --build=${BUILD_FOLDER}/pip-build \ $1 exit_code=$? @@ -531,7 +534,7 @@ install_dependencies(){ # If it's too old, exit with a nice informative message. # If it's supported, return through eval the version numbers to be used for # naming the package, for example: '8' for RHEL 8.2, '2004' for Ubuntu 20.04, -# '312' for Alpine Linux 3.12, '114' for Solaris 11.4. +# '314' for Alpine Linux 3.14, '114' for Solaris 11.4. # check_os_version() { # First parameter should be the human-readable name for the current OS. @@ -796,11 +799,11 @@ detect_os() { ARCH="x64" case "$OS" in win) - # 32bit build on Windows 2016, 64bit otherwise. + # 32bit build on Windows 2019, 64bit otherwise. # Should work with a l10n pack too (tested with French). win_ver=$(systeminfo.exe | head -n 3 | tail -n 1 \ | cut -d ":" -f 2) - if [[ "$win_ver" =~ "Microsoft Windows Server 2016" ]]; then + if [[ "$win_ver" =~ "Microsoft Windows Server 2019" ]]; then ARCH="x86" fi ;; @@ -846,7 +849,7 @@ check_source_folder copy_python install_dependencies -# Update brink.conf dependencies when running deps. +# Update pythia.conf dependencies when running deps. if [ "$COMMAND" == "deps" ] ; then install_base_deps fi diff --git a/src/Python-Windows/chevahbs b/src/Python-Windows/chevahbs index b251f5dc..06b35acc 100755 --- a/src/Python-Windows/chevahbs +++ b/src/Python-Windows/chevahbs @@ -7,7 +7,7 @@ # Import shared code. # The relative paths work in both src/blabla and build/blabla. source ../../functions.sh -source ../../functions_pythia.sh +source ../../functions_build.sh # The usual two arguments, e.g. "Python" and "3.9.0", # but the installation path is also needed, because this script is special. diff --git a/src/Python/chevahbs b/src/Python/chevahbs index 73a391ad..374eeffb 100755 --- a/src/Python/chevahbs +++ b/src/Python/chevahbs @@ -7,7 +7,7 @@ # Import shared code. # The relative paths work in both src/blabla and build/blabla. source ../../functions.sh -source ../../functions_pythia.sh +source ../../functions_build.sh chevahbs_getsources() { diff --git a/src/Python/disabled_modules.patch b/src/Python/disabled_modules.patch index 0a96bc9a..33afa959 100644 --- a/src/Python/disabled_modules.patch +++ b/src/Python/disabled_modules.patch @@ -1,7 +1,7 @@ diff -ur Python-3.8.6.orig/setup.py Python-3.8.6.disabled_modules/setup.py --- Python-3.8.6.orig/setup.py 2020-09-23 12:36:32.000000000 +0000 +++ Python-3.8.6.disabled_modules/setup.py 2020-10-30 11:48:50.512622149 +0000 -@@ -24,8 +24,17 @@ +@@ -24,8 +24,16 @@ TEST_EXTENSIONS = True # This global variable is used to hold the list of modules to be disabled. @@ -13,7 +13,6 @@ diff -ur Python-3.8.6.orig/setup.py Python-3.8.6.disabled_modules/setup.py + '_dbm', + '_gdbm', + '_locale', -+ '_lzma', + '_tkinter', + 'nis', + 'readline', diff --git a/src/bzip2/chevahbs b/src/bzip2/chevahbs index acfc06d2..0f3ea54b 100755 --- a/src/bzip2/chevahbs +++ b/src/bzip2/chevahbs @@ -5,7 +5,7 @@ # Import shared code. # The relative paths work in both src/blabla and build/blabla. source ../../functions.sh -source ../../functions_pythia.sh +source ../../functions_build.sh chevahbs_getsources() { diff --git a/src/chevah-python-test/test_python_binary_dist.py b/src/chevah-python-test/test_python_binary_dist.py index 974f0bc3..60daf7e1 100644 --- a/src/chevah-python-test/test_python_binary_dist.py +++ b/src/chevah-python-test/test_python_binary_dist.py @@ -56,6 +56,7 @@ def get_allowed_deps(): '/lib64/libkeyutils.so.1', '/lib64/libkrb5.so.3', '/lib64/libkrb5support.so.0', + '/lib64/liblzma.so.5', '/lib64/libm.so.6', '/lib64/libnsl.so.1', '/lib64/libpthread.so.0', @@ -66,15 +67,6 @@ def get_allowed_deps(): '/lib64/libz.so.1', ] rhel_version = CHEVAH_OS[4:] - if rhel_version.startswith("7"): - allowed_deps.extend([ - '/lib64/libcrypto.so.10', - '/lib64/libffi.so.6', - '/lib64/libncursesw.so.5', - '/lib64/libpcre.so.1', - '/lib64/libssl.so.10', - '/lib64/libtinfo.so.5', - ]) if rhel_version.startswith("8"): allowed_deps.extend([ '/lib64/libcrypto.so.1.1', @@ -83,32 +75,6 @@ def get_allowed_deps(): '/lib64/libssl.so.1.1', '/lib64/libtinfo.so.6', ]) - elif 'amzn' in CHEVAH_OS: - # Deps for Amazon Linux 2 (x86_64 only). - allowed_deps=[ - '/lib64/libcom_err.so.2', - '/lib64/libcrypto.so.10', - '/lib64/libcrypt.so.1', - '/lib64/libc.so.6', - '/lib64/libdl.so.2', - '/lib64/libffi.so.6', - '/lib64/libgssapi_krb5.so.2', - '/lib64/libk5crypto.so.3', - '/lib64/libkeyutils.so.1', - '/lib64/libkrb5.so.3', - '/lib64/libkrb5support.so.0', - '/lib64/libm.so.6', - '/lib64/libncursesw.so.6', - '/lib64/libpcre.so.1', - '/lib64/libpthread.so.0', - '/lib64/libresolv.so.2', - '/lib64/librt.so.1', - '/lib64/libselinux.so.1', - '/lib64/libssl.so.10', - '/lib64/libtinfo.so.6', - '/lib64/libutil.so.1', - '/lib64/libz.so.1', - ] elif 'ubuntu' in CHEVAH_OS: ubuntu_version = CHEVAH_OS[6:] # Common deps for supported Ubuntu LTS with full paths (x86_64). @@ -116,6 +82,7 @@ def get_allowed_deps(): '/lib/x86_64-linux-gnu/libc.so.6', '/lib/x86_64-linux-gnu/libcrypt.so.1', '/lib/x86_64-linux-gnu/libdl.so.2', + '/lib/x86_64-linux-gnu/liblzma.so.5', '/lib/x86_64-linux-gnu/libm.so.6', '/lib/x86_64-linux-gnu/libpthread.so.0', '/lib/x86_64-linux-gnu/librt.so.1', @@ -390,9 +357,12 @@ def main(): # On RHEL 8.3, OpenSSL got updated to 1.1.1g. To keep backward # compatibility, link to version 1.1.1c from CentOS 8.2.2004. expecting = u'OpenSSL 1.1.1c FIPS 28 May 2019' + elif CHEVAH_OS == "win": + # Latest cryptography not requiring Rust has older wheels. + expecting = u'OpenSSL 1.1.1l 24 Aug 2021' else: # Use latest OpenSSL version when building it from source. - expecting = u'OpenSSL 1.1.1k 25 Mar 2021' + expecting = u'OpenSSL 1.1.1n 15 Mar 2022' if openssl_version != expecting: sys.stderr.write('Expecting %s, got %s.\n' % ( expecting, openssl_version)) @@ -465,6 +435,19 @@ def main(): sys.stderr.write('"bz2" is missing.\n') exit_code = 149 + try: + import lzma + test_string = b"just a random string to quickly test lzma" + test_string_xzed = lzma.compress(test_string) + if lzma.decompress(test_string_xzed) == test_string: + print('"lzma" module is present.') + else: + sys.stderr.write('"lzma" is present, but broken.\n') + exit_code = 152 + except: + sys.stderr.write('"lzma" is missing.\n') + exit_code = 151 + try: import setproctitle current_process_title = setproctitle.getproctitle() diff --git a/src/libedit/chevahbs b/src/libedit/chevahbs index 1f7556b0..c6e98973 100755 --- a/src/libedit/chevahbs +++ b/src/libedit/chevahbs @@ -4,7 +4,7 @@ # Import shared code. source ../../functions.sh -source ../../functions_pythia.sh +source ../../functions_build.sh chevahbs_getsources() { diff --git a/src/libffi/chevahbs b/src/libffi/chevahbs index 00b8c3ba..b76a7f72 100755 --- a/src/libffi/chevahbs +++ b/src/libffi/chevahbs @@ -5,14 +5,14 @@ # Import shared code. # The relative paths work in both src/blabla and build/blabla. source ../../functions.sh -source ../../functions_pythia.sh +source ../../functions_build.sh chevahbs_getsources() { local name=$1 local ver=$2 local ext="tar.gz" - local link=ftp://sourceware.org/pub/libffi/"$name"-"$ver"."$ext" + local link=https://github.com/libffi/libffi/releases/download/v"$ver"/"$name"-"$ver"."$ext" download_sources $name $ver $link $ext } @@ -31,12 +31,12 @@ chevahbs_compile() { chevahbs_install() { case $OS in lnx) - # Installing manually to avoid messing with a lib64/ sub-dir. + # Install manually to avoid creating a lib64/ sub-dir on CentOS 5. execute cp -v *-linux-gnu/.libs/libffi.a "$INSTALL_DIR"/lib/ execute cp -v *-linux-gnu/libffi.la "$INSTALL_DIR"/lib/ execute cp -v *-linux-gnu/include/*.h "$INSTALL_DIR"/include/ - execute mkdir "$INSTALL_DIR"/pkgconfig/ - execute cp -v *-linux-gnu/libffi.pc "$INSTALL_DIR"/pkgconfig/ + execute mkdir "$INSTALL_DIR"/lib/pkgconfig/ + execute cp -v *-linux-gnu/libffi.pc "$INSTALL_DIR"/lib/pkgconfig/ ;; *) execute $MAKE install DESTDIR=$INSTALL_DIR diff --git a/src/libffi/sha512.sum b/src/libffi/sha512.sum index 497e3960..344aeb00 100644 --- a/src/libffi/sha512.sum +++ b/src/libffi/sha512.sum @@ -1 +1 @@ -61513801a156f11420f541d325de697131846487122d6bdcf5491b18b4da788589f5c0bb07e88e396495d3be5830d74e9135595e2b8ddbfe95c448d8597fbd6f libffi-3.3.tar.gz +31bad35251bf5c0adb998c88ff065085ca6105cf22071b9bd4b5d5d69db4fadf16cadeec9baca944c4bb97b619b035bb8279de8794b922531fddeb0779eb7fb1 libffi-3.4.2.tar.gz diff --git a/src/openssl/chevahbs b/src/openssl/chevahbs index 3bfab7ca..8a9a2fd8 100755 --- a/src/openssl/chevahbs +++ b/src/openssl/chevahbs @@ -5,7 +5,7 @@ # Import shared code. # The relative paths work in both src/blabla and build/blabla. source ../../functions.sh -source ../../functions_pythia.sh +source ../../functions_build.sh chevahbs_getsources() { @@ -38,7 +38,7 @@ chevahbs_install() { echo "Installing manually to avoid messing with a lib64/ sub-dir:" execute cp -v libcrypto.a libssl.a "$INSTALL_DIR"/lib/ execute cp -rv include/openssl/ "$INSTALL_DIR"/include/ - execute cp -v *.pc "$INSTALL_DIR"/pkgconfig/ + execute cp -v *.pc "$INSTALL_DIR"/lib/pkgconfig/ ;; *) execute $MAKE install diff --git a/src/openssl/sha512.sum b/src/openssl/sha512.sum index 5aba0b90..c23b7db0 100644 --- a/src/openssl/sha512.sum +++ b/src/openssl/sha512.sum @@ -1 +1 @@ -73cd042d4056585e5a9dd7ab68e7c7310a3a4c783eafa07ab0b560e7462b924e4376436a6d38a155c687f6942a881cfc0c1b9394afcde1d8c46bf396e7d51121 openssl-1.1.1k.tar.gz +1937796736613dcf4105a54e42ecb61f95a1cea74677156f9459aea0f2c95159359e766089632bf364ee6b0d28d661eb9957bce8fecc9d2436378d8d79e8d0a4 openssl-1.1.1n.tar.gz diff --git a/src/sqlite-autoconf/chevahbs b/src/sqlite-autoconf/chevahbs index 71e9142d..5412fdbe 100755 --- a/src/sqlite-autoconf/chevahbs +++ b/src/sqlite-autoconf/chevahbs @@ -5,7 +5,7 @@ # Import shared code. # The relative paths work in both src/blabla and build/blabla. source ../../functions.sh -source ../../functions_pythia.sh +source ../../functions_build.sh chevahbs_getsources() { @@ -14,7 +14,7 @@ chevahbs_getsources() { local name=$1 local ver=$2 local ext="tar.gz" - local link=https://sqlite.org/2020/"$name"-"$ver"."$ext" + local link=https://sqlite.org/2022/"$name"-"$ver"."$ext" download_sources $name $ver $link $ext } diff --git a/src/sqlite-autoconf/sha512.sum b/src/sqlite-autoconf/sha512.sum index ac50db10..34e9f13e 100644 --- a/src/sqlite-autoconf/sha512.sum +++ b/src/sqlite-autoconf/sha512.sum @@ -1 +1 @@ -c0d79d4012a01f12128ab5044b887576a130663245b85befcc0ab82ad3a315dd1e7f54b6301f842410c9c21b73237432c44a1d7c2fe0e0709435fec1f1a20a11 sqlite-autoconf-3330000.tar.gz +02bec3bd0d89f53c81c34a16d9105e157e3cfc9bb9c62900f65fde019a211b4d1b28017affd1785b344d85f742a0c6893b9c5b2702312c3e7ddb78ae8a4c152f sqlite-autoconf-3380300.tar.gz diff --git a/src/xz/chevahbs b/src/xz/chevahbs new file mode 100755 index 00000000..0bf2e78e --- /dev/null +++ b/src/xz/chevahbs @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +# +# Chevah Build Script for xz. + +# Import shared code. +# The relative paths work in both src/blabla and build/blabla. +source ../../functions.sh +source ../../functions_build.sh + + +chevahbs_getsources() { + local name=$1 + local ver=$2 + local ext="tar.gz" + local link=https://downloads.sourceforge.net/project/lzmautils/"$name"-"$ver"."$ext" + + download_sources $name $ver $link $ext +} + + +chevahbs_configure() { + CONF_OPTS="--enable-static --disable-shared" + execute ./configure --prefix="" $CONF_OPTS +} + + +chevahbs_compile() { + execute $MAKE +} + + +chevahbs_install() { + execute $MAKE install DESTDIR=$INSTALL_DIR +} + + +select_chevahbs_command $@ diff --git a/src/xz/sha512.sum b/src/xz/sha512.sum new file mode 100644 index 00000000..e72a0025 --- /dev/null +++ b/src/xz/sha512.sum @@ -0,0 +1 @@ +7443674247deda2935220fbc4dfc7665e5bb5a260be8ad858c8bd7d7b9f0f868f04ea45e62eb17c0a5e6a2de7c7500ad2d201e2d668c48ca29bd9eea5a73a3ce xz-5.2.5.tar.gz diff --git a/src/zlib/chevahbs b/src/zlib/chevahbs index 600c2007..4b37fb20 100755 --- a/src/zlib/chevahbs +++ b/src/zlib/chevahbs @@ -5,7 +5,7 @@ # Import shared code. # The relative paths work in both src/blabla and build/blabla. source ../../functions.sh -source ../../functions_pythia.sh +source ../../functions_build.sh chevahbs_getsources() { diff --git a/src/zlib/sha512.sum b/src/zlib/sha512.sum index c8ece673..8bfac5a4 100644 --- a/src/zlib/sha512.sum +++ b/src/zlib/sha512.sum @@ -1 +1 @@ -73fd3fff4adeccd4894084c15ddac89890cd10ef105dd5e1835e1e9bbb6a49ff229713bd197d203edfa17c2727700fce65a2a235f07568212d820dca88b528ae zlib-1.2.11.tar.gz +cc2366fa45d5dfee1f983c8c51515e0cff959b61471e2e8d24350dea22d3f6fcc50723615a911b046ffc95f51ba337d39ae402131a55e6d1541d3b095d6c0a14 zlib-1.2.12.tar.gz