summary refs log tree commit diff
path: root/pkgs/tools/misc/noti
diff options
context:
space:
mode:
authorSandro Jäckel <sandro.jaeckel@sap.com>2022-07-19 17:55:06 +0200
committerSandro Jäckel <sandro.jaeckel@sap.com>2022-07-21 17:19:59 +0200
commitdf5c71b008ca914712c1f9c73f51f722f1ca12c3 (patch)
treeea13fb0c2f3d9b3dd77f86a1890d7eddcbc2d2c3 /pkgs/tools/misc/noti
parent1131c38b3b9bb49c0ad8ffed7c83708544852ab6 (diff)
downloadnixpkgs-df5c71b008ca914712c1f9c73f51f722f1ca12c3.tar
nixpkgs-df5c71b008ca914712c1f9c73f51f722f1ca12c3.tar.gz
nixpkgs-df5c71b008ca914712c1f9c73f51f722f1ca12c3.tar.bz2
nixpkgs-df5c71b008ca914712c1f9c73f51f722f1ca12c3.tar.lz
nixpkgs-df5c71b008ca914712c1f9c73f51f722f1ca12c3.tar.xz
nixpkgs-df5c71b008ca914712c1f9c73f51f722f1ca12c3.tar.zst
nixpkgs-df5c71b008ca914712c1f9c73f51f722f1ca12c3.zip
noti: bump golang.org/x/sys
Diffstat (limited to 'pkgs/tools/misc/noti')
-rw-r--r--pkgs/tools/misc/noti/default.nix36
1 files changed, 27 insertions, 9 deletions
diff --git a/pkgs/tools/misc/noti/default.nix b/pkgs/tools/misc/noti/default.nix
index c964a8872f8..ac3ff7a59b7 100644
--- a/pkgs/tools/misc/noti/default.nix
+++ b/pkgs/tools/misc/noti/default.nix
@@ -1,7 +1,13 @@
-{ stdenv, lib, buildGoPackage, fetchFromGitHub
-, Cocoa ? null }:
-
-buildGoPackage rec {
+{ stdenv
+, lib
+, buildGoModule
+, fetchFromGitHub
+, fetchurl
+, Cocoa
+, installShellFiles
+}:
+
+buildGoModule rec {
   pname = "noti";
   version = "3.5.0";
 
@@ -12,17 +18,29 @@ buildGoPackage rec {
     sha256 = "12r9wawwl6x0rfv1kahwkamfa0pjq24z60az9pn9nsi2z1rrlwkd";
   };
 
-  buildInputs = lib.optional stdenv.isDarwin Cocoa;
+  patches = [
+    # update golang.org/x/sys to fix building on aarch64-darwin
+    # using fetchurl because fetchpatch breaks the patch
+    (fetchurl {
+      url = "https://github.com/variadico/noti/commit/a90bccfdb2e6a0adc2e92f9a4e7be64133832ba9.patch";
+      sha256 = "sha256-vSAwuAR9absMSFqGOlzmRZoOGC/jpkmh8CMCVjeleUo=";
+    })
+  ];
 
-  goPackagePath = "github.com/variadico/noti";
+  vendorSha256 = null;
+
+  nativeBuildInputs = [ installShellFiles ];
+
+  buildInputs = lib.optional stdenv.isDarwin Cocoa;
 
   ldflags = [
-    "-X ${goPackagePath}/internal/command.Version=${version}"
+    "-s"
+    "-w"
+    "-X github.com/variadico/noti/internal/command.Version=${version}"
   ];
 
   postInstall = ''
-    install -Dm444 -t $out/share/man/man1 $src/docs/man/*.1
-    install -Dm444 -t $out/share/man/man5 $src/docs/man/*.5
+    installManPage docs/man/*
   '';
 
   meta = with lib; {