This is an automated email from the ASF dual-hosted git repository.

baodi pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pulsar-client-cpp.git


The following commit(s) were added to refs/heads/main by this push:
     new 12471ec  Fix APK package installation workflow (#515)
12471ec is described below

commit 12471ec55099a51d0bcb9f551f83bb17a8358069
Author: Yunze Xu <[email protected]>
AuthorDate: Mon Oct 27 15:00:19 2025 +0800

    Fix APK package installation workflow (#515)
    
    * Fix wrong install directory for APK packages
    
    * Fix DESTDIR
    
    * Build libpulsarwithdeps.a
---
 pkg/apk/APKBUILD     | 7 +++++--
 pkg/apk/build-apk.sh | 9 +++++++++
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/pkg/apk/APKBUILD b/pkg/apk/APKBUILD
index 1b476c2..85bb1ba 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
@@ -53,8 +53,11 @@ build() {
     fi
     set -e
     cmake --build build -j8
+    $ROOT_DIR/build-support/merge_archives_vcpkg.sh $PWD/build
 }
 
 package() {
-    cmake --build build --target install
+    set -x -e
+    DESTDIR="$pkgdir" cmake --build build --target install
+    cp ./build/libpulsarwithdeps.a "$pkgdir/usr/lib/"
 }
diff --git a/pkg/apk/build-apk.sh b/pkg/apk/build-apk.sh
index 5436048..68fdf89 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

Reply via email to