From aa3535cee57479a8f0721c3e05c4e91966ecdcd6 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Sat, 7 Oct 2017 05:15:50 +0000 Subject: [PATCH] ocamlPackages.xmlm: 1.2.0 -> 1.3.0 --- .../ocaml-modules/xmlm/default.nix | 25 +++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/pkgs/development/ocaml-modules/xmlm/default.nix b/pkgs/development/ocaml-modules/xmlm/default.nix index d94a3eac873a..7f5bcb03ad6c 100644 --- a/pkgs/development/ocaml-modules/xmlm/default.nix +++ b/pkgs/development/ocaml-modules/xmlm/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, opam }: +{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, opam, topkg }: let pname = "xmlm"; webpage = "http://erratique.ch/software/${pname}"; @@ -6,22 +6,37 @@ in assert stdenv.lib.versionAtLeast ocaml.version "3.12"; +let param = + if stdenv.lib.versionAtLeast ocaml.version "4.02" + then { + version = "1.3.0"; + sha256 = "1rrdxg5kh9zaqmgapy9bhdqyxbbvxxib3bdfg1vhw4rrkp1z0x8n"; + buildInputs = [ topkg ]; + inherit (topkg) buildPhase; + } else { + version = "1.2.0"; + sha256 = "1jywcrwn5z3gkgvicr004cxmdaqfmq8wh72f81jqz56iyn5024nh"; + buildInputs = []; + buildPhase = "./pkg/build true"; + }; +in + stdenv.mkDerivation rec { name = "ocaml-${pname}-${version}"; - version = "1.2.0"; + inherit (param) version; src = fetchurl { url = "${webpage}/releases/${pname}-${version}.tbz"; - sha256 = "1jywcrwn5z3gkgvicr004cxmdaqfmq8wh72f81jqz56iyn5024nh"; + inherit (param) sha256; }; - buildInputs = [ ocaml findlib ocamlbuild opam ]; + buildInputs = [ ocaml findlib ocamlbuild opam ] ++ param.buildInputs; createFindlibDestdir = true; unpackCmd = "tar xjf $src"; - buildPhase = "./pkg/build true"; + inherit (param) buildPhase; installPhase = '' opam-installer --script --prefix=$out ${pname}.install > install.sh