nixpkgs-suyu/pkgs/development/ocaml-modules/lablgl/default.nix

48 lines
1.4 KiB
Nix
Raw Normal View History

2021-11-30 17:46:07 +01:00
{ lib, stdenv, fetchFromGitHub, ocaml, findlib, libGLU, libGL, freeglut } :
2021-11-30 17:46:07 +01:00
if !lib.versionAtLeast ocaml.version "4.03"
then throw "lablgl is not available for OCaml ${ocaml.version}"
else
2016-10-05 09:32:30 +02:00
stdenv.mkDerivation rec {
2021-11-30 17:46:07 +01:00
pname = "ocaml${ocaml.version}-lablgl";
version = "1.06";
src = fetchFromGitHub {
owner = "garrigue";
repo = "lablgl";
rev = "v${version}";
sha256 = "sha256:141kc816iv59z96738i3vn9m9iw9g2zhi45hk4cchpwd99ar5l6k";
};
2021-11-30 17:46:07 +01:00
buildInputs = [ ocaml findlib freeglut ];
2019-11-10 17:44:34 +01:00
propagatedBuildInputs = [ libGLU libGL ];
2014-10-04 00:19:32 +02:00
patches = [ ./Makefile.config.patch ./META.patch ];
preConfigure = ''
2021-11-30 17:46:07 +01:00
mkdir -p $out/bin
mkdir -p $out/lib/ocaml/${ocaml.version}/site-lib/stublibs
substituteInPlace Makefile.config \
2021-11-30 17:46:07 +01:00
--subst-var-by BINDIR $out/bin/ \
--subst-var-by INSTALLDIR $out/lib/ocaml/${ocaml.version}/site-lib/lablgl/ \
--subst-var-by DLLDIR $out/lib/ocaml/${ocaml.version}/site-lib/stublibs/ \
--subst-var-by TKINCLUDES "" \
--subst-var-by XINCLUDES ""
'';
buildFlags = [ "lib" "libopt" "glut" "glutopt" ];
postInstall = ''
2016-10-05 09:32:30 +02:00
cp ./META $out/lib/ocaml/${ocaml.version}/site-lib/lablgl
'';
meta = with lib; {
homepage = "http://wwwfun.kurims.kyoto-u.ac.jp/soft/lsl/lablgl.html";
description = "OpenGL bindings for ocaml";
2014-10-04 00:19:32 +02:00
license = licenses.gpl2;
maintainers = with maintainers; [ pSub vbgl ];
broken = stdenv.isDarwin;
};
}