From bad587bc208c1fe6c05f74c86b1414063adbb704 Mon Sep 17 00:00:00 2001 From: Lord-Valen Date: Sun, 7 Dec 2025 14:51:10 -0500 Subject: [PATCH] guitarix: add dependencies guitarix: remove unnecessary c flag guitarix: remove superfluous dependencies guitarix: split optional dependencies guitarix: add gettext to buildInputs guitarix: simplify longDescription --- pkgs/by-name/gu/guitarix/package.nix | 105 ++++++++++++++++----------- 1 file changed, 61 insertions(+), 44 deletions(-) diff --git a/pkgs/by-name/gu/guitarix/package.nix b/pkgs/by-name/gu/guitarix/package.nix index 55cc36dfde98..ebe5c1f5077a 100644 --- a/pkgs/by-name/gu/guitarix/package.nix +++ b/pkgs/by-name/gu/guitarix/package.nix @@ -13,14 +13,14 @@ glib, glib-networking, glibmm, - adwaita-icon-theme, - gsettings-desktop-schemas, + gperf, gtk3, gtkmm3, hicolor-icon-theme, intltool, ladspaH, libjack2, + liblo, libsndfile, lilv, lrdf, @@ -28,19 +28,29 @@ pkg-config, python3, sassc, - serd, - sord, - sratom, wafHook, + which, wrapGAppsHook3, zita-convolver, zita-resampler, - optimizationSupport ? false, # Enable support for native CPU extensions + + enableFaust ? false, # Transpiles Faust DSP code to C++ + enableGperf ? false, # Regenerates gperf files + enableOptimization ? # Enables support for native CPU extensions + if optimizationSupport != null then + lib.warn "`optimizationSupport` is deprecated in guitarix; use `enableOptimization` instead." optimizationSupport + else + false, + enableNSM ? true, # Enables NSM support + optimizationSupport ? null, + withAvahi ? true, + withBluez ? stdenv.hostPlatform.isLinux, + withLiblo ? enableNSM, + withZitaConvolver ? true, + withZitaResampler ? true, }: -let - inherit (lib) optional; -in +assert enableNSM -> withLiblo; stdenv.mkDerivation (finalAttrs: { pname = "guitarix"; @@ -49,7 +59,7 @@ stdenv.mkDerivation (finalAttrs: { src = fetchFromGitHub { owner = "brummer10"; repo = "guitarix"; - rev = "V${finalAttrs.version}"; + tag = "V${finalAttrs.version}"; fetchSubmodules = true; hash = "sha256-YQqcpdehfC9UE1OowC1/YUw2eWgbLWMbAJ3V5tVmtiU="; }; @@ -64,21 +74,22 @@ stdenv.mkDerivation (finalAttrs: { python3 wafHook wrapGAppsHook3 - ]; + ] + ++ lib.optionals enableFaust [ + faust + which + ] + ++ lib.optional enableGperf gperf; buildInputs = [ - avahi - bluez boost curl eigen - faust fftwSinglePrec + gettext glib glib-networking.out glibmm - adwaita-icon-theme - gsettings-desktop-schemas gtk3 gtkmm3 ladspaH @@ -88,12 +99,18 @@ stdenv.mkDerivation (finalAttrs: { lrdf lv2 sassc - serd - sord - sratom - zita-convolver - zita-resampler - ]; + ] + ++ lib.optional withAvahi avahi + ++ lib.optional withBluez bluez + ++ lib.optional withLiblo liblo + ++ lib.optional withZitaConvolver zita-convolver + ++ lib.optional withZitaResampler zita-resampler; + + # There are many bad shebangs which can fail builds. + # See `https://github.com/brummer10/guitarix/issues/246`. + postPatch = '' + patchShebangs --build tools/** + ''; wafConfigureFlags = [ "--no-font-cache-update" @@ -102,34 +119,33 @@ stdenv.mkDerivation (finalAttrs: { "--enable-nls" "--install-roboto-font" ] - ++ optional optimizationSupport "--optimization"; - - env.NIX_CFLAGS_COMPILE = toString [ "-fpermissive" ]; + # Use explicit flags to guarantee correct configuration + ++ lib.optional enableFaust "--faust" # Force waf to use the provided faust + ++ lib.optional (!enableFaust) "--no-faust" + ++ lib.optional (!enableNSM) "--no-nsm" + ++ lib.optional enableOptimization "--optimization" + ++ lib.optional (!withAvahi) "--no-avahi" + ++ lib.optional (!withBluez) "--no-bluez" + ++ lib.optional (!withZitaConvolver) "--includeconvolver" + ++ lib.optional (!withZitaResampler) "--includeresampler"; meta = { description = "Virtual guitar amplifier for Linux running with JACK"; mainProgram = "guitarix"; longDescription = '' - guitarix is a virtual guitar amplifier for Linux running with - JACK (Jack Audio Connection Kit). It is free as in speech and - free as in beer. Its free sourcecode allows to build it for - other UNIX-like systems also, namely for BSD and for MacOSX. + Guitarix takes the signal from your guitar as any real amp would do: as a + mono-signal from your sound card. Your tone is processed by a main amp and + a rack-section. Both can be routed separately and deliver a processed + stereo-signal via JACK. You may fill the rack with effects from more than + 25 built-in modules spanning from a simple noise-gate to brain-slashing + modulation-fx like flanger, phaser or auto-wah. Your signal is processed + with minimum latency. On a properly set-up Linux-system you do not need to + wait for more than 10 milliseconds for your playing to be delivered, + processed by guitarix. - It takes the signal from your guitar as any real amp would do: - as a mono-signal from your sound card. Your tone is processed by - a main amp and a rack-section. Both can be routed separately and - deliver a processed stereo-signal via JACK. You may fill the - rack with effects from more than 25 built-in modules spanning - from a simple noise-gate to brain-slashing modulation-fx like - flanger, phaser or auto-wah. Your signal is processed with - minimum latency. On any properly set-up Linux-system you do not - need to wait for more than 10 milli-seconds for your playing to - be delivered, processed by guitarix. - - guitarix offers the range of sounds you would expect from a - full-featured universal guitar-amp. You can get crisp - clean-sounds, nice overdrive, fat distortion and a diversity of - crazy sounds never heard before. + Guitarix offers the range of sounds you would expect from a full-featured + universal guitar-amp. You can get crisp clean-sounds, nice overdrive, fat + distortion and a diversity of crazy sounds never heard before. ''; homepage = "https://github.com/brummer10/guitarix"; license = lib.licenses.gpl3Plus; @@ -137,6 +153,7 @@ stdenv.mkDerivation (finalAttrs: { lord-valen anderscs ]; + # TODO: This potentially also works on darwin and BSD. platforms = lib.platforms.linux; }; })