git.iko.soy/typeable/nixpkgs
on master help sign in
vcv-rack: Fix issues from missing upstream dependency

The revision of the glfw fork that Rack depends on has been removed from GitHub. This causes cloning of the glfw submodule for the Rack git repository to fail. As the glfw fork just adds a function that is only needed on Darwin (and we don't support that platform at the moment) we remove the function call from the Rack source. We can then use the upstream version of glfw. We fetch the rest of the submodules manually as well. See https://github.com/NixOS/nixpkgs/issues/71189 for the context.

commit03470789498a3a6b5ea4e525d06191815a0978f7 authorAndré-Patrick Bubel <code@andre-bubel.de> dateSat 19 Oct 2019, 05:57 (7 years ago) parent86ccc63
3 files changed+57−26
pkgs/applications/audio/vcv-rack/default.nix+41−13 pkgs/applications/audio/vcv-rack/glfw.patch−13 pkgs/applications/audio/vcv-rack/remove-custom-glfw-function.patch+16
pkgs/applications/audio/vcv-rack/default.nix+41−13
@@ -7,16 +7,11 @@ let
77 name = "glfw-git-${version}";
88 version = "2019-06-30";
99 src = fetchFromGitHub {
10− owner = "AndrewBelt";
10+ owner = "glfw";
1111 repo = "glfw";
12− rev = "d9ab59efc781c392128a449361a381fcc93cf6f3";
13− sha256 = "1ykkq6qq8y6j5hlfj2zp1p87kr33vwhywziprz20v5avx1q7rjm8";
12+ rev = "d25248343e248337284dfbe5ecd1eddbd37ae66d";
13+ sha256 = "0gbz353bfmqbpm0af2nqf5draz3k4f3lqwiqj68s8nwn7878aqm3";
1414 };
15− # We patch the source to export a function that was added to the glfw fork
16− # for Rack so it is present when we build glfw as a shared library.
17− # See https://github.com/AndrewBelt/glfw/pull/1 for discussion of this issue
18− # with upstream.
19− patches = [ ./glfw.patch ];
2015 buildInputs = oldAttrs.buildInputs ++ [ libXext libXi ];
2116 });
2217 pfft-source = fetchFromBitbucket {
@@ -25,6 +20,30 @@ let
2520 rev = "29e4f76ac53bef048938754f32231d7836401f79";
2621 sha256 = "084csgqa6f1a270bhybjayrh3mpyi2jimc87qkdgsqcp8ycsx1l1";
2722 };
23+ nanovg-source = fetchFromGitHub {
24+ owner = "memononen";
25+ repo = "nanovg";
26+ rev = "1f9c8864fc556a1be4d4bf1d6bfe20cde25734b4";
27+ sha256 = "08r15zrr6p1kxigxzxrg5rgya7wwbdx7d078r362qbkmws83wk27";
28+ };
29+ nanosvg-source = fetchFromGitHub {
30+ owner = "memononen";
31+ repo = "nanosvg";
32+ rev = "25241c5a8f8451d41ab1b02ab2d865b01600d949";
33+ sha256 = "114qgfmazsdl53rm4pgqif3gv8msdmfwi91lyc2jfadgzfd83xkg";
34+ };
35+ osdialog-source = fetchFromGitHub {
36+ owner = "AndrewBelt";
37+ repo = "osdialog";
38+ rev = "e5db5de6444f4b2c4e1390c67b3efd718080c3da";
39+ sha256 = "0iqxn1md053nl19hbjk8rqsdcmjwa5l5z0ci4fara77q43rc323i";
40+ };
41+ oui-blendish-source = fetchFromGitHub {
42+ owner = "AndrewBelt";
43+ repo = "oui-blendish";
44+ rev = "79ec59e6bc7201017fc13a20c6e33380adca1660";
45+ sha256 = "17kd0lh2x3x12bxkyhq6z8sg6vxln8m9qirf0basvcsmylr6rb64";
46+ };
2847in
2948with stdenv.lib; stdenv.mkDerivation rec {
3049 pname = "VCV-Rack";
@@ -34,17 +53,26 @@ with stdenv.lib; stdenv.mkDerivation rec {
3453 owner = "VCVRack";
3554 repo = "Rack";
3655 rev = "v${version}";
37− sha256 = "172v66v2vb6l9dpsq6fb6xn035igwhpjci8w3kz2na3rvmz1bc5w";
38− fetchSubmodules = true;
56+ sha256 = "1g3mkghgiycbxyvzjhanc1b10jynkfkw03bpnha06qgd6gd9wv7k";
3957 };
4058
41− patches = [ ./rack-minimize-vendoring.patch ];
59+ patches = [
60+ ./rack-minimize-vendoring.patch
61+ # We patch out a call to a custom function, that is not needed on Linux.
62+ # This avoids needing a patched version of glfw. The version we previously used disappeared
63+ # on GitHub. See https://github.com/NixOS/nixpkgs/issues/71189
64+ ./remove-custom-glfw-function.patch
65+ ];
4266
4367 prePatch = ''
44− cp -r ${pfft-source} dep/jpommier-pffft-source
45−
4668 mkdir -p dep/include
4769
70+ cp -r ${pfft-source} dep/jpommier-pffft-source
71+ cp -r ${nanovg-source}/* dep/nanovg
72+ cp -r ${nanosvg-source}/* dep/nanosvg
73+ cp -r ${osdialog-source}/* dep/osdialog
74+ cp -r ${oui-blendish-source}/* dep/oui-blendish
75+
4876 cp dep/jpommier-pffft-source/*.h dep/include
4977 cp dep/nanosvg/**/*.h dep/include
5078 cp dep/nanovg/src/*.h dep/include
pkgs/applications/audio/vcv-rack/glfw.patchdeleted−13
@@ -1,13 +0,0 @@
1−diff --git a/src/init.c b/src/init.c
2−index af4a579e..317e25b8 100644
3−--- a/src/init.c
4−+++ b/src/init.c
5−@@ -339,7 +339,7 @@ GLFWAPI GLFWerrorfun glfwSetErrorCallback(GLFWerrorfun cbfun)
6−
7− char glfwOpenedFilename[1024];
8−
9−-const char *glfwGetOpenedFilename()
10−+GLFWAPI const char *glfwGetOpenedFilename()
11− {
12− if (glfwOpenedFilename[0])
13− {
pkgs/applications/audio/vcv-rack/remove-custom-glfw-function.patchnew file+16
@@ -0,0 +1,16 @@
1+diff --git a/src/main.cpp b/src/main.cpp
2+index 0954ae6..a8299f7 100644
3+--- a/src/main.cpp
4++++ b/src/main.cpp
5+@@ -162,11 +162,6 @@ int main(int argc, char* argv[]) {
6+ INFO("Initializing app");
7+ appInit();
8+
9+- const char* openedFilename = glfwGetOpenedFilename();
10+- if (openedFilename) {
11+- patchPath = openedFilename;
12+- }
13+-
14+ if (!settings::headless) {
15+ APP->patch->init(patchPath);
16+ }