gdraheim / zziplib

The ZZIPlib provides read access on ZIP-archives and unpacked data. It features an additional simplified API following the standard Posix API for file access
Other
62 stars 50 forks source link

pkgconfig has -lzzip but non-dll builds need -lzzip-0 #117

Open gdraheim opened 3 years ago

gdraheim commented 3 years ago

The mingw guys have show that a static-lib build fails as it only has a zzip-0.a being around while pkgconfig referes to zzip.a

See pull request #116 for discussions.

This comes from having the symlink "ln -s libzzip-0.so libzzip.so" activated only for shared lib builds.

if(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG)
add_custom_target(libzzip_libtool_links ALL
    COMMAND ${CMAKE_COMMAND} -E create_symlink $<TARGET_FILE_NAME:libzzip> ${lib}${libname}${dll}
    )
install(FILES
    ${outdir}/${lib}${libname}${dll}
    DESTINATION ${CMAKE_INSTALL_LIBDIR})

So the whole RELNUM and non-rel-alias setup should be revisited.

Biswa96 commented 3 years ago

As I said before, it is not necessary to take mingw as a special case. I have already done a little temporary patching to remove the number in libraries, here https://github.com/msys2/MINGW-packages/pull/8746.

gdraheim commented 3 years ago

@Biswa96 - I am not sure if it would to have a general case to remove the libname-REL.lib feature as it may break compatibility with older versions of the lib. I would add it as a general option but as you have your own patch I'll leave as it is now.

Biswa96 commented 3 years ago

Agree. BTW, just for testing, I have tried to build the latest master branch and I got this error:

CMake Error at zzip/cmake_install.cmake:130 (file):
  file INSTALL cannot read symlink "F:/zziplib/bin/zzip/libzzip.dll" to
  duplicate at "F:/zziplib/bin/install/clang64/lib/libzzip.dll": File exists.
Call Stack (most recent call first):
  cmake_install.cmake:42 (include)

Just FYI, mingw does not follow .lib extension. It has .a for static lib, .dll.a for import library, .dll for dynamic lib. File list here https://packages.msys2.org/package/mingw-w64-x86_64-zziplib?repo=mingw64

Biswa96 commented 3 years ago

Another option would be to remain -lzzip-0 in pkgconfig files. Creating symbolic link in Microsoft Windows is a bit sketchy.

esselfe commented 5 months ago

Yeah the generated pkgconfig file (/usr/lib/pkgconfig/zzip*.pc) have the wrong libs in it. Like zziplib.pc should have -lzzip-0 in it, not -lzzip. (zziplib 0.13.74)