uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead

https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948
this can do it nicely.

Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
Anton Arapov 2021-04-03 12:58:10 +02:00 committed by Alan Daniels
commit 56de2bcd43
30691 changed files with 3076956 additions and 0 deletions

View file

@ -0,0 +1,88 @@
{ lib
, substituteAll
, fetchurl
, ocaml
, dune_2
, buildDunePackage
, yojson
, csexp
, result
, dot-merlin-reader
, jq
, menhir
, menhirLib
, menhirSdk
}:
let
merlinVersion = "4.5";
hashes = {
"4.5-411" = "sha256:05nz6y7r91rh0lj8b6xdv3s3yknmvjc7y60v17kszgqnr887bvpn";
"4.5-412" = "sha256:0i5c3rfzinmwdjya7gv94zyknsm32qx9dlg472xpfqivwvnnhf1z";
"4.5-413" = "sha256:1sphq9anfg1qzrvj7hdcqflj6cmc1qiyfkljhng9fxnnr0i7550s";
"4.5-414" = "sha256:13h588kwih05zd9p3p7q528q4zc0d1l983kkvbmkxgay5d17nn1i";
};
ocamlVersionShorthand = lib.concatStrings
(lib.take 2 (lib.splitVersion ocaml.version));
version = "${merlinVersion}-${ocamlVersionShorthand}";
in
if !lib.hasAttr version hashes
then builtins.throw "merlin ${merlinVersion} is not available for OCaml ${ocaml.version}"
else
buildDunePackage {
pname = "merlin";
inherit version;
src = fetchurl {
url = "https://github.com/ocaml/merlin/releases/download/v${version}/merlin-${version}.tbz";
sha256 = hashes."${version}";
};
patches = [
(substituteAll {
src = ./fix-paths.patch;
dot_merlin_reader = "${dot-merlin-reader}/bin/dot-merlin-reader";
dune = "${dune_2}/bin/dune";
})
] ++ lib.optional (lib.versionOlder ocaml.version "4.12")
# This fixes the test-suite on macOS
# See https://github.com/ocaml/merlin/pull/1399
# Fixed in 4.4 for OCaml ≥ 4.12
./test.patch
;
strictDeps = true;
nativeBuildInputs = [
menhir
jq
];
buildInputs = [
dot-merlin-reader
yojson
csexp
result
menhirSdk
menhirLib
];
doCheck = true;
checkPhase = ''
runHook preCheck
patchShebangs tests/merlin-wrapper
dune runtest # filtering with -p disables tests
runHook postCheck
'';
meta = with lib; {
description = "An editor-independent tool to ease the development of programs in OCaml";
homepage = "https://github.com/ocaml/merlin";
license = licenses.mit;
maintainers = [ maintainers.vbgl maintainers.sternenseemann ];
};
}

View file

@ -0,0 +1,35 @@
{ lib, fetchurl, buildDunePackage, substituteAll
, dot-merlin-reader, dune_2, yojson, csexp, result, menhirSdk }:
buildDunePackage rec {
pname = "merlin";
version = "3.4.2";
src = fetchurl {
url = "https://github.com/ocaml/merlin/releases/download/v${version}/merlin-v${version}.tbz";
sha256 = "e1b7b897b11119d92995c558530149fd07bd67a4aaf140f55f3c4ffb5e882a81";
};
useDune2 = true;
minimumOCamlVersion = "4.02.3";
patches = [
(substituteAll {
src = ./fix-paths.patch;
dot_merlin_reader = "${dot-merlin-reader}/bin/dot-merlin-reader";
dune = "${dune_2}/bin/dune";
})
];
strictDeps = true;
buildInputs = [ dot-merlin-reader yojson csexp result menhirSdk ];
meta = with lib; {
description = "An editor-independent tool to ease the development of programs in OCaml";
homepage = "https://github.com/ocaml/merlin";
license = licenses.mit;
maintainers = [ maintainers.vbgl ];
};
}

View file

@ -0,0 +1,24 @@
{ lib, fetchurl, yojson, csexp, result, buildDunePackage }:
buildDunePackage rec {
pname = "dot-merlin-reader";
version = "4.1";
useDune2 = true;
minimumOCamlVersion = "4.06";
src = fetchurl {
url = "https://github.com/ocaml/merlin/releases/download/v${version}/dot-merlin-reader-v${version}.tbz";
sha256 = "14a36d6fb8646a5df4530420a7861722f1a4ee04753717947305e3676031e7cd";
};
buildInputs = [ yojson csexp result ];
meta = with lib; {
description = "Reads config files for merlin";
homepage = "https://github.com/ocaml/merlin";
license = licenses.mit;
maintainers = [ maintainers.hongchangwu ];
};
}

View file

@ -0,0 +1,15 @@
--- a/src/kernel/mconfig_dot.ml
+++ b/src/kernel/mconfig_dot.ml
@@ -126,10 +126,10 @@ module Configurator = struct
let prog, args =
match cfg with
| Dot_merlin ->
- let prog = "dot-merlin-reader" in
+ let prog = "@dot_merlin_reader@" in
prog, [| prog |]
| Dune ->
- let prog = "dune" in
+ let prog = "@dune@" in
prog, [| prog; "ocaml-merlin"; "--no-print-directory" |]
in
log ~title:"get_config" "Using %s configuration provider." (to_string cfg);

View file

@ -0,0 +1,19 @@
commit 282eed37f39ff216add8d53766fd59f3737eb87f
Author: Vincent Laporte <Vincent.Laporte@gmail.com>
Date: Thu Nov 4 06:24:07 2021 +0100
Ignore dune stderr in tests
diff --git a/tests/test-dirs/document/src-documentation.t/run.t b/tests/test-dirs/document/src-documentation.t/run.t
index 2c9e1419..4f4c4327 100644
--- a/tests/test-dirs/document/src-documentation.t/run.t
+++ b/tests/test-dirs/document/src-documentation.t/run.t
@@ -42,7 +42,7 @@ documentation for the non-last defined value (in the same file) is show
> jq '.value'
" List reversal. "
- $ dune build --root=. ./doc.exe
+ $ dune build --root=. ./doc.exe 2> /dev/null
$ cat >.merlin <<EOF
> B _build/default/.doc.eobjs/byte
> S .