From 3f8bf41b9378129f1cc9a6c2ac5edb08ffeadfc9 Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Fri, 22 Nov 2024 15:55:48 +0100 Subject: [PATCH 1/3] dexed: unstable-2022-07-09 -> 0.9.8 --- pkgs/applications/audio/dexed/default.nix | 38 +++++++++++------------ pkgs/top-level/all-packages.nix | 5 +-- 2 files changed, 20 insertions(+), 23 deletions(-) diff --git a/pkgs/applications/audio/dexed/default.nix b/pkgs/applications/audio/dexed/default.nix index 46cdb937f75e..81ee3e11e60e 100644 --- a/pkgs/applications/audio/dexed/default.nix +++ b/pkgs/applications/audio/dexed/default.nix @@ -1,6 +1,7 @@ { stdenv , lib , fetchFromGitHub +, gitUpdater , cmake , pkg-config , libX11 @@ -11,32 +12,35 @@ , freetype , alsa-lib , libjack2 -, Accelerate -, Cocoa -, WebKit -, MetalKit -, simd -, DiscRecording -, CoreAudioKit +, apple-sdk_11 }: stdenv.mkDerivation rec { pname = "dexed"; - version = "unstable-2022-07-09"; + version = "0.9.8"; src = fetchFromGitHub { owner = "asb2m10"; repo = "dexed"; - rev = "2c036316bcd512818aa9cc8129767ad9e0ec7132"; + rev = "refs/tags/v${version}"; fetchSubmodules = true; - hash = "sha256-6buvA72YRlGjHWLPEZMr45lYYG6ZY+IWmylcHruX27g="; + hash = "sha256-mXr1KGzA+DF2dEgAJE4lpnefPqO8pqfnKa43vyjSJgU="; }; postPatch = '' - # needs special setup on Linux, dunno if it can work on Darwin - sed -i -e '/juce::juce_recommended_lto_flags/d' Source/CMakeLists.txt + substituteInPlace CMakeLists.txt \ + --replace-fail 'set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64" CACHE INTERNAL "")' '# Not forcing output archs' + + substituteInPlace Source/CMakeLists.txt \ + --replace-fail 'COPY_PLUGIN_AFTER_BUILD TRUE' 'COPY_PLUGIN_AFTER_BUILD FALSE' + '' + lib.optionalString stdenv.hostPlatform.isLinux '' + # LTO needs special setup on Linux + substituteInPlace Source/CMakeLists.txt \ + --replace-fail 'juce::juce_recommended_lto_flags' '# Not forcing LTO' ''; + strictDeps = true; + nativeBuildInputs = [ cmake pkg-config @@ -52,13 +56,7 @@ stdenv.mkDerivation rec { alsa-lib libjack2 ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ - Accelerate - Cocoa - WebKit - MetalKit - simd - DiscRecording - CoreAudioKit + apple-sdk_11 ]; # JUCE insists on only dlopen'ing these @@ -97,6 +95,8 @@ stdenv.mkDerivation rec { runHook postInstall ''; + passthru.updateScript = gitUpdater { rev-prefix = "v"; }; + meta = with lib; { description = "DX7 FM multi platform/multi format plugin"; mainProgram = "Dexed"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e4bd8afa3cfd..61b8c8c61e62 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -13739,10 +13739,7 @@ with pkgs; droopy = python3Packages.callPackage ../applications/networking/droopy { }; - dexed = darwin.apple_sdk_11_0.callPackage ../applications/audio/dexed { - inherit (darwin.apple_sdk_11_0.frameworks) Accelerate Cocoa WebKit MetalKit DiscRecording CoreAudioKit; - inherit (darwin.apple_sdk_11_0.libs) simd; - }; + dexed = callPackage ../applications/audio/dexed { }; dwl = callPackage ../by-name/dw/dwl/package.nix { wlroots = wlroots_0_18; From 4ffa98835d06b9f52a405c6dc48c924a7ce34c04 Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Fri, 22 Nov 2024 15:59:38 +0100 Subject: [PATCH 2/3] dexed: Modernise, nixfmt --- pkgs/applications/audio/dexed/default.nix | 148 ++++++++++++---------- 1 file changed, 82 insertions(+), 66 deletions(-) diff --git a/pkgs/applications/audio/dexed/default.nix b/pkgs/applications/audio/dexed/default.nix index 81ee3e11e60e..0e2479517cfe 100644 --- a/pkgs/applications/audio/dexed/default.nix +++ b/pkgs/applications/audio/dexed/default.nix @@ -1,43 +1,46 @@ -{ stdenv -, lib -, fetchFromGitHub -, gitUpdater -, cmake -, pkg-config -, libX11 -, libXrandr -, libXinerama -, libXext -, libXcursor -, freetype -, alsa-lib -, libjack2 -, apple-sdk_11 +{ + stdenv, + lib, + fetchFromGitHub, + gitUpdater, + cmake, + pkg-config, + libX11, + libXrandr, + libXinerama, + libXext, + libXcursor, + freetype, + alsa-lib, + libjack2, + apple-sdk_11, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "dexed"; version = "0.9.8"; src = fetchFromGitHub { owner = "asb2m10"; repo = "dexed"; - rev = "refs/tags/v${version}"; + rev = "refs/tags/v${finalAttrs.version}"; fetchSubmodules = true; hash = "sha256-mXr1KGzA+DF2dEgAJE4lpnefPqO8pqfnKa43vyjSJgU="; }; - postPatch = '' - substituteInPlace CMakeLists.txt \ - --replace-fail 'set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64" CACHE INTERNAL "")' '# Not forcing output archs' + postPatch = + '' + substituteInPlace CMakeLists.txt \ + --replace-fail 'set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64" CACHE INTERNAL "")' '# Not forcing output archs' - substituteInPlace Source/CMakeLists.txt \ - --replace-fail 'COPY_PLUGIN_AFTER_BUILD TRUE' 'COPY_PLUGIN_AFTER_BUILD FALSE' - '' + lib.optionalString stdenv.hostPlatform.isLinux '' + substituteInPlace Source/CMakeLists.txt \ + --replace-fail 'COPY_PLUGIN_AFTER_BUILD TRUE' 'COPY_PLUGIN_AFTER_BUILD FALSE' + '' # LTO needs special setup on Linux - substituteInPlace Source/CMakeLists.txt \ - --replace-fail 'juce::juce_recommended_lto_flags' '# Not forcing LTO' - ''; + + lib.optionalString stdenv.hostPlatform.isLinux '' + substituteInPlace Source/CMakeLists.txt \ + --replace-fail 'juce::juce_recommended_lto_flags' '# Not forcing LTO' + ''; strictDeps = true; @@ -46,18 +49,18 @@ stdenv.mkDerivation rec { pkg-config ]; - buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ - libX11 - libXext - libXcursor - libXinerama - libXrandr - freetype - alsa-lib - libjack2 - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ - apple-sdk_11 - ]; + buildInputs = + lib.optionals stdenv.hostPlatform.isLinux [ + libX11 + libXext + libXcursor + libXinerama + libXrandr + freetype + alsa-lib + libjack2 + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ apple-sdk_11 ]; # JUCE insists on only dlopen'ing these NIX_LDFLAGS = lib.optionalString stdenv.hostPlatform.isLinux (toString [ @@ -69,40 +72,53 @@ stdenv.mkDerivation rec { "-ljack" ]); - installPhase = let - vst3Dir = if stdenv.hostPlatform.isDarwin then "$out/Library/Audio/Plug-Ins/VST3" else "$out/lib/vst3"; - # this one's a guess, don't know where ppl have agreed to put them yet - clapDir = if stdenv.hostPlatform.isDarwin then "$out/Library/Audio/Plug-Ins/CLAP" else "$out/lib/clap"; - auDir = "$out/Library/Audio/Plug-Ins/Components"; - in '' - runHook preInstall + installPhase = + let + vst3Dir = + if stdenv.hostPlatform.isDarwin then "$out/Library/Audio/Plug-Ins/VST3" else "$out/lib/vst3"; + # this one's a guess, don't know where ppl have agreed to put them yet + clapDir = + if stdenv.hostPlatform.isDarwin then "$out/Library/Audio/Plug-Ins/CLAP" else "$out/lib/clap"; + auDir = "$out/Library/Audio/Plug-Ins/Components"; + in + '' + runHook preInstall - '' + (if stdenv.hostPlatform.isDarwin then '' - mkdir -p $out/{Applications,bin} - mv Source/Dexed_artefacts/Release/Standalone/Dexed.app $out/Applications/ - ln -s $out/{Applications/Dexed.app/Contents/MacOS,bin}/Dexed - '' else '' - install -Dm755 {Source/Dexed_artefacts/Release/Standalone,$out/bin}/Dexed - '') + '' - mkdir -p ${vst3Dir} ${clapDir} - mv Source/Dexed_artefacts/Release/VST3/* ${vst3Dir} - mv Source/Dexed_artefacts/Release/CLAP/* ${clapDir} - '' + lib.optionalString stdenv.hostPlatform.isDarwin '' - mkdir -p ${auDir} - mv Source/Dexed_artefacts/Release/AU/* ${auDir} - '' + '' + '' + + ( + if stdenv.hostPlatform.isDarwin then + '' + mkdir -p $out/{Applications,bin} + mv Source/Dexed_artefacts/Release/Standalone/Dexed.app $out/Applications/ + ln -s $out/{Applications/Dexed.app/Contents/MacOS,bin}/Dexed + '' + else + '' + install -Dm755 {Source/Dexed_artefacts/Release/Standalone,$out/bin}/Dexed + '' + ) + + '' + mkdir -p ${vst3Dir} ${clapDir} + mv Source/Dexed_artefacts/Release/VST3/* ${vst3Dir} + mv Source/Dexed_artefacts/Release/CLAP/* ${clapDir} + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + mkdir -p ${auDir} + mv Source/Dexed_artefacts/Release/AU/* ${auDir} + '' + + '' - runHook postInstall - ''; + runHook postInstall + ''; passthru.updateScript = gitUpdater { rev-prefix = "v"; }; - meta = with lib; { + meta = { description = "DX7 FM multi platform/multi format plugin"; mainProgram = "Dexed"; homepage = "https://asb2m10.github.io/dexed"; - license = licenses.gpl3Only; - platforms = platforms.all; - maintainers = with maintainers; [ OPNA2608 ]; + license = lib.licenses.gpl3Only; + platforms = lib.platforms.all; + maintainers = with lib.maintainers; [ OPNA2608 ]; }; -} +}) From fbc630fc15b1efa9e78e0c77542efb45ae63eb88 Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Fri, 22 Nov 2024 16:07:13 +0100 Subject: [PATCH 3/3] dexed: Move to pkgs/by-name --- .../audio/dexed/default.nix => by-name/de/dexed/package.nix} | 0 pkgs/top-level/all-packages.nix | 2 -- 2 files changed, 2 deletions(-) rename pkgs/{applications/audio/dexed/default.nix => by-name/de/dexed/package.nix} (100%) diff --git a/pkgs/applications/audio/dexed/default.nix b/pkgs/by-name/de/dexed/package.nix similarity index 100% rename from pkgs/applications/audio/dexed/default.nix rename to pkgs/by-name/de/dexed/package.nix diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 61b8c8c61e62..5b024c6296d6 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -13739,8 +13739,6 @@ with pkgs; droopy = python3Packages.callPackage ../applications/networking/droopy { }; - dexed = callPackage ../applications/audio/dexed { }; - dwl = callPackage ../by-name/dw/dwl/package.nix { wlroots = wlroots_0_18; };