Skip to content

Commit

Permalink
Merge pull request #169 from Ghabry/vcpkg-update
Browse files Browse the repository at this point in the history
Vcpkg library update
  • Loading branch information
Ghabry authored Apr 11, 2024
2 parents 6df5d99 + 0108dd9 commit 37972f2
Show file tree
Hide file tree
Showing 17 changed files with 324 additions and 147 deletions.
8 changes: 4 additions & 4 deletions windows/build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ call helper\prepare.cmd
:: Using [core] everywhere to prevent surprises when new default-features are
:: added to libraries.
vcpkg install --triplet x86-windows-static --recurse^
libpng[core] expat[core] pixman[core] freetype[core,zlib] harfbuzz[core]^
libpng[core] expat[core] pixman[core] freetype[core,zlib] harfbuzz[freetype]^
libvorbis[core] libsndfile[core] wildmidi[core] libxmp[core]^
speexdsp[core] mpg123[core] opusfile[core] fluidsynth-easyrpg[core]^
inih[cpp] lhasa[core]^
inih[cpp] lhasa-easyrpg[core]^
sdl2-image[core] icu-easyrpg[core] nlohmann-json[core] fmt[core]

:: Build 64-bit libraries
vcpkg install --triplet x64-windows-static --recurse^
libpng[core] expat[core] pixman[core] freetype[core,zlib] harfbuzz[core]^
libpng[core] expat[core] pixman[core] freetype[core,zlib] harfbuzz[freetype]^
libvorbis[core] libsndfile[core] wildmidi[core] libxmp[core]^
speexdsp[core] mpg123[core] opusfile[core] fluidsynth-easyrpg[core]^
inih[cpp] lhasa[core]^
inih[cpp] lhasa-easyrpg[core]^
sdl2-image[core] icu-easyrpg[core] nlohmann-json[core] fmt[core]
11 changes: 5 additions & 6 deletions windows/fluidsynth-easyrpg/fluidsynth-no-deps.patch
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
From 9682aa045f1ae8265919770bf2a63a8337764eca Mon Sep 17 00:00:00 2001
From d11f0149429f8fc5a2f9ad79c7d9040bf72af5cc Mon Sep 17 00:00:00 2001
From: Ghabry
Date: Fri, 17 Mar 2023 14:02:43 +0100
Subject: [PATCH 2/2] Disable most features
Subject: [PATCH] Disable most features

---
CMakeLists.txt | 54 +++++++++++++++++++++++++-------------------------
1 file changed, 27 insertions(+), 27 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index dd3a0c8..7dda03e 100644
index 433197fe..df81f4c7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -76,44 +76,44 @@ option ( enable-trap-on-fpe "enable SIGFPE trap on Floating Point Exceptions" of
Expand Down Expand Up @@ -62,9 +62,8 @@ index dd3a0c8..7dda03e 100644

# Platform specific options
if ( CMAKE_SYSTEM MATCHES "Linux|FreeBSD|DragonFly" )
- option ( enable-lash "compile LASH support (if it is available)" on )
option ( enable-lash "compile LASH support (if it is available)" off )
- option ( enable-alsa "compile ALSA support (if it is available)" on )
+ option ( enable-lash "compile LASH support (if it is available)" off )
+ option ( enable-alsa "compile ALSA support (if it is available)" off )
endif ( CMAKE_SYSTEM MATCHES "Linux|FreeBSD|DragonFly" )

Expand All @@ -84,5 +83,5 @@ index dd3a0c8..7dda03e 100644

if ( CMAKE_SYSTEM MATCHES "OS2" )
--
2.40.0
2.44.0

13 changes: 11 additions & 2 deletions windows/fluidsynth-easyrpg/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
if("pulseaudio" IN_LIST FEATURES)
message(
"${PORT} with pulseaudio feature currently requires the following from the system package manager:
libpulse-dev pulseaudio
These can be installed on Ubuntu systems via sudo apt install libpulse-dev pulseaudio"
)
endif()

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO FluidSynth/fluidsynth
REF "v${VERSION}"
SHA512 21798b5a80a7edd8ef02b983d9b230af45cc66b98b32d593228e12dbec15b12c6cf6c0f3692c12af66de1ba2049fa9d6ad2b68c7d1579347eec14d24870b0025
SHA512 35eaea8c1709ebbd5dee8f3946ab59c39afe31d92b972a44013fa23987aa48936f7d1326d5bda81c6e66f02bf988e48601367d49276a4dd78dbca7a2571f5e57
HEAD_REF master
PATCHES
gentables.patch
Expand All @@ -15,6 +23,7 @@ vcpkg_check_features(
FEATURES
buildtools VCPKG_BUILD_MAKE_TABLES
sndfile enable-libsndfile
pulseaudio enable-pulseaudio
)

# enable platform-specific features, force the build to fail if the required libraries are not found,
Expand All @@ -25,7 +34,7 @@ set(LINUX_OPTIONS enable-alsa ALSA_FOUND)
set(ANDROID_OPTIONS enable-opensles OpenSLES_FOUND)
set(IGNORED_OPTIONS enable-coverage enable-dbus enable-floats enable-fpe-check enable-framework enable-jack enable-lash
enable-libinstpatch enable-midishare enable-oboe enable-openmp enable-oss enable-pipewire enable-portaudio
enable-profiling enable-pulseaudio enable-readline enable-sdl2 enable-systemd enable-trap-on-fpe enable-ubsan)
enable-profiling enable-readline enable-sdl2 enable-systemd enable-trap-on-fpe enable-ubsan)

