···11+{ stdenv
22+, fetchFromGitHub
33+, buildPythonPackage
44+, pygobject3
55+, pycairo
66+, glib
77+, gtk3
88+, gobject-introspection
99+, wrapGAppsHook
1010+, python
1111+}:
1212+1313+buildPythonPackage rec {
1414+ pname = "pick-colour-picker";
1515+ version = "unstable-2019-10-11"; # "1.5.0-3ec940"
1616+1717+ src = fetchFromGitHub {
1818+ owner = "stuartlangridge";
1919+ repo = "ColourPicker";
2020+ rev = "3ec9406d787ce373f6db0d520ed38a921edb9473";
2121+ sha256 = "04l8ch9297nhkgcmyhsbg0il424c8vy0isns1c7aypn0zp0dc4zd";
2222+ };
2323+2424+ nativeBuildInputs = [
2525+ gobject-introspection
2626+ wrapGAppsHook
2727+ ];
2828+2929+ pythonPath = [
3030+ pygobject3
3131+ pycairo
3232+ ];
3333+3434+ buildInputs = [
3535+ glib
3636+ gtk3
3737+ ];
3838+3939+ # https://github.com/NixOS/nixpkgs/issues/56943
4040+ # this must be false, otherwise the gobject-introspection hook doesn't run
4141+ strictDeps = false;
4242+4343+ preDistPhases = [ "fixupIconPath" ];
4444+4545+ fixupIconPath = ''
4646+ pickLoc="$out/${python.sitePackages}/pick"
4747+ shareLoc=$(echo "$out/${python.sitePackages}/nix/store/"*)
4848+ mv "$shareLoc/share" "$out/share"
4949+5050+ sed "s|os.environ.get('SNAP'), \"usr\"|'$out'|g" -i "$pickLoc/__main__.py"
5151+ '';
5252+5353+ meta = with stdenv.lib; {
5454+ homepage = "https://kryogenix.org/code/pick/";
5555+ license = licenses.mit;
5656+ platforms = platforms.linux;
5757+ description = "A colour picker that remembers where you picked colours from";
5858+ maintainers = [ maintainers.mkg20001 ];
5959+6060+ longDescription = ''
6161+ Pick lets you pick colours from anywhere on your screen. Choose the colour you want and Pick remembers it, names it, and shows you a screenshot so you can remember where you got it from.
6262+6363+ Zoom all the way in to pixels to pick just the right one. Show your colours in your choice of format: rgba() or hex, CSS or Gdk or Qt, whichever you prefer. Copy to the clipboard ready for pasting into code or graphics apps.
6464+ '';
6565+ };
6666+}