From 17875f90962e6f4ace0ade7ed69fd8d405549802 Mon Sep 17 00:00:00 2001 From: q66 Date: Tue, 17 Dec 2019 15:58:44 +0100 Subject: [PATCH] cli-visualizer: always use our own optimization and debug flags This also unbreaks targets where there is no -march etc. --- .../patches/use-system-opt.patch | 27 +++++++++++++++++++ srcpkgs/cli-visualizer/template | 11 ++------ 2 files changed, 29 insertions(+), 9 deletions(-) create mode 100644 srcpkgs/cli-visualizer/patches/use-system-opt.patch diff --git a/srcpkgs/cli-visualizer/patches/use-system-opt.patch b/srcpkgs/cli-visualizer/patches/use-system-opt.patch new file mode 100644 index 00000000000..7819bdd6131 --- /dev/null +++ b/srcpkgs/cli-visualizer/patches/use-system-opt.patch @@ -0,0 +1,27 @@ +Don't let the buildsystem mess with optimization and debug flags and set stuff +like -march=native which is not generic (and is very arch specific). + +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -22,17 +22,13 @@ endif() + set(PROJECT_VERSION ${vis_version}) + project(${PROJECT_NAME} VERSION ${vis_version} LANGUAGES CXX C) + +-if(NOT DEFINED VIS_COMPILER_ARCH) +- set(VIS_COMPILER_ARCH "native") +-endif() +- + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-omit-frame-pointer -D__extern_always_inline=inline -D_XOPEN_SOURCE_EXTENDED") +-set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -ggdb -g3 -ffast-math -march=x86-64 -mtune=generic -DVIS_LOG_DEBUG") +-set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -ffast-math -g1 -O3 -march=${VIS_COMPILER_ARCH} -fno-omit-frame-pointer -DNDEBUG") ++set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -ggdb -g3 -ffast-math -DVIS_LOG_DEBUG") ++set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -ffast-math -fno-omit-frame-pointer -DNDEBUG") + + set(CMAKE_LD_FLAGS "${CMAKE_LD_FLAGS} ${VIS_DEFAULT_FLAGS} -fno-omit-frame-pointer -D__extern_always_inline=inline -D_XOPEN_SOURCE_EXTENDED") +-set(CMAKE_LD_FLAGS_DEBUG "${CMAKE_LD_FLAGS_DEBUG} -ggdb -g3 -ffast-math -march=x86-64 -mtune=generic -DVIS_LOG_DEBUG") +-set(CMAKE_LD_FLAGS_RELEASE "${CMAKE_LD_FLAGS_RELEASE} -ffast-math -g1 -O3 -march=${VIS_COMPILER_ARCH} -fno-omit-frame-pointer -DNDEBUG") ++set(CMAKE_LD_FLAGS_DEBUG "${CMAKE_LD_FLAGS_DEBUG} -ggdb -g3 -ffast-math -DVIS_LOG_DEBUG") ++set(CMAKE_LD_FLAGS_RELEASE "${CMAKE_LD_FLAGS_RELEASE} -ffast-math -fno-omit-frame-pointer -DNDEBUG") + + if(DEFINED VIS_SANITIZER) + # compile with O1 to cause a little more havoc diff --git a/srcpkgs/cli-visualizer/template b/srcpkgs/cli-visualizer/template index a3fb7ad20ac..9aa8077393f 100644 --- a/srcpkgs/cli-visualizer/template +++ b/srcpkgs/cli-visualizer/template @@ -1,7 +1,7 @@ # Template file for 'cli-visualizer' pkgname=cli-visualizer version=1.8 -revision=1 +revision=2 build_style=cmake makedepends="fftw-devel ncurses-devel $(vopt_if pulseaudio 'pulseaudio-devel')" short_desc="CLI based audio visualizer" @@ -11,14 +11,7 @@ homepage="https://github.com/dpayne/cli-visualizer" distfiles="${homepage}/archive/v${version}.tar.gz" checksum=927e4c18403c7a40397e8698ffefd1b37250be20fa0ec55fda9a82cf9cc8ba51 build_options="pulseaudio" - -# Some targets don't have libpulse-simple, can't compile with pulseaudio support -case "$XBPS_TARGET_MACHINE" in - armv*) configure_args+=" -DVIS_COMPILER_ARCH=armv6";; - aarch64*) configure_args+=" -DVIS_COMPILER_ARCH=armv8-a";; - x86_64-musl) ;; - *) build_options_default+=" pulseaudio";; -esac +build_options_default="pulseaudio" post_install() { vlicense LICENSE