2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, pkg-config, xlibsWrapper, xorgproto, libXi
|
2020-04-24 23:36:52 +00:00
|
|
|
, 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";
|
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
patches = lib.optionals stdenv.isDarwin [ ./nsosv.patch ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [ libGLU libGL libjpeg zlib libpng libXft ]
|
2021-02-05 17:12:51 +00:00
|
|
|
++ lib.optional stdenv.isDarwin [ AGL Cocoa GLUT ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [ xorgproto ]
|
|
|
|
++ (if stdenv.isDarwin
|
|
|
|
then [ freetype libtiff ]
|
|
|
|
else [ xlibsWrapper libXi freeglut ]);
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--enable-gl"
|
|
|
|
"--enable-largefile"
|
|
|
|
"--enable-shared"
|
|
|
|
"--enable-threads"
|
|
|
|
"--enable-xft"
|
|
|
|
];
|
|
|
|
|
2021-07-14 22:03:04 +00:00
|
|
|
preConfigure = ''
|
|
|
|
make clean
|
|
|
|
rm VERSION
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A C++ cross-platform lightweight GUI library";
|
|
|
|
homepage = "https://www.fltk.org";
|
|
|
|
platforms = platforms.linux ++ platforms.darwin;
|
|
|
|
license = licenses.gpl2;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|