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:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
71
pkgs/development/interpreters/bqn/cbqn/default.nix
Normal file
71
pkgs/development/interpreters/bqn/cbqn/default.nix
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
{ lib
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, genBytecode ? false
|
||||
, bqn-path ? null
|
||||
, mbqn-source ? null
|
||||
}:
|
||||
|
||||
let
|
||||
cbqn-bytecode-files = fetchFromGitHub {
|
||||
name = "cbqn-bytecode-files";
|
||||
owner = "dzaima";
|
||||
repo = "CBQN";
|
||||
rev = "c39653c898531a2cdbf4cc5c764df6e37b1894a4";
|
||||
hash = "sha256-JCEmkwh5Rv5+NQoxvefSrYnayU892/Wam+gjMgcQmO0=";
|
||||
};
|
||||
in
|
||||
assert genBytecode -> ((bqn-path != null) && (mbqn-source != null));
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "cbqn" + lib.optionalString (!genBytecode) "-standalone";
|
||||
version = "0.pre+date=2022-05-06";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "dzaima";
|
||||
repo = "CBQN";
|
||||
rev = "3496a939b670f8c9ca2a04927378d6b7e9abd68e";
|
||||
hash = "sha256-P+PoY4XF9oEw7VIpmybvPp+jxWHEo2zt1Lamayf1mHg=";
|
||||
};
|
||||
|
||||
dontConfigure = true;
|
||||
|
||||
postPatch = ''
|
||||
sed -i '/SHELL =.*/ d' makefile
|
||||
'';
|
||||
|
||||
makeFlags = [
|
||||
"CC=${stdenv.cc.targetPrefix}cc"
|
||||
];
|
||||
|
||||
preBuild = ''
|
||||
# Purity: avoids git downloading bytecode files
|
||||
touch src/gen/customRuntime
|
||||
'' + (if genBytecode then ''
|
||||
${bqn-path} genRuntime ${mbqn-source}
|
||||
'' else ''
|
||||
cp ${cbqn-bytecode-files}/src/gen/{compiles,formatter,runtime0,runtime1,src} src/gen/
|
||||
'');
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out/bin/
|
||||
cp BQN -t $out/bin/
|
||||
# note guard condition for case-insensitive filesystems
|
||||
[ -e $out/bin/bqn ] || ln -s $out/bin/BQN $out/bin/bqn
|
||||
[ -e $out/bin/cbqn ] || ln -s $out/bin/BQN $out/bin/cbqn
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://github.com/dzaima/CBQN/";
|
||||
description = "BQN implementation in C";
|
||||
license = licenses.gpl3Plus;
|
||||
maintainers = with maintainers; [ AndersonTorres sternenseemann synthetica shnarazk ];
|
||||
platforms = platforms.all;
|
||||
};
|
||||
}
|
||||
# TODO: version cbqn-bytecode-files
|
||||
# TODO: test suite
|
||||
72
pkgs/development/interpreters/bqn/dzaima-bqn/default.nix
Normal file
72
pkgs/development/interpreters/bqn/dzaima-bqn/default.nix
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
{ lib
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, jdk
|
||||
, makeWrapper
|
||||
, buildNativeImage ? true
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "dbqn" + lib.optionalString buildNativeImage "-native";
|
||||
version = "0.2.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "dzaima";
|
||||
repo = "BQN";
|
||||
rev = "v${version}";
|
||||
sha256 = "1kxzxz2hrd1871281s4rsi569qk314aqfmng9pkqn8gv9nqhmph0";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
jdk
|
||||
makeWrapper
|
||||
];
|
||||
|
||||
dontConfigure = true;
|
||||
|
||||
postPatch = ''
|
||||
patchShebangs --build ./build8
|
||||
'';
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
|
||||
./build8
|
||||
'' + lib.optionalString buildNativeImage ''
|
||||
native-image --report-unsupported-elements-at-runtime \
|
||||
-H:CLibraryPath=${lib.getLib jdk}/lib -J-Dfile.encoding=UTF-8 \
|
||||
-jar BQN.jar dbqn
|
||||
'' + ''
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out/bin
|
||||
|
||||
'' + (if buildNativeImage then ''
|
||||
mv dbqn $out/bin
|
||||
'' else ''
|
||||
mkdir -p $out/share/${pname}
|
||||
mv BQN.jar $out/share/${pname}/
|
||||
|
||||
makeWrapper "${lib.getBin jdk}/bin/java" "$out/bin/dbqn" \
|
||||
--add-flags "-jar $out/share/${pname}/BQN.jar"
|
||||
'') + ''
|
||||
ln -s $out/bin/dbqn $out/bin/bqn
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://github.com/dzaima/BQN";
|
||||
description = "A BQN implementation in Java" + lib.optionalString buildNativeImage ", compiled as a native image";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ AndersonTorres sternenseemann ];
|
||||
inherit (jdk.meta) platforms;
|
||||
broken = stdenv.isDarwin; # never built on Hydra https://hydra.nixos.org/job/nixpkgs/staging-next/dbqn-native.x86_64-darwin
|
||||
};
|
||||
}
|
||||
# TODO: Processing app
|
||||
# TODO: minimalistic JDK
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
diff -Naur source-old/bqn.js source-new/bqn.js
|
||||
--- source-old/bqn.js 1969-12-31 21:00:01.000000000 -0300
|
||||
+++ source-new/bqn.js 2021-10-03 01:28:00.268998916 -0300
|
||||
@@ -4,7 +4,7 @@
|
||||
let path = require('path');
|
||||
let fs = require('fs');
|
||||
|
||||
-let bqn = require("./docs/bqn.js");
|
||||
+let bqn = require("@libbqn@");
|
||||
module.exports = bqn;
|
||||
let {fmt,fmtErr,sysvals,sysargs,makebqn,makerepl}=bqn;
|
||||
let {has,list,str,unstr,dynsys,req1str,makens}=bqn.util;
|
||||
64
pkgs/development/interpreters/bqn/mlochbaum-bqn/default.nix
Normal file
64
pkgs/development/interpreters/bqn/mlochbaum-bqn/default.nix
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
{ lib
|
||||
, stdenvNoCC
|
||||
, fetchFromGitHub
|
||||
, makeWrapper
|
||||
, nodejs
|
||||
}:
|
||||
|
||||
stdenvNoCC.mkDerivation rec {
|
||||
pname = "bqn";
|
||||
version = "0.pre+date=2021-12-13";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "mlochbaum";
|
||||
repo = "BQN";
|
||||
rev = "2c2e86e10ff963a6aefa14f76fd8833ce3c9157c";
|
||||
hash = "sha256-iAlDXGlHTeI6+r/QKFiBHhj5A+FgUy7JFrCpAwpyVQU=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
|
||||
buildInputs = [ nodejs ];
|
||||
|
||||
patches = [
|
||||
# Creates a @libbqn@ substitution variable, to be filled in the fixupPhase
|
||||
./001-libbqn-path.patch
|
||||
];
|
||||
|
||||
dontConfigure = true;
|
||||
|
||||
dontBuild = true;
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out/bin $out/share/${pname}
|
||||
cp bqn.js $out/share/${pname}/bqn.js
|
||||
cp docs/bqn.js $out/share/${pname}/libbqn.js
|
||||
|
||||
makeWrapper "${lib.getBin nodejs}/bin/node" "$out/bin/mbqn" \
|
||||
--add-flags "$out/share/${pname}/bqn.js"
|
||||
|
||||
ln -s $out/bin/mbqn $out/bin/bqn
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
fixupPhase = ''
|
||||
runHook preFixup
|
||||
|
||||
substituteInPlace $out/share/${pname}/bqn.js \
|
||||
--subst-var-by "libbqn" "$out/share/${pname}/libbqn.js"
|
||||
|
||||
runHook postFixup
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://github.com/mlochbaum/BQN/";
|
||||
description = "The original BQN implementation in Javascript";
|
||||
license = licenses.isc;
|
||||
maintainers = with maintainers; [ AndersonTorres ];
|
||||
platforms = platforms.all;
|
||||
};
|
||||
}
|
||||
# TODO: install docs and other stuff
|
||||
Loading…
Add table
Add a link
Reference in a new issue