From f199f53d010984717c09b62da392757aca83fc06 Mon Sep 17 00:00:00 2001 From: Lord-Valen Date: Sun, 7 Dec 2025 14:37:24 -0500 Subject: [PATCH 1/4] guitarix: move to `pkgs/by-name` From bad587bc208c1fe6c05f74c86b1414063adbb704 Mon Sep 17 00:00:00 2001 From: Lord-Valen Date: Sun, 7 Dec 2025 14:51:10 -0500 Subject: [PATCH 2/4] 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; }; }) From 21b26027c9b8dcdf2a0d1a65a7e02fb301d962d2 Mon Sep 17 00:00:00 2001 From: Lord-Valen Date: Sun, 15 Feb 2026 10:18:08 -0500 Subject: [PATCH 3/4] guitarix: fix cross-compilation Co-authored-by: Aleksey Sidorov <83360+alekseysidorov@users.noreply.github.com> --- pkgs/by-name/gu/guitarix/package.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/gu/guitarix/package.nix b/pkgs/by-name/gu/guitarix/package.nix index ebe5c1f5077a..33009903f357 100644 --- a/pkgs/by-name/gu/guitarix/package.nix +++ b/pkgs/by-name/gu/guitarix/package.nix @@ -42,6 +42,7 @@ else false, enableNSM ? true, # Enables NSM support + enableSse ? stdenv.hostPlatform.isx86, # Enables support for SSE CPU extensions optimizationSupport ? null, withAvahi ? true, withBluez ? stdenv.hostPlatform.isLinux, @@ -66,12 +67,15 @@ stdenv.mkDerivation (finalAttrs: { sourceRoot = "${finalAttrs.src.name}/trunk"; + strictDeps = true; + nativeBuildInputs = [ gettext hicolor-icon-theme intltool pkg-config python3 + sassc wafHook wrapGAppsHook3 ] @@ -98,7 +102,6 @@ stdenv.mkDerivation (finalAttrs: { lilv lrdf lv2 - sassc ] ++ lib.optional withAvahi avahi ++ lib.optional withBluez bluez @@ -124,6 +127,7 @@ stdenv.mkDerivation (finalAttrs: { ++ lib.optional (!enableFaust) "--no-faust" ++ lib.optional (!enableNSM) "--no-nsm" ++ lib.optional enableOptimization "--optimization" + ++ lib.optional (!enableSse) "--disable-sse" ++ lib.optional (!withAvahi) "--no-avahi" ++ lib.optional (!withBluez) "--no-bluez" ++ lib.optional (!withZitaConvolver) "--includeconvolver" From d304fa415953fcabda31c7e9a4bb13cfe82e8668 Mon Sep 17 00:00:00 2001 From: Lord-Valen Date: Tue, 24 Feb 2026 14:20:49 -0500 Subject: [PATCH 4/4] guitarix: fix build with boost 1.89 Fixes: https://github.com/NixOS/nixpkgs/issues/493717#issuecomment-3953833474 --- pkgs/by-name/gu/guitarix/package.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pkgs/by-name/gu/guitarix/package.nix b/pkgs/by-name/gu/guitarix/package.nix index 33009903f357..a1cc284088ce 100644 --- a/pkgs/by-name/gu/guitarix/package.nix +++ b/pkgs/by-name/gu/guitarix/package.nix @@ -8,6 +8,7 @@ curl, eigen, faust, + fetchpatch2, fftwSinglePrec, gettext, glib, @@ -109,6 +110,21 @@ stdenv.mkDerivation (finalAttrs: { ++ lib.optional withZitaConvolver zita-convolver ++ lib.optional withZitaResampler zita-resampler; + patchFlags = [ "-p2" ]; + patches = [ + # Remove the mandatory check for `boost_system` which was removed in boost 1.89 + (fetchpatch2 { + name = "make-boost-system-stub-optional.patch"; + url = "https://github.com/brummer10/guitarix/compare/v0.47.0..187670358ffc47a0fa09e140586b2e88dfdcf043.patch?full_index=1"; + hash = "sha256-9Z0sAM/oTm3ejv9chDbXEpkjNvlX/SN+k48XaJTqdy0="; + includes = [ + "trunk/waf" + "*/wscript" + "trunk/waftools/*.py" + ]; + }) + ]; + # There are many bad shebangs which can fail builds. # See `https://github.com/brummer10/guitarix/issues/246`. postPatch = ''