From 4bb2c4de14cf38ea7daa0b8913de2c0132e15239 Mon Sep 17 00:00:00 2001 From: UsernameRandomlyGenerated Date: Thu, 17 Jun 2021 11:06:52 +0200 Subject: [PATCH] noise-repellent: update to 0.1.5. Add patch made by ericonr to fix cross compilation. --- .../noise-repellent/patches/fix-cross.patch | 78 +++++++++++++++++++ srcpkgs/noise-repellent/template | 6 +- 2 files changed, 81 insertions(+), 3 deletions(-) create mode 100644 srcpkgs/noise-repellent/patches/fix-cross.patch diff --git a/srcpkgs/noise-repellent/patches/fix-cross.patch b/srcpkgs/noise-repellent/patches/fix-cross.patch new file mode 100644 index 000000000000..183ea572748f --- /dev/null +++ b/srcpkgs/noise-repellent/patches/fix-cross.patch @@ -0,0 +1,78 @@ +From c37f95aa74bc7a4d20548d6475a66190b28fc1ec Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=C3=89rico=20Nogueira?= +Date: Mon, 21 Jun 2021 10:02:12 -0300 +Subject: [PATCH 1/2] Fix cross building and archs other than x86_64/aarch64 + +- for defining compilation flags and any other information, it's the + host machine (where the resulting binary will run) that matters, not + the build machine +- x86_64 optimizations should be enabled only for x86_64; there are many + archs other than x86_64 and aarch64 +--- + meson.build | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/meson.build b/meson.build +index 7203bfe..bbf0e67 100755 +--- a/meson.build ++++ b/meson.build +@@ -20,13 +20,13 @@ add_global_arguments('-ffast-math','-fomit-frame-pointer','-fno-finite-math-only + #install folder + install_folder = join_paths(get_option('libdir'), 'lv2', meson.project_name()) + +-#get the build operating system and configure install path and shared object extension +-current_os = build_machine.system() +-current_arch = build_machine.cpu_family() ++#get the host operating system and configure install path and shared object extension ++current_os = host_machine.system() ++current_arch = host_machine.cpu_family() + cflags = [] + +-# Add x86_64 optimization where appropriate (not for ARM) +-if current_arch != 'aarch64' ++# Add x86_64 optimization ++if current_arch == 'x86_64' + cflags += ['-msse','-msse2','-mfpmath=sse'] + endif + +@@ -82,4 +82,4 @@ nrepel_ttl = custom_target('nrepel_ttl', + if sord_validate.found() + test('LV2 validation', sord_validate, + args : [run_command('find','./lv2 -name "*.ttl"').stdout(), run_command('find','. -name "*.ttl"').stdout()]) +-endif +\ No newline at end of file ++endif + +From d0c2939de244a0b9912be02b43ad8d09d6b392bd Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=C3=89rico=20Nogueira?= +Date: Mon, 21 Jun 2021 10:09:49 -0300 +Subject: [PATCH 2/2] Only use -ffast-math for x86_64 + +This compiler optimization is heavily tested only on x86_64 and can lead +to issues on other archs, including hangs or wrong behavior. +--- + meson.build | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/meson.build b/meson.build +index bbf0e67..4022997 100755 +--- a/meson.build ++++ b/meson.build +@@ -15,7 +15,7 @@ lv2_dep = dependency('lv2', required : true) + nr_dep = [m_dep,fftw_dep,lv2_dep] + + #compiler default flags +-add_global_arguments('-ffast-math','-fomit-frame-pointer','-fno-finite-math-only','-Wno-unused-function',language : 'c') ++add_global_arguments('-fomit-frame-pointer','-fno-finite-math-only','-Wno-unused-function',language : 'c') + + #install folder + install_folder = join_paths(get_option('libdir'), 'lv2', meson.project_name()) +@@ -27,7 +27,7 @@ cflags = [] + + # Add x86_64 optimization + if current_arch == 'x86_64' +- cflags += ['-msse','-msse2','-mfpmath=sse'] ++ cflags += ['-ffast-math','-msse','-msse2','-mfpmath=sse'] + endif + + # Add osx multiarch flags when appropriate diff --git a/srcpkgs/noise-repellent/template b/srcpkgs/noise-repellent/template index a682812b9d9b..c064532d6540 100644 --- a/srcpkgs/noise-repellent/template +++ b/srcpkgs/noise-repellent/template @@ -1,8 +1,8 @@ # Template file for 'noise-repellent' pkgname=noise-repellent -version=0.1.4 +version=0.1.5 revision=1 -build_style=gnu-makefile +build_style=meson hostmakedepends="pkg-config" makedepends="lv2 fftw-devel" short_desc="LV2 plug-in for broadband noise reduction" @@ -10,4 +10,4 @@ maintainer="Colin Gillespie " license="LGPL-3.0-or-later" homepage="https://github.com/lucianodato/noise-repellent" distfiles="$homepage/archive/$version.tar.gz" -checksum=19a2a899b740dd81775f09e03bc09b010725b3366219296f488425beb632c243 +checksum=5f83a1ac4ddb7f92934041f0b5576ad37932bb81e3eb767f2aea78c9f8cfcaae