summary refs log tree commit diff
path: root/pkgs/development/tools/build-managers/gnustep/make/default.nix
blob: a58273e6086efad187bc9d500257974717502e2e (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
{ stdenv, fetchurl }:

let version = "2.6.7"; in
stdenv.mkDerivation rec {
  name = "gnustep-make-${version}";

  src = fetchurl {
    url = "http://ftpmain.gnustep.org/pub/gnustep/core/${name}.tar.gz";
    sha256 = "1r2is23xdg4qirckb6bd4lynfwnnw5d9522wib3ndk1xgirmfaqi";
  };

  patchPhase = ''
    substituteInPlace GNUmakefile.in \
      --replace which type \
      --replace 'tooldir = $(DESTDIR)' 'tooldir = ' \
      --replace 'makedir = $(DESTDIR)' 'makedir = ' \
      --replace 'mandir  = $(DESTDIR)' 'mandir  = '

    substituteInPlace FilesystemLayouts/apple \
      --replace /usr/local ""

    substituteInPlace configure \
      --replace /Library/GNUstep "$out"
  '';

  installFlags = "DESTDIR=$(out)";

  postInstall = ''
    mkdir -p $out/nix-support
    cat >$out/nix-support/setup-hook <<EOF
      . $out/Library/GNUstep/Makefiles/GNUstep.sh
    EOF
  '';
}