aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGriffin Downs <35574547+grdowns@users.noreply.github.com>2019-07-02 14:45:33 -0700
committerGitHub <noreply@github.com>2019-07-02 14:45:33 -0700
commit2291b2f429081340816c8e98a2ecf483dd93e85f (patch)
tree74650504c636eceeaf78584bd87a2d1fabfdea34
parent59995facabf379174ef415394d876326dd613207 (diff)
parent65d807be5777bbb6d49cc7ad4d731b0642d9361b (diff)
downloadvcpkg-2291b2f429081340816c8e98a2ecf483dd93e85f.tar.gz
vcpkg-2291b2f429081340816c8e98a2ecf483dd93e85f.zip
Merge pull request #6478 from ThijsWithaar/soxr
[soxr] Add new port
-rw-r--r--ports/soxr/001_initialize-resampler.patch13
-rw-r--r--ports/soxr/002_disable_warning.patch12
-rw-r--r--ports/soxr/003_detect_arm_on_windows.patch13
-rw-r--r--ports/soxr/CONTROL3
-rw-r--r--ports/soxr/portfile.cmake33
5 files changed, 74 insertions, 0 deletions
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/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 <arm_neon.h>
+ typedef float32x4_t v4sf;
+ # define SIMD_SZ 4
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/portfile.cmake b/ports/soxr/portfile.cmake
new file mode 100644
index 000000000..3a2e23c30
--- /dev/null
+++ b/ports/soxr/portfile.cmake
@@ -0,0 +1,33 @@
+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}
+ PATCHES
+ 001_initialize-resampler.patch
+ 002_disable_warning.patch
+ 003_detect_arm_on_windows.patch
+)
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA
+ OPTIONS
+ -DBUILD_TESTS=OFF
+ -DBUILD_EXAMPLES=OFF
+ -DWITH_OPENMP=OFF
+ -DWITH_LSR_BINDINGS=OFF
+)
+
+vcpkg_install_cmake()
+
+file(INSTALL ${SOURCE_PATH}/LICENCE DESTINATION ${CURRENT_PACKAGES_DIR}/share/soxr RENAME copyright)
+
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)