fire: 1.0.1-unstable-2025-03-12 -> 1.0.2-unstable-2025-07-05

This commit is contained in:
OPNA2608 2025-08-03 17:45:25 +02:00
parent f635b72b9a
commit b37ad4281b

View File

@ -1,10 +1,13 @@
{ {
stdenv, stdenv,
lib, lib,
fetchurl,
fetchFromGitHub, fetchFromGitHub,
runCommand,
unstableGitUpdater, unstableGitUpdater,
catch2_3, catch2_3,
cmake, cmake,
fontconfig,
pkg-config, pkg-config,
libX11, libX11,
libXrandr, libXrandr,
@ -13,36 +16,102 @@
libXcursor, libXcursor,
freetype, freetype,
alsa-lib, alsa-lib,
# Only able to test this myself in Linux
withStandalone ? stdenv.hostPlatform.isLinux,
}: }:
let
# Required version, base URL and expected location specified in cmake/CPM.cmake
cpmDownloadVersion = "0.40.2";
cpmSrc = fetchurl {
url = "https://github.com/cpm-cmake/CPM.cmake/releases/download/v${cpmDownloadVersion}/CPM.cmake";
hash = "sha256-yM3DLAOBZTjOInge1ylk3IZLKjSjENO3EEgSpcotg10=";
};
cpmSourceCache = runCommand "cpm-source-cache" { } ''
mkdir -p $out/cpm
ln -s ${cpmSrc} $out/cpm/CPM_${cpmDownloadVersion}.cmake
'';
pathMappings = [
{
from = "LV2";
to = "${placeholder "out"}/${
if stdenv.hostPlatform.isDarwin then "Library/Audio/Plug-Ins/LV2" else "lib/lv2"
}";
}
{
from = "VST3";
to = "${placeholder "out"}/${
if stdenv.hostPlatform.isDarwin then "Library/Audio/Plug-Ins/VST3" else "lib/vst3"
}";
}
# this one's a guess, don't know where ppl have agreed to put them yet
{
from = "CLAP";
to = "${placeholder "out"}/${
if stdenv.hostPlatform.isDarwin then "Library/Audio/Plug-Ins/CLAP" else "lib/clap"
}";
}
]
++ lib.optionals withStandalone [
{
from = "Standalone";
to = "${placeholder "out"}/bin";
}
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
# Audio Unit is a macOS-specific thing
{
from = "AU";
to = "${placeholder "out"}/Library/Audio/Plug-Ins/Components";
}
];
x11Libs = [
libX11
libXrandr
libXinerama
libXext
libXcursor
];
in
stdenv.mkDerivation (finalAttrs: { stdenv.mkDerivation (finalAttrs: {
pname = "fire"; pname = "fire";
version = "1.0.1-unstable-2025-03-12"; version = "1.0.2-unstable-2025-07-05";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "jerryuhoo"; owner = "jerryuhoo";
repo = "Fire"; repo = "Fire";
rev = "b7ded116ce7ab78a57bb9b6b61796cb2cf3a6e8b"; rev = "a0553c6fcced4919871771da3add390e931e29de";
fetchSubmodules = true; fetchSubmodules = true;
hash = "sha256-d8w+b4OpU2/kQdcAimR4ihDEgVTM1V7J0hj7saDrQpY="; hash = "sha256-bHqWP3EZQg42OBi44Z1RvkIB2Ou0dDxgBLcidgxaMU8=";
}; };
postPatch = '' postPatch =
# Disable automatic copying of built plugins during buildPhase, it defaults let
# into user home and we want to have building & installing separated. formatsListing = lib.strings.concatMapStringsSep " " (entry: entry.from) pathMappings;
substituteInPlace CMakeLists.txt \ in
--replace-fail 'COPY_PLUGIN_AFTER_BUILD TRUE' 'COPY_PLUGIN_AFTER_BUILD FALSE' ''
'' # Allow all the formats we can handle
+ lib.optionalString stdenv.hostPlatform.isLinux '' # Set LV2URI again for LV2 build
# Remove hardcoded LTO flags: needs extra setup on Linux # Disable automatic copying of built plugins during buildPhase, it defaults
substituteInPlace CMakeLists.txt \ # into user home and we want to have building & installing separated.
--replace-fail 'juce::juce_recommended_lto_flags' '# Not forcing LTO' substituteInPlace CMakeLists.txt \
'' --replace-fail 'set(FORMATS' 'set(FORMATS ${formatsListing}) #' \
+ lib.optionalString (!finalAttrs.finalPackage.doCheck) '' --replace-fail 'BUNDLE_ID "''${BUNDLE_ID}"' 'BUNDLE_ID "''${BUNDLE_ID}" LV2URI "https://www.bluewingsmusic.com/Fire/"' \
substituteInPlace CMakeLists.txt \ --replace-fail 'COPY_PLUGIN_AFTER_BUILD TRUE' 'COPY_PLUGIN_AFTER_BUILD FALSE'
--replace-fail 'include(Tests)' '# Not building tests' \ ''
--replace-fail 'include(Benchmarks)' '# Not building benchmark test' + lib.optionalString stdenv.hostPlatform.isLinux ''
''; # Remove hardcoded LTO flags: needs extra setup on Linux
substituteInPlace CMakeLists.txt \
--replace-fail 'juce::juce_recommended_lto_flags' '# Not forcing LTO'
''
+ lib.optionalString (!finalAttrs.finalPackage.doCheck) ''
substituteInPlace CMakeLists.txt \
--replace-fail 'include(Tests)' '# Not building tests' \
--replace-fail 'include(Benchmarks)' '# Not building benchmark test'
'';
strictDeps = true; strictDeps = true;
@ -51,74 +120,55 @@ stdenv.mkDerivation (finalAttrs: {
pkg-config pkg-config
]; ];
buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ buildInputs = [
libX11 catch2_3
libXrandr fontconfig
libXinerama ]
libXext ++ lib.optionals stdenv.hostPlatform.isLinux (
libXcursor x11Libs
freetype ++ [
alsa-lib freetype
]; alsa-lib
]
);
cmakeFlags = [ cmakeFlags = [
(lib.cmakeBool "FETCHCONTENT_FULLY_DISCONNECTED" true) (lib.cmakeFeature "CPM_SOURCE_CACHE" "${cpmSourceCache}")
(lib.cmakeFeature "FETCHCONTENT_SOURCE_DIR_CATCH2" "${catch2_3.src}") (lib.cmakeBool "CPM_LOCAL_PACKAGES_ONLY" true)
(lib.cmakeFeature "Catch2_SOURCE_DIR" "${catch2_3.src}")
]; ];
installPhase = installPhase = ''
let runHook preInstall
pathMappings = [
{
from = "LV2";
to = "${placeholder "out"}/${
if stdenv.hostPlatform.isDarwin then "Library/Audio/Plug-Ins/LV2" else "lib/lv2"
}";
}
{
from = "VST3";
to = "${placeholder "out"}/${
if stdenv.hostPlatform.isDarwin then "Library/Audio/Plug-Ins/VST3" else "lib/vst3"
}";
}
# this one's a guess, don't know where ppl have agreed to put them yet
{
from = "CLAP";
to = "${placeholder "out"}/${
if stdenv.hostPlatform.isDarwin then "Library/Audio/Plug-Ins/CLAP" else "lib/clap"
}";
}
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
{
from = "AU";
to = "${placeholder "out"}/Library/Audio/Plug-Ins/Components";
}
];
in
''
runHook preInstall
'' ''
+ lib.strings.concatMapStringsSep "\n" (entry: '' + lib.strings.concatMapStringsSep "\n" (entry: ''
mkdir -p ${entry.to} mkdir -p ${entry.to}
# Exact path of the build artefact depends on used CMAKE_BUILD_TYPE # Exact path of the build artefact depends on used CMAKE_BUILD_TYPE
cp -r Fire_artefacts/*/${entry.from}/* ${entry.to}/ cp -r -t ${entry.to} Fire_artefacts/${finalAttrs.cmakeBuildType or "Release"}/${entry.from}/*
'') pathMappings '') pathMappings
+ '' + ''
runHook postInstall runHook postInstall
''; '';
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
# Standalone dlopen's X11 libraries
postFixup = lib.strings.optionalString (withStandalone && stdenv.hostPlatform.isLinux) ''
patchelf --add-rpath ${lib.makeLibraryPath x11Libs} $out/bin/Fire
'';
passthru.updateScript = unstableGitUpdater { tagPrefix = "v"; }; passthru.updateScript = unstableGitUpdater { tagPrefix = "v"; };
meta = { meta = {
description = "Multi-band distortion plugin by Wings"; description = "Multi-band distortion plugin by Wings";
homepage = "https://github.com/jerryuhoo/Fire"; homepage = "https://www.bluewingsmusic.com/Fire";
license = lib.licenses.agpl3Only; # Not clarified if Only or Plus license = lib.licenses.agpl3Only; # Not clarified if Only or Plus
platforms = lib.platforms.unix; platforms = lib.platforms.unix;
maintainers = with lib.maintainers; [ OPNA2608 ]; maintainers = with lib.maintainers; [ OPNA2608 ];
}
// lib.optionalAttrs withStandalone {
mainProgram = "Fire";
}; };
}) })