Skip to content

Commit

Permalink
Build latest desktop-file-utils statically with meson
Browse files Browse the repository at this point in the history
  • Loading branch information
TheAssassin committed Dec 8, 2024
1 parent 8918da8 commit c2fe382
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
4 changes: 2 additions & 2 deletions ci/build-in-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ apk add bash git gcc g++ cmake make file wget \
gpgme-dev libgcrypt-dev libgcrypt-static argp-standalone zstd-dev zstd-static util-linux-static \
glib-static libassuan-static zlib-static libgpg-error-static \
curl-dev curl-static nghttp2-static libidn2-static openssl-libs-static brotli-static c-ares-static libunistring-static \
glib-static glib-dev autoconf automake
glib-static glib-dev autoconf automake meson
# libcurl's pkg-config scripts are broken. everywhere, everytime.
# these additional flags have been collected from all the .pc files whose libs are mentioned as -l<lib> in Libs.private
Expand All @@ -75,7 +75,7 @@ echo "Requires.private: libcares libnghttp2 libidn2 libssl openssl libcrypto lib
# in a Docker container, we can safely disable this check
git config --global --add safe.directory '*'
bash -euxo pipefail /source/ci/install-static-desktop-file-validate.sh 0.27
bash -euxo pipefail /source/ci/install-static-desktop-file-validate.sh 0.28
bash -euxo pipefail /source/ci/install-static-mksquashfs.sh 4.6.1
bash -euxo pipefail /source/ci/install-static-zsyncmake.sh 0.6.2
Expand Down
18 changes: 5 additions & 13 deletions ci/install-static-desktop-file-validate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,15 @@ pushd "$build_dir"
wget -c "https://gitlab.freedesktop.org/xdg/desktop-file-utils/-/archive/"$version"/desktop-file-utils-"$version".tar.gz"
tar xf desktop-file-utils-*.tar.gz
cd desktop-file-utils-*/
# The next 2 lines are a workaround for: checking build system type... ./config.guess: unable to guess system type
wget 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD' -O config.guess
wget 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD' -O config.sub
autoreconf --install # https://github.com/shendurelab/LACHESIS/issues/31#issuecomment-283963819
./configure CFLAGS=-no-pie LDFLAGS=-static

# setting LDFLAGS as suggested in https://mesonbuild.com/Creating-Linux-binaries.html#building-and-installing
env LDFLAGS=-static meson setup build --prefer-static --default-library=static

if [[ "${GITHUB_ACTIONS:-}" != "" ]]; then
jobs="$(nproc)"
else
jobs="$(nproc --ignore=1)"
fi

make -j"$jobs"

# TODO: Find more elegant way to do this
cd src/
gcc -static -o desktop-file-validate keyfileutils.o validate.o validator.o mimeutils.o -lglib-2.0 -lintl
strip desktop-file-validate
cp desktop-file-validate /usr/bin/
cd ..
ninja -C build -j "$jobs" -v
ninja -C build -j 1 -v install

0 comments on commit c2fe382

Please sign in to comment.