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,65 @@
# This file is based on https://github.com/turboMaCk/bs-platform.nix/blob/master/build-bs-platform.nix
# to make potential future updates simpler
{ lib, stdenv, fetchFromGitHub, ninja, runCommand, nodejs, python3,
ocaml-version, version, src,
patches ? [],
ocaml ? (import ./ocaml.nix {
version = ocaml-version;
inherit lib stdenv;
src = "${src}/ocaml";
}),
custom-ninja ? (ninja.overrideAttrs (attrs: {
src = runCommand "ninja-patched-source" {} ''
mkdir -p $out
tar zxvf ${src}/vendor/ninja.tar.gz -C $out
'';
patches = [];
}))
}:
let
bin_folder = if stdenv.isDarwin then "darwin" else "linux";
in
stdenv.mkDerivation rec {
inherit src version patches;
pname = "bs-platform";
BS_RELEASE_BUILD = "true";
# BuckleScript's idiosyncratic build process only builds artifacts required
# for editor-tooling to work when this environment variable is set:
# https://github.com/BuckleScript/bucklescript/blob/7.2.0/scripts/install.js#L225-L227
BS_TRAVIS_CI = "1";
buildInputs = [ nodejs python3 custom-ninja ];
prePatch = ''
sed -i 's:./configure.py --bootstrap:python3 ./configure.py --bootstrap:' ./scripts/install.js
mkdir -p ./native/${ocaml-version}/bin
ln -sf ${ocaml}/bin/* ./native/${ocaml-version}/bin
'';
# avoid building the development version, will break aarch64 build
dontConfigure = true;
buildPhase = ''
# This is an unfortunate name, but it's actually how to build a release
# binary for BuckleScript
npm run postinstall
'';
installPhase = ''
mkdir -p $out/bin
cp -rf jscomp lib ${bin_folder} vendor odoc_gen native bsb bsc bsrefmt $out
mkdir -p $out/lib/ocaml
cp jscomp/runtime/js.* jscomp/runtime/*.cm* $out/lib/ocaml
cp jscomp/others/*.ml jscomp/others/*.mli jscomp/others/*.cm* $out/lib/ocaml
cp jscomp/stdlib-406/*.ml jscomp/stdlib-406/*.mli jscomp/stdlib-406/*.cm* $out/lib/ocaml
cp bsconfig.json package.json $out
ln -s $out/bsb $out/bin/bsb
ln -s $out/bsc $out/bin/bsc
ln -s $out/bsrefmt $out/bin/bsrefmt
'';
}

View file

@ -0,0 +1,27 @@
{ lib, stdenv, runCommand, fetchFromGitHub, ninja, nodejs, python3, ... }:
let
build-bs-platform = import ./build-bs-platform.nix;
in
(build-bs-platform rec {
inherit lib stdenv runCommand fetchFromGitHub ninja nodejs python3;
version = "8.2.0";
ocaml-version = "4.06.1";
patches = [ ./jscomp-release-ninja.patch ];
src = fetchFromGitHub {
owner = "BuckleScript";
repo = "bucklescript";
rev = version;
sha256 = "1hql7sxps1k17zmwyha6idq6nw20abpq770l55ry722birclmsmf";
fetchSubmodules = true;
};
}).overrideAttrs (attrs: {
meta = with lib; {
description = "A JavaScript backend for OCaml focused on smooth integration and clean generated code";
homepage = "https://bucklescript.github.io";
license = licenses.lgpl3;
maintainers = with maintainers; [ turbomack gamb ];
platforms = platforms.all;
};
})

View file

@ -0,0 +1,16 @@
jscomp/others/release.ninja | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/jscomp/others/release.ninja b/jscomp/others/release.ninja
index 9ea6d11c5..a91ed9c80 100644
--- a/jscomp/others/release.ninja
+++ b/jscomp/others/release.ninja
@@ -30,7 +30,7 @@ build others/js_json.cmj : cc_cmi others/js_json.ml | others/js_array2.cmj other
build others/js_json.cmi : cc others/js_json.mli | others/js_dict.cmi others/js_null.cmi others/js_string.cmj others/js_types.cmi runtime
build others/js_list.cmj : cc_cmi others/js_list.ml | others/js_array2.cmj others/js_list.cmi others/js_vector.cmj runtime
build others/js_list.cmi : cc others/js_list.mli | others/js_vector.cmi runtime
-build others/js_mapperRt.cmj : cc_cmi others/js_mapperRt.ml | others/js_mapperRt.cmi runtime
+build others/js_mapperRt.cmj : cc_cmi others/js_mapperRt.ml | others/js_array2.cmj others/js_mapperRt.cmi runtime
build others/js_mapperRt.cmi : cc others/js_mapperRt.mli | runtime
build others/js_math.cmi others/js_math.cmj : cc others/js_math.ml | others/js_int.cmj runtime
build others/js_null.cmj : cc_cmi others/js_null.ml | others/js_exn.cmj others/js_null.cmi runtime

View file

@ -0,0 +1,16 @@
{ lib, stdenv, src, version }:
stdenv.mkDerivation rec {
inherit src version;
pname = "ocaml-bs";
configurePhase = ''
./configure -prefix $out
'';
buildPhase = ''
make -j9 world.opt
'';
meta = with lib; {
branch = "4.06";
platforms = platforms.all;
};
}