aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/libxmp
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/libxmp
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/libxmp')
-rw-r--r--vcpkg/ports/libxmp/fix-cmake-config-dir.patch13
-rw-r--r--vcpkg/ports/libxmp/portfile.cmake42
-rw-r--r--vcpkg/ports/libxmp/usage4
-rw-r--r--vcpkg/ports/libxmp/vcpkg.json31
4 files changed, 90 insertions, 0 deletions
diff --git a/vcpkg/ports/libxmp/fix-cmake-config-dir.patch b/vcpkg/ports/libxmp/fix-cmake-config-dir.patch
new file mode 100644
index 0000000..95c35d9
--- /dev/null
+++ b/vcpkg/ports/libxmp/fix-cmake-config-dir.patch
@@ -0,0 +1,13 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 1794cb2c1534d53d502785e0446d302e5439216a..c960405632c0d1b4797470424fce4ff8a7ec1aef 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -170,7 +170,7 @@ add_subdirectory(docs)
+
+ include(CMakePackageConfigHelpers)
+
+-if(WIN32)
++if(0)
+ set(cmake_install_cmakdir "cmake")
+ else()
+ set(cmake_install_cmakdir "${CMAKE_INSTALL_LIBDIR}/cmake/libxmp")
diff --git a/vcpkg/ports/libxmp/portfile.cmake b/vcpkg/ports/libxmp/portfile.cmake
new file mode 100644
index 0000000..47fcb18
--- /dev/null
+++ b/vcpkg/ports/libxmp/portfile.cmake
@@ -0,0 +1,42 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO libxmp/libxmp
+ REF libxmp-${VERSION}
+ SHA512 5f7690e274f3857bd6889cd2ba637473f4a85359a6ef87c76313f87d0c725e3880ba6e428b542dbbf0c8a7725a87b5019289b3f19d2c5bb49527b380f1b4f7e4
+ PATCHES
+ fix-cmake-config-dir.patch
+)
+
+string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC)
+string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" BUILD_SHARED)
+
+vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+ INVERTED_FEATURES
+ depackers LIBXMP_DISABLE_DEPACKERS
+ prowizard LIBXMP_DISABLE_PROWIZARD
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ ${FEATURE_OPTIONS}
+ -DBUILD_STATIC=${BUILD_STATIC}
+ -DBUILD_SHARED=${BUILD_SHARED}
+ -DLIBXMP_DOCS=OFF
+)
+
+vcpkg_cmake_install()
+vcpkg_copy_pdbs()
+
+vcpkg_cmake_config_fixup(
+ PACKAGE_NAME "libxmp"
+ CONFIG_PATH "lib/cmake/libxmp"
+)
+
+vcpkg_fixup_pkgconfig()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+
+file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/docs/COPYING.LIB")
diff --git a/vcpkg/ports/libxmp/usage b/vcpkg/ports/libxmp/usage
new file mode 100644
index 0000000..6dcd832
--- /dev/null
+++ b/vcpkg/ports/libxmp/usage
@@ -0,0 +1,4 @@
+libxmp provides CMake targets:
+
+ find_package(libxmp CONFIG REQUIRED)
+ target_link_libraries(main PRIVATE $<IF:$<TARGET_EXISTS:libxmp::xmp_shared>,libxmp::xmp_shared,libxmp::xmp_static>)
diff --git a/vcpkg/ports/libxmp/vcpkg.json b/vcpkg/ports/libxmp/vcpkg.json
new file mode 100644
index 0000000..551016e
--- /dev/null
+++ b/vcpkg/ports/libxmp/vcpkg.json
@@ -0,0 +1,31 @@
+{
+ "name": "libxmp",
+ "version": "4.6.0",
+ "port-version": 1,
+ "description": "Libxmp is a library that renders module files to PCM data.",
+ "homepage": "https://sourceforge.net/projects/xmp/",
+ "license": "LGPL-2.1-or-later",
+ "supports": "!xbox",
+ "dependencies": [
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ],
+ "default-features": [
+ "depackers",
+ "prowizard"
+ ],
+ "features": {
+ "depackers": {
+ "description": "Enable archive depackers."
+ },
+ "prowizard": {
+ "description": "Enable ProWizard format loaders."
+ }
+ }
+}