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