From d89015db440ad85d18b3dcd593e40552020cb8ef Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Wed, 21 Jul 2021 10:11:05 +0200 Subject: ocamlPackages.yojson: remove legacy version 1.2.3 --- pkgs/development/ocaml-modules/yojson/default.nix | 46 +++++------------------ 1 file changed, 10 insertions(+), 36 deletions(-) (limited to 'pkgs/development/ocaml-modules') diff --git a/pkgs/development/ocaml-modules/yojson/default.nix b/pkgs/development/ocaml-modules/yojson/default.nix index 07025be296ce..2be9ce1b0210 100644 --- a/pkgs/development/ocaml-modules/yojson/default.nix +++ b/pkgs/development/ocaml-modules/yojson/default.nix @@ -1,48 +1,22 @@ -{ lib, stdenv, fetchzip, ocaml, findlib, dune_2, cppo, easy-format, biniou }: -let - pname = "yojson"; - param = - if lib.versionAtLeast ocaml.version "4.02" then rec { - version = "1.7.0"; - url = "https://github.com/ocaml-community/yojson/releases/download/${version}/yojson-${version}.tbz"; - sha256 = "08llz96if8bcgnaishf18si76cv11zbkni0aldb54k3cn7ipiqvd"; - nativeBuildInputs = [ dune_2 ]; - extra = { - installPhase = '' - dune install --prefix $out --libdir $OCAMLFIND_DESTDIR ${pname} - ''; - }; - } else rec { - version = "1.2.3"; - url = "https://github.com/ocaml-community/yojson/archive/v${version}.tar.gz"; - sha256 = "10dvkndgwanvw4agbjln7kgb1n9s6lii7jw82kwxczl5rd1sgmvl"; - extra = { - createFindlibDestdir = true; +{ lib, fetchurl, buildDunePackage, cppo, easy-format, biniou }: - makeFlags = [ "PREFIX=$(out)" ]; - - preBuild = "mkdir $out/bin"; - }; - }; -in -stdenv.mkDerivation ({ - - name = "ocaml${ocaml.version}-${pname}-${param.version}"; +buildDunePackage rec { + pname = "yojson"; + version = "1.7.0"; + useDune2 = true; - src = fetchzip { - inherit (param) url sha256; + src = fetchurl { + url = "https://github.com/ocaml-community/yojson/releases/download/${version}/yojson-${version}.tbz"; + sha256 = "1iich6323npvvs8r50lkr4pxxqm9mf6w67cnid7jg1j1g5gwcvv5"; }; - nativeBuildInputs = [ ocaml findlib ] ++ (param.nativeBuildInputs or []); - propagatedNativeBuildInputs = [ cppo ]; + nativeBuildInputs = [ cppo ]; propagatedBuildInputs = [ easy-format biniou ]; - configurePlatforms = []; meta = with lib; { description = "An optimized parsing and printing library for the JSON format"; homepage = "https://github.com/ocaml-community/${pname}"; license = licenses.bsd3; maintainers = [ maintainers.vbgl ]; - platforms = ocaml.meta.platforms or []; }; -} // param.extra) +} -- cgit 1.4.1