if(VCPKG_TARGET_IS_WINDOWS)
set(OPTIONS_TO_ENABLE ${WINDOWS_OPTIONS})
Expand Down
8 changes: 6 additions & 2 deletions windows/fluidsynth-easyrpg/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "fluidsynth-easyrpg",
"version": "2.3.2",
"port-version": 1,
"version": "2.3.5",
"description": "FluidSynth reads and handles MIDI events from the MIDI input device. It is the software analogue of a MIDI synthesizer. FluidSynth can also play midifiles using a Soundfont.",
"homepage": "https://github.com/FluidSynth/fluidsynth",
"license": "LGPL-2.1-or-later",
"supports": "!xbox",
"dependencies": [
{
"name": "alsa",
Expand All @@ -31,6 +31,10 @@
"buildtools": {
"description": "Build tools gentables"
},
"pulseaudio": {
"description": "Build with PulseAudio support",
"supports": "linux"
},
"sndfile": {
"description": "Enable rendering to file and SF3 support",
"dependencies": [
Expand Down
5 changes: 5 additions & 0 deletions windows/helper/prepare.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,13 @@ IF EXIST vcpkg (
:: Build vcpkg
call bootstrap-vcpkg.bat

:: Optimize the debug libraries
copy ..\helper\windows.cmake scripts\toolchains\windows.cmake

:: Copy custom portfiles
:: ICU static data file
xcopy /Y /I /E ..\icu-easyrpg ports\icu-easyrpg
:: fluidsynth without glib dependency
xcopy /Y /I /E ..\fluidsynth-easyrpg ports\fluidsynth-easyrpg
:: lhasa (delete when upstream port accepted)
xcopy /Y /I /E ..\lhasa-easyrpg ports\lhasa-easyrpg
86 changes: 86 additions & 0 deletions windows/helper/windows.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
if(NOT _VCPKG_WINDOWS_TOOLCHAIN)
set(_VCPKG_WINDOWS_TOOLCHAIN 1)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>$<$<STREQUAL:${VCPKG_CRT_LINKAGE},dynamic>:DLL>" CACHE STRING "")
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "")

set(CMAKE_SYSTEM_NAME Windows CACHE STRING "")

if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
set(CMAKE_SYSTEM_PROCESSOR x86 CACHE STRING "")
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
set(CMAKE_SYSTEM_PROCESSOR AMD64 CACHE STRING "")
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm")
set(CMAKE_SYSTEM_PROCESSOR ARM CACHE STRING "")
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
set(CMAKE_SYSTEM_PROCESSOR ARM64 CACHE STRING "")
endif()

if(DEFINED VCPKG_CMAKE_SYSTEM_VERSION)
set(CMAKE_SYSTEM_VERSION "${VCPKG_CMAKE_SYSTEM_VERSION}" CACHE STRING "" FORCE)
endif()

if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
if(CMAKE_SYSTEM_PROCESSOR STREQUAL CMAKE_HOST_SYSTEM_PROCESSOR)
set(CMAKE_CROSSCOMPILING OFF CACHE STRING "")
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86")
# any of the four platforms can run x86 binaries
set(CMAKE_CROSSCOMPILING OFF CACHE STRING "")
elseif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "ARM64")
# arm64 can run binaries of any of the four platforms after Windows 11
set(CMAKE_CROSSCOMPILING OFF CACHE STRING "")
endif()

if(NOT DEFINED CMAKE_SYSTEM_VERSION)
set(CMAKE_SYSTEM_VERSION "${CMAKE_HOST_SYSTEM_VERSION}" CACHE STRING "")
endif()
endif()

get_property( _CMAKE_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE )
if(NOT _CMAKE_IN_TRY_COMPILE)

if(VCPKG_CRT_LINKAGE STREQUAL "dynamic")
set(VCPKG_CRT_LINK_FLAG_PREFIX "/MD")
elseif(VCPKG_CRT_LINKAGE STREQUAL "static")
set(VCPKG_CRT_LINK_FLAG_PREFIX "/MT")
else()
message(FATAL_ERROR "Invalid setting for VCPKG_CRT_LINKAGE: \"${VCPKG_CRT_LINKAGE}\". It must be \"static\" or \"dynamic\"")
endif()

set(CHARSET_FLAG "/utf-8")
if (NOT VCPKG_SET_CHARSET_FLAG OR VCPKG_PLATFORM_TOOLSET MATCHES "v120")
# VS 2013 does not support /utf-8
set(CHARSET_FLAG)
endif()

set(MP_BUILD_FLAG "")
if(NOT (CMAKE_CXX_COMPILER MATCHES "clang-cl.exe"))
set(MP_BUILD_FLAG "/MP")
endif()

set(CMAKE_CXX_FLAGS " /nologo /DWIN32 /D_WINDOWS /W3 ${CHARSET_FLAG} /GR /EHsc ${MP_BUILD_FLAG} ${VCPKG_CXX_FLAGS}" CACHE STRING "")
set(CMAKE_C_FLAGS " /nologo /DWIN32 /D_WINDOWS /W3 ${CHARSET_FLAG} ${MP_BUILD_FLAG} ${VCPKG_C_FLAGS}" CACHE STRING "")

if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64ec")
string(APPEND CMAKE_CXX_FLAGS " /arm64EC /D_AMD64_ /DAMD64 /D_ARM64EC_ /DARM64EC")
string(APPEND CMAKE_C_FLAGS " /arm64EC /D_AMD64_ /DAMD64 /D_ARM64EC_ /DARM64EC")
endif()
set(CMAKE_RC_FLAGS "-c65001 /DWIN32" CACHE STRING "")

unset(CHARSET_FLAG)

set(CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG ${VCPKG_CRT_LINK_FLAG_PREFIX}d /Z7 /O2 ${VCPKG_CXX_FLAGS_DEBUG}" CACHE STRING "")
set(CMAKE_C_FLAGS_DEBUG "/D_DEBUG ${VCPKG_CRT_LINK_FLAG_PREFIX}d /Z7 /O2 ${VCPKG_C_FLAGS_DEBUG}" CACHE STRING "")
set(CMAKE_CXX_FLAGS_RELEASE "${VCPKG_CRT_LINK_FLAG_PREFIX} /O2 /Oi /Gy /DNDEBUG /Z7 ${VCPKG_CXX_FLAGS_RELEASE}" CACHE STRING "")
set(CMAKE_C_FLAGS_RELEASE "${VCPKG_CRT_LINK_FLAG_PREFIX} /O2 /Oi /Gy /DNDEBUG /Z7 ${VCPKG_C_FLAGS_RELEASE}" CACHE STRING "")

string(APPEND CMAKE_STATIC_LINKER_FLAGS_RELEASE_INIT " /nologo ")
set(CMAKE_MODULE_LINKER_FLAGS_RELEASE "/nologo /DEBUG /INCREMENTAL:NO /OPT:REF /OPT:ICF ${VCPKG_LINKER_FLAGS} ${VCPKG_LINKER_FLAGS_RELEASE}" CACHE STRING "")
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "/nologo /DEBUG /INCREMENTAL:NO /OPT:REF /OPT:ICF ${VCPKG_LINKER_FLAGS} ${VCPKG_LINKER_FLAGS_RELEASE}" CACHE STRING "")
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/nologo /DEBUG /INCREMENTAL:NO /OPT:REF /OPT:ICF ${VCPKG_LINKER_FLAGS} ${VCPKG_LINKER_FLAGS_RELEASE}" CACHE STRING "")

string(APPEND CMAKE_STATIC_LINKER_FLAGS_DEBUG_INIT " /nologo ")
string(APPEND CMAKE_MODULE_LINKER_FLAGS_DEBUG_INIT " /nologo ${VCPKG_LINKER_FLAGS} ${VCPKG_LINKER_FLAGS_DEBUG} ")
string(APPEND CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT " /nologo ${VCPKG_LINKER_FLAGS} ${VCPKG_LINKER_FLAGS_DEBUG} ")
string(APPEND CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT " /nologo ${VCPKG_LINKER_FLAGS} ${VCPKG_LINKER_FLAGS_DEBUG} ")
endif()
endif()
14 changes: 0 additions & 14 deletions windows/icu-easyrpg/check-autoconf-archive.patch

This file was deleted.

14 changes: 14 additions & 0 deletions windows/icu-easyrpg/darwin-rpath.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/source/config/mh-darwin b/source/config/mh-darwin
index 7b15709..e2cdbdb 100644
--- a/source/config/mh-darwin
+++ b/source/config/mh-darwin
@@ -31,7 +31,8 @@ SHLIB.cc= $(CXX) -dynamiclib -dynamic $(CXXFLAGS) $(LDFLAGS) $(LD_SOOPTIONS)

## Compiler switches to embed a library name and version information
ifeq ($(ENABLE_RPATH),YES)
-LD_SONAME = -Wl,-compatibility_version -Wl,$(SO_TARGET_VERSION_MAJOR) -Wl,-current_version -Wl,$(SO_TARGET_VERSION) -install_name $(libdir)/$(notdir $(MIDDLE_SO_TARGET))
+ID_PREFIX = @rpath
+LD_SONAME = -Wl,-compatibility_version -Wl,$(SO_TARGET_VERSION_MAJOR) -Wl,-current_version -Wl,$(SO_TARGET_VERSION) -install_name $(ID_PREFIX)/$(notdir $(MIDDLE_SO_TARGET))
else
LD_SONAME = -Wl,-compatibility_version -Wl,$(SO_TARGET_VERSION_MAJOR) -Wl,-current_version -Wl,$(SO_TARGET_VERSION) -install_name $(notdir $(MIDDLE_SO_TARGET)) $(PKGDATA_TRAILING_SPACE)
endif
15 changes: 14 additions & 1 deletion windows/icu-easyrpg/mingw-dll-install.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
diff --git a/source/config/mh-mingw b/source/config/mh-mingw
index 30f6e5be81..b6364551ea 100644
--- a/source/config/mh-mingw
+++ b/source/config/mh-mingw
@@ -13,7 +13,7 @@
# On Windows we generally have the DLLs in the bin directory rather than the lib directory.
# This setting moves the ICU DLLs into the bin folder for MinGW/MSYS2 when "make install" is run.
# If you prefer to have the DLLs in the lib folder, then set this to NO instead.
-MINGW_MOVEDLLSTOBINDIR = YES
+MINGW_MOVEDLLSTOBINDIR = NO

# We install sbin tools into the same bin directory because
# pkgdata needs some of the tools in sbin, and we can't always depend on
diff --git a/source/config/mh-mingw64 b/source/config/mh-mingw64
index fb64c56..a43cc4d 100644
index fb64c56260..a43cc4dd71 100644
--- a/source/config/mh-mingw64
+++ b/source/config/mh-mingw64
@@ -10,7 +10,7 @@
Expand Down
Loading

0 comments on commit 37972f2

Please sign in to comment.