about summary refs log tree commit diff
path: root/pkgs/tools/X11/setroot
diff options
context:
space:
mode:
authorAzat Bahawi <azat@bahawi.net>2022-05-21 22:27:08 +0300
committerAzat Bahawi <azat@bahawi.net>2022-05-21 22:27:08 +0300
commit91198c9987707342d9b321f08e015f1126c9944d (patch)
treee3e47843928108afe30439eb30a83d2a36d59986 /pkgs/tools/X11/setroot
parent51717872195aabaff5ba415b55f180d0f26410fe (diff)
setroot: fix build
Diffstat (limited to 'pkgs/tools/X11/setroot')
-rw-r--r--pkgs/tools/X11/setroot/default.nix21
1 files changed, 14 insertions, 7 deletions
diff --git a/pkgs/tools/X11/setroot/default.nix b/pkgs/tools/X11/setroot/default.nix
index 014ac4c54be78..bc7b468caaf8a 100644
--- a/pkgs/tools/X11/setroot/default.nix
+++ b/pkgs/tools/X11/setroot/default.nix
@@ -1,9 +1,7 @@
-{ lib, stdenv, fetchFromGitHub, libX11, imlib2
-, enableXinerama ? true, libXinerama ? null
+{ lib, stdenv, fetchFromGitHub, libX11, imlib2, pkg-config, fetchpatch
+, enableXinerama ? true, libXinerama
 }:
 
-assert enableXinerama -> libXinerama != null;
-
 stdenv.mkDerivation rec {
   version = "2.0.2";
   pname = "setroot";
@@ -15,12 +13,21 @@ stdenv.mkDerivation rec {
     sha256 = "0w95828v0splk7bj5kfacp4pq6wxpyamvyjmahyvn5hc3ycq21mq";
   };
 
+  patches = [
+    (fetchpatch {
+      url = "https://github.com/ttzhou/setroot/commit/d8ff8edd7d7594d276d741186bf9ccf0bce30277.patch";
+      sha256 = "sha256-e0iMSpiOmTOpQnp599fjH2UCPU4Oq1VKXcVypVoR9hw=";
+    })
+  ];
+
+  nativeBuildInputs = [ pkg-config ];
+
   buildInputs = [ libX11 imlib2 ]
-    ++ lib.optional enableXinerama libXinerama;
+    ++ lib.optionals enableXinerama [ libXinerama ];
 
-  buildFlags = [ "CC=${stdenv.cc.targetPrefix}cc" (if enableXinerama then "xinerama=1" else "xinerama=0") ] ;
+  buildFlags = [ (if enableXinerama then "xinerama=1" else "xinerama=0") ] ;
 
-  installFlags = [ "DESTDIR=$(out)" "PREFIX=" ];
+  installFlags = [ "PREFIX=$(out)" ];
 
   meta = with lib; {
     description = "Simple X background setter inspired by imlibsetroot and feh";