From d226cb45416ed624d48bf96c63d3b01166248d19 Mon Sep 17 00:00:00 2001 From: sternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org> Date: Thu, 21 Jan 2021 15:21:29 +0100 Subject: [PATCH] ocamlPackages.opam-file-format: build using dune Since has been merged, switching opam-file-format doesn't create a cyclical dependency of opam-file-format -> dune -> opaline -> opam-file-format anymore. Thus we switch to dune which seems to be supported better by upstream and doesn't require us to patch the 2.1.2 release. --- .../opam-file-format/default.nix | 25 +++++-------------- .../opam-file-format/optional-static.patch | 13 ---------- 2 files changed, 6 insertions(+), 32 deletions(-) delete mode 100644 pkgs/development/ocaml-modules/opam-file-format/optional-static.patch diff --git a/pkgs/development/ocaml-modules/opam-file-format/default.nix b/pkgs/development/ocaml-modules/opam-file-format/default.nix index 04079fcb4761..dd16a369881c 100644 --- a/pkgs/development/ocaml-modules/opam-file-format/default.nix +++ b/pkgs/development/ocaml-modules/opam-file-format/default.nix @@ -1,35 +1,22 @@ -{ stdenv, lib, fetchpatch, fetchFromGitHub, ocaml, findlib }: +{ lib, buildDunePackage, fetchFromGitHub }: -stdenv.mkDerivation rec { +buildDunePackage rec { version = "2.1.2"; - name = "ocaml${ocaml.version}-opam-file-format-${version}"; + pname = "opam-file-format"; + + useDune2 = true; src = fetchFromGitHub { owner = "ocaml"; - repo = "opam-file-format"; + repo = pname; rev = version; sha256 = "19xppn2s3yjid8jc1wh8gdf5mgmlpzby2cf2slmnbyrgln3vj6i2"; }; - buildInputs = [ ocaml findlib ]; - - installFlags = [ "LIBDIR=$(OCAMLFIND_DESTDIR)" ]; - - patches = [ - ./optional-static.patch - # fix no implementation error for OpamParserTypes - # can be removed at next release presumably - (fetchpatch { - url = "https://github.com/ocaml/opam-file-format/pull/41/commits/2a9a92ec334e0bf2adf8d2b4c1b83f1f9f68df8f.patch"; - sha256 = "090nl7yciyyidmbjfryw3wyx7srh6flnrr4zgyhv4kvjsvq944y2"; - }) - ]; - meta = { description = "Parser and printer for the opam file syntax"; license = lib.licenses.lgpl21; maintainers = [ lib.maintainers.vbgl ]; inherit (src.meta) homepage; - inherit (ocaml.meta) platforms; }; } diff --git a/pkgs/development/ocaml-modules/opam-file-format/optional-static.patch b/pkgs/development/ocaml-modules/opam-file-format/optional-static.patch deleted file mode 100644 index 5501fdd0c6c3..000000000000 --- a/pkgs/development/ocaml-modules/opam-file-format/optional-static.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -u a/Makefile b/Makefile ---- a/Makefile -+++ b/Makefile -@@ -1,1 +1,5 @@ --TARGETS = opam-file-format.cma opam-file-format.cmxa opam-file-format.cmxs -+TARGETS = opam-file-format.cma opam-file-format.cmxa -+ -+ifeq "$(NATDYNLINK)" "true" -+TARGETS = $(TARGETS) opam-file-format.cmxs -+endif - -all: $(TARGETS) -