about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/misc/xstow/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/tools/misc/xstow/default.nix')
-rw-r--r--nixpkgs/pkgs/tools/misc/xstow/default.nix14
1 files changed, 12 insertions, 2 deletions
diff --git a/nixpkgs/pkgs/tools/misc/xstow/default.nix b/nixpkgs/pkgs/tools/misc/xstow/default.nix
index 079f4e67579d..694634cf0bfe 100644
--- a/nixpkgs/pkgs/tools/misc/xstow/default.nix
+++ b/nixpkgs/pkgs/tools/misc/xstow/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchurl, ncurses }:
+{ stdenv, lib, fetchurl, ncurses, autoreconfHook }:
 stdenv.mkDerivation rec {
   pname = "xstow";
   version = "1.1.0";
@@ -8,6 +8,16 @@ stdenv.mkDerivation rec {
     sha256 = "sha256-wXQ5XSmogAt1torfarrqIU4nBYj69MGM/HBYqeIE+dw=";
   };
 
+  nativeBuildInputs = [ autoreconfHook ];
+
+  # Upstream seems to try to support building both static and dynamic version
+  # of executable on dynamic systems, but fails with link error when attempting
+  # to cross-build "xstow-static" to the system where "xstow" proper is static.
+  postPatch = lib.optionalString stdenv.hostPlatform.isStatic ''
+    substituteInPlace src/Makefile.am --replace xstow-static ""
+    substituteInPlace src/Makefile.am --replace xstow-stow ""
+  '';
+
   buildInputs = [
     ncurses
   ];
@@ -15,7 +25,7 @@ stdenv.mkDerivation rec {
   meta = with lib; {
     broken = stdenv.isDarwin;
     description = "A replacement of GNU Stow written in C++";
-    homepage = "http://xstow.sourceforge.net";
+    homepage = "https://xstow.sourceforge.net";
     license = licenses.gpl2Only;
     maintainers = with maintainers; [ nzbr ];
     platforms = platforms.unix;