aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDariusz Antoniuk <qaston@gmail.com>2021-04-30 19:36:27 +0100
committerGitHub <noreply@github.com>2021-04-30 11:36:27 -0700
commitb7057d1ade3fcd57f6d0f177b88501ba895f7800 (patch)
tree1ce0494d13cfa677f55c685612d0107adc45eaa0
parent85308d1a2135f65bf52603687360f54e9c4e25ba (diff)
downloadvcpkg-b7057d1ade3fcd57f6d0f177b88501ba895f7800.tar.gz
vcpkg-b7057d1ade3fcd57f6d0f177b88501ba895f7800.zip
[freealut] Add a port of freealut (#16890)
* [freealut] add a new port Also apply review suggestions from Cheney Wang and Robert Schumacher Co-authored-by: Cheney Wang <38240633+Cheney-W@users.noreply.github.com> Co-authored-by: Robert Schumacher <roschuma@microsoft.com> * [freealut] add version info Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
-rw-r--r--ports/freealut/cmake_builds.patch114
-rw-r--r--ports/freealut/portfile.cmake42
-rw-r--r--ports/freealut/unix_headers.patch32
-rw-r--r--ports/freealut/vcpkg.json21
-rw-r--r--versions/baseline.json4
-rw-r--r--versions/f-/freealut.json9
6 files changed, 222 insertions, 0 deletions
diff --git a/ports/freealut/cmake_builds.patch b/ports/freealut/cmake_builds.patch
new file mode 100644
index 000000000..187b32669
--- /dev/null
+++ b/ports/freealut/cmake_builds.patch
@@ -0,0 +1,114 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 963c530..656ce14 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1,6 +1,6 @@
+ # cmake project file by Prakash Punnoor
+ # improved by Ryan Pavlik
+-cmake_minimum_required(VERSION 2.6)
++cmake_minimum_required(VERSION 2.8.12)
+
+ project(Alut C)
+
+@@ -27,7 +27,6 @@ include_directories(${Alut_SOURCE_DIR}/include)
+
+ # What to build?
+ option(BUILD_EXAMPLES "build example applications" ON)
+-option(BUILD_STATIC "build static library too" OFF)
+ option(BUILD_TESTS "build the test-suite" ON)
+
+ # How to build it?
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index b72d1a1..5fc6cdc 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -39,35 +39,7 @@ set(ALUT_HEADERS
+ ../include/AL/alut.h)
+ source_group(APIHeader FILES ${ALUT_HEADERS})
+
+-
+-if(BUILD_STATIC)
+- # we can't create a static library with the same name
+- # as the shared one, so we copy it over after creation
+- add_library(alut_static STATIC ${ALUT_SOURCES} ${ALUT_INTERNAL_HEADERS} ${ALUT_HEADERS})
+- target_link_libraries(alut_static ${OPENAL_LIBRARY} ${ADD_LIBS})
+- if(UNIX)
+- target_link_libraries(alut_static m)
+- endif()
+- if(NOT WIN32)
+- # TODO this is an inelegant hack...
+- add_custom_command(TARGET
+- alut_static
+- POST_BUILD
+- COMMAND
+- ${CMAKE_COMMAND}
+- ARGS
+- -E
+- copy
+- ${CMAKE_BINARY_DIR}/src/${CMAKE_STATIC_LIBRARY_PREFIX}alut_static${CMAKE_STATIC_LIBRARY_SUFFIX}
+- ${CMAKE_BINARY_DIR}/src/${CMAKE_STATIC_LIBRARY_PREFIX}alut${CMAKE_STATIC_LIBRARY_SUFFIX})
+- install_files(/lib${LIB_SUFFIX}
+- FILES
+- ${CMAKE_STATIC_LIBRARY_PREFIX}alut${CMAKE_STATIC_LIBRARY_SUFFIX})
+- endif()
+-endif()
+-
+-
+-add_library(alut SHARED ${ALUT_SOURCES} ${ALUT_INTERNAL_HEADERS} ${ALUT_HEADERS})
++add_library(alut ${ALUT_SOURCES} ${ALUT_INTERNAL_HEADERS} ${ALUT_HEADERS})
+ set_property(TARGET
+ alut
+ PROPERTY
+@@ -80,12 +52,40 @@ set_target_properties(alut
+ SOVERSION
+ ${MAJOR_VERSION})
+ target_link_libraries(alut ${OPENAL_LIBRARY})
++target_include_directories(alut PUBLIC ${OPENAL_INCLUDE_DIR})
+ if(UNIX)
+ target_link_libraries(alut m)
+ endif()
++if(NOT BUILD_SHARED_LIBS)
++ target_compile_definitions(alut PUBLIC ALUT_BUILD_STATIC)
++endif()
+
+ install(TARGETS alut
++ EXPORT "FreeALUTTargets"
+ LIBRARY DESTINATION lib${LIB_SUFFIX}
+ ARCHIVE DESTINATION lib${LIB_SUFFIX}
+ RUNTIME DESTINATION bin
+- PUBLIC_HEADER DESTINATION include/AL)
++ PUBLIC_HEADER DESTINATION include/AL
++ )
++
++include(CMakePackageConfigHelpers)
++
++set(version_config "${CMAKE_CURRENT_BINARY_DIR}/temp/FreeALUTConfigVersion.cmake")
++set(project_config "${CMAKE_CURRENT_BINARY_DIR}/temp/FreeALUTConfig.cmake")
++set(namespace "FreeALUT::")
++
++write_basic_package_version_file("${version_config}"
++ COMPATIBILITY SameMajorVersion
++ VERSION ${PACKAGE_VERSION})
++
++configure_package_config_file("Config.cmake.in"
++ "${project_config}"
++ INSTALL_DESTINATION
++ lib${LIB_SUFFIX}/cmake/freealut)
++
++install(FILES "${project_config}" "${version_config}"
++ DESTINATION lib${LIB_SUFFIX}/cmake/freealut)
++
++install(EXPORT "FreeALUTTargets"
++ NAMESPACE "${namespace}"
++ DESTINATION lib${LIB_SUFFIX}/cmake/freealut)
+diff --git a/src/Config.cmake.in b/src/Config.cmake.in
+new file mode 100644
+index 0000000..2a20f59
+--- /dev/null
++++ b/src/Config.cmake.in
+@@ -0,0 +1,5 @@
++
++@PACKAGE_INIT@
++
++include("${CMAKE_CURRENT_LIST_DIR}/FreeALUTTargets.cmake")
++check_required_components("FreeALUT")
diff --git a/ports/freealut/portfile.cmake b/ports/freealut/portfile.cmake
new file mode 100644
index 000000000..668b64e3a
--- /dev/null
+++ b/ports/freealut/portfile.cmake
@@ -0,0 +1,42 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO vancegroup/freealut
+ REF fc814e316c2bfa6e05b723b8cc9cb276da141aae
+ SHA512 046990cc13822ca6eea0b8e412aa95a994b881429e0b15cefee379f08bd9636d4a4598292a8d46b30c3cd06814bfaeae3298e8ef4087a46eede344f3880e9fed
+ HEAD_REF master
+ PATCHES
+ cmake_builds.patch
+ unix_headers.patch
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA
+ DISABLE_PARALLEL_CONFIGURE
+ OPTIONS
+ -DBUILD_EXAMPLES=OFF
+ -DBUILD_TESTS=OFF
+)
+
+vcpkg_cmake_install()
+vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/${PORT})
+vcpkg_fixup_pkgconfig()
+vcpkg_copy_pdbs()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share"
+ "${CURRENT_PACKAGES_DIR}/debug/include"
+ )
+
+if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
+endif()
+
+if(EXISTS "${CURRENT_PACKAGES_DIR}/bin/freealut-config")
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin/freealut-config")
+endif()
+
+if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/bin/freealut-config")
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/bin/freealut-config")
+endif()
+
+file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
diff --git a/ports/freealut/unix_headers.patch b/ports/freealut/unix_headers.patch
new file mode 100644
index 000000000..aabf69e77
--- /dev/null
+++ b/ports/freealut/unix_headers.patch
@@ -0,0 +1,32 @@
+diff --git a/include/AL/alut.h b/include/AL/alut.h
+index 4b05a3c..1084604 100644
+--- a/include/AL/alut.h
++++ b/include/AL/alut.h
+@@ -1,24 +1,18 @@
+ #if !defined(AL_ALUT_H)
+ #define AL_ALUT_H
+
+-#if defined(_MSC_VER)
+ #include <alc.h>
+ #include <al.h>
+-#elif defined(__APPLE__)
+-#include <OpenAL/alc.h>
+-#include <OpenAL/al.h>
+-#else
+-#include <AL/al.h>
+-#include <AL/alc.h>
+-#endif
+
+ #if defined(__cplusplus)
+ extern "C" {
+ #endif
+
+ #if defined(_WIN32) && !defined(_XBOX)
+- #if defined (ALUT_BUILD_LIBRARY)
++ #if defined(ALUT_BUILD_LIBRARY)
+ #define ALUT_API __declspec(dllexport)
++ #elif defined(ALUT_BUILD_STATIC)
++ #define ALUT_API extern
+ #else
+ #define ALUT_API __declspec(dllimport)
+ #endif
diff --git a/ports/freealut/vcpkg.json b/ports/freealut/vcpkg.json
new file mode 100644
index 000000000..fe3830674
--- /dev/null
+++ b/ports/freealut/vcpkg.json
@@ -0,0 +1,21 @@
+{
+ "name": "freealut",
+ "version-string": "1.1.0",
+ "description": [
+ "FreeALUT is a free implementation of OpenAL's ALUT standard.",
+ "ALUT is a set of portable functions which remove the annoying details of getting an audio application started. It is the OpenAL counterpart of what GLUT is for OpenGL. "
+ ],
+ "homepage": "https://github.com/vancegroup/freealut",
+ "supports": "!uwp & !arm & !arm64",
+ "dependencies": [
+ "openal-soft",
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ]
+}
diff --git a/versions/baseline.json b/versions/baseline.json
index 55a208008..b22a13c20 100644
--- a/versions/baseline.json
+++ b/versions/baseline.json
@@ -2060,6 +2060,10 @@
"baseline": "0.2.14-p0",
"port-version": 0
},
+ "freealut": {
+ "baseline": "1.1.0",
+ "port-version": 0
+ },
"freeglut": {
"baseline": "3.2.1",
"port-version": 5
diff --git a/versions/f-/freealut.json b/versions/f-/freealut.json
new file mode 100644
index 000000000..595bb98d3
--- /dev/null
+++ b/versions/f-/freealut.json
@@ -0,0 +1,9 @@
+{
+ "versions": [
+ {
+ "git-tree": "d4108f61eb91e67aacdfd186074e835f0541676b",
+ "version-string": "1.1.0",
+ "port-version": 0
+ }
+ ]
+}