4 , ensureNewerSourcesForZipFilesHook
20 # data copied from build system: https://build.opensuse.org/package/view_file/home:plugdata/plugdata/PlugData.desktop
21 desktopItem = makeDesktopItem {
23 desktopName = "PlugData";
25 icon = "plugdata_logo.png";
26 comment = "Pure Data as a plugin, with a new GUI";
28 categories = [ "AudioVideo" "Music" ];
31 stdenv.mkDerivation (finalAttrs: {
35 src = fetchFromGitHub {
36 owner = "plugdata-team";
38 rev = "v${finalAttrs.version}";
39 hash = "sha256-qG9fH5C42jiHj03p/KM28jmDIkJkrQMe7fxg92Lg7B4=";
40 fetchSubmodules = true;
46 ensureNewerSourcesForZipFilesHook
63 # Standard fix for JUCE programs: https://github.com/NixOS/nixpkgs/blob/5014727e62ae7b22fb1afc61d789ca6ad9170435/pkgs/applications/audio/bespokesynth/default.nix#L137
64 env.NIX_LDFLAGS = lib.optionalString stdenv.hostPlatform.isLinux "-rpath ${lib.makeLibraryPath ([
72 dontPatchELF = true; # needed or nix will try to optimize the binary by removing "useless" rpath
75 # Don't build LV2 plugin (it hangs), and don't automatically install
76 sed -i 's/ LV2 / /g' CMakeLists.txt
82 cd .. # build artifacts are placed inside the source directory for some reason
83 mkdir -p $out/{bin,lib/{clap,vst3}}
84 cp Plugins/Standalone/plugdata $out/bin
85 cp -r Plugins/CLAP/plugdata{,-fx}.clap $out/lib/clap
86 cp -r Plugins/VST3/plugdata{,-fx}.vst3 $out/lib/vst3
88 icon_name="plugdata_logo.png"
89 icon_path="Resources/Icons/$icon_name"
91 install -m644 -D "${desktopItem}"/share/applications/* -t $out/share/applications
92 for size in 16 24 32 48 64 128 256 512; do
93 mkdir -p $out/share/icons/hicolor/"$size"x"$size"/apps
94 convert -resize "$size"x"$size" "$icon_path" $out/share/icons/hicolor/"$size"x"$size"/apps/"$icon_name"
101 # Ensure zenity is available, or it won't be able to open new files.
102 # These X11 libs get dlopen'd, they cause visual bugs when unavailable.
103 wrapProgram $out/bin/plugdata \
104 --prefix PATH : '${lib.makeBinPath [
107 --prefix LD_LIBRARY_PATH : '${lib.makeLibraryPath [
116 description = "Plugin wrapper around Pure Data to allow patching in a wide selection of DAWs";
117 mainProgram = "plugdata";
118 homepage = "https://plugdata.org/";
119 license = licenses.gpl3;
120 platforms = platforms.linux;
121 maintainers = with maintainers; [ PowerUser64 ];