about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/graphics/wallutils/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/tools/graphics/wallutils/default.nix')
-rw-r--r--nixpkgs/pkgs/tools/graphics/wallutils/default.nix69
1 files changed, 52 insertions, 17 deletions
diff --git a/nixpkgs/pkgs/tools/graphics/wallutils/default.nix b/nixpkgs/pkgs/tools/graphics/wallutils/default.nix
index 8ab6bba1ef12..796baa25b0bf 100644
--- a/nixpkgs/pkgs/tools/graphics/wallutils/default.nix
+++ b/nixpkgs/pkgs/tools/graphics/wallutils/default.nix
@@ -1,36 +1,71 @@
-{ buildGoPackage, fetchFromGitHub, lib
+{ lib
+, buildGoModule
+, fetchFromGitHub
+, libX11
+, libXcursor
+, libXmu
+, libXpm
+, libheif
 , pkg-config
-, wayland, libX11, xbitmaps, libXcursor, libXmu, libXpm, libheif
+, wayland
+, xbitmaps
 }:
 
-buildGoPackage rec {
+buildGoModule rec {
   pname = "wallutils";
-  version = "5.11.1";
+  version = "5.12.7";
 
   src = fetchFromGitHub {
     owner = "xyproto";
     repo = "wallutils";
     rev = version;
-    sha256 = "sha256-FL66HALXsf7shoUKIZp6HORyuxhOfgTrY+PQAe92yk8=";
+    hash = "sha256-7UqZr/DEiHDgg3XwvsKk/gc6FNtLh3aj5NWVz/A3J4o=";
   };
 
-  goPackagePath = "github.com/xyproto/wallutils";
+  vendorHash = null;
 
-  patches = [ ./lscollection-Add-NixOS-paths-to-DefaultWallpaperDirectories.patch ];
+  patches = [
+    ./000-add-nixos-dirs-to-default-wallpapers.patch
+  ];
 
-  postPatch = ''
-    # VersionString is sometimes not up-to-date:
-    sed -iE 's/VersionString = "[0-9].[0-9].[0-9]"/VersionString = "${version}"/' wallutils.go
-  '';
+  excludedPackages = [
+    "./pkg/event/cmd" # Development tools
+  ];
 
-  nativeBuildInputs = [ pkg-config ];
-  buildInputs = [ wayland libX11 xbitmaps libXcursor libXmu libXpm libheif ];
+  nativeBuildInputs = [
+    pkg-config
+  ];
 
-  meta = with lib; {
+  buildInputs = [
+    libX11
+    libXcursor
+    libXmu
+    libXpm
+    libheif
+    wayland
+    xbitmaps
+  ];
+
+  ldflags = [ "-s" "-w" ];
+
+  preCheck =
+    let skippedTests = [
+      "TestClosest" # Requiring Wayland or X
+      "TestEveryMinute" # Blocking
+      "TestNewSimpleEvent" # Blocking
+    ]; in
+    ''
+      export XDG_RUNTIME_DIR=`mktemp -d`
+
+      buildFlagsArray+=("-run" "[^(${builtins.concatStringsSep "|" skippedTests})]")
+    '';
+
+  meta = {
     description = "Utilities for handling monitors, resolutions, and (timed) wallpapers";
     inherit (src.meta) homepage;
-    license = licenses.mit;
-    maintainers = with maintainers; [ ];
-    platforms = platforms.linux;
+    license = lib.licenses.bsd3;
+    maintainers = [ lib.maintainers.AndersonTorres ];
+    inherit (wayland.meta) platforms;
+    badPlatforms = lib.platforms.darwin;
   };
 }