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

surge: init at 1.7.1 #82308

Merged
merged 3 commits into from Sep 2, 2020
Merged

surge: init at 1.7.1 #82308

merged 3 commits into from Sep 2, 2020

Conversation

magnetophon
Copy link
Member

@magnetophon magnetophon commented Mar 11, 2020

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

pkgs/applications/audio/surge/default.nix Outdated Show resolved Hide resolved
pkgs/applications/audio/surge/default.nix Outdated Show resolved Hide resolved
@magnetophon
Copy link
Member Author

Thanks for the review. All done.

Copy link
Contributor

@puzzlewolf puzzlewolf left a comment

Choose a reason for hiding this comment

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

Looks good to me, other than the nit.

pkgs/applications/audio/surge/default.nix Outdated Show resolved Hide resolved
pkgs/applications/audio/surge/default.nix Outdated Show resolved Hide resolved
pkgs/applications/audio/surge/default.nix Outdated Show resolved Hide resolved
pkgs/applications/audio/surge/default.nix Outdated Show resolved Hide resolved
@magnetophon
Copy link
Member Author

@puzzlewolf Thanks for the feedback. All done.

Copy link
Contributor

@puzzlewolf puzzlewolf left a comment

Choose a reason for hiding this comment

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

Sorry for piecemeal reviews :) I found some more things.

pkgs/applications/audio/surge/default.nix Outdated Show resolved Hide resolved
pkgs/applications/audio/surge/default.nix Outdated Show resolved Hide resolved
pkgs/applications/audio/surge/default.nix Outdated Show resolved Hide resolved
Copy link
Contributor

@puzzlewolf puzzlewolf left a comment

Choose a reason for hiding this comment

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

@magnetophon Do the tests work for you like that? Do you think that's a good solution?

@baconpaul Thank for the pointers!

mkdir -p $out/share/surge
cp -r resources/data/* $out/share/surge/
'';

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
doInstallCheck = true;
installCheckPhase = ''
./build-linux.sh build -p headless
./target/headless/Release/Surge/Surge-Headless
'';

I made the tests work :) They're install checks because surge-headless looks for the resources in the install directory.

Choose a reason for hiding this comment

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

Yeah that makes sense - there’s no reason to run them any time other than after build.

A couple of the tests have tolerance problems I’m chasing and will fail about one time in 20 just FYI.

@magnetophon
Copy link
Member Author

@puzzlewolf @baconpaul Thanks!

Now all we need is a way to make zenity work without installing it globally or in the user profile.
I tried the folowing in the patchPhase:

    substituteInPlace src/linux/UserInteractionsLinux.cpp --replace zenity ${gnome3.zenity}/bin/zenity
    substituteInPlace src/common/gui/PopupEditorDialog.cpp --replace zenity ${gnome3.zenity}/bin/zenity

but that gave a build error.
Any ideas?

@puzzlewolf
Copy link
Contributor

Yeah, src/linux/UserInteractionsLinux.cpp contains the string zenity in a lot more places than the ones we'd like to change. This builds for me:

substituteInPlace src/linux/UserInteractionsLinux.cpp --replace 'execlp("zenity"' 'execlp("${gnome3.zenity}/bin/zenity"'
substituteInPlace src/common/gui/PopupEditorDialog.cpp --replace zenity ${gnome3.zenity}/bin/zenity

Can you check if it actually works? Even if it works, I really don't know if this is a good idea.

@magnetophon
Copy link
Member Author

@puzzlewolf That works wonderfully, thank you!
Why would it not be a good idea?
FWIW, steam does it too:

substituteInPlace src/lsi/lsi.c --replace zenity ${gnome3.zenity}/bin/zenity

@baconpaul
Copy link

Yeah, src/linux/UserInteractionsLinux.cpp contains the string zenity in a lot more places than the ones we'd like to change. This builds for me:

substituteInPlace src/linux/UserInteractionsLinux.cpp --replace 'execlp("zenity"' 'execlp("${gnome3.zenity}/bin/zenity"'
substituteInPlace src/common/gui/PopupEditorDialog.cpp --replace zenity ${gnome3.zenity}/bin/zenity

Can you check if it actually works? Even if it works, I really don't know if this is a good idea.

Folks: I am more than happy to take changes to upstream so you don't have to do these substitutions to build (in fact I am way way happier to take changes upstream).

For instance we could easily make a quick function which gets the name of the zenity executable in the C++ and defaults to 'zenity' but reads an environment variable. And even have it conditionally build a different version. I would merge that PR happily. Would even put it on my queue if you want me to do it if you just open up an issue over on the surge repo.

The more that we have visibility on changes made to the code in master, even if it ends up being a bit of spaghetti of ifs, the less likely it is we will break you when we have a new release. etc... you know the drill.

@baconpaul
Copy link

The more that we have visibility on changes made to the code in master, even if it ends up being a bit of spaghetti of ifs, the less likely it is we will break you when we have a new release. etc... you know the drill.

An obvious change, for instance, now that I have moved master to 100% cmake, is to have some cmake rule that detects nixos build and adds a -DNIXOS and then change the zenity symbol based on that. Is there some way at build time that you indicate I am in your environment? (And also are you building master or 1.6.6? like I said, master moved entirely to cmake this week)

@magnetophon
Copy link
Member Author

@baconpaul That's very generous of you, but my C/C++ fu is lacking, and I'd hate to saddle you up with more work on Surge that only benefits a few users.

And also are you building master or 1.6.6?

This PR is building 1.6.6.

@michalrus
Copy link
Member

Great! So can we merge this after a month+? =)

Copy link
Contributor

@puzzlewolf puzzlewolf left a comment

Choose a reason for hiding this comment

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

Yes 👍

@magnetophon magnetophon mentioned this pull request Jun 5, 2020
10 tasks
@magnetophon magnetophon changed the title surge: init at 1.6.6 surge: init at 1.7.1 Aug 28, 2020
@orivej
Copy link
Contributor

orivej commented Sep 2, 2020

I have updated the package definition after the switch to cmake (which simplified it a lot).

@magnetophon
Copy link
Member Author

Thanks!

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

Successfully merging this pull request may close these issues.

None yet

6 participants