mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-27 18:31:15 +08:00
Fix libmodplug to build on Linux (#5397)
* Update libmodplug to build on linux * [libmodplug] Patch instead of changing downloading source * [libmodplug] Keep original source instead of using fork
This commit is contained in:
parent
7859944528
commit
590f3a78b2
@ -1,7 +1,7 @@
|
||||
diff --git a/libmodplug/modplug.h b/libmodplug/modplug.h
|
||||
diff --git a/src/modplug.h b/src/modplug.h
|
||||
index 3ffbf9d..fd19ae5 100644
|
||||
--- a/libmodplug/modplug.h
|
||||
+++ b/libmodplug/modplug.h
|
||||
--- a/src/modplug.h
|
||||
+++ b/src/modplug.h
|
||||
@@ -11,6 +11,8 @@
|
||||
extern "C" {
|
||||
#endif
|
35
ports/libmodplug/002-detect_sinf.patch
Normal file
35
ports/libmodplug/002-detect_sinf.patch
Normal file
@ -0,0 +1,35 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 2ada51b..468f1a3 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -4,6 +4,7 @@ project(libmodplug)
|
||||
add_definitions(-DMODPLUG_BUILD)
|
||||
|
||||
include (CheckFunctionExists)
|
||||
+include (CheckIncludeFile)
|
||||
|
||||
include_directories(AFTER
|
||||
src
|
||||
@@ -11,6 +12,10 @@ include_directories(AFTER
|
||||
${PROJECT_BINARY_DIR}
|
||||
)
|
||||
|
||||
+if (UNIX)
|
||||
+ set (CMAKE_REQUIRED_LIBRARIES m)
|
||||
+endif()
|
||||
+
|
||||
if (WIN32)
|
||||
add_definitions(-D_USE_MATH_DEFINES)
|
||||
add_definitions(-DNOMINMAX)
|
||||
@@ -44,6 +49,11 @@ if (WIN32 AND NOT (MINGW OR MSYS))
|
||||
"Compilation may fail if inttypes.h is not natively supported by the compiler."
|
||||
"You can get inttypes.h from http://code.google.com/p/msinttypes/")
|
||||
endif()
|
||||
+else()
|
||||
+ check_include_file("stdint.h" HAVE_STDINT)
|
||||
+ if (HAVE_STDINT)
|
||||
+ add_definitions(-DHAVE_STDINT_H)
|
||||
+ endif()
|
||||
endif()
|
||||
|
||||
check_function_exists("setenv" HAVE_SETENV)
|
@ -1,3 +1,3 @@
|
||||
Source: libmodplug
|
||||
Version: 0.8.9.0-1
|
||||
Version: 0.8.9.0-4
|
||||
Description: The ModPlug mod file playing library.
|
||||
|
@ -1,14 +1,30 @@
|
||||
|
||||
set(MODPLUG_HASH 5a39f5913d07ba3e61d8d5afdba00b70165da81d)
|
||||
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-${MODPLUG_HASH}.zip"
|
||||
SHA512 71b1314c44c98694c66ac17b638e997b99abc1ad61f7ac2e971000bdd4276d50d538259f4ee4dd39a3f672d28d3d322a32c83a9be0b1ffe5099ecc81273b5b55)
|
||||
|
||||
vcpkg_extract_source_archive(${ARCHIVE})
|
||||
include(vcpkg_common_functions)
|
||||
|
||||
if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
||||
vcpkg_from_github(ARCHIVE
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO Konstanty/libmodplug
|
||||
REF ${MODPLUG_HASH}
|
||||
SHA512 c43bb3190b62c3a4e3636bba121b5593bbf8e6577ca9f2aa04d90b03730ea7fb590e640cdadeb565758b92e81187bc456e693fe37f1f4deace9b9f37556e3ba1
|
||||
PATCHES
|
||||
"001-automagically-define-modplug-static.patch"
|
||||
"002-detect_sinf.patch"
|
||||
)
|
||||
else()
|
||||
vcpkg_from_github(ARCHIVE
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO JackBister/libmodplug
|
||||
REF ${MODPLUG_HASH}
|
||||
SHA512 c43bb3190b62c3a4e3636bba121b5593bbf8e6577ca9f2aa04d90b03730ea7fb590e640cdadeb565758b92e81187bc456e693fe37f1f4deace9b9f37556e3ba1
|
||||
PATCHES
|
||||
"002-detect_sinf.patch"
|
||||
)
|
||||
endif()
|
||||
|
||||
vcpkg_configure_cmake(SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
||||
@ -19,11 +35,6 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
|
||||
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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user