[libgig] New Port (#33255)

This commit is contained in:
Rossmaxx 2023-10-10 03:33:09 +05:30 committed by GitHub
parent cc97b4536a
commit 9c2fc5d351
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 137 additions and 0 deletions

View File

@ -0,0 +1,16 @@
diff --git a/src/Serialization.h b/src/Serialization.h
index cccfc54..91a8fa4 100644
--- a/src/Serialization.h
+++ b/src/Serialization.h
@@ -40,6 +40,11 @@
#include <assert.h>
#include <functional>
+#ifdef _MSC_VER
+#include <BaseTsd.h>
+using ssize_t = SSIZE_T;
+#endif
+
#ifndef __has_extension
# define __has_extension(x) 0
#endif

View File

@ -0,0 +1,18 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ae66913..893e3ea 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,9 +1,9 @@
-cmake_minimum_required(VERSION 3.0)
+cmake_minimum_required(VERSION 3.1)
project(libgig)
-if(NOT MSVC)
- message(FATAL_ERROR "Please use configure and make, this cmake file is currently only to generate msvc solution files")
-endif()
+#To force the compiler to use C++ 11
+set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
#configuration options

View File

@ -0,0 +1,19 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 893e3ea..2eef641 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -128,12 +128,11 @@ install(TARGETS libgig EXPORT libgig-config
ARCHIVE DESTINATION lib
RUNTIME DESTINATION bin
PUBLIC_HEADER DESTINATION include/libgig)
-install(EXPORT libgig-config NAMESPACE libgig:: DESTINATION share/libgig)
-install(TARGETS libakai EXPORT libakai-config
+install(TARGETS libakai EXPORT libgig-config
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
RUNTIME DESTINATION bin
PUBLIC_HEADER DESTINATION include/libgig)
-install(EXPORT libakai-config NAMESPACE libgig:: DESTINATION share/libgig)
+install(EXPORT libgig-config NAMESPACE libgig:: DESTINATION share/libgig)

View File

@ -0,0 +1,40 @@
vcpkg_download_distfile(ARCHIVE
URLS "https://download.linuxsampler.org/packages/libgig-4.3.0.tar.bz2"
FILENAME "libgig-4.3.0.tar.bz2"
SHA512 683c09b1d17acf69020c631452b7dfb25ac54c3701db5e97471d4e7973e9a06267667bf19bfe4eb00d2964223e8446f248d93b4cf29c062dec2588758b4dfba2
)
vcpkg_extract_source_archive(
SOURCE_PATH
ARCHIVE "${ARCHIVE}"
PATCHES
0001-msvc-fix-ssize_t.patch
0002-cmake-fixes.patch
0003-fix-usage.patch
)
string(COMPARE EQUAL ${VCPKG_LIBRARY_LINKAGE} dynamic LIBGIG_BUILD_SHARED)
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
extra-tools LIBGIG_BUILD_TOOLS
tests LIBGIG_ENABLE_TESTING
)
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
${FEATURE_OPTIONS}
-DLIBGIG_BUILD_SHARED=${LIBGIG_BUILD_SHARED}
)
vcpkg_cmake_install()
if("tools" IN_LIST FEATURES)
vcpkg_copy_tools(TOOL_NAMES dlsdump gigdump gigmerge korg2gig korgdump rifftree sf2dump
SEARCH_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bin")
endif()
vcpkg_cmake_config_fixup()
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")

31
ports/libgig/vcpkg.json Normal file
View File

@ -0,0 +1,31 @@
{
"name": "libgig",
"version": "4.3.0",
"description": "C++ library for loading Gigasampler files and DLS Level 1/2 files",
"homepage": "https://www.linuxsampler.org/libgig/",
"supports": "windows & !uwp",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
],
"features": {
"tests": {
"description": "Build test cases",
"dependencies": [
"cppunit"
]
},
"tools": {
"description": "Build extra tools",
"dependencies": [
"libsndfile"
]
}
}
}

View File

@ -4196,6 +4196,10 @@
"baseline": "1.7.1", "baseline": "1.7.1",
"port-version": 3 "port-version": 3
}, },
"libgig": {
"baseline": "4.3.0",
"port-version": 0
},
"libgit2": { "libgit2": {
"baseline": "1.6.4", "baseline": "1.6.4",
"port-version": 1 "port-version": 1

9
versions/l-/libgig.json Normal file
View File

@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "328bc5b2b64bc33badee7d282589b14d49aadb55",
"version": "4.3.0",
"port-version": 0
}
]
}