Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{stdenv, lib, fetchurl, ocaml, pkg-config, findlib, SDL, SDL_image, SDL_mixer, SDL_ttf, SDL_gfx, lablgl }:
2
3let
4 pname = "ocamlsdl";
5in
6
7if lib.versionAtLeast ocaml.version "4.06"
8then throw "${pname} is not available for OCaml ${ocaml.version}"
9else
10
11stdenv.mkDerivation rec {
12 name = "${pname}-${version}";
13 version = "0.9.1";
14
15 src = fetchurl {
16 url = "mirror://sourceforge/project/ocamlsdl/OCamlSDL/ocamlsdl-0.9.1/ocamlsdl-0.9.1.tar.gz";
17 sha256 = "abfb295b263dc11e97fffdd88ea1a28b46df8cc2b196777093e4fe7f509e4f8f";
18 };
19
20 strictDeps = true;
21
22 nativeBuildInputs = [ pkg-config ocaml findlib ];
23 buildInputs = [ SDL SDL_image SDL_mixer SDL_ttf SDL_gfx lablgl ];
24
25 propagatedBuildInputs = [ SDL SDL_image SDL_mixer SDL_ttf SDL_gfx pkg-config ];
26 createFindlibDestdir = true;
27
28 meta = {
29 homepage = "http://ocamlsdl.sourceforge.net/";
30 description = "OCaml bindings for SDL 1.2";
31 license = lib.licenses.lgpl21;
32 };
33}