aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/plibsys
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/plibsys')
-rw-r--r--vcpkg/ports/plibsys/fix_configuration.patch155
-rw-r--r--vcpkg/ports/plibsys/portfile.cmake30
-rw-r--r--vcpkg/ports/plibsys/vcpkg.json17
3 files changed, 202 insertions, 0 deletions
diff --git a/vcpkg/ports/plibsys/fix_configuration.patch b/vcpkg/ports/plibsys/fix_configuration.patch
new file mode 100644
index 0000000..83f4b0f
--- /dev/null
+++ b/vcpkg/ports/plibsys/fix_configuration.patch
@@ -0,0 +1,155 @@
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index 12cad07..cda9f76 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -827,10 +827,10 @@ if (PLIBSYS_PLATFORM_DEFINES)
+ endif()
+
+ # Add targets
+-add_library (plibsys SHARED ${PLIBSYS_SRCS} ${PLIBSYS_PLATFORM_SRCS} ${PLIBSYS_PUBLIC_HDRS} ${PLIBSYS_PRIVATE_HDRS})
+-
+ if (PLIBSYS_BUILD_STATIC)
+ add_library (plibsysstatic STATIC ${PLIBSYS_SRCS} ${PLIBSYS_PLATFORM_SRCS} ${PLIBSYS_PUBLIC_HDRS} ${PLIBSYS_PRIVATE_HDRS})
++else()
++ add_library (plibsys SHARED ${PLIBSYS_SRCS} ${PLIBSYS_PLATFORM_SRCS} ${PLIBSYS_PUBLIC_HDRS} ${PLIBSYS_PRIVATE_HDRS})
+ endif()
+
+ # Prepare installation dirs
+@@ -838,6 +838,10 @@ if (NOT CMAKE_INSTALL_LIBDIR)
+ set (CMAKE_INSTALL_LIBDIR "lib")
+ endif()
+
++if (NOT CMAKE_INSTALL_BINDIR)
++ set (CMAKE_INSTALL_BINDIR "bin")
++endif()
++
+ if (NOT CMAKE_INSTALL_INCLUDEDIR)
+ set (CMAKE_INSTALL_INCLUDEDIR "include")
+ endif()
+@@ -846,16 +850,16 @@ set (PLIBSYS_INCL_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR}/plibsys)
+
+ # Add include directories
+ if (COMMAND target_include_directories)
+- target_include_directories (plibsys PUBLIC
+- "$<BUILD_INTERFACE:${PLIBSYS_INCLUDE_DIRS}>"
+- "$<INSTALL_INTERFACE:${PLIBSYS_INCL_INSTALL_DIR}>"
+- )
+-
+ if (PLIBSYS_BUILD_STATIC)
+ target_include_directories (plibsysstatic PUBLIC
+ "$<BUILD_INTERFACE:${PLIBSYS_INCLUDE_DIRS}>"
+ "$<INSTALL_INTERFACE:${PLIBSYS_INCL_INSTALL_DIR}>"
+ )
++ else()
++ target_include_directories (plibsys PUBLIC
++ "$<BUILD_INTERFACE:${PLIBSYS_INCLUDE_DIRS}>"
++ "$<INSTALL_INTERFACE:${PLIBSYS_INCL_INSTALL_DIR}>"
++ )
+ endif()
+ else()
+ include_directories (${PLIBSYS_INCLUDE_DIRS})
+@@ -863,15 +867,16 @@ endif()
+
+ # Add compile definitions
+ if (COMMAND target_compile_definitions)
+- target_compile_definitions (plibsys PRIVATE ${PLIBSYS_COMPILE_DEFS})
+-
+ if (PLIBSYS_BUILD_STATIC)
+ target_compile_definitions (plibsysstatic PRIVATE ${PLIBSYS_COMPILE_DEFS})
++ else()
++ target_compile_definitions (plibsys PRIVATE ${PLIBSYS_COMPILE_DEFS})
+ endif()
+ else()
+ add_definitions (${PLIBSYS_COMPILE_DEFS})
+ endif()
+
++if(NOT PLIBSYS_BUILD_STATIC)
+ set_target_properties (plibsys PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_DIR})
+ set_target_properties (plibsys PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_DIR})
+ set_target_properties (plibsys PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${OUTPUT_DIR})
+@@ -884,6 +889,7 @@ endif()
+ if (NOT PLIBSYS_TARGET_OS STREQUAL os2 AND NOT PLIBSYS_TARGET_OS STREQUAL amigaos)
+ set_target_properties (plibsys PROPERTIES SOVERSION ${PLIBSYS_SOVERSION})
+ endif()
++endif()
+
+ if (PLIBSYS_BUILD_STATIC)
+ set_target_properties (plibsysstatic PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${OUTPUT_DIR})
+@@ -898,10 +904,10 @@ if (PLIBSYS_PLATFORM_CFLAGS)
+ set (PLIBSYS_PLATFORM_CFLAGS_STR "${PLIBSYS_PLATFORM_CFLAGS_STR} ${PLATFORM_CFLAG}")
+ endforeach()
+
+- set_target_properties (plibsys PROPERTIES COMPILE_FLAGS "${PLIBSYS_PLATFORM_CFLAGS_STR}")
+-
+ if (PLIBSYS_BUILD_STATIC)
+ set_target_properties (plibsysstatic PROPERTIES COMPILE_FLAGS "${PLIBSYS_PLATFORM_CFLAGS_STR}")
++ else()
++ set_target_properties (plibsys PROPERTIES COMPILE_FLAGS "${PLIBSYS_PLATFORM_CFLAGS_STR}")
+ endif()
+ endif()
+
+@@ -910,29 +916,29 @@ if (PLIBSYS_PLATFORM_LDFLAGS)
+ set (PLIBSYS_PLATFORM_LDFLAGS_STR "${PLIBSYS_PLATFORM_LDFLAGS_STR} ${PLATFORM_LDFLAG}")
+ endforeach()
+
+- set_target_properties (plibsys PROPERTIES LINK_FLAGS "${PLIBSYS_PLATFORM_LDFLAGS_STR}")
+-
+ if (PLIBSYS_BUILD_STATIC)
+ set_target_properties (plibsysstatic PROPERTIES LINK_FLAGS "${PLIBSYS_PLATFORM_LDFLAGS_STR}")
++ else()
++ set_target_properties (plibsys PROPERTIES LINK_FLAGS "${PLIBSYS_PLATFORM_LDFLAGS_STR}")
+ endif()
+ endif()
+
+-target_link_libraries (plibsys ${PLIBSYS_PLATFORM_LINK_LIBRARIES})
+-
+ if (PLIBSYS_BUILD_STATIC)
+ target_link_libraries (plibsysstatic ${PLIBSYS_PLATFORM_LINK_LIBRARIES})
++else()
++ target_link_libraries (plibsys ${PLIBSYS_PLATFORM_LINK_LIBRARIES})
+ endif()
+
+ if (PLIBSYS_BUILD_STATIC)
+- set (PLIBSYS_INSTALL_TARGETS plibsys plibsysstatic)
++ set (PLIBSYS_INSTALL_TARGETS plibsysstatic)
+ else()
+ set (PLIBSYS_INSTALL_TARGETS plibsys)
+ endif()
+
+ if (PLIBSYS_NATIVE_WINDOWS)
+ install (TARGETS ${PLIBSYS_INSTALL_TARGETS}
+- DESTINATION lib
+- RUNTIME DESTINATION lib
++ LIBRARY DESTINATION lib
++ RUNTIME DESTINATION bin
+ COMPONENT Core
+ )
+
+@@ -942,11 +948,6 @@ if (PLIBSYS_NATIVE_WINDOWS)
+
+ set (CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP TRUE)
+ include (InstallRequiredSystemLibraries)
+-
+- install (PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS}
+- DESTINATION lib
+- COMPONENT Core
+- )
+ endif()
+
+ set (PLIBSYS_EXPORT_NAME plibsys-targets)
+@@ -974,13 +975,9 @@ endif()
+
+ install (TARGETS ${PLIBSYS_INSTALL_TARGETS}
+ EXPORT ${PLIBSYS_EXPORT_NAME}
+- DESTINATION ${CMAKE_INSTALL_LIBDIR}
+- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+- COMPONENT Core
+-)
+-install (TARGETS ${PLIBSYS_INSTALL_TARGETS}
+- DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+ COMPONENT Core
+ )
+ install (FILES
diff --git a/vcpkg/ports/plibsys/portfile.cmake b/vcpkg/ports/plibsys/portfile.cmake
new file mode 100644
index 0000000..278025c
--- /dev/null
+++ b/vcpkg/ports/plibsys/portfile.cmake
@@ -0,0 +1,30 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO saprykin/plibsys
+ REF "${VERSION}"
+ SHA512 ccc4dd0e54d69121542f4ddec319ec9fd2069866a93135acb87fe564c7bd067a218038dfaa4ddda4debcd897975c016165cbe3d41af6c2149d2b49fbe52f8fbb
+ HEAD_REF master
+ PATCHES
+ fix_configuration.patch
+)
+
+string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" PLIBSYS_STATIC)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ -DPLIBSYS_TESTS=OFF
+ -DPLIBSYS_COVERAGE=OFF
+ -DPLIBSYS_BUILD_DOC=OFF
+ -DPLIBSYS_BUILD_STATIC=${PLIBSYS_STATIC}
+ -DPLIBSYS_WRITE_PACKAGE=TRUE
+)
+
+vcpkg_cmake_install()
+
+vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/plibsys)
+
+vcpkg_copy_pdbs()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")
diff --git a/vcpkg/ports/plibsys/vcpkg.json b/vcpkg/ports/plibsys/vcpkg.json
new file mode 100644
index 0000000..8836293
--- /dev/null
+++ b/vcpkg/ports/plibsys/vcpkg.json
@@ -0,0 +1,17 @@
+{
+ "name": "plibsys",
+ "version": "0.0.5",
+ "description": "Highly portable C system library: threads and synchronization, sockets, IPC, data structures and more.",
+ "homepage": "https://github.com/saprykin/plibsys",
+ "supports": "!uwp",
+ "dependencies": [
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ]
+}