From f362309178c05c3acde238f2eb2dbc816a195704 Mon Sep 17 00:00:00 2001 From: Thijs Withaar Date: Thu, 16 May 2019 18:30:43 +0200 Subject: [soxr] initial commit --- ports/soxr/CONTROL | 3 ++ ports/soxr/disable_cmake_settings.patch | 25 ++++++++++++++++ ports/soxr/portfile.cmake | 51 +++++++++++++++++++++++++++++++++ 3 files changed, 79 insertions(+) create mode 100644 ports/soxr/CONTROL create mode 100644 ports/soxr/disable_cmake_settings.patch create mode 100644 ports/soxr/portfile.cmake diff --git a/ports/soxr/CONTROL b/ports/soxr/CONTROL new file mode 100644 index 000000000..ebf120c06 --- /dev/null +++ b/ports/soxr/CONTROL @@ -0,0 +1,3 @@ +Source: soxr +Version: 0.1.3. +Description: High quality audio resampling diff --git a/ports/soxr/disable_cmake_settings.patch b/ports/soxr/disable_cmake_settings.patch new file mode 100644 index 000000000..192e7bf54 --- /dev/null +++ b/ports/soxr/disable_cmake_settings.patch @@ -0,0 +1,25 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -40,10 +40,10 @@ + "Build type, one of: None Debug Release RelWithDebInfo MinSizeRel." FORCE) + endif () + +-option (BUILD_TESTS "Build sanity-tests." ON) ++option (BUILD_TESTS "Build sanity-tests." OFF) + option (BUILD_EXAMPLES "Build examples." OFF) +-option (WITH_OPENMP "Include OpenMP threading." ON) +-option (WITH_LSR_BINDINGS "Include a `libsamplerate'-like interface." ON) ++option (WITH_OPENMP "Include OpenMP threading." OFF) ++option (WITH_LSR_BINDINGS "Include a `libsamplerate'-like interface." OFF) + + cmake_dependent_option (BUILD_SHARED_LIBS + "Build shared (dynamic) soxr libraries." ON +@@ -75,7 +75,7 @@ + option (WITH_HI_PREC_CLOCK "Enable high-precision time-base." ON) + option (WITH_FLOAT_STD_PREC_CLOCK + "Use floating-point for standard-precision time-base." OFF) +-option (WITH_DEV_TRACE "Enable developer trace capability." ON) ++option (WITH_DEV_TRACE "Enable developer trace capability." OFF) + option (WITH_DEV_GPROF "Enable developer grpof output." OFF) + mark_as_advanced (WITH_HI_PREC_CLOCK WITH_FLOAT_STD_PREC_CLOCK + WITH_DEV_TRACE WITH_DEV_GPROF) diff --git a/ports/soxr/portfile.cmake b/ports/soxr/portfile.cmake new file mode 100644 index 000000000..c7c624caa --- /dev/null +++ b/ports/soxr/portfile.cmake @@ -0,0 +1,51 @@ +# Common Ambient Variables: +# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT} +# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} +# CURRENT_PORT_DIR = ${VCPKG_ROOT_DIR}\ports\${PORT} +# PORT = current port name (zlib, etc) +# TARGET_TRIPLET = current triplet (x86-windows, x64-windows-static, etc) +# VCPKG_CRT_LINKAGE = C runtime linkage type (static, dynamic) +# VCPKG_LIBRARY_LINKAGE = target library linkage type (static, dynamic) +# VCPKG_ROOT_DIR = +# VCPKG_TARGET_ARCHITECTURE = target architecture (x64, x86, arm) +# + +include(vcpkg_common_functions) + +vcpkg_download_distfile(ARCHIVE + URLS "https://netcologne.dl.sourceforge.net/project/soxr/soxr-0.1.3-Source.tar.xz" + FILENAME "soxr-0.1.3-Source.tar.xz" + SHA512 f4883ed298d5650399283238aac3dbe78d605b988246bea51fa343d4a8ce5ce97c6e143f6c3f50a3ff81795d9c19e7a07217c586d4020f6ced102aceac46aaa8 +) + +vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH SOURCE_PATH + ARCHIVE ${ARCHIVE} + # (Optional) A friendly name to use instead of the filename of the archive (e.g.: a version number or tag). + # REF 1.0.0 + # (Optional) Read the docs for how to generate patches at: + # https://github.com/Microsoft/vcpkg/blob/master/docs/examples/patching.md + # PATCHES + # 001_port_fixes.patch + # 002_more_port_fixes.patch + disable_cmake_settings.patch +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA # Disable this option if project cannot be built with Ninja + # OPTIONS -DUSE_THIS_IN_ALL_BUILDS=1 -DUSE_THIS_TOO=2 + # OPTIONS_RELEASE -DOPTIMIZE=1 + # OPTIONS_DEBUG -DDEBUGGABLE=1 +) + + +vcpkg_install_cmake() + +# Handle copyright +file(INSTALL ${SOURCE_PATH}/LICENCE DESTINATION ${CURRENT_PACKAGES_DIR}/share/soxr RENAME copyright) + +# Post-build test for cmake libraries +# vcpkg_test_cmake(PACKAGE_NAME soxr) + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -- cgit v1.2.3 From 60b96c3d0c0d99dccd6f710b89212af75f1b948c Mon Sep 17 00:00:00 2001 From: Thijs Withaar Date: Sun, 19 May 2019 19:21:27 +0200 Subject: [soxr] Set Cmake options through portfile.cmake rather than a patch. --- ports/soxr/disable_cmake_settings.patch | 25 ------------------------- ports/soxr/portfile.cmake | 3 +-- 2 files changed, 1 insertion(+), 27 deletions(-) delete mode 100644 ports/soxr/disable_cmake_settings.patch diff --git a/ports/soxr/disable_cmake_settings.patch b/ports/soxr/disable_cmake_settings.patch deleted file mode 100644 index 192e7bf54..000000000 --- a/ports/soxr/disable_cmake_settings.patch +++ /dev/null @@ -1,25 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -40,10 +40,10 @@ - "Build type, one of: None Debug Release RelWithDebInfo MinSizeRel." FORCE) - endif () - --option (BUILD_TESTS "Build sanity-tests." ON) -+option (BUILD_TESTS "Build sanity-tests." OFF) - option (BUILD_EXAMPLES "Build examples." OFF) --option (WITH_OPENMP "Include OpenMP threading." ON) --option (WITH_LSR_BINDINGS "Include a `libsamplerate'-like interface." ON) -+option (WITH_OPENMP "Include OpenMP threading." OFF) -+option (WITH_LSR_BINDINGS "Include a `libsamplerate'-like interface." OFF) - - cmake_dependent_option (BUILD_SHARED_LIBS - "Build shared (dynamic) soxr libraries." ON -@@ -75,7 +75,7 @@ - option (WITH_HI_PREC_CLOCK "Enable high-precision time-base." ON) - option (WITH_FLOAT_STD_PREC_CLOCK - "Use floating-point for standard-precision time-base." OFF) --option (WITH_DEV_TRACE "Enable developer trace capability." ON) -+option (WITH_DEV_TRACE "Enable developer trace capability." OFF) - option (WITH_DEV_GPROF "Enable developer grpof output." OFF) - mark_as_advanced (WITH_HI_PREC_CLOCK WITH_FLOAT_STD_PREC_CLOCK - WITH_DEV_TRACE WITH_DEV_GPROF) diff --git a/ports/soxr/portfile.cmake b/ports/soxr/portfile.cmake index c7c624caa..6dbc65eb8 100644 --- a/ports/soxr/portfile.cmake +++ b/ports/soxr/portfile.cmake @@ -28,7 +28,6 @@ vcpkg_extract_source_archive_ex( # PATCHES # 001_port_fixes.patch # 002_more_port_fixes.patch - disable_cmake_settings.patch ) vcpkg_configure_cmake( @@ -37,9 +36,9 @@ vcpkg_configure_cmake( # OPTIONS -DUSE_THIS_IN_ALL_BUILDS=1 -DUSE_THIS_TOO=2 # OPTIONS_RELEASE -DOPTIMIZE=1 # OPTIONS_DEBUG -DDEBUGGABLE=1 + OPTIONS -DBUILD_TESTS=OFF -DWITH_OPENMP=OFF -DWITH_LSR_BINDINGS=OFF ) - vcpkg_install_cmake() # Handle copyright -- cgit v1.2.3 From f4993def219abaabf1527d66f584b2bc5c2f8e48 Mon Sep 17 00:00:00 2001 From: Thijs Withaar Date: Fri, 31 May 2019 14:09:35 +0200 Subject: [soxr] Fix macos build: remove share --- ports/soxr/portfile.cmake | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ports/soxr/portfile.cmake b/ports/soxr/portfile.cmake index 6dbc65eb8..d71f1acdd 100644 --- a/ports/soxr/portfile.cmake +++ b/ports/soxr/portfile.cmake @@ -20,10 +20,10 @@ vcpkg_download_distfile(ARCHIVE vcpkg_extract_source_archive_ex( OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${ARCHIVE} + ARCHIVE ${ARCHIVE} # (Optional) A friendly name to use instead of the filename of the archive (e.g.: a version number or tag). # REF 1.0.0 - # (Optional) Read the docs for how to generate patches at: + # (Optional) Read the docs for how to generate patches at: # https://github.com/Microsoft/vcpkg/blob/master/docs/examples/patching.md # PATCHES # 001_port_fixes.patch @@ -48,3 +48,4 @@ file(INSTALL ${SOURCE_PATH}/LICENCE DESTINATION ${CURRENT_PACKAGES_DIR}/share/so # vcpkg_test_cmake(PACKAGE_NAME soxr) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) -- cgit v1.2.3 From 93b9320fe40afeb921750206ac4be83b1e9fa6d2 Mon Sep 17 00:00:00 2001 From: Thijs Withaar Date: Tue, 4 Jun 2019 19:05:25 +0200 Subject: [soxr] skip examples --- ports/soxr/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/soxr/portfile.cmake b/ports/soxr/portfile.cmake index d71f1acdd..091c94e49 100644 --- a/ports/soxr/portfile.cmake +++ b/ports/soxr/portfile.cmake @@ -36,7 +36,7 @@ vcpkg_configure_cmake( # OPTIONS -DUSE_THIS_IN_ALL_BUILDS=1 -DUSE_THIS_TOO=2 # OPTIONS_RELEASE -DOPTIMIZE=1 # OPTIONS_DEBUG -DDEBUGGABLE=1 - OPTIONS -DBUILD_TESTS=OFF -DWITH_OPENMP=OFF -DWITH_LSR_BINDINGS=OFF + OPTIONS -DBUILD_TESTS=OFF -DBUILD_EXAMPLES=OFF -DWITH_OPENMP=OFF -DWITH_LSR_BINDINGS=OFF ) vcpkg_install_cmake() -- cgit v1.2.3 From f884a9e2ea75d623b4bf2d1d68e4680bdfeaacc8 Mon Sep 17 00:00:00 2001 From: Thijs Withaar Date: Tue, 4 Jun 2019 22:08:33 +0200 Subject: [soxr] patch potentially uninitialized variable, remove build warning --- ports/soxr/001_initialize-resampler.patch | 13 +++++++++++++ ports/soxr/002_disable_warning.patch | 12 ++++++++++++ ports/soxr/portfile.cmake | 3 +++ 3 files changed, 28 insertions(+) create mode 100644 ports/soxr/001_initialize-resampler.patch create mode 100644 ports/soxr/002_disable_warning.patch diff --git a/ports/soxr/001_initialize-resampler.patch b/ports/soxr/001_initialize-resampler.patch new file mode 100644 index 000000000..6be5f29bd --- /dev/null +++ b/ports/soxr/001_initialize-resampler.patch @@ -0,0 +1,13 @@ +diff --git a/src/soxr.c b/src/soxr.c +index c2861ac..c95cfd4 100644 +--- a/src/soxr.c ++++ b/src/soxr.c +@@ -815,7 +815,7 @@ soxr_error_t soxr_oneshot( + soxr_quality_spec_t const * q_spec, + soxr_runtime_spec_t const * runtime_spec) + { +- soxr_t resampler; ++ soxr_t resampler = NULL; + soxr_error_t error = q_spec? q_spec->e : 0; + if (!error) { + soxr_quality_spec_t q_spec1; diff --git a/ports/soxr/002_disable_warning.patch b/ports/soxr/002_disable_warning.patch new file mode 100644 index 000000000..fc8550187 --- /dev/null +++ b/ports/soxr/002_disable_warning.patch @@ -0,0 +1,12 @@ +diff --git a/src/pffft.c b/src/pffft.c +index 46c841e..0686bef 100644 +--- a/src/pffft.c ++++ b/src/pffft.c +@@ -182,7 +182,6 @@ typedef float32x4_t v4sf; + # define VALIGNED(ptr) ((((long)(ptr)) & 0x3) == 0) + #else + # if !defined(PFFFT_SIMD_DISABLE) +-# warning "building with simd disabled !\n"; + # define PFFFT_SIMD_DISABLE /* fallback to scalar code */ + # endif + #endif diff --git a/ports/soxr/portfile.cmake b/ports/soxr/portfile.cmake index 091c94e49..344b725f2 100644 --- a/ports/soxr/portfile.cmake +++ b/ports/soxr/portfile.cmake @@ -28,6 +28,9 @@ vcpkg_extract_source_archive_ex( # PATCHES # 001_port_fixes.patch # 002_more_port_fixes.patch + PATCHES + 001_initialize-resampler.patch + 002_disable_warning.patch ) vcpkg_configure_cmake( -- cgit v1.2.3 From 0550221978d520e4e12c459a6fab5be16d5fa753 Mon Sep 17 00:00:00 2001 From: Thijs Withaar Date: Sun, 9 Jun 2019 11:46:09 +0200 Subject: [soxr]: define arm on windows --- ports/soxr/003_detect_arm_on_windows.h | 13 +++++++++++++ ports/soxr/portfile.cmake | 1 + 2 files changed, 14 insertions(+) create mode 100644 ports/soxr/003_detect_arm_on_windows.h diff --git a/ports/soxr/003_detect_arm_on_windows.h b/ports/soxr/003_detect_arm_on_windows.h new file mode 100644 index 000000000..f1643fb63 --- /dev/null +++ b/ports/soxr/003_detect_arm_on_windows.h @@ -0,0 +1,13 @@ +diff --git a/src/pffft.c b/src/pffft.c +index 0686bef..e4cb094 100644 +--- a/src/pffft.c ++++ b/src/pffft.c +@@ -157,7 +157,7 @@ typedef __m128 v4sf; + /* + ARM NEON support macros + */ +-#elif !defined(PFFFT_SIMD_DISABLE) && defined(__arm__) ++#elif !defined(PFFFT_SIMD_DISABLE) && (defined(__arm__) || defined(_M_ARM)) + # include + typedef float32x4_t v4sf; + # define SIMD_SZ 4 diff --git a/ports/soxr/portfile.cmake b/ports/soxr/portfile.cmake index 344b725f2..c1a028114 100644 --- a/ports/soxr/portfile.cmake +++ b/ports/soxr/portfile.cmake @@ -31,6 +31,7 @@ vcpkg_extract_source_archive_ex( PATCHES 001_initialize-resampler.patch 002_disable_warning.patch + 003_detect_arm_on_windows.h ) vcpkg_configure_cmake( -- cgit v1.2.3 From dbeae6f05c417e7652f7295f77c94f9cd6bda992 Mon Sep 17 00:00:00 2001 From: grdowns Date: Mon, 1 Jul 2019 12:41:26 -0700 Subject: Clean up comments and whitespace --- ports/soxr/portfile.cmake | 46 ++++++++++++---------------------------------- 1 file changed, 12 insertions(+), 34 deletions(-) diff --git a/ports/soxr/portfile.cmake b/ports/soxr/portfile.cmake index c1a028114..15180241c 100644 --- a/ports/soxr/portfile.cmake +++ b/ports/soxr/portfile.cmake @@ -1,33 +1,14 @@ -# Common Ambient Variables: -# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT} -# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} -# CURRENT_PORT_DIR = ${VCPKG_ROOT_DIR}\ports\${PORT} -# PORT = current port name (zlib, etc) -# TARGET_TRIPLET = current triplet (x86-windows, x64-windows-static, etc) -# VCPKG_CRT_LINKAGE = C runtime linkage type (static, dynamic) -# VCPKG_LIBRARY_LINKAGE = target library linkage type (static, dynamic) -# VCPKG_ROOT_DIR = -# VCPKG_TARGET_ARCHITECTURE = target architecture (x64, x86, arm) -# - include(vcpkg_common_functions) vcpkg_download_distfile(ARCHIVE - URLS "https://netcologne.dl.sourceforge.net/project/soxr/soxr-0.1.3-Source.tar.xz" - FILENAME "soxr-0.1.3-Source.tar.xz" - SHA512 f4883ed298d5650399283238aac3dbe78d605b988246bea51fa343d4a8ce5ce97c6e143f6c3f50a3ff81795d9c19e7a07217c586d4020f6ced102aceac46aaa8 + URLS "https://netcologne.dl.sourceforge.net/project/soxr/soxr-0.1.3-Source.tar.xz" + FILENAME "soxr-0.1.3-Source.tar.xz" + SHA512 f4883ed298d5650399283238aac3dbe78d605b988246bea51fa343d4a8ce5ce97c6e143f6c3f50a3ff81795d9c19e7a07217c586d4020f6ced102aceac46aaa8 ) vcpkg_extract_source_archive_ex( - OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${ARCHIVE} - # (Optional) A friendly name to use instead of the filename of the archive (e.g.: a version number or tag). - # REF 1.0.0 - # (Optional) Read the docs for how to generate patches at: - # https://github.com/Microsoft/vcpkg/blob/master/docs/examples/patching.md - # PATCHES - # 001_port_fixes.patch - # 002_more_port_fixes.patch + OUT_SOURCE_PATH SOURCE_PATH + ARCHIVE ${ARCHIVE} PATCHES 001_initialize-resampler.patch 002_disable_warning.patch @@ -35,21 +16,18 @@ vcpkg_extract_source_archive_ex( ) vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA # Disable this option if project cannot be built with Ninja - # OPTIONS -DUSE_THIS_IN_ALL_BUILDS=1 -DUSE_THIS_TOO=2 - # OPTIONS_RELEASE -DOPTIMIZE=1 - # OPTIONS_DEBUG -DDEBUGGABLE=1 - OPTIONS -DBUILD_TESTS=OFF -DBUILD_EXAMPLES=OFF -DWITH_OPENMP=OFF -DWITH_LSR_BINDINGS=OFF + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DBUILD_TESTS=OFF + -DBUILD_EXAMPLES=OFF + -DWITH_OPENMP=OFF + -DWITH_LSR_BINDINGS=OFF ) vcpkg_install_cmake() -# Handle copyright file(INSTALL ${SOURCE_PATH}/LICENCE DESTINATION ${CURRENT_PACKAGES_DIR}/share/soxr RENAME copyright) -# Post-build test for cmake libraries -# vcpkg_test_cmake(PACKAGE_NAME soxr) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) -- cgit v1.2.3 From 65d807be5777bbb6d49cc7ad4d731b0642d9361b Mon Sep 17 00:00:00 2001 From: grdowns Date: Mon, 1 Jul 2019 12:42:53 -0700 Subject: Rename patch file --- ports/soxr/003_detect_arm_on_windows.h | 13 ------------- ports/soxr/003_detect_arm_on_windows.patch | 13 +++++++++++++ ports/soxr/portfile.cmake | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) delete mode 100644 ports/soxr/003_detect_arm_on_windows.h create mode 100644 ports/soxr/003_detect_arm_on_windows.patch diff --git a/ports/soxr/003_detect_arm_on_windows.h b/ports/soxr/003_detect_arm_on_windows.h deleted file mode 100644 index f1643fb63..000000000 --- a/ports/soxr/003_detect_arm_on_windows.h +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/src/pffft.c b/src/pffft.c -index 0686bef..e4cb094 100644 ---- a/src/pffft.c -+++ b/src/pffft.c -@@ -157,7 +157,7 @@ typedef __m128 v4sf; - /* - ARM NEON support macros - */ --#elif !defined(PFFFT_SIMD_DISABLE) && defined(__arm__) -+#elif !defined(PFFFT_SIMD_DISABLE) && (defined(__arm__) || defined(_M_ARM)) - # include - typedef float32x4_t v4sf; - # define SIMD_SZ 4 diff --git a/ports/soxr/003_detect_arm_on_windows.patch b/ports/soxr/003_detect_arm_on_windows.patch new file mode 100644 index 000000000..f1643fb63 --- /dev/null +++ b/ports/soxr/003_detect_arm_on_windows.patch @@ -0,0 +1,13 @@ +diff --git a/src/pffft.c b/src/pffft.c +index 0686bef..e4cb094 100644 +--- a/src/pffft.c ++++ b/src/pffft.c +@@ -157,7 +157,7 @@ typedef __m128 v4sf; + /* + ARM NEON support macros + */ +-#elif !defined(PFFFT_SIMD_DISABLE) && defined(__arm__) ++#elif !defined(PFFFT_SIMD_DISABLE) && (defined(__arm__) || defined(_M_ARM)) + # include + typedef float32x4_t v4sf; + # define SIMD_SZ 4 diff --git a/ports/soxr/portfile.cmake b/ports/soxr/portfile.cmake index 15180241c..3a2e23c30 100644 --- a/ports/soxr/portfile.cmake +++ b/ports/soxr/portfile.cmake @@ -12,7 +12,7 @@ vcpkg_extract_source_archive_ex( PATCHES 001_initialize-resampler.patch 002_disable_warning.patch - 003_detect_arm_on_windows.h + 003_detect_arm_on_windows.patch ) vcpkg_configure_cmake( -- cgit v1.2.3