pkgsrc/archivers/zziplib/patches/patch-zzip_CMakeLists.txt
2021-01-17 09:36:45 +00:00

124 lines
7.2 KiB
Text

$NetBSD: patch-zzip_CMakeLists.txt,v 1.3 2021/01/17 09:36:45 otis Exp $
Use portable ln switches.
This is a backport of:
https://github.com/gdraheim/zziplib/commit/eaba986ff3e6b29539d693fdab7189682dc72351
--- zzip/CMakeLists.txt.orig 2021-01-04 23:05:08.000000000 +0000
+++ zzip/CMakeLists.txt
@@ -276,6 +276,22 @@ install(TARGETS libzzipmmapped
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
+if(ZZIP_COMPAT OR ZZIP_LIBTOOL)
+ if(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG)
+ execute_process(COMMAND bash -c "ln --help"
+ OUTPUT_VARIABLE ln_verbose_help
+ ERROR_QUIET
+ )
+ string(FIND "${ln_verbose_help}" "verbose" ln_verbose_found)
+ if(${ln_verbose_found} STREQUAL "-1")
+ set(ln_svf "ln -sf")
+ else()
+ set(ln_svf "ln -svf")
+ endif()
+ message(STATUS "Can symlink libraries with: ${ln_svf}")
+ endif()
+endif()
+
if(ZZIP_COMPAT)
install(FILES ${outdir}/compat/zzip.h ${outdir}/compat/zziplib.h ${outdir}/compat/zzip-io.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
@@ -290,17 +306,17 @@ if(ZZIP_COMPAT)
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}
+ ${ln_svf} ${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}
+ ${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
+ ${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
+ ${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
+ ${ln_svf} ${lib}${libname}${librelease}${dll}.${libversion} ${lib}${libname}${librelease}${dll}.12
\")")
endif()
endif()
@@ -317,17 +333,17 @@ if(ZZIP_LIBTOOL)
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}
+ ${ln_svf} ${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}
+ ${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
+ ${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
+ ${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
+ ${ln_svf} ${lib}${libname}${librelease}${dll}.${libversion} ${lib}${libname}${librelease}${dll}.12
\")")
if(ZZIPFSEEKO)
get_target_property(libname libzzipfseeko OUTPUT_NAME)
@@ -337,17 +353,17 @@ if(ZZIP_LIBTOOL)
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}
+ ${ln_svf} ${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}
+ ${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
+ ${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
+ ${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
+ ${ln_svf} ${lib}${libname}${librelease}${dll}.${libversion} ${lib}${libname}${librelease}${dll}.12
\")")
endif(ZZIPFSEEKO)
if(ZZIPMMAPPED)
@@ -358,17 +374,17 @@ if(ZZIP_LIBTOOL)
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}
+ ${ln_svf} ${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}
+ ${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
+ ${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
+ ${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
+ ${ln_svf} ${lib}${libname}${librelease}${dll}.${libversion} ${lib}${libname}${librelease}${dll}.12
\")")
endif(ZZIPMMAPPED)
endif(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG)