summary refs log tree commit diff
diff options
context:
space:
mode:
authorMaciej Krüger <mkg20001@gmail.com>2019-12-15 20:12:32 +0100
committerJon <jonringer@users.noreply.github.com>2019-12-16 11:16:11 -0800
commit9af73d932662e91312493f7721601a262b15f801 (patch)
treed9439d317a11342ab549194e0840dd96dc6ad369
parent75b8f3820dc4b31382136a353b8ee5e2d5fc227b (diff)
downloadnixpkgs-9af73d932662e91312493f7721601a262b15f801.tar
nixpkgs-9af73d932662e91312493f7721601a262b15f801.tar.gz
nixpkgs-9af73d932662e91312493f7721601a262b15f801.tar.bz2
nixpkgs-9af73d932662e91312493f7721601a262b15f801.tar.lz
nixpkgs-9af73d932662e91312493f7721601a262b15f801.tar.xz
nixpkgs-9af73d932662e91312493f7721601a262b15f801.tar.zst
nixpkgs-9af73d932662e91312493f7721601a262b15f801.zip
pick-colour-picker: init at unstable-2019-10-11
-rw-r--r--pkgs/applications/graphics/pick-colour-picker/default.nix66
-rw-r--r--pkgs/top-level/all-packages.nix4
2 files changed, 70 insertions, 0 deletions
diff --git a/pkgs/applications/graphics/pick-colour-picker/default.nix b/pkgs/applications/graphics/pick-colour-picker/default.nix
new file mode 100644
index 00000000000..e34d5a87a47
--- /dev/null
+++ b/pkgs/applications/graphics/pick-colour-picker/default.nix
@@ -0,0 +1,66 @@
+{ stdenv
+, fetchFromGitHub
+, buildPythonPackage
+, pygobject3
+, pycairo
+, glib
+, gtk3
+, gobject-introspection
+, wrapGAppsHook
+, python
+}:
+
+buildPythonPackage rec {
+  pname = "pick-colour-picker";
+  version = "unstable-2019-10-11"; # "1.5.0-3ec940"
+
+  src = fetchFromGitHub {
+    owner = "stuartlangridge";
+    repo = "ColourPicker";
+    rev = "3ec9406d787ce373f6db0d520ed38a921edb9473";
+    sha256 = "04l8ch9297nhkgcmyhsbg0il424c8vy0isns1c7aypn0zp0dc4zd";
+  };
+
+  nativeBuildInputs = [
+    gobject-introspection
+    wrapGAppsHook
+  ];
+
+  pythonPath = [
+    pygobject3
+    pycairo
+  ];
+
+  buildInputs = [
+    glib
+    gtk3
+  ];
+
+  # https://github.com/NixOS/nixpkgs/issues/56943
+  # this must be false, otherwise the gobject-introspection hook doesn't run
+  strictDeps = false;
+
+  preDistPhases = [ "fixupIconPath" ];
+
+  fixupIconPath = ''
+    pickLoc="$out/${python.sitePackages}/pick"
+    shareLoc=$(echo "$out/${python.sitePackages}/nix/store/"*)
+    mv "$shareLoc/share" "$out/share"
+
+    sed "s|os.environ.get('SNAP'), \"usr\"|'$out'|g" -i "$pickLoc/__main__.py"
+    '';
+
+  meta = with stdenv.lib; {
+    homepage = "https://kryogenix.org/code/pick/";
+    license = licenses.mit;
+    platforms = platforms.linux;
+    description = "A colour picker that remembers where you picked colours from";
+    maintainers = [ maintainers.mkg20001 ];
+
+    longDescription = ''
+      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.
+
+      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.
+      '';
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 6c610ae03b3..ea2cea457ea 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -24964,6 +24964,10 @@ in
 
   rfc-bibtex = python3Packages.callPackage ../development/python-modules/rfc-bibtex { };
 
+  pick-colour-picker = python3Packages.callPackage ../applications/graphics/pick-colour-picker {
+    inherit (pkgs) glib gtk3 gobject-introspection wrapGAppsHook;
+  };
+
   rpl = callPackage ../tools/text/rpl {
     pythonPackages = python3Packages;
   };