summary refs log tree commit diff
path: root/pkgs/os-specific/windows/cygwin-setup/default.nix
blob: 91dad81f1f52af11410ddf4083635c51cfe6e21f (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
42
43
44
45
46
{ lib, stdenv, fetchcvs, autoconf, automake, libtool, flex, bison, pkg-config
, zlib, bzip2, xz, libgcrypt
}:

with lib;

stdenv.mkDerivation rec {
  pname = "cygwin-setup";
  version = "20131101";

  src = fetchcvs {
    cvsRoot = ":pserver:anoncvs@cygwin.com:/cvs/cygwin-apps";
    module = "setup";
    date = version;
    sha256 = "024wxaaxkf7p1i78bh5xrsqmfz7ss2amigbfl2r5w9h87zqn9aq3";
  };

  nativeBuildInputs = [ autoconf automake libtool flex bison pkg-config ];

  buildInputs = let
    mkStatic = flip overrideDerivation (o: {
      dontDisableStatic = true;
      configureFlags = toList (o.configureFlags or []) ++ [ "--enable-static" ];
      buildInputs = map mkStatic (o.buildInputs or []);
      propagatedBuildInputs = map mkStatic (o.propagatedBuildInputs or []);
    });
  in map mkStatic [ zlib bzip2 xz libgcrypt ];

  configureFlags = [ "--disable-shared" ];

  dontDisableStatic = true;

  preConfigure = ''
    autoreconf -vfi
  '';

  installPhase = ''
    install -vD setup.exe "$out/bin/setup.exe"
  '';

  meta = {
    homepage = "https://sourceware.org/cygwin-apps/setup.html";
    description = "A tool for installing Cygwin";
    license = licenses.gpl2Plus;
  };
}