about summary refs log tree commit diff
path: root/pkgs/applications/misc/sticky
diff options
context:
space:
mode:
authorlinsui <linsui555@gmail.com>2022-06-04 22:42:09 +0800
committerlinsui <linsui555@gmail.com>2022-06-04 22:42:09 +0800
commit2b71239bb27383a3af93b38db6d376c4242bfa11 (patch)
tree03dd70e8a29b4161f3a9f5dba73e825b3b3ae5b5 /pkgs/applications/misc/sticky
parent4ae74bbc9489c37c2c53b15e600dbdcf0c33ba32 (diff)
sticky: init at 1.8
Diffstat (limited to 'pkgs/applications/misc/sticky')
-rw-r--r--pkgs/applications/misc/sticky/default.nix83
1 files changed, 83 insertions, 0 deletions
diff --git a/pkgs/applications/misc/sticky/default.nix b/pkgs/applications/misc/sticky/default.nix
new file mode 100644
index 0000000000000..9039854f74e37
--- /dev/null
+++ b/pkgs/applications/misc/sticky/default.nix
@@ -0,0 +1,83 @@
+{ lib
+, python3
+, fetchFromGitHub
+, wrapGAppsHook
+, cinnamon
+, glib
+, gspell
+, gtk3
+, gobject-introspection
+}:
+
+python3.pkgs.buildPythonApplication rec {
+  pname = "sticky";
+  version = "1.8";
+  format = "other";
+
+  src = fetchFromGitHub {
+    owner = "linuxmint";
+    repo = pname;
+    rev = version;
+    hash = "sha256-VSD/QsG7G9hji5m6NSEkCoVM+XK3t4KmCqbocTbZwE4=";
+  };
+
+  postPatch = ''
+    sed -i -e "s|/usr/share|$out/share|" usr/lib/sticky/*.py
+  '';
+
+  nativeBuildInputs = [
+    gobject-introspection
+    wrapGAppsHook
+  ];
+
+  buildInputs = [
+    glib
+    gobject-introspection
+    cinnamon.xapps
+    gspell
+  ];
+
+  propagatedBuildInputs = with python3.pkgs; [
+    pygobject3
+    xapp
+  ];
+
+  postBuild = ''
+    glib-compile-schemas usr/share/glib-2.0/schemas
+  '';
+
+  # hook for gobject-introspection doesn't like strictDeps
+  # https://github.com/NixOS/nixpkgs/issues/56943
+  strictDeps = false;
+
+  # no tests
+  doCheck = false;
+
+  dontWrapGApps = true;
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out/bin
+    mv usr/lib $out
+    mv usr/share $out
+    patchShebangs $out/lib/sticky
+    mv $out/lib/sticky/sticky.py $out/bin/sticky
+    sed -i -e "1aimport sys;sys.path.append('$out/lib/sticky')" $out/bin/sticky
+
+    runHook postInstall
+  '';
+
+  # Arguments to be passed to `makeWrapper`, only used by buildPython*
+  preFixup = ''
+    makeWrapperArgs+=("''${gappsWrapperArgs[@]}")
+  '';
+
+  meta = with lib; {
+    description = "A sticky notes app for the linux desktop";
+    homepage = "https://github.com/linuxmint/sticky";
+    license = licenses.gpl2Only;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ linsui ];
+  };
+}