Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vcvrack: init at 0.5.1 #33132

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
162 changes: 162 additions & 0 deletions pkgs/applications/audio/vcvrack/default.nix
@@ -0,0 +1,162 @@
{ stdenv, fetchFromGitHub, fetchgit, makeWrapper, gcc, fetchpatch,
curl, glew, glfw, gnome2, jansson, libsamplerate, libzip,
pkgconfig, rtaudio, rtmidi3,
... }:

with stdenv.lib;

let
plugins = {
Copy link
Contributor

@svenkeidel svenkeidel Mar 4, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I put the plugins into a separate plugin.nix file. I turned this file then into a function from plugins to derivation:
vcvrack/default.nix:

{ stdenv, ... }:

plugins:
stdenv.mkDerivation rec {
  name = "Rack-${version}";
  ...
}

all-packages.nix:

vcvrackWithPlugins = callPackage ../applications/audio/vcvrack { };
vcvrack = pkgs.vcvrackWithPlugins (import ../applications/audio/vcvrack/plugins.nix { inherit fetchFromGitHub; });

This allows people to add their own plugins by calling vcvrackWithPlugins.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, I would like to be able to pick plugins like for vim or something.
Bad thing is that some of the plugins need the Rack repo as well.
I don't think a vcvrack without modules makes any sense. I think the vcvrack (withoutPlugins) should at least deliver the default repos.
I would like to deliver all the other modules as separate plugins. Something like

nixos.vcvrack
nixos.vcvrackPlugins.AS
nixos.vcvrackPlugins.Vult
...

what do you think ?

Copy link
Contributor

@svenkeidel svenkeidel Mar 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think a vcvrack without modules makes any sense.

Yes this makes sense.

I would like to deliver all the other modules as separate plugins.

How would vcvrack find the installed plugins? So far I have not found an easy way to compile plugins separate from vcvrack.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How would vcvrack find the installed plugins? So far I have not found an easy way to compile plugins separate from vcvrack.

I did not accomplish that task (of course).
But I thought of links. (of course we can't change the vcvrack, but maybe we use /etc/ or something)

something like ${pkgs.vcvrack}/usr/share/vcvrack/plugins -> /etc/vcvrack/plugins and
than every plugin (e.g. AS plugin) creates /etc/vcvrack/AS -> ${pkgs.vcvrackPlugins.AS}/usr/share/vcvrack/plugins/AS

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes this makes sense.

What do you want to do with a vcvrack without any plugins ? You can only look at the background image.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@svenkeidel Would it be Ok, if we merge this pull-request with as few further changes, because @yegortimoshenko would have to spend time on reviewing it. And when it's merged you create a pull-request ? We could also talk on irc (i'm palo in the #nixos channel)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes this makes sense.

What do you want to do with a vcvrack without any plugins ? You can only look at the
background image.

This was a misunderstanding 😄, I was agreeing with you that vcvrack without any plugins does not make any sense.

Copy link
Contributor

@svenkeidel svenkeidel Mar 6, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

About the plugin problem. I don't know if vcvrack finding plugins over the global filesystem is the most Nix way of doing things. I think that for packages that can be extended with plugins it is acceptable to take these as an input argument, see for example emacsWithPackages. This gives the users more flexibility to instantiate this package multiple times with different sets of plugins. This flexibility probably will not be needed in case of vcvrack, however, I think it is good practice.

Based this plea, I would like to refine my proposal from above to support a standard set of plugins:

vcvrack/default.nix:

{ stdenv, ... }:

plugins:
stdenv.mkDerivation rec {
  name = "Rack-${version}";
  ...
}

all-packages.nix:

vcvrackWithPlugins = callPackage ../applications/audio/vcvrack { };
vcvrack = userPlugins:
  let corePlugins =  import ../applications/audio/vcvrack/core-plugins.nix { inherit fetchFromGitHub; };
  in pkgs.vcvrackWithPlugins (corePlugins // userPlugins);

@mrVanDalo, what do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@svenkeidel : Yeah that sounds also good. But I still would like to "just" get this pr done (also because it is so old) and solve your issues in another pull-request right after this thing got merged.

# fetch official Plugins
# ----------------------
Fundamental = fetchgit {
url = "https://github.com/VCVRack/Fundamental.git";
rev = "v0.5.1";
sha256 = "0dawi83463fiml03d1d40r638rnzgxlvc4d1744gdal2rmhrycva";
};
Befco = fetchgit {
url = "https://github.com/VCVRack/Befaco.git";
rev = "v0.5.0";
sha256 = "0v62ffahybff1ipz85zg30sih56wkfdkbbhs9qz10s6k0nr7i63r";
};
ESeries = fetchgit {
url = "https://github.com/VCVRack/Eseries.git";
rev = "v0.5.0";
sha256 = "1kwvbsi5vjljlgs6annh7qkxzakjyhmx05qrfhqk9llxs8r8f0d7";
};
AudibleInstruments = fetchgit {
url = "https://github.com/VCVRack/AudibleInstruments.git";
rev = "v0.5.0";
sha256 = "0paj9iryx3xd46ilipsyiq6516zhzpgciijqyjl1nrji4g7v7l5f";
};

# fetch additional Plugins
# ------------------------
# todo : make these `nixos.vcvrackPlugins.<plugin-name>`
AmalgamatedHarmonics = fetchgit {
url = "https://github.com/jhoar/AmalgamatedHarmonics.git";
rev = "v0.5.8";
sha256 = "1k9641p2lmy549iaj2gmj9wsj5h611h1n7255bq3z6bmm4pdv89r";
};
AS = fetchgit {
url = "https://github.com/AScustomWorks/AS.git";
rev = "0.5.6";
sha256 = "0jp0ba264a4c4gydams3k4964mh3y47gmbpnhcapcdkq7q09ryv5";
};
BogaudioModules = fetchgit {
url = "https://github.com/bogaudio/BogaudioModules.git";
rev = "v0.5.3";
sha256 = "10apg23wyzsk1y41241jcpkj1047h9ygfk45fcrf44sj310yw0ji";
};
Dekstop = fetchgit {
url = "https://github.com/dekstop/vcvrackplugins_dekstop";
rev = "v0.5.0";
sha256 = "1kqywcgf7vacg0f471v9xlvrsdqr64m6ivq13j0x3ka6j6nziyjq";
};
HetrickCV = fetchgit {
url = "https://github.com/mhetrick/hetrickcv.git";
rev = "0.5.4";
sha256 = "0f047y4rfzfyzpcsz58d9kjb2dg4xi59dzzs35i0phz1vkgxvm0d";
};
NauModular = fetchgit {
url = "https://github.com/naus3a/NauModular.git";
rev = "0.5.2";
sha256 = "0mh2yyranzy8fzi9kcw6z534s788gzxzyrng38cwyw02jkkk05m9";
};
RJModules = fetchgit {
url = "https://github.com/Miserlou/RJModules.git";
rev = "0.5.0";
sha256 = "1w9w578fyfkxrzz9s8xap3696id8ibhj2bzap8zdg0k7vw609jrl";
};
StellareLink = fetchgit {
url = "https://github.com/stellare-modular/vcv-link.git";
rev = "0.5.1";
sha256 = "1b7rrdhfqrwrffxaswdqrykq7k8sxsbxr62pi3ggfphqrgkijspr";
};
};

in
stdenv.mkDerivation rec {
name = "vcvrack-${version}";
version = "0.5.1";

# need to use fetchgit here to pull submodules as well
src = fetchgit {
url = "https://github.com/VCVRack/Rack.git";
rev = "v${version}";
sha256 = "0zy1splbir50iz12vlpxbpix1qx6lrjmqyb4fy7nz03sz8dij59a";
};


buildInputs = [
curl
glew
glfw
gnome2.gtk.dev
jansson
libsamplerate
libzip
makeWrapper
pkgconfig
rtaudio
rtmidi3
];


# include the plugins
prePatch = ''
${builtins.toString (flip mapAttrsToList plugins (k: v: ''
echo ${k}
mkdir -p plugins/${k}
cp -a ${v}/* plugins/${k}
''))}
'';

patches = [
(fetchpatch {
name = "Fix-Xmonad.patch";
sha256 = "00qakp95xjrsv6vapmkvwyavg2y6mbdvqzq4zprgnfzm1jfh9bry";
url = "https://github.com/sorki/Rack/commit/e1a81a44e400c23b5239d941e9cc4943009ea714.patch";
})
];

postPatch = ''
# patch RtAudio include
substituteInPlace src/core/AudioInterface.cpp \
--replace RtAudio.h rtaudio/RtAudio.h

# otherwise we will not find the fonts and pulgins
sed src/asset.cpp -i -e "46s@.*@dir = \"$out/share/vcvrack\"\;@"
sed src/asset.cpp -i -e "49s@.*@dir = \"$out/share/vcvrack\"\;@"
'';

buildPhase = ''
# call make plugins separately to not override the VERSION parameter
make allplugins
# VERSION parameter is important to build a release version,
# which contains the plugin manager.
make VERSION=${version}
'';

# there is no `make install` so we override this phase
installPhase = ''
mkdir -p $out/{bin,share/vcvrack}
cp Rack $out/share/vcvrack
ln -s $out/share/vcvrack/Rack $out/bin/Rack
ln -s $out/share/vcvrack/Rack $out/bin/VCVRack

cp -r res $out/share/vcvrack/
cp -r plugins $out/share/vcvrack/ # todo : only copy libs
'';

meta = with stdenv.lib; {
description = "Open-source virtual modular synthesizer";
longDescription = ''
Rack is the engine for the VCV open-source virtual Eurorack DAW.
'';
homepage = https://vcvrack.com/;
license = with licenses; [ bsd3 mit ];
maintainers = [ maintainers.mrVanDalo ];
platforms = platforms.linux;
} ;
}
14 changes: 14 additions & 0 deletions pkgs/development/libraries/audio/rtmidi/rtmidi3.nix
@@ -0,0 +1,14 @@
{ stdenv, fetchFromGitHub, rtmidi2 }:

rtmidi2.overrideAttrs (oldAttrs: rec {
name = "rtmidi-${version}";
version = "3.0.0";

src = fetchFromGitHub {
owner = "thestk";
repo = "rtmidi";
rev = "v${version}";
sha256 = "1z4sj85vvnmvg4pjjs963ghi69srb63jp5xpck46dcb9wgypdviy";
};

})
4 changes: 2 additions & 2 deletions pkgs/development/libraries/glew/default.nix
Expand Up @@ -5,11 +5,11 @@
with stdenv.lib;

stdenv.mkDerivation rec {
name = "glew-2.0.0";
name = "glew-2.1.0";

src = fetchurl {
url = "mirror://sourceforge/glew/${name}.tgz";
sha256 = "0r37fg2s1f0jrvwh6c8cz5x6v4wqmhq42qm15cs9qs349q5c6wn5";
sha256 = "159wk5dc0ykjbxvag5i1m2mhp23zkk6ra04l26y3jc3nwvkr3ph4";
};

outputs = [ "bin" "out" "dev" "doc" ];
Expand Down
8 changes: 7 additions & 1 deletion pkgs/top-level/all-packages.nix
Expand Up @@ -4283,7 +4283,11 @@ with pkgs;

rtaudio = callPackage ../development/libraries/audio/rtaudio { };

rtmidi = callPackage ../development/libraries/audio/rtmidi { };
rtmidi2 = callPackage ../development/libraries/audio/rtmidi/rtmidi2.nix { };
rtmidi3 = callPackage ../development/libraries/audio/rtmidi/rtmidi3.nix {
inherit (self) rtmidi2;
};
rtmidi = rtmidi2;

openmpi = callPackage ../development/libraries/openmpi { };

Expand Down Expand Up @@ -5089,6 +5093,8 @@ with pkgs;

vcstool = callPackage ../development/tools/vcstool { };

vcvrack = callPackage ../applications/audio/vcvrack { };

verilator = callPackage ../applications/science/electronics/verilator {};

verilog = callPackage ../applications/science/electronics/verilog {};
Expand Down