From 8dec8210e0257c74c9b269c827ad964b2a933203 Mon Sep 17 00:00:00 2001 From: Aaron <10217842+byteduck@users.noreply.github.com> Date: Wed, 3 Apr 2024 23:56:34 -0700 Subject: [PATCH] Ports: Allow custom prebuild steps, properly set PKG_CONFIG_* environment vars --- ports/ports.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ports/ports.sh b/ports/ports.sh index 179f55c9..ae66db62 100755 --- a/ports/ports.sh +++ b/ports/ports.sh @@ -21,11 +21,14 @@ export CXXFILT="i686-pc-duckos-c++filt" export READELF="i686-pc-duckos-readelf" export STRIP="$i686-pc-duckos-strip" export OBJCOPY="i686-pc-duckos-objcopy" +export PKG_CONFIG_DIR="" +export PKG_CONFIG_SYSROOT_DIR="$ROOT_DIR" +export PKG_CONFIG_LIBDIR="$ROOT_DIR/usr/local/lib/pkgconfig" download_extract_patch() { if [ ! -d "$DOWNLOAD_FILE" ]; then msg "Downloading $DOWNLOAD_URL" - curl "$DOWNLOAD_URL" > "$DOWNLOAD_FILE.tar.gz" || return 1 + curl -L "$DOWNLOAD_URL" > "$DOWNLOAD_FILE.tar.gz" || return 1 msg "Extracting $DOWNLOAD_FILE.tar.gz..." tar -xf "$DOWNLOAD_FILE.tar.gz" || return 1 rm "$DOWNLOAD_FILE.tar.gz" @@ -97,6 +100,10 @@ build_port() { elif [ -n "$GIT_URL" ]; then git_clone_patch fi + if [[ $(type -t prebuild) == function ]]; then + msg "Executing prebuild steps for $DUCKOS_PORT_NAME..." + prebuild + fi if [ "$USE_CONFIGURE" = "true" ]; then msg "Configuring port $DUCKOS_PORT_NAME..." if [ -z "$CONFIGURE_PATH" ]; then