Skip to content

surge: init at 1.7.1#82308

Merged
orivej-nixos merged 3 commits intoNixOS:masterfrom
magnetophon:surge
Sep 2, 2020
Merged

surge: init at 1.7.1#82308
orivej-nixos merged 3 commits intoNixOS:masterfrom
magnetophon:surge

Conversation

@magnetophon
Copy link
Copy Markdown
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.

@ofborg ofborg bot added 8.has: package (new) This PR adds a new package 11.by: package-maintainer This PR was created by a maintainer of all the package it changes. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Mar 11, 2020
@magnetophon
Copy link
Copy Markdown
Member Author

Thanks for the review. All done.

Copy link
Copy Markdown
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.

@magnetophon
Copy link
Copy Markdown
Member Author

@puzzlewolf Thanks for the feedback. All done.

Copy link
Copy Markdown
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.

@ofborg ofborg bot added the 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. label Apr 2, 2020
Copy link
Copy Markdown
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!

Copy link
Copy Markdown
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.

Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown

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
Copy Markdown

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
Copy Markdown
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
Copy Markdown
Member

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

Copy link
Copy Markdown
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
Copy Markdown
Contributor

orivej commented Sep 2, 2020

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

@orivej-nixos orivej-nixos force-pushed the surge branch 2 times, most recently from eae98b6 to 2449839 Compare September 2, 2020 04:11
@magnetophon
Copy link
Copy Markdown
Member Author

Thanks!

@orivej-nixos orivej-nixos merged commit ae5bd28 into NixOS:master Sep 2, 2020
@magnetophon magnetophon deleted the surge branch September 2, 2020 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

8.has: package (new) This PR adds a new package 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 11.by: package-maintainer This PR was created by a maintainer of all the package it changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants