Open mheily opened 2 years ago
There's a Debian patch to CMakelists.txt that does not apply cleanly to the new version. Perhaps we should incorporate this upstream, and drop the patch?
$ cat patches/cmake-debian-updates
Description: Update CMake config for debian package
A few updates to the CMakeLists.txt file to be more relevant for the
Debian package.
Author: Matthew Newton <matthew-git@newtoncomputing.co.uk>
Last-Update: 2019-01-15
Index: libkqueue-2.3.1/CMakeLists.txt
===================================================================
--- libkqueue-2.3.1.orig/CMakeLists.txt
+++ libkqueue-2.3.1/CMakeLists.txt
@@ -120,22 +120,28 @@ else()
endif()
add_library(kqueue ${LIBRARY_TYPE} ${LIBKQUEUE_SOURCES} ${LIBKQUEUE_HEADERS})
-set_target_properties(kqueue PROPERTIES DEBUG_POSTFIX "d")
+set_target_properties(kqueue PROPERTIES DEBUG_POSTFIX "d" SOVERSION 0)
+
+add_library(kqueue_static STATIC ${LIBKQUEUE_SOURCES} ${LIBKQUEUE_HEADERS})
+set_target_properties(kqueue_static PROPERTIES DEBUG_POSTFIX "d" OUTPUT_NAME kqueue)
if(WIN32)
target_compile_definitions(kqueue PRIVATE _USRDLL;_WINDLL)
target_compile_definitions(kqueue PRIVATE _CRT_SECURE_NO_WARNINGS)
else()
target_compile_definitions(kqueue PRIVATE _XOPEN_SOURCE=600)
+ target_compile_definitions(kqueue_static PRIVATE _XOPEN_SOURCE=600)
endif()
target_include_directories(kqueue PRIVATE include)
if(NOT WIN32)
target_include_directories(kqueue PRIVATE src/common)
+ target_include_directories(kqueue_static PRIVATE src/common include)
endif()
if(CMAKE_C_COMPILER_ID MATCHES GNU)
target_compile_options(kqueue PRIVATE -Wall -Werror)
+ target_compile_options(kqueue_static PRIVATE -Wall -Werror)
endif()
if(MINGW AND CMAKE_C_COMPILER_ID MATCHES GNU)
target_compile_options(kqueue PRIVATE -march=i486)
@@ -145,6 +151,7 @@ if(WIN32)
target_link_libraries(kqueue PRIVATE Ws2_32)
endif()
target_link_libraries(kqueue PRIVATE Threads::Threads)
+target_link_libraries(kqueue_static PRIVATE Threads::Threads)
if(ENABLE_TESTING)
add_subdirectory(test)
@@ -164,10 +171,10 @@ set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST
install(FILES
"include/sys/event.h"
DESTINATION
- "${CMAKE_INSTALL_FULL_INCLUDEDIR}/sys"
+ "${CMAKE_INSTALL_FULL_INCLUDEDIR}/kqueue/sys"
COMPONENT headers)
install(TARGETS
- kqueue
+ kqueue kqueue_static
DESTINATION
"${CMAKE_INSTALL_FULL_LIBDIR}"
COMPONENT libraries)
We now already set SOVERSION, so that's fine.
The second answer here describes a way of building shared or static or both without duplicating library properties.
If we can get away with just using cpack I think that'd be ideal instead of needing to maintain separate packaging infrastructure.
Debian doesn't support the use of CPack to build their official packages. I've updated my packaging scripts in this repository to handle the new version: https://github.com/mheily/debian-packages
I've uploaded the package to mentors.debian.net and need to find someone with permission to upload the package to the archive.
Has there been any update so far, or would it be possible to support this packaging effort?
The official Debian package is several years old now, and it would be good to push a new version downstream.
I plan to make a few other improvements to support this: