ocamlPackages.lablgl: 1.05 → 1.06

This commit is contained in:
Vincent Laporte 2021-11-30 17:46:07 +01:00 committed by Vincent Laporte
parent b17f3a4d71
commit 856f4cde2d

View File

@ -1,34 +1,36 @@
{lib, stdenv, fetchurl, ocaml, lablgtk, findlib, libGLU, libGL, freeglut, camlp4 } :
{ lib, stdenv, fetchFromGitHub, ocaml, findlib, libGLU, libGL, freeglut } :
let
pname = "lablgl";
in
if !lib.versionAtLeast ocaml.version "4.03"
then throw "lablgl is not available for OCaml ${ocaml.version}"
else
stdenv.mkDerivation rec {
name = "${pname}-${version}";
version = "1.05";
pname = "ocaml${ocaml.version}-lablgl";
version = "1.06";
src = fetchurl {
url = "http://wwwfun.kurims.kyoto-u.ac.jp/soft/lsl/dist/lablgl-${version}.tar.gz";
sha256 = "0qabydd219i4ak7hxgc67496qnnscpnydya2m4ijn3cpbgih7zyq";
src = fetchFromGitHub {
owner = "garrigue";
repo = "lablgl";
rev = "v${version}";
sha256 = "sha256:141kc816iv59z96738i3vn9m9iw9g2zhi45hk4cchpwd99ar5l6k";
};
buildInputs = [ocaml findlib lablgtk freeglut camlp4];
buildInputs = [ ocaml findlib freeglut ];
propagatedBuildInputs = [ libGLU libGL ];
patches = [ ./Makefile.config.patch ./META.patch ];
preConfigure = ''
mkdir -p $out/bin
mkdir -p $out/lib/ocaml/${ocaml.version}/site-lib/stublibs
substituteInPlace Makefile.config \
--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/lablgl \
--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 ""
'';
createFindlibDestdir = true;
buildFlags = [ "lib" "libopt" "glut" "glutopt" ];
postInstall = ''