diff options
author | prspkt <prspkt@protonmail.com> | 2019-03-14 02:10:35 +0200 |
---|---|---|
committer | prspkt <prspkt@protonmail.com> | 2019-03-14 18:48:02 +0200 |
commit | fef1962ce8ae30f61a0258d8a01ca2a8addf53be (patch) | |
tree | 1a74e4ebe0a9146fb6a06176147e106f6a127e6d /community/libzip | |
parent | aa1fbae68b399ae7869a10e1aa4f767b059d52a9 (diff) | |
download | aports-fef1962ce8ae30f61a0258d8a01ca2a8addf53be.tar.bz2 aports-fef1962ce8ae30f61a0258d8a01ca2a8addf53be.tar.xz |
community/libzip: add cmake workaround
Build both static and dynamic libraries in one go
Diffstat (limited to 'community/libzip')
-rw-r--r-- | community/libzip/APKBUILD | 22 | ||||
-rw-r--r-- | community/libzip/build-static-and-dynamic.patch | 33 |
2 files changed, 38 insertions, 17 deletions
diff --git a/community/libzip/APKBUILD b/community/libzip/APKBUILD index 91f74cec11..0b6ba42626 100644 --- a/community/libzip/APKBUILD +++ b/community/libzip/APKBUILD @@ -11,7 +11,9 @@ license="BSD-3-Clause" depends_dev="zlib-dev" makedepends="$depends_dev cmake openssl-dev perl" subpackages="$pkgname-dev $pkgname-doc $pkgname-tools" -source="https://www.nih.at/libzip/$pkgname-$pkgver.tar.xz" +source="https://www.nih.at/libzip/$pkgname-$pkgver.tar.xz + build-static-and-dynamic.patch + " builddir="$srcdir/$pkgname-$pkgver" # secfixes: @@ -23,24 +25,10 @@ build() { cmake \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_INSTALL_LIBDIR=lib \ - -DBUILD_SHARED_LIBS=False \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_CXX_FLAGS="$CXXFLAGS" \ -DCMAKE_C_FLAGS="$CFLAGS" make - - mkdir -p "$pkgdir"/tmp - cp "$builddir"/lib/libzip.a "$pkgdir"/tmp - cmake \ - -DCMAKE_INSTALL_PREFIX=/usr \ - -DCMAKE_INSTALL_LIBDIR=lib \ - -DBUILD_SHARED_LIBS=True \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_CXX_FLAGS="$CXXFLAGS" \ - -DCMAKE_C_FLAGS="$CFLAGS" - make - mv "$pkgdir"/tmp/libzip.a "$builddir"/lib/libzip.a - rm -rf "$pkgdir"/tmp } check() { @@ -51,7 +39,6 @@ check() { package() { cd "$builddir" make DESTDIR="$pkgdir" -j1 install - cp "$builddir"/lib/libzip.a "$pkgdir"/usr/lib } tools() { @@ -60,4 +47,5 @@ tools() { mv "$pkgdir"/usr/bin "$subpkgdir"/usr } -sha512sums="1e6d48ddbac4d270f70b314f6ada3c93a3196a8cc3b8d17c6cf5ea8409ff29f36ac351206675f9d81351fcf633b0c15d7b0b5530c30c4140e4fe55e64c602643 libzip-1.5.2.tar.xz" +sha512sums="1e6d48ddbac4d270f70b314f6ada3c93a3196a8cc3b8d17c6cf5ea8409ff29f36ac351206675f9d81351fcf633b0c15d7b0b5530c30c4140e4fe55e64c602643 libzip-1.5.2.tar.xz +09b31e42e732b3d0e7705c90fa0b3afa5a2d2eaa8dfde4ab24d728158d805dc4e8c803f184b6eb69711f4975a220528578a4d78d88713b4ce405d3892be11fa9 build-static-and-dynamic.patch" diff --git a/community/libzip/build-static-and-dynamic.patch b/community/libzip/build-static-and-dynamic.patch new file mode 100644 index 0000000000..890725ee57 --- /dev/null +++ b/community/libzip/build-static-and-dynamic.patch @@ -0,0 +1,33 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -59,7 +59,7 @@ + SET(WINDOWS_CRYPTO_FOUND FALSE) + ENDIF() + +-OPTION(BUILD_SHARED_LIBS "Build shared libraries" ON) ++SET(BUILD_SHARED_LIBS ON) + + + OPTION(SHARED_LIB_VERSIONNING "Add SO version in .so build" ON) +--- a/lib/CMakeLists.txt ++++ b/lib/CMakeLists.txt +@@ -215,7 +215,9 @@ + ) + ENDIF() + +-ADD_LIBRARY(zip ${LIBZIP_SOURCES} ${LIBZIP_EXTRA_FILES} ${LIBZIP_OPTIONAL_FILES} ${LIBZIP_OPSYS_FILES}) ++ADD_LIBRARY(zip SHARED ${LIBZIP_SOURCES} ${LIBZIP_EXTRA_FILES} ${LIBZIP_OPTIONAL_FILES} ${LIBZIP_OPSYS_FILES}) ++ADD_LIBRARY(zip_static STATIC ${LIBZIP_SOURCES} ${LIBZIP_EXTRA_FILES} ${LIBZIP_OPTIONAL_FILES} ${LIBZIP_OPSYS_FILES}) ++SET_TARGET_PROPERTIES(zip_static PROPERTIES OUTPUT_NAME zip CLEAN_DIRECT_OUTPUT 1) + + IF(SHARED_LIB_VERSIONNING) + SET_TARGET_PROPERTIES(zip PROPERTIES VERSION 5.0 SOVERSION 5) +@@ -223,7 +225,7 @@ + + + TARGET_LINK_LIBRARIES(zip ${ZLIB_LIBRARY} ${OPTIONAL_LIBRARY}) +-INSTALL(TARGETS zip ++INSTALL(TARGETS zip zip_static + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) |