Merge pull request #177819 from ddelabru/update-vcv-to-v2

vcv-rack: 1.1.6 -> 2.0.6

authored by Doron Behar and committed by GitHub a7a11f98 736edbba

+156 -45
+146 -34
pkgs/applications/audio/vcv-rack/default.nix
··· 1 - { lib, stdenv, makeWrapper, fetchzip, fetchFromGitHub, pkg-config 2 - , alsa-lib, curl, glew, glfw, gtk2-x11, jansson, libjack2, libXext, libXi 3 - , libzip, rtaudio, rtmidi, speex, libsamplerate }: 4 5 let 6 # The package repo vendors some of the package dependencies as submodules. 7 - # Others are downloaded with `make deps`. Due to previous issues with the 8 - # `glfw` submodule (see above) and because we can not access the network when 9 - # building in a sandbox, we fetch the dependency source manually. 10 - pfft-source = fetchzip { 11 - url = "https://vcvrack.com/downloads/dep/pffft.zip"; 12 - sha256 = "084csgqa6f1a270bhybjayrh3mpyi2jimc87qkdgsqcp8ycsx1l1"; 13 }; 14 nanovg-source = fetchFromGitHub { 15 - owner = "memononen"; 16 repo = "nanovg"; 17 - rev = "1f9c8864fc556a1be4d4bf1d6bfe20cde25734b4"; 18 - sha256 = "08r15zrr6p1kxigxzxrg5rgya7wwbdx7d078r362qbkmws83wk27"; 19 }; 20 nanosvg-source = fetchFromGitHub { 21 owner = "memononen"; 22 repo = "nanosvg"; 23 - rev = "25241c5a8f8451d41ab1b02ab2d865b01600d949"; 24 - sha256 = "114qgfmazsdl53rm4pgqif3gv8msdmfwi91lyc2jfadgzfd83xkg"; 25 }; 26 osdialog-source = fetchFromGitHub { 27 owner = "AndrewBelt"; 28 repo = "osdialog"; 29 - rev = "e5db5de6444f4b2c4e1390c67b3efd718080c3da"; 30 - sha256 = "0iqxn1md053nl19hbjk8rqsdcmjwa5l5z0ci4fara77q43rc323i"; 31 }; 32 oui-blendish-source = fetchFromGitHub { 33 owner = "AndrewBelt"; 34 repo = "oui-blendish"; 35 - rev = "79ec59e6bc7201017fc13a20c6e33380adca1660"; 36 - sha256 = "17kd0lh2x3x12bxkyhq6z8sg6vxln8m9qirf0basvcsmylr6rb64"; 37 }; 38 in 39 - with lib; stdenv.mkDerivation rec { 40 pname = "VCV-Rack"; 41 - version = "1.1.6"; 42 43 src = fetchFromGitHub { 44 owner = "VCVRack"; 45 repo = "Rack"; 46 rev = "v${version}"; 47 - sha256 = "0ji64prr74qzxf5bx1sw022kbslx9nzll16lmk5in78hbl137b3i"; 48 }; 49 50 patches = [ ··· 56 # above), we do it here manually 57 mkdir -p dep/include 58 59 - cp -r ${pfft-source} dep/jpommier-pffft-source 60 cp -r ${nanovg-source}/* dep/nanovg 61 cp -r ${nanosvg-source}/* dep/nanosvg 62 cp -r ${osdialog-source}/* dep/osdialog 63 cp -r ${oui-blendish-source}/* dep/oui-blendish 64 65 - cp dep/jpommier-pffft-source/*.h dep/include 66 cp dep/nanosvg/**/*.h dep/include 67 cp dep/nanovg/src/*.h dep/include 68 cp dep/osdialog/*.h dep/include 69 cp dep/oui-blendish/*.h dep/include 70 71 - substituteInPlace include/audio.hpp --replace "<RtAudio.h>" "<rtaudio/RtAudio.h>" 72 - substituteInPlace compile.mk --replace "-march=nocona" "" 73 ''; 74 75 enableParallelBuilding = true; 76 77 - nativeBuildInputs = [ makeWrapper pkg-config ]; 78 - buildInputs = [ alsa-lib curl glew glfw gtk2-x11 jansson libjack2 libsamplerate libzip rtaudio rtmidi speex ]; 79 80 - buildFlags = [ "Rack" ]; 81 82 installPhase = '' 83 install -D -m755 -t $out/bin Rack 84 85 mkdir -p $out/share/vcv-rack 86 - cp -r res Core.json template.vcv LICENSE* cacert.pem $out/share/vcv-rack 87 88 - # Override the default global resource file directory 89 - wrapProgram $out/bin/Rack --add-flags "-s $out/share/vcv-rack" 90 ''; 91 92 meta = with lib; { 93 description = "Open-source virtual modular synthesizer"; 94 homepage = "https://vcvrack.com/"; 95 - # The source is BSD-3 licensed, some of the art is CC-BY-NC 4.0 or under a 96 # no-derivatives clause 97 - license = with licenses; [ bsd3 cc-by-nc-40 unfreeRedistributable ]; 98 - maintainers = with maintainers; [ moredread nathyong ]; 99 platforms = platforms.linux; 100 }; 101 }
··· 1 + { alsa-lib 2 + , copyDesktopItems 3 + , curl 4 + , fetchFromBitbucket 5 + , fetchFromGitHub 6 + , fetchzip 7 + , ghc_filesystem 8 + , glew 9 + , glfw 10 + , gnome 11 + , gtk3-x11 12 + , imagemagick 13 + , jansson 14 + , jq 15 + , lib 16 + , libarchive 17 + , libicns 18 + , libjack2 19 + , libpulseaudio 20 + , libsamplerate 21 + , libXext 22 + , libXi 23 + , makeDesktopItem 24 + , makeWrapper 25 + , pkg-config 26 + , rtaudio 27 + , rtmidi 28 + , speex 29 + , stdenv 30 + , wrapGAppsHook 31 + , zstd 32 + }: 33 34 let 35 # The package repo vendors some of the package dependencies as submodules. 36 + # Unfortunately, they are not pinned, so we have no guarantee that they 37 + # will be stable, and therefore, we can't use them directly. Instead 38 + # we'll have to fetch them separately ourselves. 39 + pffft-source = fetchFromBitbucket { 40 + owner = "jpommier"; 41 + repo = "pffft"; 42 + rev = "988259a41d1522047a9420e6265a6ba8289c1654"; 43 + sha256 = "Oq5N02UNXsbhcPUfjMtD0cgqAZsGx9ke9A+ArrenzGE="; 44 + }; 45 + fuzzysearchdatabase-source = fetchFromBitbucket { 46 + owner = "j_norberg"; 47 + repo = "fuzzysearchdatabase"; 48 + rev = "fe62479811e503ef3c091f5a859d27bfcf0a44da"; 49 + sha256 = "zgeUzuuInHPeveBIjlivRGIz+NSb7cW/9hMndxm6qOA="; 50 }; 51 nanovg-source = fetchFromGitHub { 52 + owner = "VCVRack"; 53 repo = "nanovg"; 54 + rev = "0bebdb314aff9cfa28fde4744bcb037a2b3fd756"; 55 + sha256 = "HmQhCE/zIKc3f+Zld229s5i5MWzRrBMF9gYrn8JVQzg="; 56 }; 57 nanosvg-source = fetchFromGitHub { 58 owner = "memononen"; 59 repo = "nanosvg"; 60 + rev = "ccdb1995134d340a93fb20e3a3d323ccb3838dd0"; 61 + sha256 = "ymziU0NgGqxPOKHwGm0QyEdK/8jL/QYk5UdIQ3Tn8jw="; 62 }; 63 osdialog-source = fetchFromGitHub { 64 owner = "AndrewBelt"; 65 repo = "osdialog"; 66 + rev = "21b9dcc2a1bbdacb9b46da477ffd82a4ce9204b9"; 67 + sha256 = "+4VCBuQvfiuEUdjFu3IB2FwbHFrDJXTb4vcVg6ZFwSM="; 68 }; 69 oui-blendish-source = fetchFromGitHub { 70 owner = "AndrewBelt"; 71 repo = "oui-blendish"; 72 + rev = "2fc6405883f8451944ed080547d073c8f9f31898"; 73 + sha256 = "/QZFZuI5kSsEvSfMJlcqB1HiZ9Vcf3vqLqWIMEgxQK8="; 74 + }; 75 + fundamental-source = fetchFromGitHub { 76 + owner = "VCVRack"; 77 + repo = "Fundamental"; 78 + rev = "533397cdcad5c6401ebd3937d6c1663de2473627"; # tip of branch v2 79 + sha256 = "QnwOgrYxiCa/7t/u6F63Ks8C9E8k6T+hia4JZFhp1LI="; 80 }; 81 in 82 + stdenv.mkDerivation rec { 83 pname = "VCV-Rack"; 84 + version = "2.0.6"; 85 + 86 + desktopItems = [ 87 + (makeDesktopItem { 88 + type = "Application"; 89 + name = pname; 90 + desktopName = "VCV Rack"; 91 + genericName = "Eurorack simulator"; 92 + comment = "Create music by patching together virtual synthesizer modules"; 93 + exec = "Rack"; 94 + icon = "Rack"; 95 + categories = [ "AudioVideo" "AudioVideoEditing" "Audio" ]; 96 + keywords = [ "music" ]; 97 + }) 98 + ]; 99 100 src = fetchFromGitHub { 101 owner = "VCVRack"; 102 repo = "Rack"; 103 rev = "v${version}"; 104 + sha256 = "vvGx8tnE7gMiboVUTywIzBB1q/IfiJ8TPnSHvmfHUQg="; 105 }; 106 107 patches = [ ··· 113 # above), we do it here manually 114 mkdir -p dep/include 115 116 + cp -r ${pffft-source}/* dep/pffft 117 + cp -r ${fuzzysearchdatabase-source}/* dep/fuzzysearchdatabase 118 cp -r ${nanovg-source}/* dep/nanovg 119 cp -r ${nanosvg-source}/* dep/nanosvg 120 cp -r ${osdialog-source}/* dep/osdialog 121 cp -r ${oui-blendish-source}/* dep/oui-blendish 122 123 + cp dep/pffft/*.h dep/include 124 + cp dep/fuzzysearchdatabase/src/*.hpp dep/include 125 cp dep/nanosvg/**/*.h dep/include 126 cp dep/nanovg/src/*.h dep/include 127 cp dep/osdialog/*.h dep/include 128 cp dep/oui-blendish/*.h dep/include 129 130 + # Build and dist the Fundamental plugins 131 + cp -r ${fundamental-source} plugins/Fundamental/ 132 + chmod -R +rw plugins/Fundamental # will be used as build dir 133 + substituteInPlace plugin.mk --replace ":= all" ":= dist" 134 + 135 + # Fix reference to zenity 136 + substituteInPlace dep/osdialog/osdialog_zenity.c \ 137 + --replace 'zenityBin[] = "zenity"' 'zenityBin[] = "${gnome.zenity}/bin/zenity"' 138 ''; 139 140 enableParallelBuilding = true; 141 142 + nativeBuildInputs = [ 143 + copyDesktopItems 144 + imagemagick 145 + jq 146 + libicns 147 + makeWrapper 148 + pkg-config 149 + wrapGAppsHook 150 + ]; 151 + buildInputs = [ 152 + alsa-lib 153 + curl 154 + ghc_filesystem 155 + glew 156 + glfw 157 + gnome.zenity 158 + gtk3-x11 159 + jansson 160 + libarchive 161 + libjack2 162 + libpulseaudio 163 + libsamplerate 164 + rtaudio 165 + rtmidi 166 + speex 167 + zstd 168 + ]; 169 170 + makeFlags = [ "all" "plugins" ]; 171 172 installPhase = '' 173 + runHook preInstall 174 + 175 install -D -m755 -t $out/bin Rack 176 + install -D -m755 -t $out/lib libRack.so 177 178 mkdir -p $out/share/vcv-rack 179 + cp -r res cacert.pem Core.json template.vcv LICENSE-GPLv3.txt $out/share/vcv-rack 180 + cp -r plugins/Fundamental/dist/Fundamental-*.vcvplugin $out/share/vcv-rack/Fundamental.vcvplugin 181 + 182 + # Extract pngs from the Apple icon image and create 183 + # the missing ones from the 1024x1024 image. 184 + icns2png --extract icon.icns 185 + for size in 16 24 32 48 64 128 256 512 1024; do 186 + mkdir -pv $out/share/icons/hicolor/"$size"x"$size"/apps 187 + if [ ! -e icon_"$size"x"$size"x32.png ] ; then 188 + convert -resize "$size"x"$size" icon_1024x1024x32.png icon_"$size"x"$size"x32.png 189 + fi 190 + install -Dm644 icon_"$size"x"$size"x32.png $out/share/icons/hicolor/"$size"x"$size"/apps/Rack.png 191 + done; 192 193 + runHook postInstall 194 + ''; 195 + 196 + dontWrapGApps = true; 197 + postFixup = '' 198 + # Wrap gApp and override the default global resource file directory 199 + wrapProgram $out/bin/Rack \ 200 + "''${gappsWrapperArgs[@]}" \ 201 + --add-flags "-s $out/share/vcv-rack" 202 ''; 203 204 meta = with lib; { 205 description = "Open-source virtual modular synthesizer"; 206 homepage = "https://vcvrack.com/"; 207 + # The source is GPL3+ licensed, some of the art is CC-BY-NC 4.0 or under a 208 # no-derivatives clause 209 + license = with licenses; [ gpl3Plus cc-by-nc-40 unfreeRedistributable ]; 210 + maintainers = with maintainers; [ nathyong jpotier ddelabru ]; 211 platforms = platforms.linux; 212 }; 213 }
+10 -11
pkgs/applications/audio/vcv-rack/rack-minimize-vendoring.patch
··· 1 diff -ru a/Makefile b/Makefile 2 - --- a/Makefile 1970-01-01 01:00:01.000000000 +0100 3 - +++ b/Makefile 1970-01-01 01:00:01.000000000 +0100 4 - @@ -21,8 +21,8 @@ 5 - build/dep/osdialog/osdialog_gtk2.c.o: FLAGS += $(shell pkg-config --cflags gtk+-2.0) 6 7 - LDFLAGS += -rdynamic \ 8 - - dep/lib/libGLEW.a dep/lib/libglfw3.a dep/lib/libjansson.a dep/lib/libcurl.a dep/lib/libssl.a dep/lib/libcrypto.a dep/lib/libzip.a dep/lib/libz.a dep/lib/libspeexdsp.a dep/lib/libsamplerate.a dep/lib/librtmidi.a dep/lib/librtaudio.a \ 9 - + -lGLEW -lglfw -ljansson -lcurl -lssl -lcrypto -lzip -lz -lspeexdsp -lsamplerate -lrtmidi -lrtaudio \ 10 - -lpthread -lGL -ldl -lX11 -lasound -ljack \ 11 - $(shell pkg-config --libs gtk+-2.0) 12 - TARGET := Rack 13 - endif
··· 1 diff -ru a/Makefile b/Makefile 2 + --- a/Makefile 1970-01-01 01:00:01.000000000 +0100 3 + +++ b/Makefile 1970-01-01 01:00:01.000000000 +0100 4 + @@ -36,7 +36,7 @@ build/dep/osdialog/osdialog_gtk3.c.o: FLAGS += $(shell pkg-config --cflags gtk+- 5 6 + LDFLAGS += -Wl,--whole-archive 7 + LDFLAGS += -static-libstdc++ -static-libgcc 8 + - LDFLAGS += dep/lib/libGLEW.a dep/lib/libglfw3.a dep/lib/libjansson.a dep/lib/libcurl.a dep/lib/libssl.a dep/lib/libcrypto.a dep/lib/libarchive.a dep/lib/libzstd.a dep/lib/libspeexdsp.a dep/lib/libsamplerate.a dep/lib/librtmidi.a dep/lib/librtaudio.a 9 + + LDFLAGS += -lGLEW -lglfw -ljansson -lcurl -lssl -lcrypto -larchive -lz -lspeexdsp -lsamplerate -lrtmidi -lrtaudio 10 + LDFLAGS += -Wl,--no-whole-archive 11 + LDFLAGS += -lpthread -lGL -ldl -lX11 -lasound -ljack -lpulse -lpulse-simple 12 + LDFLAGS += $(shell pkg-config --libs gtk+-3.0)