From 39521b4d2edc3860af783b3f9ccc1af734c5c65f Mon Sep 17 00:00:00 2001 From: vlj Date: Fri, 14 Oct 2016 20:02:46 +0200 Subject: [PATCH 1/3] Add libogg. --- ports/libogg/CONTROL | 3 +++ ports/libogg/portfile.cmake | 43 +++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 ports/libogg/CONTROL create mode 100644 ports/libogg/portfile.cmake diff --git a/ports/libogg/CONTROL b/ports/libogg/CONTROL new file mode 100644 index 000000000..266cf4c2b --- /dev/null +++ b/ports/libogg/CONTROL @@ -0,0 +1,3 @@ +Source: libogg +Version: 1.3.2 +Description: Ogg is a multimedia container format, and the native file and stream format for the Xiph.org multimedia codecs. diff --git a/ports/libogg/portfile.cmake b/ports/libogg/portfile.cmake new file mode 100644 index 000000000..8cd5a7a38 --- /dev/null +++ b/ports/libogg/portfile.cmake @@ -0,0 +1,43 @@ +# Common Ambient Variables: +# VCPKG_ROOT_DIR = +# TARGET_TRIPLET is the current triplet (x86-windows, etc) +# PORT is the current port name (zlib, etc) +# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT} +# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} +# + +include(${CMAKE_TRIPLET_FILE}) +include(vcpkg_common_functions) +find_program(GIT git) + +set(GIT_URL "https://git.xiph.org/ogg.git") +set(GIT_REF "cab46b19847eb1d38aeda73ab4708716e5776366") + +if(NOT EXISTS "${DOWNLOADS}/ogg.git") + message(STATUS "Cloning") + vcpkg_execute_required_process( + COMMAND ${GIT} clone --bare ${GIT_URL} ${DOWNLOADS}/ogg.git + WORKING_DIRECTORY ${DOWNLOADS} + LOGNAME clone + ) +endif() + +if(NOT EXISTS "${CURRENT_BUILDTREES_DIR}/src/.git") + message(STATUS "Adding worktree") + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}) + vcpkg_execute_required_process( + COMMAND ${GIT} worktree add -f --detach ${CURRENT_BUILDTREES_DIR}/src ${GIT_REF} + WORKING_DIRECTORY ${DOWNLOADS}/ogg.git + LOGNAME worktree + ) +endif() + +vcpkg_configure_cmake( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src +) + +vcpkg_install_cmake() +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +# Handle copyright +file(COPY ${CURRENT_BUILDTREES_DIR}/src/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libogg) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/libogg/COPYING ${CURRENT_PACKAGES_DIR}/share/libogg/copyright) From c22ceaf2b3e9b86dfe9699f708077646681e23d6 Mon Sep 17 00:00:00 2001 From: vlj Date: Sun, 16 Oct 2016 23:48:11 +0200 Subject: [PATCH 2/3] Add libvorbis. --- ...01-Add-vorbisenc.c-to-vorbis-library.patch | 25 ++++++++ ports/libvorbis/CONTROL | 4 ++ ports/libvorbis/portfile.cmake | 58 +++++++++++++++++++ 3 files changed, 87 insertions(+) create mode 100644 ports/libvorbis/0001-Add-vorbisenc.c-to-vorbis-library.patch create mode 100644 ports/libvorbis/CONTROL create mode 100644 ports/libvorbis/portfile.cmake diff --git a/ports/libvorbis/0001-Add-vorbisenc.c-to-vorbis-library.patch b/ports/libvorbis/0001-Add-vorbisenc.c-to-vorbis-library.patch new file mode 100644 index 000000000..0f713029d --- /dev/null +++ b/ports/libvorbis/0001-Add-vorbisenc.c-to-vorbis-library.patch @@ -0,0 +1,25 @@ +From 0046f290a31b603a4caa9b728b54447b95ee5aa1 Mon Sep 17 00:00:00 2001 +From: vlj +Date: Mon, 24 Oct 2016 23:59:55 +0200 +Subject: [PATCH] Add vorbisenc.c to vorbis library. + +--- + lib/CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt +index a682ed4..2043294 100644 +--- a/lib/CMakeLists.txt ++++ b/lib/CMakeLists.txt +@@ -68,7 +68,7 @@ include_directories(.) + include_directories(${OGG_INCLUDE_DIRS}) + + if (NOT BUILD_FRAMEWORK) +- add_library(vorbis ${VORBIS_HEADERS} ${VORBIS_SOURCES}) ++ add_library(vorbis ${VORBIS_HEADERS} ${VORBIS_SOURCES} ${VORBISENC_SOURCES}) + add_library(vorbisenc ${VORBISENC_SOURCES}) + add_library(vorbisfile ${VORBISFILE_SOURCES}) + +-- +2.10.0.windows.1 + diff --git a/ports/libvorbis/CONTROL b/ports/libvorbis/CONTROL new file mode 100644 index 000000000..64721181e --- /dev/null +++ b/ports/libvorbis/CONTROL @@ -0,0 +1,4 @@ +Source: libvorbis +Version: +Description: Ogg Vorbis is a fully open, non-proprietary, patent-and-royalty-free, general-purpose compressed audio format. +Build-depends: libogg diff --git a/ports/libvorbis/portfile.cmake b/ports/libvorbis/portfile.cmake new file mode 100644 index 000000000..675a35b60 --- /dev/null +++ b/ports/libvorbis/portfile.cmake @@ -0,0 +1,58 @@ +# Common Ambient Variables: +# VCPKG_ROOT_DIR = +# TARGET_TRIPLET is the current triplet (x86-windows, etc) +# PORT is the current port name (zlib, etc) +# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT} +# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} +# + +include(${CMAKE_TRIPLET_FILE}) +include(vcpkg_common_functions) +find_program(GIT git) + +set(GIT_URL "https://git.xiph.org/vorbis.git") +set(GIT_REF "143caf4023a90c09a5eb685fdd46fb9b9c36b1ee") + +if(NOT EXISTS "${DOWNLOADS}/vorbis.git") + message(STATUS "Cloning") + vcpkg_execute_required_process( + COMMAND ${GIT} clone --bare ${GIT_URL} ${DOWNLOADS}/vorbis.git + WORKING_DIRECTORY ${DOWNLOADS} + LOGNAME clone + ) +endif() + +if(NOT EXISTS "${CURRENT_BUILDTREES_DIR}/src/.git") + message(STATUS "Adding worktree and patching") + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}) + vcpkg_execute_required_process( + COMMAND ${GIT} worktree add -f --detach ${CURRENT_BUILDTREES_DIR}/src ${GIT_REF} + WORKING_DIRECTORY ${DOWNLOADS}/vorbis.git + LOGNAME worktree + ) + message(STATUS "Patching") + vcpkg_execute_required_process( + COMMAND ${GIT} apply ${CMAKE_CURRENT_LIST_DIR}/0001-Add-vorbisenc.c-to-vorbis-library.patch --ignore-whitespace --whitespace=fix + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/src + LOGNAME patch + ) +endif() + +file(TO_NATIVE_PATH "${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/include" OGG_INCLUDE) +file(TO_NATIVE_PATH "${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/lib/ogg.lib" OGG_LIB_REL) +file(TO_NATIVE_PATH "${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/debug/lib/ogg.lib" OGG_LIB_DBG) + +vcpkg_configure_cmake( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src + OPTIONS -DOGG_INCLUDE_DIRS=${OGG_INCLUDE} + OPTIONS_RELEASE -DOGG_LIBRARIES=${OGG_LIB_REL} + OPTIONS_DEBUG -DOGG_LIBRARIES=${OGG_LIB_DBG} +) + +vcpkg_install_cmake() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +# Handle copyright +file(COPY ${CURRENT_BUILDTREES_DIR}/src/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libvorbis) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/libvorbis/COPYING ${CURRENT_PACKAGES_DIR}/share/libvorbis/copyright) From d2c3ad8b57a82b016ebf5fe8f621294ad7497ddc Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 24 Oct 2016 15:36:33 -0700 Subject: [PATCH 3/3] [libogg] [libvorbis] Add vcpkg_copy_pdbs() --- ports/libogg/portfile.cmake | 2 ++ ports/libvorbis/portfile.cmake | 2 ++ 2 files changed, 4 insertions(+) diff --git a/ports/libogg/portfile.cmake b/ports/libogg/portfile.cmake index 8cd5a7a38..d19bee8f7 100644 --- a/ports/libogg/portfile.cmake +++ b/ports/libogg/portfile.cmake @@ -41,3 +41,5 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) # Handle copyright file(COPY ${CURRENT_BUILDTREES_DIR}/src/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libogg) file(RENAME ${CURRENT_PACKAGES_DIR}/share/libogg/COPYING ${CURRENT_PACKAGES_DIR}/share/libogg/copyright) + +vcpkg_copy_pdbs() diff --git a/ports/libvorbis/portfile.cmake b/ports/libvorbis/portfile.cmake index 675a35b60..6e50efd93 100644 --- a/ports/libvorbis/portfile.cmake +++ b/ports/libvorbis/portfile.cmake @@ -56,3 +56,5 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) # Handle copyright file(COPY ${CURRENT_BUILDTREES_DIR}/src/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libvorbis) file(RENAME ${CURRENT_PACKAGES_DIR}/share/libvorbis/COPYING ${CURRENT_PACKAGES_DIR}/share/libvorbis/copyright) + +vcpkg_copy_pdbs()