From e47dcb9cefdf154450382662fb59db0593eb773f Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Wed, 12 Jul 2017 19:27:37 +0000 Subject: [PATCH] ocamlPackages.tsdl: 0.9.0 -> 0.9.4 --- .../ocaml-modules/tsdl/default.nix | 26 ++++++++----------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/pkgs/development/ocaml-modules/tsdl/default.nix b/pkgs/development/ocaml-modules/tsdl/default.nix index d47d5d3169b6..01fa5b7ba6ab 100644 --- a/pkgs/development/ocaml-modules/tsdl/default.nix +++ b/pkgs/development/ocaml-modules/tsdl/default.nix @@ -1,44 +1,40 @@ -{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, ctypes, result, SDL2, pkgconfig, opam }: +{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, topkg, ctypes, result, SDL2, pkgconfig, opam, ocb-stubblr }: + +if !stdenv.lib.versionAtLeast ocaml.version "4.02" +then throw "tsdl is not available for OCaml ${ocaml.version}" +else let - inherit (stdenv.lib) getVersion; - pname = "tsdl"; - version = "0.9.0"; + version = "0.9.4"; webpage = "http://erratique.ch/software/${pname}"; - in stdenv.mkDerivation { - name = "ocaml-${pname}-${version}"; + name = "ocaml${ocaml.version}-${pname}-${version}"; src = fetchurl { url = "${webpage}/releases/${pname}-${version}.tbz"; - sha256 = "02x0wsy5nxagxrh07yb2h4yqqy1bxryp2gwrylds0j6ybqsv4shm"; + sha256 = "13af37w2wybx8yzgjr5zz5l50402ldl614qiwphl1q69hig5mag2"; }; - buildInputs = [ ocaml findlib ocamlbuild result pkgconfig opam ]; + buildInputs = [ ocaml findlib ocamlbuild topkg result pkgconfig opam ocb-stubblr ]; propagatedBuildInputs = [ SDL2 ctypes ]; createFindlibDestdir = true; unpackCmd = "tar xjf $src"; - buildPhase = '' + preConfigure = '' # The following is done to avoid an additional dependency (ncurses) # due to linking in the custom bytecode runtime. Instead, just # compile directly into a native binary, even if it's just a # temporary build product. substituteInPlace myocamlbuild.ml \ --replace ".byte" ".native" - - ocaml pkg/build.ml native=true native-dynlink=true ''; - installPhase = '' - opam-installer --script --prefix=$out ${pname}.install | sh - ln -s $out/lib/${pname} $out/lib/ocaml/${getVersion ocaml}/site-lib/${pname} - ''; + inherit (topkg) buildPhase installPhase; meta = with stdenv.lib; { homepage = "${webpage}";