summary refs log tree commit diff
path: root/pkgs/tools/misc/xstow/default.nix
blob: 694634cf0bfe34474af0f8d97439fe6240c18094 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{ stdenv, lib, fetchurl, ncurses, autoreconfHook }:
stdenv.mkDerivation rec {
  pname = "xstow";
  version = "1.1.0";

  src = fetchurl {
    url = "http://downloads.sourceforge.net/sourceforge/${pname}/${pname}-${version}.tar.bz2";
    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
  ];

  meta = with lib; {
    broken = stdenv.isDarwin;
    description = "A replacement of GNU Stow written in C++";
    homepage = "https://xstow.sourceforge.net";
    license = licenses.gpl2Only;
    maintainers = with maintainers; [ nzbr ];
    platforms = platforms.unix;
  };
}