From 32fd6889b9e37e641a0ca077a52987d768ec664a Mon Sep 17 00:00:00 2001 From: apio Date: Tue, 8 Aug 2023 20:28:11 +0200 Subject: [PATCH] ports: Add pkg-config wrapper --- tools/env.sh | 2 +- tools/exec/luna-pkg-config | 10 ++++++++++ tools/make-package.sh | 2 ++ 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 tools/exec/luna-pkg-config diff --git a/tools/env.sh b/tools/env.sh index 5b6de5f7..7eec281e 100755 --- a/tools/env.sh +++ b/tools/env.sh @@ -5,7 +5,7 @@ export LUNA_BASE=${LUNA_BASE:-$LUNA_ROOT/base} [ -f "$LUNA_ROOT/env-local.sh" ] && source $LUNA_ROOT/env-local.sh export LUNA_ARCH=${LUNA_ARCH:-x86_64} -export PATH=$LUNA_ROOT/toolchain/$LUNA_ARCH-luna/bin:$LUNA_ROOT/toolchain/dist:$PATH +export PATH=$LUNA_ROOT/toolchain/$LUNA_ARCH-luna/bin:$LUNA_ROOT/toolchain/dist:$LUNA_ROOT/tools/exec/:$PATH if [ "$USE_MAKE" = "1" ] then diff --git a/tools/exec/luna-pkg-config b/tools/exec/luna-pkg-config new file mode 100644 index 00000000..8b552e07 --- /dev/null +++ b/tools/exec/luna-pkg-config @@ -0,0 +1,10 @@ +#!/bin/sh +# Fill these in appropriately: +export PKG_CONFIG_SYSROOT_DIR=$LUNA_BASE +export PKG_CONFIG_LIBDIR=$LUNA_BASE/usr/lib/pkgconfig +# TODO: If it works this should probably just be set to the empty string. +export PKG_CONFIG_PATH=$PKG_CONFIG_LIBDIR +# Use --static here if your OS only has static linking. +# TODO: Perhaps it's a bug in the libraries if their pkg-config files doesn't +# record that only static libraries were built. +exec pkg-config --static "$@" diff --git a/tools/make-package.sh b/tools/make-package.sh index 20a9f051..9aa3d072 100755 --- a/tools/make-package.sh +++ b/tools/make-package.sh @@ -70,8 +70,10 @@ esac export CC=x86_64-luna-gcc export CXX=x86_64-luna-g++ +export PKG_CONFIG=luna-pkg-config export CC_FOR_BUILD=gcc export CXX_FOR_BUILD=g++ +export PKG_CONFIG_FOR_BUILD=pkg-config mkdir -p $builddir cd $builddir