ocamlPackages.pprint: 20171003 → 20220103

authored by Vincent Laporte and committed by Vincent Laporte 7c09dc2d e61b18ba

+43 -30
+4
pkgs/development/compilers/mezzo/default.nix
··· 28 28 prePatch = lib.optionalString (check-ocaml-version "4.02") '' 29 29 substituteInPlace myocamlbuild.pre.ml \ 30 30 --replace '@1..3' '@1..2+3' 31 + '' 32 + # Compatibility with PPrint ≥ 20220103 33 + + '' 34 + substituteInPlace typing/Fact.ml --replace PPrintOCaml PPrint.OCaml 31 35 ''; 32 36 33 37 createFindlibDestdir = true;
+4 -1
pkgs/development/ocaml-modules/crowbar/default.nix
··· 14 14 sha256 = "0wjfc9irvirfkic32ivvj6qb7r838w08b0d3vmngigbjpjyc9b14"; 15 15 }; 16 16 17 - minimumOCamlVersion = "4.08"; 17 + minimalOCamlVersion = "4.08"; 18 + 19 + # Fix tests with pprint ≥ 20220103 20 + patches = [ ./pprint.patch ]; 18 21 19 22 # disable xmldiff tests, so we don't need to package unmaintained and legacy pkgs 20 23 postPatch = "rm -rf examples/xmldiff";
+22
pkgs/development/ocaml-modules/crowbar/pprint.patch
··· 1 + commit 77b5e54d33a66445f45ddc48577d835207be8cef 2 + Author: Stephen Dolan <stephen.dolan@cl.cam.ac.uk> 3 + Date: Fri Jun 12 19:34:51 2020 +0100 4 + 5 + Unbreak small example logic 6 + 7 + diff --git a/examples/pprint/test_pprint.ml b/examples/pprint/test_pprint.ml 8 + index 77789ef..44124e7 100644 9 + --- a/examples/pprint/test_pprint.ml 10 + +++ b/examples/pprint/test_pprint.ml 11 + @@ -1,9 +1,9 @@ 12 + -open Crowbar 13 + open PPrint 14 + +open Crowbar 15 + type t = (string * PPrint.document) 16 + let doc = fix (fun doc -> choose [ 17 + const ("", empty); 18 + - const ("a", char 'a'); 19 + + const ("a", PPrint.char 'a'); 20 + const ("123", string "123"); 21 + const ("Hello", string "Hello"); 22 + const ("awordwhichisalittlebittoolong",
+13 -29
pkgs/development/ocaml-modules/pprint/default.nix
··· 1 - { lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild }: 1 + { lib, fetchFromGitHub, buildDunePackage }: 2 2 3 - assert lib.versionAtLeast (lib.getVersion ocaml) "3.12"; 3 + buildDunePackage rec { 4 + pname = "pprint"; 5 + version = "20220103"; 4 6 5 - let param = 6 - if lib.versionAtLeast ocaml.version "4.02" 7 - then { 8 - version = "20171003"; 9 - sha256 = "06zwsskri8kaqjdszj9360nf36zvwh886xwf033aija8c9k4w6cx"; 10 - } else { 11 - version = "20140424"; 12 - sha256 = "0sc9q89dnyarcg24czyhr6ams0ylqvia3745s6rfwd2nldpygsdk"; 13 - }; in 7 + useDune2 = true; 14 8 15 - stdenv.mkDerivation { 16 - 17 - name = "ocaml${ocaml.version}-pprint-${param.version}"; 18 - 19 - src = fetchurl { 20 - url = "http://gallium.inria.fr/~fpottier/pprint/pprint-${param.version}.tar.gz"; 21 - inherit (param) sha256; 9 + src = fetchFromGitHub { 10 + owner = "fpottier"; 11 + repo = pname; 12 + rev = version; 13 + sha256 = "sha256:09y6nwnjldifm47406q1r9987njlk77g4ifqg6qs54dckhr64vax"; 22 14 }; 23 15 24 - buildInputs = [ ocaml findlib ocamlbuild ]; 25 - 26 - createFindlibDestdir = true; 27 - 28 - dontBuild = true; 29 - installFlags = [ "-C" "src" ]; 30 - 31 16 meta = with lib; { 32 - homepage = "http://gallium.inria.fr/~fpottier/pprint/"; 33 - description = "An OCaml adaptation of Wadler’s and Leijen’s prettier printer"; 34 - license = licenses.cecill-c; 17 + inherit (src.meta) homepage; 18 + description = "An OCaml library for pretty-printing textual documents"; 19 + license = licenses.lgpl2Only; 35 20 maintainers = [ maintainers.vbgl ]; 36 - platforms = ocaml.meta.platforms or []; 37 21 }; 38 22 }