From e562a124c96c789682f6364a817c13a6f7e9c05b Mon Sep 17 00:00:00 2001 From: Rafal Mielniczuk Date: Fri, 10 Nov 2023 19:58:32 +0000 Subject: [PATCH] Add libressl port --- .github/workflows/toolchain.yml | 5 ++++- README.md | 1 + sysroot/build.sh | 36 ++++++++++++++++++++++++++++++++- 3 files changed, 40 insertions(+), 2 deletions(-) diff --git a/.github/workflows/toolchain.yml b/.github/workflows/toolchain.yml index 06266f97..155fbaea 100644 --- a/.github/workflows/toolchain.yml +++ b/.github/workflows/toolchain.yml @@ -22,7 +22,10 @@ jobs: submodules: true - name: Install Packages - run: apt-fast -y install nasm meson ninja-build bison flex libgmp3-dev libmpc-dev libmpfr-dev texinfo xorriso autotools-dev automake autoconf autoconf-archive gettext pkgconf autopoint gcc-12 g++-12 gperf linux-libc-dev + run: | + add-apt-repository --yes ppa:deadsnakes/ppa + apt-get update + apt-fast -y install nasm meson ninja-build bison flex libgmp3-dev libmpc-dev libmpfr-dev texinfo xorriso autotools-dev automake autoconf autoconf-archive gettext pkgconf autopoint gcc-12 g++-12 gperf linux-libc-dev python3.11 - name: Configure gcc run: | diff --git a/README.md b/README.md index da0cadac..89643514 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,7 @@ https://github.com/rafalmiel/cykusz-rs/assets/3881998/afa514a1-f435-4eeb-8c80-20 - [x] less () - [x] zstd () - [x] zlib () +- [x] libressl () - [x] doom () - [x] netcat () - [x] python () diff --git a/sysroot/build.sh b/sysroot/build.sh index 64c94a7c..c411c857 100755 --- a/sysroot/build.sh +++ b/sysroot/build.sh @@ -19,6 +19,7 @@ DOOM_SRC_DIR=$SRC_DIR/doomgeneric COREUTILS_SRC_DIR=$SRC_DIR/coreutils TZDB_SRC_DIR=$SRC_DIR/tzdb ZSTD_SRC_DIR=$SRC_DIR/zstd +LIBRESSL_SRC_DIR=$SRC_DIR/libressl-portable LLVM_SRC_DIR=$SRC_DIR/llvm-project LESS_SRC_DIR=$SRC_DIR/less NETCAT_SRC_DIR=$SRC_DIR/netcat @@ -34,6 +35,7 @@ NANO_CYKUSZ_BUILD_DIR=$BUILD_DIR/cykusz-nano BASH_CYKUSZ_BUILD_DIR=$BUILD_DIR/cykusz-bash COREUTILS_CYKUSZ_BUILD_DIR=$BUILD_DIR/cykusz-coreutils ZSTD_CYKUSZ_BUILD_DIR=$BUILD_DIR/cykusz-zstd +LIBRESSL_CYKUSZ_BUILD_DIR=$BUILD_DIR/cykusz-libressl LLVM_CYKUSZ_BUILD_DIR=$BUILD_DIR/cykusz-llvm LESS_CYKUSZ_BUILD_DIR=$BUILD_DIR/cykusz-less NETCAT_CYKUSZ_BUILD_DIR=$BUILD_DIR/cykusz-netcat @@ -141,6 +143,18 @@ function _prepare_zlib { fi } +function _prepare_libressl { + if [ ! -d $LIBRESSL_SRC_DIR ]; then + mkdir -p $SRC_DIR + git clone --depth 1 -b cykusz https://github.com/rafalmiel/libressl-portable.git $LIBRESSL_SRC_DIR + + pushd . + cd $LIBRESSL_SRC_DIR + ./autogen.sh + popd + fi +} + function _prepare_python { if [ ! -d $PYTHON_SRC_DIR ]; then mkdir -p $SRC_DIR @@ -532,6 +546,7 @@ function _cykusz_zstd { popd } + function _cykusz_zlib { _prepare_zlib @@ -551,6 +566,25 @@ function _cykusz_zlib { popd } +function _cykusz_libressl { + _prepare_libressl + + mkdir -p $LIBRESSL_CYKUSZ_BUILD_DIR + + pushd . + + cd $LIBRESSL_CYKUSZ_BUILD_DIR + + export CYKUSZ_SYSROOT_DIR=$SYSROOT + export CYKUSZ_ROOT_DIR=$SPATH + cmake -DCMAKE_TOOLCHAIN_FILE=$SPATH/CMakeToolchain-x86_64-cykusz.txt -DBUILD_SHARED_LIBS=ON -DLIBRESSL_APPS=ON -DENABLE_NC=OFF -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release $LIBRESSL_SRC_DIR + + VERBOSE=1 make -j12 DESTDIR=$SYSROOT + make DESTDIR=$SYSROOT install + + popd +} + function _cykusz_python { _prepare_python @@ -562,7 +596,7 @@ function _cykusz_python { export CONFIG_SITE=$SPATH/python-config-site export PKG_CONFIG_SYSROOT_DIR=$SYSROOT export PKG_CONFIG_LIBDIR=$SYSROOT/usr/lib/pkgconfig:$SYSROOT/usr/share/pkgconfig - $PYTHON_SRC_DIR/configure --with-build-python=python --host=$TRIPLE --build=x86_64-linux-gnu --prefix=/usr --enable-shared --with-system-ffi --with-system-expat --disable-ipv6 --without-ensurepip --without-static-libpython + $PYTHON_SRC_DIR/configure --with-build-python=python3.11 --host=$TRIPLE --build=x86_64-linux-gnu --prefix=/usr --enable-shared --with-system-ffi --with-system-expat --disable-ipv6 --without-ensurepip --without-static-libpython make -j6 DESTDIR=$SYSROOT