about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/tk/generic.nix
blob: 34024b23e270ec04d524b6d669a672f0735ae25f (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
47
48
49
50
51
{ stdenv, src, pkgconfig, tcl, libXft, fontconfig, patches ? [], ... }:

stdenv.mkDerivation {
  name = "tk-${tcl.version}";

  inherit src patches;

  outputs = [ "out" "man" "dev" ];

  setOutputFlags = false;

  preConfigure = ''
    configureFlagsArray+=(--mandir=$man/share/man --enable-man-symlinks)
    cd unix
  '';

  postInstall = ''
    ln -s $out/bin/wish* $out/bin/wish
    cp ../{unix,generic}/*.h $out/include
  '';

  configureFlags = [
    "--with-tcl=${tcl}/lib"
  ];

  nativeBuildInputs = [ pkgconfig ];
  buildInputs = [ ]
    ++ stdenv.lib.optional stdenv.isDarwin fontconfig;

  propagatedBuildInputs = [ tcl libXft ];

  NIX_CFLAGS_LINK = if stdenv.isDarwin then "-lfontconfig" else null;

  doCheck = false; # fails. can't find itself

  inherit tcl;

  passthru = rec {
    inherit (tcl) release version;
    libPrefix = "tk${tcl.release}";
    libdir = "lib/${libPrefix}";
  };

  meta = with stdenv.lib; {
    description = "A widget toolkit that provides a library of basic elements for building a GUI in many different programming languages";
    homepage = http://www.tcl.tk/;
    license = licenses.tcltk;
    platforms = platforms.all;
    maintainers = with maintainers; [ lovek323 vrthra wkennington ];
  };
}