mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-26 17:41:09 +08:00
[dumb] New port (#30740)
* [dumb] New port. * [dumb] Add to baseline. * [dumb] Apply suggestion from review. - Remove unofficial config since a pkg-config file is provided. - Update the match string for pkg-config fixes. - Limit ONLY_STATIC_LIBRARY to Windows. * [dumb] Update version. * [dumb] Remove vcpkg-cmake-config dependency. This dependency is no longer needed since the unofficial config was removed. * [dumb] Update version.
This commit is contained in:
parent
f0ee0ca1cc
commit
bf4958bce6
16
ports/dumb/check-for-math-lib.patch
Normal file
16
ports/dumb/check-for-math-lib.patch
Normal file
@ -0,0 +1,16 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index a793bba..6fd094c 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -223,7 +223,10 @@ IF(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||
set_target_properties(dumb PROPERTIES INSTALL_NAME_DIR ${CMAKE_INSTALL_FULL_LIBDIR})
|
||||
ENDIF(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||
|
||||
+find_library(HAS_MATH_LIB NAMES "m")
|
||||
+if(HAS_MATH_LIB)
|
||||
target_link_libraries(dumb m)
|
||||
+endif()
|
||||
|
||||
install(FILES ${PKG_CONFIG_FILE} DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
||||
install(FILES ${INSTALL_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
||||
|
26
ports/dumb/do-not-overwrite-cflags.patch
Normal file
26
ports/dumb/do-not-overwrite-cflags.patch
Normal file
@ -0,0 +1,26 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index a793bba..585ef78 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -29,17 +29,17 @@ check_and_add_c_compiler_flag("-Wall" CMAKE_C_FLAGS)
|
||||
add_definitions("-D_FILE_OFFSET_BITS=64")
|
||||
add_definitions("-DDUMB_DECLARE_DEPRECATED")
|
||||
|
||||
-set(CMAKE_C_FLAGS_DEBUG "-DDEBUGMODE=1 -D_DEBUG")
|
||||
+set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DDEBUGMODE=1 -D_DEBUG")
|
||||
check_and_add_c_compiler_flag("-ggdb" CMAKE_C_FLAGS_DEBUG)
|
||||
check_and_add_c_compiler_flag("-Zi" CMAKE_C_FLAGS_DEBUG)
|
||||
|
||||
-set(CMAKE_C_FLAGS_RELEASE "-ffast-math -O2 -DNDEBUG")
|
||||
+set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -ffast-math -O2 -DNDEBUG")
|
||||
|
||||
-set(CMAKE_C_FLAGS_RELWITHDEBINFO "-ffast-math -O2 -DNDEBUG")
|
||||
+set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -ffast-math -O2 -DNDEBUG")
|
||||
check_and_add_c_compiler_flag("-g" CMAKE_C_FLAGS_RELWITHDEBINFO)
|
||||
check_and_add_c_compiler_flag("-Zi" CMAKE_C_FLAGS_RELWITHDEBINFO)
|
||||
|
||||
-set(CMAKE_C_FLAGS_MINSIZEREL "-ffast-math -Os -DNDEBUG")
|
||||
+set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} -ffast-math -Os -DNDEBUG")
|
||||
|
||||
if(USE_SSE)
|
||||
check_c_compiler_flag("-msse" "CC_HAS_MSSE")
|
44
ports/dumb/portfile.cmake
Normal file
44
ports/dumb/portfile.cmake
Normal file
@ -0,0 +1,44 @@
|
||||
if(VCPKG_TARGET_IS_WINDOWS)
|
||||
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
|
||||
endif()
|
||||
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO kode54/dumb
|
||||
REF "${VERSION}"
|
||||
SHA512 18b10a507d69a754cdf97fbeae41c17f211a6ba1f166a822276bdb6769d3edc326919067a3f4d1247d6715d7a5a8276669d83b9427e7336c6d111593fb7e36cf
|
||||
HEAD_REF master
|
||||
PATCHES
|
||||
"check-for-math-lib.patch"
|
||||
"do-not-overwrite-cflags.patch"
|
||||
)
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
OPTIONS
|
||||
-DBUILD_EXAMPLES=OFF
|
||||
-DBUILD_ALLEGRO4=OFF
|
||||
)
|
||||
|
||||
vcpkg_cmake_install()
|
||||
vcpkg_fixup_pkgconfig()
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/dumb.pc" "-llibdumb" "-ldumb")
|
||||
if(NOT VCPKG_BUILD_TYPE)
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/dumb.pc" "-llibdumb" "-ldumbd")
|
||||
endif()
|
||||
|
||||
if(VCPKG_TARGET_IS_WINDOWS)
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/dumb.pc" " -lm" "")
|
||||
if(NOT VCPKG_BUILD_TYPE)
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/dumb.pc" " -lm" "")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
file(REMOVE_RECURSE
|
||||
"${CURRENT_PACKAGES_DIR}/debug/include"
|
||||
"${CURRENT_PACKAGES_DIR}/debug/share"
|
||||
)
|
||||
|
||||
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
|
13
ports/dumb/vcpkg.json
Normal file
13
ports/dumb/vcpkg.json
Normal file
@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "dumb",
|
||||
"version": "2.0.3",
|
||||
"description": "Module/tracker based music format parser and player library",
|
||||
"homepage": "https://github.com/kode54/dumb",
|
||||
"license": null,
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
}
|
||||
]
|
||||
}
|
@ -2180,6 +2180,10 @@
|
||||
"baseline": "2.5.0",
|
||||
"port-version": 3
|
||||
},
|
||||
"dumb": {
|
||||
"baseline": "2.0.3",
|
||||
"port-version": 0
|
||||
},
|
||||
"dv-processing": {
|
||||
"baseline": "1.7.8",
|
||||
"port-version": 1
|
||||
|
9
versions/d-/dumb.json
Normal file
9
versions/d-/dumb.json
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "fb0e42347cd9ec43e40d2b123990e1705399dc02",
|
||||
"version": "2.0.3",
|
||||
"port-version": 0
|
||||
}
|
||||
]
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user