about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMarcus Ramberg <marcus@means.no>2024-06-08 23:24:55 +0200
committerGitHub <noreply@github.com>2024-06-08 23:24:55 +0200
commit3300460d40a16f02c1c11cd271ef1ea116cd0f35 (patch)
treeea7e944b20ede0ab430b2b27d7b6a5d727c07adb
parent63874868cee67e5c631d6bc7635e14d2ec7be6a4 (diff)
parentcb9a16d3b04ecf23ee8f54464be388e0f822bbc6 (diff)
Merge pull request #317486 from JManch/darkman
darkman: 1.5.4 -> 2.0.1
-rw-r--r--pkgs/applications/misc/darkman/default.nix28
-rw-r--r--pkgs/applications/misc/darkman/go-mod.patch28
-rw-r--r--pkgs/applications/misc/darkman/makefile.patch12
3 files changed, 59 insertions, 9 deletions
diff --git a/pkgs/applications/misc/darkman/default.nix b/pkgs/applications/misc/darkman/default.nix
index 1b33b9fac3ed8..33918b41329ba 100644
--- a/pkgs/applications/misc/darkman/default.nix
+++ b/pkgs/applications/misc/darkman/default.nix
@@ -1,29 +1,38 @@
-{ lib, fetchFromGitLab, buildGoModule, scdoc, nix-update-script }:
+{ lib
+, fetchFromGitLab
+, buildGoModule
+, scdoc
+, nix-update-script
+}:
 
 buildGoModule rec {
   pname = "darkman";
-  version = "1.5.4";
+  version = "2.0.1";
 
   src = fetchFromGitLab {
     owner = "WhyNotHugo";
     repo = "darkman";
     rev = "v${version}";
-    sha256 = "sha256-6SNXVe6EfVwcXH9O6BxNw+v4/uhKhCtVS3XE2GTc2Sc=";
+    sha256 = "sha256-FaEpVy/0PqY5Bmw00hMyFZb9wcwYwEuCKMatYN8Xk3o=";
   };
 
-  vendorHash = "sha256-xEPmNnaDwFU4l2G4cMvtNeQ9KneF5g9ViQSFrDkrafY=";
-
-  nativeBuildInputs = [ scdoc ];
+  patches = [
+    ./go-mod.patch
+    ./makefile.patch
+  ];
 
   postPatch = ''
     substituteInPlace darkman.service \
-      --replace "/usr/bin/darkman" "$out/bin/darkman"
+      --replace-fail /usr/bin/darkman $out/bin/darkman
     substituteInPlace contrib/dbus/nl.whynothugo.darkman.service \
-      --replace "/usr/bin/darkman" "$out/bin/darkman"
+      --replace-fail /usr/bin/darkman $out/bin/darkman
     substituteInPlace contrib/dbus/org.freedesktop.impl.portal.desktop.darkman.service \
-      --replace "/usr/bin/darkman" "$out/bin/darkman"
+      --replace-fail /usr/bin/darkman $out/bin/darkman
   '';
 
+  vendorHash = "sha256-3lILSVm7mtquCdR7+cDMuDpHihG+gDJTcQa1cM2o7ZU=";
+  nativeBuildInputs = [ scdoc ];
+
   buildPhase = ''
     runHook preBuild
     make build
@@ -32,6 +41,7 @@ buildGoModule rec {
 
   installPhase = ''
     runHook preInstall
+    install -Dm755 darkman -t $out/bin
     make PREFIX=$out install
     runHook postInstall
   '';
diff --git a/pkgs/applications/misc/darkman/go-mod.patch b/pkgs/applications/misc/darkman/go-mod.patch
new file mode 100644
index 0000000000000..8fbb26dfc5a03
--- /dev/null
+++ b/pkgs/applications/misc/darkman/go-mod.patch
@@ -0,0 +1,28 @@
+diff --git a/go.mod b/go.mod
+index 2d396a4..c4fea4b 100644
+--- a/go.mod
++++ b/go.mod
+@@ -1,14 +1,19 @@
+ module gitlab.com/WhyNotHugo/darkman
+ 
+-go 1.16
++go 1.18
+ 
+ require (
+ 	github.com/adrg/xdg v0.3.3
+ 	github.com/godbus/dbus/v5 v5.0.4
+-	github.com/kr/pretty v0.2.0 // indirect
+ 	github.com/rxwycdh/rxhash v0.0.0-20230131062142-10b7a38b400d
+ 	github.com/sj14/astral v0.1.2
+-	github.com/spf13/cobra v1.7.0 // indirect
+-	gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
++	github.com/spf13/cobra v1.7.0
+ 	gopkg.in/yaml.v3 v3.0.1
+ )
++
++require (
++	github.com/inconshreveable/mousetrap v1.1.0 // indirect
++	github.com/kr/pretty v0.2.0 // indirect
++	github.com/spf13/pflag v1.0.5 // indirect
++	gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
++)
diff --git a/pkgs/applications/misc/darkman/makefile.patch b/pkgs/applications/misc/darkman/makefile.patch
new file mode 100644
index 0000000000000..1374c37cf061c
--- /dev/null
+++ b/pkgs/applications/misc/darkman/makefile.patch
@@ -0,0 +1,12 @@
+diff --git a/Makefile b/Makefile
+index 9048e45..0fb1f5a 100644
+--- a/Makefile
++++ b/Makefile
+@@ -26,7 +26,6 @@ site/index.html: darkman.1
+ 	mandoc -T html -O style=man-style.css < darkman.1 > site/index.html
+ 
+ install: build
+-	@install -Dm755 darkman 	${DESTDIR}${PREFIX}/bin/darkman
+ 	@install -Dm644 darkman.service	${DESTDIR}${PREFIX}/lib/systemd/user/darkman.service
+ 	@install -Dm644 darkman.1	${DESTDIR}${PREFIX}/share/man/man1/darkman.1
+ 	@install -Dm644 LICENCE 	${DESTDIR}${PREFIX}/share/licenses/darkman/LICENCE