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

deepin.deepin-screenshot: init at 4.1.8 #59242

Merged
merged 1 commit into from
Apr 13, 2019
Merged

deepin.deepin-screenshot: init at 4.1.8 #59242

merged 1 commit into from
Apr 13, 2019

Conversation

romildo
Copy link
Contributor

@romildo romildo commented Apr 10, 2019

Motivation for this change

Add deepin-screenshot, a easy-to-use screenshot tool for Deepin Desktop Environment.

About packaging deepin for NixOS: #59023

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • 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 nix-review --run "nix-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)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@romildo
Copy link
Contributor Author

romildo commented Apr 10, 2019

Notice that dde-file-manager may be needed. I have started packaging it, but has not finished it yet. I will make a PR for it too.

@GrahamcOfBorg GrahamcOfBorg added the 8.has: package (new) This PR adds a new package label Apr 10, 2019
@GrahamcOfBorg GrahamcOfBorg requested a review from flokli April 10, 2019 02:46
@GrahamcOfBorg GrahamcOfBorg added 11.by: package-maintainer This PR was created by the maintainer of the package it changes 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 labels Apr 10, 2019
@worldofpeace
Copy link
Contributor

Notice that dde-file-manager may be needed. I have started packaging it, but has not finished it yet. I will make a PR for it too.

👍 Looked like it was optional functionality

Copy link
Contributor

@worldofpeace worldofpeace left a comment

Choose a reason for hiding this comment

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

There's /usr/bin/deepin-screenshot in the dbus service and I think we should hardcode
everything in the .desktop file because it wants to use deepin-turbo-invoker.

Exec=deepin-turbo-invoker --type=dtkwidget deepin-screenshot --icon
Note: the desktop file has multiple actions

@worldofpeace
Copy link
Contributor

Also appears to fallback to xdg-open if it can't find the path to the dde-file-manager

I'm thinking about patching away it trying to use dde-file-manager completely.
I feel the behavior of xdg-open just makes more sense.

@romildo
Copy link
Contributor Author

romildo commented Apr 10, 2019

@GrahamcOfBorg build deepin-screenshot

@worldofpeace worldofpeace changed the title deepin-screenshot: init at 4.1.8 deepin.deepin-screenshot: init at 4.1.8 Apr 11, 2019
@flokli
Copy link
Contributor

flokli commented Apr 11, 2019

@GrahamcOfBorg build deepin.deepin-screenshot

];

buildInputs = [
# dde-file-manager
Copy link
Contributor

Choose a reason for hiding this comment

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

did you already figure out whether dde-file-manager is needed or not?
Maybe add a small comment here…

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Right…

It might make sense it opens in a deepin desktop environment to open with dde-file-manager, but not in general. A hardcoded /usr/bin/dde-file-manager is ugly, for sure ;-)

I'm not sure how this is handled for example in gnome-shell, to make sure folders are opened with nautilus. Is that also just an xdg-open thing?

If that's the case, I'd be inclined to solely rely on xdg-open for deepin-screenshot, and even send the patch upstream (given it should work with xdg-open for them, too)

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure how this is handled for example in gnome-shell, to make sure folders are opened with nautilus. Is that also just an xdg-open thing?

It's just mime type associations. So the default file manager will be used, and in a deepin environment it would be dde-file-manager.

If that's the case, I'd be inclined to solely rely on xdg-open for deepin-screenshot, and even send the patch upstream (given it should work with xdg-open for them, too)

I'd say that's reasonable, though there's still room for improvement.

I'll put the patch here for now, and pr it to deepin 👍

Copy link
Contributor

@worldofpeace worldofpeace Apr 12, 2019

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

From the commit message:

deepin.deepin-screenshot: only use xdg-open

This doesn't hardcode or put it into PATH
as I wasn't sure what romildo would have preferred.

To have xdg-open in PATH is it enough to add it to the buildInputs list, or some sort of wrapping is also needed? If not needed, that is the easier choice, in my opinion.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

From the commit message:

deepin.deepin-screenshot: only use xdg-open

This doesn't hardcode or put it into PATH
as I wasn't sure what romildo would have preferred.

To have xdg-open in PATH is it enough to add it to the buildInputs list, or some sort of wrapping is also needed? If not needed, that is the easier choice, in my opinion.

Copy link
Contributor

@worldofpeace worldofpeace Apr 12, 2019

Choose a reason for hiding this comment

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

Usually hardcoding, like you've been doing, is preferred.

@worldofpeace then it is my choice too. Can you do that, please?

@GrahamcOfBorg GrahamcOfBorg requested a review from flokli April 12, 2019 19:15
@flokli
Copy link
Contributor

flokli commented Apr 13, 2019

Pushed another version that uses fetchpatch instead of adding the patch to nixpkgs, removed debug statements and hardcoded xdg-open. I don't really like we effectively patch twice now, but alas :-D

I looked into other places in nixpkgs on how it's done, it seems for GTK applications where wrapGappsHook is used, we just add it to the wrapper already present anyhow.

For QT application, we currently don't have a wrapper (but might get one soon: #54525), so I think hardcoding this for now is fine.

@worldofpeace good to merge?

Co-authored-by: worldofpeace <[email protected]>
Co-authored-by: Florian Klink <[email protected]>
@worldofpeace
Copy link
Contributor

worldofpeace commented Apr 13, 2019

Just had to add

fixPath $out/bin/deepin-screenshot /usr/bin/deepin-screenshot src/dbusservice/com.deepin.Screenshot.service

Looks good, merging 👍

I looked into other places in nixpkgs on how it's done, it seems for GTK applications where wrapGappsHook is used, we just add it to the wrapper already present anyhow.

We just suffixes PATH with a wrapper if you don't want to hardcode

@worldofpeace worldofpeace merged commit 1d9b51d into NixOS:master Apr 13, 2019
@romildo romildo deleted the upd.deepin.deepin-screenshot branch April 13, 2019 20:22
@romildo
Copy link
Contributor Author

romildo commented Apr 13, 2019

Pushed another version that [...] removed debug statements

I would keep them because they help a lot spotting FHS hard coded paths in the source. There is the possibility that some of them may have unseen, or not handled yet, or introduced in new versions.

@romildo
Copy link
Contributor Author

romildo commented Apr 13, 2019

Just had to add

fixPath $out/bin/deepin-screenshot /usr/bin/deepin-screenshot src/dbusservice/com.deepin.Screenshot.service

That should be:

    fixPath $out /usr/bin/deepin-screenshot src/dbusservice/com.deepin.Screenshot.service

Fixed in #59429

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 11.by: package-maintainer This PR was created by the maintainer of the package it changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants