about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/fltk/1.4.nix
blob: 2db0aea3ecf8c66dd41214d000510bbb830a72b5 (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
{ lib, stdenv, fetchurl, pkg-config, xlibsWrapper, xorgproto, libXi
, freeglut, libGLU, libGL, libjpeg, zlib, libXft, libpng
, libtiff, freetype, Cocoa, AGL, GLUT
}:

let
  version = "1.4.x-r13121";
in

stdenv.mkDerivation {
  pname = "fltk";
  inherit version;

  src = fetchurl {
    url = "https://www.fltk.org/pub/fltk/snapshots/fltk-${version}.tar.gz";
    sha256 = "1v8wxvxcbk99i82x2v5fpqg5vj8n7g8a38g30ry7nzcjn5sf3r63";
  };

  patches = lib.optionals stdenv.isDarwin [ ./nsosv.patch ];

  nativeBuildInputs = [ pkg-config ];
  buildInputs = [ libGLU libGL libjpeg zlib libpng libXft ]
    ++ lib.optional stdenv.isDarwin [ AGL Cocoa GLUT ];

  propagatedBuildInputs = [ xorgproto ]
    ++ (if stdenv.isDarwin
        then [ freetype libtiff ]
        else [ xlibsWrapper libXi freeglut ]);

  configureFlags = [
    "--enable-gl"
    "--enable-largefile"
    "--enable-shared"
    "--enable-threads"
    "--enable-xft"
  ];

  preConfigure = "make clean";

  enableParallelBuilding = true;

  meta = with lib; {
    description = "A C++ cross-platform lightweight GUI library";
    homepage = "https://www.fltk.org";
    platforms = platforms.linux ++ platforms.darwin;
    license = licenses.gpl2;
  };

}