Files
nixpkgs/pkgs/development/ocaml-modules/lablgl/default.nix
T
Ihar Hrachyshka 567e8dfd8e treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01:00

79 lines
1.5 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
ocaml,
findlib,
libGLU,
libglut,
camlp-streams,
}:
stdenv.mkDerivation rec {
pname = "ocaml${ocaml.version}-lablgl";
version = "1.07";
src = fetchFromGitHub {
owner = "garrigue";
repo = "lablgl";
rev = "v${version}";
hash = "sha256-GiQKHMn5zHyvDrA2ve12X5YTm3/RZp8tukIqifgVaW4=";
};
strictDeps = true;
nativeBuildInputs = [
ocaml
findlib
];
buildInputs = [
libglut
camlp-streams
];
propagatedBuildInputs = [
libGLU
];
patches = [ ./META.patch ];
preConfigure = ''
mkdir -p $out/bin
mkdir -p $out/lib/ocaml/${ocaml.version}/site-lib/stublibs
cp \
Makefile.config.${if stdenv.hostPlatform.isDarwin then "osx" else "ex"} \
Makefile.config
'';
makeFlags = [
"BINDIR=${placeholder "out"}/bin/"
"INSTALLDIR=${placeholder "out"}/lib/ocaml/${ocaml.version}/site-lib/lablgl/"
"DLLDIR=${placeholder "out"}/lib/ocaml/${ocaml.version}/site-lib/stublibs/"
"XINCLUDES="
"TKINCLUDES="
"TKLIBS="
];
buildFlags = [
"lib"
"libopt"
"glut"
"glutopt"
];
postInstall = ''
cp ./META $out/lib/ocaml/${ocaml.version}/site-lib/lablgl
'';
meta = {
description = "OpenGL bindings for ocaml";
homepage = "http://wwwfun.kurims.kyoto-u.ac.jp/soft/lsl/lablgl.html";
license = lib.licenses.gpl2;
maintainers = with lib.maintainers; [
pSub
vbgl
];
mainProgram = "lablglut";
broken = lib.versionOlder ocaml.version "4.06";
};
}