Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/zziplib: fix static build failure with mpd
@ 2021-12-24 16:21 Andreas Ziegler
  2021-12-24 17:22 ` Thomas Petazzoni
  0 siblings, 1 reply; 14+ messages in thread
From: Andreas Ziegler @ 2021-12-24 16:21 UTC (permalink / raw)
  To: buildroot; +Cc: Romain Naour, Jörg Krause, Andreas Ziegler

The latest released version of zziplib copies static libraries with appended 
major version, but omits creating the necessary links to the base file names. 
This prevents the linker to find the libraries via the search path. 

There is a discussion upstream: https://github.com/gdraheim/zziplib/issues/117

Update zzip/CMakeLists.txt to the current master, version a32538e to enable 
creation of symlinks. 

This resolves the following autobuild issue:

http://autobuild.buildroot.net/results/ba711034c0abe980f677e26de41739223e2f66e9

Signed-off-by: Andreas Ziegler <br015@umbiko.net>
---
 ...01-update-zzip-cmakelists-to-a32538e.patch | 220 ++++++++++++++++++
 1 file changed, 220 insertions(+)
 create mode 100644 package/zziplib/0001-update-zzip-cmakelists-to-a32538e.patch

diff --git a/package/zziplib/0001-update-zzip-cmakelists-to-a32538e.patch b/package/zziplib/0001-update-zzip-cmakelists-to-a32538e.patch
new file mode 100644
index 0000000000..1ed9243f69
--- /dev/null
+++ b/package/zziplib/0001-update-zzip-cmakelists-to-a32538e.patch
@@ -0,0 +1,220 @@
+--- zziplib-0.13.72/zzip/CMakeLists.txt
++++ zziplib-a32538e/zzip/CMakeLists.txt
+@@ -14,12 +14,11 @@
+ 
+ # options ###########################################################
+ option(BUILD_SHARED_LIBS "Build a shared library" ON)
+-option(BUILD_STATIC_LIBS "Build the static library" OFF)
+ option(MSVC_STATIC_RUNTIME "Build with static runtime libs (/MT)" ON)
+ option(ZZIPMMAPPED "Build libzzipmmapped (not fully portable)" ON)
+ option(ZZIPFSEEKO "Build libzzipfseeko (based on posix.1 api)" ON)
+ 
+-if(UNIX)
++if(UNIX OR MINGW)
+ option(ZZIP_COMPAT "Build compatibility with old libzzip releases" ON)
+ option(ZZIP_LIBTOOL "Ensure binary compatibility with libtool" ON)
+ option(ZZIP_PKGCONFIG "Generate pkg-config files for linking" ON)
+@@ -27,6 +26,12 @@
+ option(ZZIP_COMPAT "Build compatibility with old libzzip releases" OFF)
+ option(ZZIP_LIBTOOL "Ensure binary compatibility with libtool" OFF)
+ option(ZZIP_PKGCONFIG "Generate pkg-config files for linking" OFF)
++endif()
++
++if(ZZIP_LIBTOOL OR ZZIP_PKGCONFIG)
++option(ZZIP_LIBLATEST "Ensure libname.lib links to libname-REL.lib" ON)
++else()
++option(ZZIP_LIBLATEST "Ensure libname.lib links to libname-REL.lib" OFF)
+ endif()
+ 
+ # used in zzip/_config.h
+@@ -114,7 +119,7 @@
+     )
+ endif()
+ 
+-set(CMAKE_POSITION_INDEPENDENT_CODE ON)
++set(CMAKE_POSITION_INDEPENDENT_CODE ${BUILD_SHARED_LIBS})
+ add_definitions ( -DHAVE_CONFIG_H )
+ 
+ set(RELNUM "${PROJECT_VERSION_MAJOR}")
+@@ -276,103 +281,103 @@
+     ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ endif()
+ 
+-if(ZZIP_COMPAT)
+-  install(FILES ${outdir}/compat/zzip.h ${outdir}/compat/zziplib.h ${outdir}/compat/zzip-io.h 
+-          DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
+-  if(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG)
++if(ZZIP_COMPAT OR ZZIP_LIBTOOL)
++  if(BUILD_SHARED_LIBS AND CMAKE_SHARED_LIBRARY_SONAME_C_FLAG)
+     set(lib ${CMAKE_SHARED_LIBRARY_PREFIX})
+     set(dll ${CMAKE_SHARED_LIBRARY_SUFFIX})
+-    set(libdir ${CMAKE_INSTALL_FULL_LIBDIR})
+     get_target_property(libname libzzip OUTPUT_NAME)
+     get_target_property(librelease libzzip RELEASE_POSTFIX)
+-    get_target_property(libversion libzzip VERSION)
+-    install(CODE "execute_process(COMMAND bash -c \"set -e
+-        cd $DESTDIR/${libdir}
+-        if [ -f ${lib}${libname}${librelease}.${libversion}${dll} ]; then
+-          # Fix for APPLE where dylib goes in the end
+-          ln -s ${lib}${libname}${librelease}.${libversion}${dll} ${lib}${libname}${librelease}${dll}.${libversion}
+-        fi
+-        [ -f ${lib}${libname}${librelease}${dll}.${libversion} ] || exit 0
+-        echo -n .. Installing: `pwd`
+-        ln -svf ${lib}${libname}${librelease}${dll}.${libversion} ${lib}${libname}${librelease}${dll}
+-        echo -n .. Installing: `pwd`
+-        ln -svf ${lib}${libname}${librelease}${dll}.${libversion} ${lib}${libname}${librelease}${dll}.10
+-        echo -n .. Installing: `pwd`
+-        ln -svf ${lib}${libname}${librelease}${dll}.${libversion} ${lib}${libname}${librelease}${dll}.11
+-        echo -n .. Installing: `pwd`
+-        ln -svf ${lib}${libname}${librelease}${dll}.${libversion} ${lib}${libname}${librelease}${dll}.12
+-        \")")
++    add_custom_target(libzzip_links ALL
++        COMMAND ${CMAKE_COMMAND} -E create_symlink $<TARGET_FILE_NAME:libzzip> ${lib}${libname}${librelease}${dll}.10
++        COMMAND ${CMAKE_COMMAND} -E create_symlink $<TARGET_FILE_NAME:libzzip> ${lib}${libname}${librelease}${dll}.11
++        COMMAND ${CMAKE_COMMAND} -E create_symlink $<TARGET_FILE_NAME:libzzip> ${lib}${libname}${librelease}${dll}.12
++        )
++    install(FILES
++      ${outdir}/${lib}${libname}${librelease}${dll}.10
++      ${outdir}/${lib}${libname}${librelease}${dll}.11
++      ${outdir}/${lib}${libname}${librelease}${dll}.12
++      DESTINATION ${CMAKE_INSTALL_LIBDIR})
+   endif()
+ endif()
+ 
++if(ZZIP_COMPAT)
++  install(FILES ${outdir}/compat/zzip.h ${outdir}/compat/zziplib.h ${outdir}/compat/zzip-io.h
++          DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
++endif()
++
+ if(ZZIP_LIBTOOL)
+-  if(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG)
++  if(BUILD_SHARED_LIBS AND CMAKE_SHARED_LIBRARY_SONAME_C_FLAG)
+     set(lib ${CMAKE_SHARED_LIBRARY_PREFIX})
+     set(dll ${CMAKE_SHARED_LIBRARY_SUFFIX})
+-    set(libdir ${CMAKE_INSTALL_FULL_LIBDIR})
+-    get_target_property(libname libzzip OUTPUT_NAME)
+-    get_target_property(librelease libzzip RELEASE_POSTFIX)
+-    get_target_property(libversion libzzip VERSION)
+-    install(CODE "execute_process(COMMAND bash -c \"set -e
+-        cd $DESTDIR/${libdir}
+-        if [ -f ${lib}${libname}${librelease}.${libversion}${dll} ]; then
+-          # Fix for APPLE where dylib goes in the end
+-          ln -s ${lib}${libname}${librelease}.${libversion}${dll} ${lib}${libname}${librelease}${dll}.${libversion}
+-        fi
+-        [ -f ${lib}${libname}${librelease}${dll}.${libversion} ] || exit 0
+-        echo -n .. Installing: `pwd`
+-        ln -svf ${lib}${libname}${librelease}${dll}.${libversion} ${lib}${libname}${dll}
+-        echo -n .. Installing: `pwd`
+-        ln -svf ${lib}${libname}${librelease}${dll}.${libversion} ${lib}${libname}${librelease}${dll}.10
+-        echo -n .. Installing: `pwd`
+-        ln -svf ${lib}${libname}${librelease}${dll}.${libversion} ${lib}${libname}${librelease}${dll}.11
+-        echo -n .. Installing: `pwd`
+-        ln -svf ${lib}${libname}${librelease}${dll}.${libversion} ${lib}${libname}${librelease}${dll}.12
+-        \")")
+     if(ZZIPFSEEKO)
+     get_target_property(libname libzzipfseeko OUTPUT_NAME)
+     get_target_property(librelease libzzipfseeko RELEASE_POSTFIX)
+-    get_target_property(libversion libzzipfseeko VERSION)
+-    install(CODE "execute_process(COMMAND bash -c \"set -e
+-        cd $DESTDIR/${libdir}
+-        if [ -f ${lib}${libname}${librelease}.${libversion}${dll} ]; then
+-          # Fix for APPLE where dylib goes in the end
+-          ln -s ${lib}${libname}${librelease}.${libversion}${dll} ${lib}${libname}${librelease}${dll}.${libversion}
+-        fi
+-        [ -f ${lib}${libname}${librelease}${dll}.${libversion} ] || exit 0
+-        echo -n .. Installing: `pwd`
+-        ln -svf ${lib}${libname}${librelease}${dll}.${libversion} ${lib}${libname}${dll}
+-        echo -n .. Installing: `pwd`
+-        ln -svf ${lib}${libname}${librelease}${dll}.${libversion} ${lib}${libname}${librelease}${dll}.10
+-        echo -n .. Installing: `pwd`
+-        ln -svf ${lib}${libname}${librelease}${dll}.${libversion} ${lib}${libname}${librelease}${dll}.11
+-        echo -n .. Installing: `pwd`
+-        ln -svf ${lib}${libname}${librelease}${dll}.${libversion} ${lib}${libname}${librelease}${dll}.12
+-        \")")
++    add_custom_target(libzzipfseeko_links ALL
++        COMMAND ${CMAKE_COMMAND} -E create_symlink $<TARGET_FILE_NAME:libzzipfseeko> ${lib}${libname}${librelease}${dll}.10
++        COMMAND ${CMAKE_COMMAND} -E create_symlink $<TARGET_FILE_NAME:libzzipfseeko> ${lib}${libname}${librelease}${dll}.11
++        COMMAND ${CMAKE_COMMAND} -E create_symlink $<TARGET_FILE_NAME:libzzipfseeko> ${lib}${libname}${librelease}${dll}.12
++        )
++    install(FILES
++        ${outdir}/${lib}${libname}${librelease}${dll}.10
++        ${outdir}/${lib}${libname}${librelease}${dll}.11
++        ${outdir}/${lib}${libname}${librelease}${dll}.12
++        DESTINATION ${CMAKE_INSTALL_LIBDIR})
+     endif(ZZIPFSEEKO)
+     if(ZZIPMMAPPED)
+     get_target_property(libname libzzipmmapped OUTPUT_NAME)
+     get_target_property(librelease libzzipmmapped RELEASE_POSTFIX)
+-    get_target_property(libversion libzzipmmapped VERSION)
+-    install(CODE "execute_process(COMMAND bash -c \"set -e
+-        cd $DESTDIR/${libdir}
+-        if [ -f ${lib}${libname}${librelease}.${libversion}${dll} ]; then
+-          # Fix for APPLE where dylib goes in the end
+-          ln -s ${lib}${libname}${librelease}.${libversion}${dll} ${lib}${libname}${librelease}${dll}.${libversion}
+-        fi
+-        [ -f ${lib}${libname}${librelease}${dll}.${libversion} ] || exit 0
+-        echo -n .. Installing: `pwd`
+-        ln -svf ${lib}${libname}${librelease}${dll}.${libversion} ${lib}${libname}${dll}
+-        echo -n .. Installing: `pwd`
+-        ln -svf ${lib}${libname}${librelease}${dll}.${libversion} ${lib}${libname}${librelease}${dll}.10
+-        echo -n .. Installing: `pwd`
+-        ln -svf ${lib}${libname}${librelease}${dll}.${libversion} ${lib}${libname}${librelease}${dll}.11
+-        echo -n .. Installing: `pwd`
+-        ln -svf ${lib}${libname}${librelease}${dll}.${libversion} ${lib}${libname}${librelease}${dll}.12
+-        \")")
++    add_custom_target(libzzipmmaped_links ALL
++        COMMAND ${CMAKE_COMMAND} -E create_symlink $<TARGET_FILE_NAME:libzzipmmapped> ${lib}${libname}${librelease}${dll}.10
++        COMMAND ${CMAKE_COMMAND} -E create_symlink $<TARGET_FILE_NAME:libzzipmmapped> ${lib}${libname}${librelease}${dll}.11
++        COMMAND ${CMAKE_COMMAND} -E create_symlink $<TARGET_FILE_NAME:libzzipmmapped> ${lib}${libname}${librelease}${dll}.12
++        )
++    install(FILES
++        ${outdir}/${lib}${libname}${librelease}${dll}.10
++        ${outdir}/${lib}${libname}${librelease}${dll}.11
++        ${outdir}/${lib}${libname}${librelease}${dll}.12
++        DESTINATION ${CMAKE_INSTALL_LIBDIR})
+     endif(ZZIPMMAPPED)
+   endif(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG)
+ endif(ZZIP_LIBTOOL)
++
++if(ZZIP_LIBLATEST)
++  if(BUILD_SHARED_LIBS)
++    set(lib ${CMAKE_SHARED_LIBRARY_PREFIX})
++    set(dll ${CMAKE_SHARED_LIBRARY_SUFFIX})
++  else()
++    set(lib ${CMAKE_STATIC_LIBRARY_PREFIX})
++    set(dll ${CMAKE_STATIC_LIBRARY_SUFFIX})
++  endif()
++    get_target_property(libname libzzip OUTPUT_NAME)
++    get_target_property(librelease libzzip RELEASE_POSTFIX)
++    add_custom_target(libzzip_latest ALL
++        COMMAND ${CMAKE_COMMAND} -E create_symlink $<TARGET_FILE_NAME:libzzip> ${lib}${libname}${dll}
++        )
++    install(FILES
++        ${outdir}/${lib}${libname}${dll}
++        DESTINATION ${CMAKE_INSTALL_LIBDIR})
++    if(ZZIPFSEEKO)
++    get_target_property(libname libzzipfseeko OUTPUT_NAME)
++    get_target_property(librelease libzzipfseeko RELEASE_POSTFIX)
++    add_custom_target(libzzipfseeko_latest ALL
++        COMMAND ${CMAKE_COMMAND} -E create_symlink $<TARGET_FILE_NAME:libzzipfseeko> ${lib}${libname}${dll}
++        )
++    install(FILES
++        ${outdir}/${lib}${libname}${dll}
++        DESTINATION ${CMAKE_INSTALL_LIBDIR})
++    endif(ZZIPFSEEKO)
++    if(ZZIPMMAPPED)
++    get_target_property(libname libzzipmmapped OUTPUT_NAME)
++    get_target_property(librelease libzzipmmapped RELEASE_POSTFIX)
++    add_custom_target(libzzipmmaped_latest ALL
++        COMMAND ${CMAKE_COMMAND} -E create_symlink $<TARGET_FILE_NAME:libzzipmmapped> ${lib}${libname}${dll}
++        )
++    install(FILES
++        ${outdir}/${lib}${libname}${dll}
++        DESTINATION ${CMAKE_INSTALL_LIBDIR})
++    endif(ZZIPMMAPPED)
++endif(ZZIP_LIBLATEST)
++
+ 
+ ## messages ##############################################
+ 
+
-- 
2.33.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2022-09-13 14:18 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-24 16:21 [Buildroot] [PATCH 1/1] package/zziplib: fix static build failure with mpd Andreas Ziegler
2021-12-24 17:22 ` Thomas Petazzoni
2021-12-27  7:40   ` [Buildroot] [PATCH v2 " Andreas Ziegler
2022-03-20 11:41     ` [Buildroot] [PATCH v3 " Andreas Ziegler
2022-03-27 15:57       ` Arnout Vandecappelle
2022-03-30 19:43       ` Peter Korsgaard
2022-07-25 20:49       ` Arnout Vandecappelle
2022-07-26  6:24         ` Andreas Ziegler
2022-07-28 14:36         ` Andreas Ziegler
2022-07-29  9:13         ` [Buildroot] [PATCH 1/1] package/zziplib: create symlinks only if target is missing Andreas Ziegler
2022-07-29  9:34           ` Andreas Ziegler
2022-07-29 16:37           ` [Buildroot] [PATCH v2 " Andreas Ziegler
2022-07-29 20:15             ` Arnout Vandecappelle
2022-09-13 14:18             ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox