about summary refs log tree commit diff
path: root/pkgs/tools
diff options
context:
space:
mode:
authorAnderson Torres <torres.anderson.85@protonmail.com>2022-07-02 12:08:15 -0300
committerGitHub <noreply@github.com>2022-07-02 12:08:15 -0300
commit2d48f0c18abe235f74679cd18b5e03adae4669af (patch)
tree92f85667792c7db249b78add643cf661ee10dc48 /pkgs/tools
parent13b9616f7e79ec92a1edcda62332c49b79c11c94 (diff)
parenta2403ed37f4e8bb2f581b7ad0bb25a9e30fb435a (diff)
Merge pull request #179715 from WeebSorceress/trackma
trackma: init at 0.8.4
Diffstat (limited to 'pkgs/tools')
-rw-r--r--pkgs/tools/misc/trackma/default.nix62
-rwxr-xr-xpkgs/tools/misc/trackma/update.sh8
2 files changed, 70 insertions, 0 deletions
diff --git a/pkgs/tools/misc/trackma/default.nix b/pkgs/tools/misc/trackma/default.nix
new file mode 100644
index 0000000000000..bebadd5db47fc
--- /dev/null
+++ b/pkgs/tools/misc/trackma/default.nix
@@ -0,0 +1,62 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, python3
+, wrapGAppsHook
+, gobject-introspection
+, glib
+, gtk3
+, withCurses ? false
+, withGtk ? false
+}:
+
+python3.pkgs.buildPythonApplication rec {
+  pname = "trackma";
+  version = "0.8.4";
+
+  src = fetchFromGitHub {
+    owner = "z411";
+    repo = "trackma";
+    rev = "v${version}";
+    sha256 = "sha256-drc39ID4WYBQ/L2py57CB5OkQNfRKNigPQW0Lp8GIMc=";
+  };
+
+  nativeBuildInputs = lib.optionals withGtk [ wrapGAppsHook ];
+
+  buildInputs = lib.optionals withGtk [ glib gobject-introspection gtk3 ];
+
+  propagatedBuildInputs = [ python3.pkgs.urllib3  python3.pkgs.dbus-python ]
+    ++ lib.optionals withGtk [ python3.pkgs.pillow python3.pkgs.pygobject3 python3.pkgs.pycairo ]
+    ++ lib.optionals withCurses [ python3.pkgs.urwid ]
+    ++ lib.optionals stdenv.isLinux [ python3.pkgs.pyinotify ];
+
+  # broken with gobject-introspection setup hook, see https://github.com/NixOS/nixpkgs/issues/56943
+  strictDeps = false;
+
+  dontWrapGApps = true; # prevent double wrapping
+
+  preFixup = ''
+    makeWrapperArgs+=("''${gappsWrapperArgs[@]}")
+  '';
+
+  doCheck = false;
+
+  pythonImportsCheck = [ "trackma" ];
+
+  # FIXME(trackma-qt): https://github.com/NixOS/nixpkgs/pull/179715#issuecomment-1171371059
+  postDist = ''
+    rm $out/bin/trackma-qt
+    ${lib.optionalString (!withGtk) "rm $out/bin/trackma-gtk"}
+    ${lib.optionalString (!withCurses) "rm $out/bin/trackma-curses"}
+  '';
+
+  passthru.updateScript = ./update.sh;
+
+  meta = with lib; {
+    homepage = "https://github.com/z411/trackma";
+    description = "Open multi-site list manager for Unix-like systems (ex-wMAL)";
+    license = licenses.gpl3Plus;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ WeebSorceress ];
+  };
+}
diff --git a/pkgs/tools/misc/trackma/update.sh b/pkgs/tools/misc/trackma/update.sh
new file mode 100755
index 0000000000000..7ad4a31f185b9
--- /dev/null
+++ b/pkgs/tools/misc/trackma/update.sh
@@ -0,0 +1,8 @@
+#!/usr/bin/env nix-shell
+#!nix-shell -i bash -p curl jq common-updater-scripts
+
+set -eu -o pipefail
+
+version="$(curl --silent "https://api.github.com/repos/z411/trackma/releases" | jq '.[0].tag_name' --raw-output)"
+
+update-source-version trackma "${version:1}"