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
vcvrack: init at 0.5.1 #33132
Conversation
4761e2e
to
bb27bf0
Compare
@@ -0,0 +1,115 @@ | |||
{ lib, stdenv, fetchFromGitHub, fetchgit, makeWrapper, gcc, | |||
# buildInputs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this was left here by accident :-)
# fetch source | ||
# ------------ | ||
# need to use fetchgit here to pull submodules as well | ||
src = fetchgit { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be preferable to use fetchFromGitHub
, it's much faster than fetchgit
. But, then, it would involve quite a bit of hash recalculation...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not get fetchFromGitHub
to pull also submodules this is why I used fetchgit
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I didn't expect so many repositories with submodules. Sorry!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mrVanDalo, you can fetch the submodules by adding fetchSubmodules = true;
to fetchFromGitHub
.
|
||
githubUser = "VCVRack"; | ||
|
||
# fetch source |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these comments are redundant.
name = "vcvrack-${version}"; | ||
version = "0.5.1"; | ||
|
||
githubUser = "VCVRack"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"githubUser" is longer than "VCVRack", inlining it would be more straightforward.
|
||
# fetch Plugins | ||
# ------------- | ||
pluginFundamental = fetchgit { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you define this in a single attrset plugins
, you can easily iterate through it later in prePatch
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried that, but I couldn't make it work. For example I need the pluginFundamental
variable later in the patch phase, I don't know how to dynamically create variables and such. If this would be Haskell I would know how to do it.
|
||
# otherwise we will not find the fonts and pulgins | ||
sed src/asset.cpp -i -e "46s@.*@dir = \"$out/share\"\;@" | ||
sed src/asset.cpp -i -e "49s@.*@dir = \"$out/share\"\;@" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I replace a specific line here. Not sure how to do that with substituteInPlace
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't find something like substituteInPlace --line 46 "dir = \"$out/share\"\;"
|
||
|
||
buildPhase = '' | ||
make allplugins && make |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use makeFlags
instead of overriding buildPhase
. In this case it would be:
makeFlags = [ "allplugins" "all" ];
where all
is the name of the first target in Makefile, which is probably all
.
ln -s ../share/Rack $out/bin/Rack | ||
ln -s ../share/Rack $out/bin/VCVRack | ||
|
||
cp -r res $out/share/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Packaging binaries that look for assets in their dir is best solved by having a separate derivation that installs everything to $out
, and a wrapper that links binaries from the "bare" derivation to $out/bin
.
At least, this shouldn't pollute $out/share
, it should go to its own subdirectory within it, but approach described above is better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand what you mean by
having a separate derivation that installs everything to
$out
and a wrapper that links binaries from the "bare" derivation to $out/bin.
Do you mean I should install everything in $out/share/vcvrack/
?
Rack is the engine for the VCV open-source virtual Eurorack DAW. | ||
''; | ||
homepage = https://vcvrack.com/; | ||
downloadPage = https://vcvrack.com/; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
downloadPage
is de facto deprecated.
cp -r plugins $out/share/ # todo : only copy libs | ||
''; | ||
|
||
meta = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stdenv.lib
can be moved to meta
definition:
meta = with stdenv.lib; {
license = licenses.gpl3;
};
753f75b
to
d6e9ddc
Compare
@yegortimoshenko I fixed most of the things you commented, and add 2 more plugins (which bring in some good features, like recording or sending fixed numbers). I would like to separate the plugins, but it is expected they are compiled via I'm using I put everything in Hope you are satisfied. (my nick on freenode is |
Thank you a lot for your work! I'll review it now. For loop, here is an inspiration for future packages if need arises: https://github.com/yegortimoshenko/nixpkgs/blob/05dc1bd798d1a445b9d2459d41229ea50e349564/pkgs/tools/inputmethods/ibus/default.nix#L38 But of course it's not required for merge. |
By the way, it's 5 AM in my time zone and I usually go to bed at around 12 PM so I probably align with New Zealand time zone pretty well :-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Let me build this and then I'll merge.
@@ -1,14 +1,14 @@ | |||
{ stdenv, fetchFromGitHub, autoconf, automake, libtool, libjack2, alsaLib, pkgconfig }: | |||
|
|||
stdenv.mkDerivation rec { | |||
version = "2.1.1"; | |||
version = "3.0.0"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From RtMidi page:
The version number has been bumped to 3.0.0 because of the past API change concerning the renaming of the RtError class to RtMidiError.
That might be problematic, I'll check if this bump breaks other packages and if it does, I'll add a separate derivation for v3...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know how to do that by now. Not a long term NixOS user. But I create a ticket to learn that too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be done via nix-shell -p nox --run "nox-review pr 33132"
, but it will involve a lot of rebuilding.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried that, but I get "merge conflicts" (dont know why, and where) I'm using nixos stable (17.09 I think). So I can't do these checks I guess
d6e9ddc
to
0936a32
Compare
@yegortimoshenko I had some time yesterday, and I improved the plugin part using map. |
Sorry for not publishing this earlier as I totally forgot about it but here's my hackish attempt - I've packaged the dependencies as well (if it makes sense to add them) sorki@2508164 Regarding plugins I really like what you did. To make the built-in plugin-manager working too you need to pass |
I just pull the repo with all submodules this makes stuff much simpler, of course if we reuse the dependencies some time in future, it make sense to package them as well. (not sure what is best practice here)
That is a very good advice! thanks I will include this. |
0936a32
to
7c5ed2d
Compare
@sorki @yegortimoshenko I'm not sure about the prepackaged plugins. I made this actually because I didn't had the plugin-manager. But because the plugin-manager is there, we might only ship the default plugins, what do you think? |
I think just shipping all plugins is OK, but if you can make the plugin manager work, then it would probably be better to have it, because in theory it allows to install paid plugins. I'm not sure if it's flexible enough for Nix, perhaps it tries to write in Nix store which would mean it's not an option. The only reason I haven't merged this yet is that I still need to rebuild rtmidi/glut dependents in order to ensure that updates don't break anything. I should receive access to aarch64-build-box pretty soon, then I'll be able to do that. |
I like the idea of being able to add plugins via nix conf but I don't really mind if it's not exposed. Now you need to do a bit of hunting as not all the plugins are available via plugin manager. @yegortimoshenko got a point about immutable plugins directory though - I'm currently running my hacked build from ~/Downloads/VCVRack so it is working as expected. Think it's quite reasonable to suggest this to upstream if not already there. |
Great ! If you need anything to be done, which helps you please let me know. But I must mention I'm using the stable channel and I'm pretty new to everything in NixOS.
I just checked this again and it install the packages into
That is true. I suggest we put the vcvrack upstream as it is for now. And I create a ticket for me
|
According to IRC - "plugin manager disabled now for 3rd parties :/" |
f3160e4
to
ae6a702
Compare
I bumped some of the plugin versions, because there was something happening the last month. @yegortimoshenko I guess you have been busy the last time, or forgot about this pull-request. |
Hi, @mrVanDalo, I also created a PR for the same package (I was not aware of this PR at first). Maybe we can compare our packages. I created the package for the current master of VCVRack. I leave some comments inline in your code if this is ok for you. |
with stdenv.lib; | ||
|
||
let | ||
plugins = { |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
As far as I'm concerned this PR should be merged as soon as possible, that people can stop packaging VCVRack 😄. |
@yegortimoshenko I guess you had a lot of other troubles to do and had time (or other problems) figuring out what if the rtmidi version bump breaks anything. I could create a rtmidi3 package so we'll be on the safe side, and can merge this pull-request, this was your last issue as far as I read (and remember). |
Yes I think that is the best solution. I think newer major versions of |
3d3ec95
to
3e524ab
Compare
@yegortimoshenko I created a new packages ( |
a524d6a
to
fc3360a
Compare
fc3360a
to
7794ef2
Compare
I'm closing this Pull-Request, because VCVRack 0.6.0 is out and has to be build in a different way. Maybe one of you (@svanderburg @sorki) are quicker the next time. Please ping me when you created a pull-request, so I wont. |
@svanderburg @sorki @yegortimoshenko If you want to use version 0.6 I created a build in my overlay. This is the commit The pain point are the dependencies. Also compiling the Plugins did not work for me, but the Plugin Manager works just fine. |
Motivation for this change
VCVRack is an aweseome tool and a joy to play around with.
I had to update
rtmidi
andglew
to make it work (they are separate commits though)I'm not sure about the version handling of
rtmidi
this is a major version bump (2.1.1 -> 3.0.0).Somebody should check this thing with the
nox
I'm not that deep intoNix
to understand what is going on there.Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)