aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/libversion
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/libversion
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/libversion')
-rw-r--r--vcpkg/ports/libversion/disable-test.patch14
-rw-r--r--vcpkg/ports/libversion/portfile.cmake22
-rw-r--r--vcpkg/ports/libversion/separate-build-type.patch18
-rw-r--r--vcpkg/ports/libversion/vcpkg.json20
4 files changed, 74 insertions, 0 deletions
diff --git a/vcpkg/ports/libversion/disable-test.patch b/vcpkg/ports/libversion/disable-test.patch
new file mode 100644
index 0000000..b192f26
--- /dev/null
+++ b/vcpkg/ports/libversion/disable-test.patch
@@ -0,0 +1,14 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 5309a30..f5fafa6 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -4,9 +4,6 @@ cmake_minimum_required(VERSION 3.22.1 FATAL_ERROR)
+ project(libversion VERSION 3.0.4)
+
+ include(GNUInstallDirs)
+-enable_testing()
+
+ # subdirs
+ add_subdirectory(libversion)
+-add_subdirectory(tests)
+-add_subdirectory(utils)
diff --git a/vcpkg/ports/libversion/portfile.cmake b/vcpkg/ports/libversion/portfile.cmake
new file mode 100644
index 0000000..e512f8c
--- /dev/null
+++ b/vcpkg/ports/libversion/portfile.cmake
@@ -0,0 +1,22 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO repology/libversion
+ REF ${VERSION}
+ SHA512 5be723103f33d764ad9c426fb915144d7ab0ca0de9c2650099060a543d01184c68d0849325d964b4815372ae9d71c9dbcb114049828ccd87d6dd6ad186d91fee
+ HEAD_REF master
+ PATCHES
+ disable-test.patch
+ separate-build-type.patch
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+)
+
+vcpkg_cmake_install()
+vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/libversion)
+vcpkg_fixup_pkgconfig()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")
diff --git a/vcpkg/ports/libversion/separate-build-type.patch b/vcpkg/ports/libversion/separate-build-type.patch
new file mode 100644
index 0000000..c72fa32
--- /dev/null
+++ b/vcpkg/ports/libversion/separate-build-type.patch
@@ -0,0 +1,18 @@
+diff --git a/libversion/CMakeLists.txt b/libversion/CMakeLists.txt
+index 52a6ba7..71760dc 100644
+--- a/libversion/CMakeLists.txt
++++ b/libversion/CMakeLists.txt
+@@ -89,8 +89,11 @@ install(FILES
+ ${CMAKE_CURRENT_BINARY_DIR}/export.h
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libversion
+ )
+-install(TARGETS libversion libversion_static EXPORT libversion)
+-
++if(BUILD_SHARED_LIBS)
++install(TARGETS libversion EXPORT libversion)
++else()
++install(TARGETS libversion_static EXPORT libversion)
++endif()
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libversion.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
+
+ install(EXPORT libversion NAMESPACE libversion:: DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libversion FILE libversionConfig.cmake)
diff --git a/vcpkg/ports/libversion/vcpkg.json b/vcpkg/ports/libversion/vcpkg.json
new file mode 100644
index 0000000..aa4a81e
--- /dev/null
+++ b/vcpkg/ports/libversion/vcpkg.json
@@ -0,0 +1,20 @@
+{
+ "$comment": "The supports clause avoids trying to produce version.lib which conflicts with the Windows SDK and causes other ports to fail due to missing VerQueryValue et al.",
+ "name": "libversion",
+ "version": "3.0.4",
+ "port-version": 1,
+ "description": "Advanced version string comparison library",
+ "homepage": "https://github.com/repology/libversion",
+ "license": "MIT",
+ "supports": "!(windows & static)",
+ "dependencies": [
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ]
+}