Skip to content

Commit

Permalink
Update libxmp vcpkg port to latest git version for MIT relicense
Browse files Browse the repository at this point in the history
  • Loading branch information
Nopey committed Nov 4, 2024
1 parent fcc6ea1 commit 3a8d217
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 0 deletions.
13 changes: 13 additions & 0 deletions vcpkg-ports/libxmp/fix-cmake-config-dir.patch
Original file line number Diff line number Diff line change
@@ -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")
set(cmake_install_cmakdir_lite "cmake")
else()
43 changes: 43 additions & 0 deletions vcpkg-ports/libxmp/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO libxmp/libxmp
REF 25050f2657be54eae7c37325cefb9644588cf09e
HEAD_REF master
SHA512 4101dc302b5c1e926c703a74e2d1c1ee820221511dec681e161abf63c369ad2e617a5a21531c8c4343bee8adc9da376d5512b3e60b3e73475d5c5a5666da1fd5
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")
4 changes: 4 additions & 0 deletions vcpkg-ports/libxmp/usage
Original file line number Diff line number Diff line change
@@ -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>)
31 changes: 31 additions & 0 deletions vcpkg-ports/libxmp/vcpkg.json
Original file line number Diff line number Diff line change
@@ -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": "MIT",
"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."
}
}
}

0 comments on commit 3a8d217

Please sign in to comment.