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

Enable build under NixOS #6855

Merged
merged 3 commits into from
Sep 20, 2023
Merged

Conversation

michaelgregorius
Copy link
Contributor

Enable the build under NixOS by explicitly calling the perl interpreter when building the SWH LADSPA plugins. The reason is that NixOS does not have much of a /usr/bin directory:

$ which perl
/run/current-system/sw/bin/perl

Hence the build failed under NixOS when relying on the first hash-bang-slash line of the makestub.pl script which wants to be interpreted by /usr/bin/perl -w.

Enable the build under NixOS by explicitly calling the perl interpreter when building the SWH LADSPA plugins. The reason is that NixOS does not have much of a `/usr/bin` directory:

```
$ which perl
/run/current-system/sw/bin/perl
```

Hence the build failed under NixOS when relying on the first hash-bang-slash line of the `makestub.pl` script which wants to be interpreted by `/usr/bin/perl -w`.
@Veratil
Copy link
Contributor

Veratil commented Sep 8, 2023

Failing on MacOS. I recall this was tried before and just adding perl was not the solution.

@michaelgregorius
Copy link
Contributor Author

Failing on MacOS. I recall this was tried before and just adding perl was not the solution.

Hmm, that's strange as it seems to fail on the dependent perl packages, i.e. List::MoreUtils (link to build):

[  7%] Generating /Users/runner/work/lmms/lmms/plugins/LadspaEffect/swh/ladspa/alias_1407.c
Can't locate List/MoreUtils.pm in @INC (you may need to install the List::MoreUtils module) (@INC contains: /usr/local/opt/perl/lib/perl5/site_perl/5.36/darwin-thread-multi-2level /usr/local/opt/perl/lib/perl5/site_perl/5.36 /usr/local/opt/perl/lib/perl5/5.36/darwin-thread-multi-2level /usr/local/opt/perl/lib/perl5/5.36 /usr/local/lib/perl5/site_perl/5.36/darwin-thread-multi-2level /usr/local/lib/perl5/site_perl/5.36) at ./makestub.pl line 3.
BEGIN failed--compilation aborted at ./makestub.pl line 3.
make[2]: *** [/Users/runner/work/lmms/lmms/plugins/LadspaEffect/swh/ladspa/alias_1407.c] Error 2

I have no idea why it should be visible when using the hash-bang-slash approach but not when calling the interpreter explicitly. I also cannot find a mention to the packages in the "Installing dependencies" step of the build.

@PhysSong
Copy link
Member

PhysSong commented Sep 9, 2023

@michaelgregorius Could you test if #6758 work on NixOS?

@Rossmaxx
Copy link
Contributor

Rossmaxx commented Sep 9, 2023

I had the same issue on #6758 and tres fixed it for me. Was about to suggest it but then saw that physsong already suggested it. See the swh cmakelists file there.

The thing is, while calling perl using the #! line, it fails to fetch the List::MoreUtils module while calling the system perl does it.

@michaelgregorius
Copy link
Contributor Author

@michaelgregorius Could you test if #6758 work on NixOS?

Hi @PhysSong, @Rossmaxx,

the Rossmaxx:enable-ladspa branch builds on NixOS. 👍

Shall I delete this PR then?

@Rossmaxx
Copy link
Contributor

Rossmaxx commented Sep 9, 2023

Shall I delete this PR then?

I don't know when it'll get merged. It's currently stuck in PR hell. Also, since I bumped calf plugins which is a rather major change, need to merge #6771 before merging this. Perhaps you can test the pr for any regressions. If there are no regressions, it'll get merged soon.

@Rossmaxx
Copy link
Contributor

Shall I delete this PR then?

I think it's better to copy the swh/cmakelists change as is from #6758 to this pr and get this merged.

Cherry-pick some changes from PR LMMS#6758 to keep MacOS building.
@michaelgregorius
Copy link
Contributor Author

michaelgregorius commented Sep 11, 2023

Shall I delete this PR then?

I think it's better to copy the swh/cmakelists change as is from #6758 to this pr and get this merged.

Hi @Rossmaxx, done!

I have also copied the CMake policy changes because I don't know if they are needed or not. I can also remove them again if this keeps the changes cleaner.

@Rossmaxx
Copy link
Contributor

Good job.

I have also copied the CMake policy changes because I don't know if they are needed or not.

Thats a @tresf question.

@tresf
Copy link
Member

tresf commented Sep 12, 2023

Good job.

I have also copied the CMake policy changes because I don't know if they are needed or not.

Thats a @tresf question.

Hmm... we removed all of these on master here: #6780, but what I can tell, CMP0074 is needed, quoting:

+ CMAKE_POLICY(SET CMP0074 NEW) # find_package() uses <PackageName>_ROOT variables
# ... 
+ SET(Perl_ROOT "/usr/bin")

Only keep the CMake policy that's needed in the context of the SWH Ladspa plugins.
@michaelgregorius
Copy link
Contributor Author

Thanks @tresf! I have now adjusted the CMake file to only keep the policy that you have mentioned.

@michaelgregorius
Copy link
Contributor Author

Hi @Rossmaxx, @tresf,

can I merge this? I think there's nothing more to do here.

@tresf tresf merged commit 7e8c79a into LMMS:master Sep 20, 2023
@tresf
Copy link
Member

tresf commented Sep 20, 2023

Done. @Rossmaxx FYI, you'll need to address this in your next rebase of #6758.

@michaelgregorius
Copy link
Contributor Author

Thanks @tresf!

@michaelgregorius michaelgregorius deleted the EnableBuildUnderNixOS branch September 20, 2023 17:59
consolegrl pushed a commit to consolegrl/lmms that referenced this pull request Sep 27, 2023
Explicitly call the perl interpreter when building the SWH LADSPA plugins
@bwkam
Copy link

bwkam commented Oct 18, 2023

Hello @michaelgregorius, do you mind please sharing your LMMS Nix config? Having some troubles with loading VSTs from Vestige...

@michaelgregorius
Copy link
Contributor Author

Hi @bwkam,

attached you can find my shell.nix with some rudimentary build instructions: LMMS-Development-Nix.zip. The build command assumes that the build directory build lies in parallel to the lmms source directory. Please note that you have to disable STK for the build because it does not seem to be available in the Nix repository.

If I remember correctly I also tried to run some external (Linux) plugins under Nix and ran into problems because the plugin was not able to resolve all its library dependencies due to the rather "ephemeral" or composed nature of the whole file system. I am by no means a Nix guru though so perhaps I am just missing something that would fix this.

@bwkam
Copy link

bwkam commented Oct 18, 2023

Hi @bwkam,

attached you can find my shell.nix with some rudimentary build instructions: LMMS-Development-Nix.zip. The build command assumes that the build directory build lies in parallel to the lmms source directory. Please note that you have to disable STK for the build because it does not seem to be available in the Nix repository.

If I remember correctly I also tried to run some external (Linux) plugins under Nix and ran into problems because the plugin was not able to resolve all its library dependencies due to the rather "ephemeral" or composed nature of the whole file system. I am by no means a Nix guru though so perhaps I am just missing something that would fix this.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants