mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-06-07 14:07:29 +08:00
[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>
This commit is contained in:
parent
85308d1a21
commit
b7057d1ade
114
ports/freealut/cmake_builds.patch
Normal file
114
ports/freealut/cmake_builds.patch
Normal file
@ -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")
|
42
ports/freealut/portfile.cmake
Normal file
42
ports/freealut/portfile.cmake
Normal file
@ -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)
|
32
ports/freealut/unix_headers.patch
Normal file
32
ports/freealut/unix_headers.patch
Normal file
@ -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
|
21
ports/freealut/vcpkg.json
Normal file
21
ports/freealut/vcpkg.json
Normal file
@ -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
|
||||
}
|
||||
]
|
||||
}
|
@ -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
|
||||
|
9
versions/f-/freealut.json
Normal file
9
versions/f-/freealut.json
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "d4108f61eb91e67aacdfd186074e835f0541676b",
|
||||
"version-string": "1.1.0",
|
||||
"port-version": 0
|
||||
}
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue
Block a user