|
| 1 | +name: Cmake and Autotools |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + paths: |
| 6 | + - CMakeLists.txt |
| 7 | + - configure.ac |
| 8 | + |
| 9 | +jobs: |
| 10 | + Cmake: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + permissions: |
| 13 | + contents: read |
| 14 | + env: |
| 15 | + HOST_TRIPLE: x86_64-linux-gnu |
| 16 | + steps: |
| 17 | + - name: Checkout repository |
| 18 | + uses: actions/checkout@v4 |
| 19 | + - name: Install Dependencies |
| 20 | + run: | |
| 21 | + sudo apt update |
| 22 | + sudo apt install -y autoconf automake autopoint binutils bison build-essential cmake doxygen gettext gperf libc6-dev libtool ninja-build pkg-config po4a qemu-user-static tar texinfo texlive valgrind xz-utils |
| 23 | +
|
| 24 | + - name: libcap and libseccomp |
| 25 | + run: | |
| 26 | + # libcap |
| 27 | + wget https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/libcap-2.77.tar.gz |
| 28 | + tar -xzf libcap-2.77.tar.gz -C . |
| 29 | +
|
| 30 | + make -C libcap-2.77/libcap BUILD_CC=gcc \ |
| 31 | + CC="${HOST_TRIPLE}-gcc" \ |
| 32 | + SHARED=no GOLANG=no PAM_CAP=no DYNAMIC=no lib=lib \ |
| 33 | + COPTS="-O2 -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security" \ |
| 34 | + prefix=$(pwd)/out \ |
| 35 | + install |
| 36 | +
|
| 37 | + # libseccomp |
| 38 | + wget https://github.com/seccomp/libseccomp/releases/download/v2.6.0/libseccomp-2.6.0.tar.gz |
| 39 | + tar -xzf libseccomp-2.6.0.tar.gz -C . |
| 40 | + cd libseccomp-2.6.0 |
| 41 | +
|
| 42 | + if [ ! -f configure ]; then |
| 43 | + autoreconf -fi |
| 44 | + fi |
| 45 | + ./configure --disable-shared --enable-static \ |
| 46 | + --prefix=$(pwd)/../out \ |
| 47 | + ${HOST_TRIPLE:+--host=${HOST_TRIPLE}} |
| 48 | +
|
| 49 | + make && make install |
| 50 | +
|
| 51 | + - name: ruri (Cmake) |
| 52 | + shell: bash |
| 53 | + run: | |
| 54 | + cmake -S . -B x86_64 \ |
| 55 | + -DCMAKE_C_COMPILER="${HOST_TRIPLE}-gcc" \ |
| 56 | + -DENABLE_STATIC=ON \ |
| 57 | + -DCMAKE_FIND_ROOT_PATH=$(pwd)/out |
| 58 | +
|
| 59 | + cmake --build x86_64 --parallel |
| 60 | + ./x86_64/ruri -v |
| 61 | +
|
| 62 | + - name: ruri (Autotools) |
| 63 | + shell: bash |
| 64 | + run: | |
| 65 | + autoreconf -fi |
| 66 | + ./configure --enable-static ${HOST_TRIPLE:+--host=${HOST_TRIPLE}} \ |
| 67 | + CPPFLAGS="-I$(pwd)/out/include" \ |
| 68 | + LDFLAGS="-L$(pwd)/out/lib" |
| 69 | +
|
| 70 | + make -j$(nproc) |
| 71 | + ./ruri -v && make distclean |
| 72 | +
|
| 73 | + - name: ruri (Autotools Android Core) |
| 74 | + shell: bash |
| 75 | + run: | |
| 76 | + sudo apt install -y qemu-user-static |
| 77 | +
|
| 78 | + ./configure --enable-static --enable-coreonly --host=aarch64-linux-android \ |
| 79 | + CC=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang \ |
| 80 | + AR=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar \ |
| 81 | + RANLIB=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ranlib |
| 82 | + make && qemu-aarch64-static ./ruri -v |
0 commit comments