about summary refs log tree commit diff
path: root/pkgs/tools/misc/xstow/default.nix
blob: e40cffb516599518251eb8c5326112bbf6f6a3ff (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
34
35
36
37
38
39
40
41
{ stdenv
, lib
, fetchFromGitHub
, ncurses
, autoreconfHook
}:

stdenv.mkDerivation rec {
  pname = "xstow";
  version = "1.1.1";

  src = fetchFromGitHub {
    owner = "majorkingleo";
    repo = "xstow";
    rev = version;
    fetchSubmodules = true;
    hash = "sha256-c89+thw5N3Cgl1Ww+W7c3YsyhNJMLlreedvdWJFY3WY=";
  };

  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; {
    description = "A replacement of GNU Stow written in C++";
    homepage = "https://github.com/majorkingleo/xstow";
    license = licenses.gpl2Only;
    maintainers = with maintainers; [ nzbr ];
    platforms = platforms.unix;
  };
}