reason: ppxlib migration (#126066)

* reason: refactoring

* reason: add superherointj as maintainer

* reason: ppxlib migration

Migrate from ocaml-migrate-parsetree to ppxlib fixing conflicts in downstream dependencies.

* reason: add downloadPage to meta

* reason: removed maintainer volth by his request

* reason: add test hello
This commit is contained in:
superherointj 2021-06-08 18:20:38 -03:00 committed by GitHub
parent 70346bf6d0
commit e075fef89f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 61 additions and 6 deletions

View File

@ -1,5 +1,5 @@
{ lib, stdenv, makeWrapper, fetchFromGitHub, ocaml, findlib, dune_2
, fix, menhir, menhirLib, menhirSdk, merlin-extend, ppx_tools_versioned, utop, cppo
{ lib, callPackage, stdenv, makeWrapper, fetchFromGitHub, ocaml, findlib, dune_2
, fix, menhir, menhirLib, menhirSdk, merlin-extend, ppxlib, utop, cppo, ppx_derivers
}:
stdenv.mkDerivation rec {
@ -13,11 +13,28 @@ stdenv.mkDerivation rec {
sha256 = "0m6ldrci1a4j0qv1cbwh770zni3al8qxsphl353rv19f6rblplhs";
};
nativeBuildInputs = [ makeWrapper menhir ];
nativeBuildInputs = [
makeWrapper
menhir
];
propagatedBuildInputs = [ menhirLib merlin-extend ppx_tools_versioned ];
buildInputs = [
cppo
dune_2
findlib
fix
menhir
menhirSdk
ocaml
ppxlib
utop
];
buildInputs = [ ocaml findlib dune_2 cppo fix utop menhir menhirSdk ];
propagatedBuildInputs = [
menhirLib
merlin-extend
ppx_derivers
];
buildFlags = [ "build" ]; # do not "make tests" before reason lib is installed
@ -29,11 +46,16 @@ stdenv.mkDerivation rec {
--prefix OCAMLPATH : "$OCAMLPATH:$OCAMLFIND_DESTDIR"
'';
passthru.tests = {
hello = callPackage ./tests/hello { };
};
meta = with lib; {
homepage = "https://reasonml.github.io/";
downloadPage = "https://github.com/reasonml/reason";
description = "Facebook's friendly syntax to OCaml";
license = licenses.mit;
inherit (ocaml.meta) platforms;
maintainers = [ maintainers.volth ];
maintainers = with maintainers; [ superherointj ];
};
}

View File

@ -0,0 +1,23 @@
{ lib, buildDunePackage, reason }:
buildDunePackage rec {
pname = "helloreason";
version = "0.0.1";
src = ./.;
useDune2 = true;
buildInputs = [
reason
];
doCheck = true;
doInstallCheck = true;
postInstallCheck = ''
$out/bin/${pname} | grep -q "Hello From Reason" > /dev/null
'';
meta.timeout = 60;
}

View File

@ -0,0 +1,4 @@
(executable
(name helloreason)
(public_name helloreason)
(libraries reason))

View File

@ -0,0 +1,6 @@
let sayHello = () => {
let fromWhom = "From Reason";
print_endline("Hello " ++ fromWhom);
};
sayHello();