From 5ec46732c7052201fd64945ce88249bd5c9f8857 Mon Sep 17 00:00:00 2001 From: gdesmar <75089569+gdesmar@users.noreply.github.com> Date: Fri, 26 Jul 2024 15:38:17 +0000 Subject: [PATCH] Statically compile and strip the executable --- .github/workflows/build.yml | 8 +++++++- src/stream/slice.cpp | 5 ++++- src/util/encoding.cpp | 1 + 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 10db61ea..2d1ff811 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,6 +7,9 @@ on: jobs: build: runs-on: ubuntu-latest + # Forced to run on debian:buster since debian:bullseye's Boost is not + # functional to compile executables statically WITH bz2 and lzma. + container: debian:buster steps: - name: Checkout repository uses: actions/checkout@v4 @@ -14,12 +17,15 @@ jobs: run: | sudo apt-get update sudo apt-get install -y build-essential cmake libboost-all-dev liblzma-dev + # Only because we are running on debian:buster + sudo apt-get install -y zlib1g-dev libbz2-dev - name: Build innoextract run: | mkdir -p build cd build - cmake .. + cmake -DUSE_STATIC_LIBS=ON .. make + strip innoextract - name: Archive artifacts uses: actions/upload-artifact@v4 with: diff --git a/src/stream/slice.cpp b/src/stream/slice.cpp index 9a76f30d..0e3f402e 100644 --- a/src/stream/slice.cpp +++ b/src/stream/slice.cpp @@ -27,7 +27,10 @@ #include #include #include -#include +// Debian Buster has Boost Filesystem 1.67.0.1 installed by default +// directory.hpp was split from the main in 1.72 +// https://www.boost.org/users/history/version_1_72_0.html +// #include #include "util/console.hpp" #include "util/load.hpp" diff --git a/src/util/encoding.cpp b/src/util/encoding.cpp index 3cb88be8..39fc7b56 100644 --- a/src/util/encoding.cpp +++ b/src/util/encoding.cpp @@ -72,6 +72,7 @@ #include "util/log.hpp" #include "util/math.hpp" +#include namespace util {