From 101640f4cba41ab645143bd68a4c1459b53d43e8 Mon Sep 17 00:00:00 2001 From: Yunze Xu Date: Mon, 20 Oct 2025 19:12:58 +0800 Subject: [PATCH 1/3] Fix wrong install directory for APK packages --- pkg/apk/APKBUILD | 2 +- pkg/apk/build-apk.sh | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/pkg/apk/APKBUILD b/pkg/apk/APKBUILD index 1b476c2d..18949f17 100644 --- a/pkg/apk/APKBUILD +++ b/pkg/apk/APKBUILD @@ -44,7 +44,7 @@ build() { set +e cmake -B build -DINTEGRATE_VCPKG=ON -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_MAKE_PROGRAM=make \ - -DCMAKE_INSTALL_PREFIX="$pkgdir" \ + -DCMAKE_INSTALL_PREFIX="/usr" \ -DBUILD_TESTS=OFF -DBUILD_DYNAMIC_LIB=ON -DBUILD_STATIC_LIB=ON \ $ROOT_DIR if [[ $? -ne 0 ]]; then diff --git a/pkg/apk/build-apk.sh b/pkg/apk/build-apk.sh index 54360481..68fdf893 100755 --- a/pkg/apk/build-apk.sh +++ b/pkg/apk/build-apk.sh @@ -40,3 +40,12 @@ sudo abuild-keygen -a -i -n abuild -F -c -r cp -r /root/packages/pkg ./build + +# Test installation +apk add --allow-untrusted build/$PLATFORM/*.apk + +cd $ROOT_DIR/win-examples +g++ -o dynamic.out -std=c++11 ./example.cc -Wl,-rpath=/usr/lib -lpulsar +./dynamic.out +g++ -o static.out -std=c++11 ./example.cc /usr/lib/libpulsarwithdeps.a -lpthread -ldl +./static.out From 6be66556d0a21553182bab600eecf6e7e62cb006 Mon Sep 17 00:00:00 2001 From: Yunze Xu Date: Fri, 24 Oct 2025 18:57:41 +0800 Subject: [PATCH 2/3] Fix DESTDIR --- pkg/apk/APKBUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/apk/APKBUILD b/pkg/apk/APKBUILD index 18949f17..d6c33306 100644 --- a/pkg/apk/APKBUILD +++ b/pkg/apk/APKBUILD @@ -56,5 +56,5 @@ build() { } package() { - cmake --build build --target install + DESTDIR="$pkgdir" cmake --build build --target install } From af5371e1f5ff6a57471ed6f21f842065c662cd9c Mon Sep 17 00:00:00 2001 From: Yunze Xu Date: Sun, 26 Oct 2025 20:21:31 +0800 Subject: [PATCH 3/3] Build libpulsarwithdeps.a --- pkg/apk/APKBUILD | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/apk/APKBUILD b/pkg/apk/APKBUILD index d6c33306..85bb1bae 100644 --- a/pkg/apk/APKBUILD +++ b/pkg/apk/APKBUILD @@ -53,8 +53,11 @@ build() { fi set -e cmake --build build -j8 + $ROOT_DIR/build-support/merge_archives_vcpkg.sh $PWD/build } package() { + set -x -e DESTDIR="$pkgdir" cmake --build build --target install + cp ./build/libpulsarwithdeps.a "$pkgdir/usr/lib/" }