From 421d2bcc851e97b728563a70ec18ad1fd59e82ff Mon Sep 17 00:00:00 2001 From: Bart Brouns Date: Fri, 23 Jan 2026 01:08:16 +0100 Subject: [PATCH] filtr: init at 1.1.0 --- pkgs/by-name/fi/filtr/package.nix | 95 +++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 pkgs/by-name/fi/filtr/package.nix diff --git a/pkgs/by-name/fi/filtr/package.nix b/pkgs/by-name/fi/filtr/package.nix new file mode 100644 index 000000000000..07d318c5ae7f --- /dev/null +++ b/pkgs/by-name/fi/filtr/package.nix @@ -0,0 +1,95 @@ +{ + lib, + stdenv, + fetchFromGitHub, + cmake, + pkg-config, + alsa-lib, + fontconfig, + freetype, + libX11, + libXcomposite, + libXcursor, + libXdmcp, + libXext, + libXinerama, + libXrandr, + libXtst, + writableTmpDirAsHomeHook, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "filtr"; + version = "1.1.0"; + + src = fetchFromGitHub { + owner = "tiagolr"; + repo = "filtr"; + tag = "v${finalAttrs.version}"; + fetchSubmodules = true; + hash = "sha256-LRVwJ/Eh+XeNGnlbd2c56hWV8StHZGhxy0XLjGZ0toY="; + }; + + nativeBuildInputs = [ + cmake + pkg-config + writableTmpDirAsHomeHook # fontconfig cache + ]; + + buildInputs = [ + fontconfig + freetype + ] + ++ lib.optionals stdenv.isLinux [ + alsa-lib + libX11 + libXcomposite + libXcursor + libXdmcp + libXext + libXinerama + libXrandr + libXtst + ]; + + enableParallelBuilding = true; + + cmakeFlags = [ + (lib.cmakeBool "COPY_PLUGIN_AFTER_BUILD" false) + (lib.cmakeFeature "BUILD_STANDALONE" "OFF") + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "-DCMAKE_OSX_ARCHITECTURES=${stdenv.hostPlatform.darwinArch}" + ]; + + env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isLinux (toString [ + # juce, compiled in this build as part of a Git submodule, uses `-flto` as + # a Link Time Optimization flag, and instructs the plugin compiled here to + # use this flag to. This breaks the build for us. Using _fat_ LTO allows + # successful linking while still providing LTO benefits. If our build of + # `juce` was used as a dependency, we could have patched that `-flto` line + # in our juce's source, but that is not possible because it is used as a + # Git Submodule. + "-ffat-lto-objects" + ]); + + installPhase = '' + runHook preInstall + + mkdir -p $out/lib/vst3 $out/lib/lv2 + + cp -r "FILTR_artefacts/Release/LV2/FILT-R.lv2" $out/lib/lv2 + cp -r "FILTR_artefacts/Release/VST3/FILT-R.vst3" $out/lib/vst3 + + runHook postInstall + ''; + + meta = { + description = "Envelope based filter modulator"; + homepage = "https://github.com/tiagolr/filtr"; + changelog = "https://github.com/tiagolr/filtr/releases/tag/v${finalAttrs.version}"; + license = lib.licenses.gpl3Plus; + maintainers = with lib.maintainers; [ magnetophon ]; + platforms = lib.platforms.all; + }; +})