Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions ports/libmikmod/fix-dependency-openal.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 40fa4ee..78ad3f9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -799,8 +799,8 @@ ELSE()
ENDIF(ENABLE_SDL)

IF (ENABLE_OPENAL)
- include(FindOpenAL)
- IF (OPENAL_FOUND)
+ find_package(OpenAL CONFIG REQUIRED)
+ IF (1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My preferred form of minimal patching would be:

find_package(OPENAL NAMES OpenAL REQUIRED)
set(OPENAL_LIBRARY OpenAL::OpenAL)

This would be all which is needed to get the needed OPENAL_<...> variables.

SET (DRV_OPENAL 1)
CHECK_MULTI_INCLUDE_FILES("AL/al.h" "AL/alc.h")
IF (HAVE_AL_AL_H)
@@ -811,7 +811,10 @@ IF (ENABLE_OPENAL)
#include <AL/alext.h>
int main() {return 0;}" HAVE_AL_ALEXT_H)
ENDIF()
- LIST (APPEND EXTRA_LIBS ${OPENAL_LIBRARY})
+ LIST (APPEND EXTRA_LIBS OpenAL::OpenAL)
+ if (APPLE)
+ LIST (APPEND EXTRA_LIBS c++)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still think this shouldn't be done here.
I checked OpenALConfig.cmake: OpenAL::OpenAL lacks the link language property. This should be fixed in openal-soft, and libmikmod should be modified to enable CXX in addition to C.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No that doesn't help.
Openal contains both c and cxx sources, and cmake will not export the cxx standard library.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It won't export the library. The consuming CMake project (libmikmod) shall use the C++ linker. To do that, the exporting project (openal-soft) shall export CXX as the linking language, and the consuming project (libmikmod) shall enable CXX language to know the linker binary.

But in the end, you have to hard code the c++ lib into the pc file.

Interesting that Linux didn't complain about missing symbols.

+ endif()
ELSE()
SET (ENABLE_OPENAL 0)
SET (DRV_OPENAL)
15 changes: 8 additions & 7 deletions ports/libmikmod/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ vcpkg_from_sourceforge(
PATCHES
fix-missing-dll.patch
name_conflict.patch
fix-dependency-openal.patch
)

if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
Expand All @@ -16,7 +17,7 @@ else()
endif()

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
SOURCE_PATH "${SOURCE_PATH}"
PREFER_NINJA # Disable this option if project cannot be built with Ninja
OPTIONS
-DENABLE_DOC=OFF
Expand All @@ -30,20 +31,20 @@ vcpkg_configure_cmake(
-DENABLE_RAW=ON
-DENABLE_STDOUT=ON
-DENABLE_WAV=ON
-DOPENAL_INCLUDE_DIR=${CURRENT_INSTALLED_DIR}/include
"-DOPENAL_INCLUDE_DIR=${CURRENT_INSTALLED_DIR}/include"
-DENABLE_STATIC=${ENABLE_STATIC}
OPTIONS_RELEASE -DENABLE_SIMD=ON
OPTIONS_DEBUG -DENABLE_SIMD=OFF
)

vcpkg_install_cmake()

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
vcpkg_fixup_pkgconfig()

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")

if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
endif()

file(INSTALL ${SOURCE_PATH}/COPYING.LESSER DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)

vcpkg_fixup_pkgconfig()
file(INSTALL "${SOURCE_PATH}/COPYING.LESSER" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
5 changes: 3 additions & 2 deletions ports/libmikmod/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"name": "libmikmod",
"version-string": "3.3.11.1",
"port-version": 10,
"version": "3.3.11.1",
"port-version": 11,
"description": "Mikmod is a module player and library supporting many formats, including mod, s3m, it, and xm.",
"homepage": "https://sourceforge.net/projects/mikmod/",
"license": "GPL-2.0-only",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

README: LGPL 2.0 or later (plus some extra attribution for parts of the code).

"dependencies": [
"openal-soft"
]
Expand Down
22 changes: 22 additions & 0 deletions ports/openal-soft/fix-export-libs.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0cf0613..f1ac2ed 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1211,7 +1211,7 @@ set(IMPL_TARGET OpenAL) # Either OpenAL or soft_oal.
if(LIBTYPE STREQUAL "STATIC")
add_library(${IMPL_TARGET} STATIC ${COMMON_OBJS} ${OPENAL_OBJS} ${ALC_OBJS} ${CORE_OBJS})
target_compile_definitions(${IMPL_TARGET} PUBLIC AL_LIBTYPE_STATIC)
- target_link_libraries(${IMPL_TARGET} PRIVATE ${LINKER_FLAGS} ${EXTRA_LIBS} ${MATH_LIB})
+ target_link_libraries(${IMPL_TARGET} PRIVATE ${LINKER_FLAGS} PUBLIC ${EXTRA_LIBS} ${MATH_LIB})
if(WIN32)
# This option is for static linking OpenAL Soft into another project
# that already defines the IDs. It is up to that project to ensure all
@@ -1263,7 +1263,7 @@ else()
if(WIN32)
set_target_properties(${IMPL_TARGET} PROPERTIES PREFIX "")
endif()
- target_link_libraries(${IMPL_TARGET} PRIVATE common ${LINKER_FLAGS} ${EXTRA_LIBS} ${MATH_LIB})
+ target_link_libraries(${IMPL_TARGET} PRIVATE common ${LINKER_FLAGS} PUBLIC ${EXTRA_LIBS} ${MATH_LIB})

if(APPLE AND ALSOFT_OSX_FRAMEWORK)
# Sets framework name to soft_oal to avoid ambiguity with the system OpenAL.framework
1 change: 1 addition & 0 deletions ports/openal-soft/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ vcpkg_from_github(
HEAD_REF master
PATCHES
dont-export-symbols-in-static-build.patch
fix-export-libs.patch
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO this patch is not needed at all. ${EXTRA_LIBS} ${MATH_LIB} are really private. CMake stills exports them for static linkages as needed (verified on x64-linux).

)

if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
Expand Down
3 changes: 2 additions & 1 deletion ports/openal-soft/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"name": "openal-soft",
"version-semver": "1.21.1",
"port-version": 4,
"port-version": 5,
"description": "OpenAL Soft is an LGPL-licensed, cross-platform, software implementation of the OpenAL 3D audio API.",
"homepage": "https://github.com/kcat/openal-soft",
"license": "GPL-2.0-only",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGPL.

"supports": "!uwp"
}
4 changes: 2 additions & 2 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -3730,7 +3730,7 @@
},
"libmikmod": {
"baseline": "3.3.11.1",
"port-version": 10
"port-version": 11
},
"libmodbus": {
"baseline": "3.1.6",
Expand Down Expand Up @@ -5006,7 +5006,7 @@
},
"openal-soft": {
"baseline": "1.21.1",
"port-version": 4
"port-version": 5
},
"openblas": {
"baseline": "0.3.19",
Expand Down
5 changes: 5 additions & 0 deletions versions/l-/libmikmod.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "19de7c2ac0ec006729301f4a0c1efdf791a5dc6b",
"version": "3.3.11.1",
"port-version": 11
},
{
"git-tree": "ed94a83a674fb90d5884515fc763840df2ec0375",
"version-string": "3.3.11.1",
Expand Down
5 changes: 5 additions & 0 deletions versions/o-/openal-soft.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "f9f1b680060b8cc8484965d0987654d94ae5598b",
"version-semver": "1.21.1",
"port-version": 5
},
{
"git-tree": "a1dee3171a9184c0a13631fda79f6aa58d2b80b6",
"version-semver": "1.21.1",
Expand Down