aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Karatarakis <alex@karatarakis.com>2016-12-19 15:34:28 -0800
committerGitHub <noreply@github.com>2016-12-19 15:34:28 -0800
commita1be45adc3ca994df94f35483a190aac8722e088 (patch)
tree540de2fb9abe8ad46d9027262a1b419e5578793f
parentf30e93753fa539d128ce1c62cf6f9f8d48aa158b (diff)
parent92124c9b5ef9baae6d57e57880e32489cba8068d (diff)
downloadvcpkg-a1be45adc3ca994df94f35483a190aac8722e088.tar.gz
vcpkg-a1be45adc3ca994df94f35483a190aac8722e088.zip
Merge pull request #425 from codicodi/add-modplug
[libmodplug] initial commit
-rw-r--r--ports/libmodplug/CONTROL3
-rw-r--r--ports/libmodplug/automagically-define-modplug-static.patch13
-rw-r--r--ports/libmodplug/portfile.cmake30
3 files changed, 46 insertions, 0 deletions
diff --git a/ports/libmodplug/CONTROL b/ports/libmodplug/CONTROL
new file mode 100644
index 000000000..8aca622a4
--- /dev/null
+++ b/ports/libmodplug/CONTROL
@@ -0,0 +1,3 @@
+Source: libmodplug
+Version: 0.8.8.5-bb25b05
+Description: The ModPlug mod file playing library.
diff --git a/ports/libmodplug/automagically-define-modplug-static.patch b/ports/libmodplug/automagically-define-modplug-static.patch
new file mode 100644
index 000000000..b7982b2d3
--- /dev/null
+++ b/ports/libmodplug/automagically-define-modplug-static.patch
@@ -0,0 +1,13 @@
+diff --git a/libmodplug/modplug.h b/libmodplug/modplug.h
+index 3ffbf9d..fd19ae5 100644
+--- a/libmodplug/modplug.h
++++ b/libmodplug/modplug.h
+@@ -11,6 +11,8 @@
+ extern "C" {
+ #endif
+
++#define MODPLUG_STATIC
++
+ #if defined(_WIN32) || defined(__CYGWIN__)
+ # if defined(MODPLUG_BUILD) && defined(DLL_EXPORT) /* building libmodplug as a dll for windows */
+ # define MODPLUG_EXPORT __declspec(dllexport)
diff --git a/ports/libmodplug/portfile.cmake b/ports/libmodplug/portfile.cmake
new file mode 100644
index 000000000..6d2070975
--- /dev/null
+++ b/ports/libmodplug/portfile.cmake
@@ -0,0 +1,30 @@
+
+set(MODPLUG_HASH bb25b059a963f62aa0a3fe4c580da7da47f2b9c0)
+include(vcpkg_common_functions)
+set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libmodplug-${MODPLUG_HASH})
+vcpkg_download_distfile(ARCHIVE
+ URLS "https://github.com/Konstanty/libmodplug/archive/${MODPLUG_HASH}.zip"
+ FILENAME "libmodplug-0.8.8.5-${MODPLUG_HASH}.zip"
+ SHA512 65840b7748284b400dfe99775e18f44dcc4846bc0ff522d18b9ded42c7032e10683e453110d530722d9e22547b7e5f4878ebfff92f232691cbd5b0638c48d88b)
+
+vcpkg_extract_source_archive(${ARCHIVE})
+vcpkg_configure_cmake(SOURCE_PATH ${SOURCE_PATH})
+vcpkg_install_cmake()
+
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
+
+if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
+ file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin)
+ file(RENAME ${CURRENT_PACKAGES_DIR}/lib/modplug.dll ${CURRENT_PACKAGES_DIR}/bin/modplug.dll)
+ file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin)
+ file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/modplug.dll ${CURRENT_PACKAGES_DIR}/debug/bin/modplug.dll)
+ vcpkg_copy_pdbs()
+else()
+ vcpkg_apply_patches(
+ SOURCE_PATH ${CURRENT_PACKAGES_DIR}/include
+ PATCHES
+ ${CMAKE_CURRENT_LIST_DIR}/automagically-define-modplug-static.patch)
+endif()
+
+file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libmodplug)
+file(RENAME ${CURRENT_PACKAGES_DIR}/share/libmodplug/COPYING ${CURRENT_PACKAGES_DIR}/share/libmodplug/copyright)