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

make-desktopitem: make genericName optional #26416

Merged
merged 1 commit into from Aug 27, 2018

Conversation

lverns
Copy link
Contributor

@lverns lverns commented Jun 6, 2017

Motivation for this change

There are several changes in this PR.

  1. Closes makeDesktopItem incorrectly requires GenericName #20624
  2. Several entries will default to being absent (rather than empty string) when none is passed in.
  3. There is no longer an extra newline at the end of the file when no extra entries are passed in.
Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip" I have not done this. It looks like this function gets used in almost 80 different files, so it could be a fairly big rebuild.
  • N/A Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@bennofs
Copy link
Contributor

bennofs commented Jul 17, 2017

/cc @lethalman @vcunat @ttuegel Changed make-desktopitem in the past

@joachifm
Copy link
Contributor

@GrahamcOfBorg eval

@peterhoeg
Copy link
Member

Is there any particular reason why we are creating the .desktop file under share/applications instead of just in the root of the derivation? The .desktop are always copied into place later as well as processed again later to fix up paths so there isn't much point in having to dig it out from a directory structure several directories deep.

@lverns
Copy link
Contributor Author

lverns commented Feb 28, 2018

@peterhoeg I don't know what the reason for that decision was originally, but I agree that putting it in the root would make more sense.

Unfortunately, that would be a breaking change.

Doing grep makeDesktopItem -R pkgs -l - | wc -l on master right now reveals that this function is used in 95 files. All of these occurrences would have to be updated to pull from the new location, but I don't think that sounds like too much work.

Would it make sense to change that in this PR since this PR will cause a rebuild anyway, or would it be better to have such a change in a different PR, since it really is a different sort of change?

@peterhoeg
Copy link
Member

I think it makes sense to do it in 2 different PRs but then simply merge them at the same time. sed should be able to handle 95% of the changes.

@lverns
Copy link
Contributor Author

lverns commented Jun 25, 2018

I think it makes sense to do it in 2 different PRs but then simply merge them at the same time.

Would the second branch be based on master or on this branch?

If master, then there will be merge conflicts in pkgs/build-support/make-desktopitem/default.nix once this PR is merged.

If this branch, then the diff is going to be a bit deceiving until this PR goes through. Also, this branch is so old that we probably can't change all those files and expect to merge back into master without conflict.

My preference: merge this PR and then make a new branch off master to make the ${out}/share/applications -> ${out} change.

@samueldr
Copy link
Member

samueldr commented Aug 24, 2018

My preference: merge this PR and then make a new branch off master to make the ${out}/share/applications -> ${out} change.

I tend to agree with this; the changes are orthogonal and can live fine independently from each-other. (Abstracting away the wish to not incurr two rebuilds)

Additionally, some makeDesktopItem calls could drop their (redundant) genericName in the future (e.g. zsnes).


I have verified a couple of the affected derivations (some I expected a short build time for), and all work as-is. Tried removing a genericName and it built as expected.

@samueldr samueldr merged commit ba9db08 into NixOS:master Aug 27, 2018
@lverns lverns deleted the make-genericName-optional branch August 28, 2018 13:39
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