3
0
Fork 0
forked from mirrors/nixpkgs

cbqn: remove vendoring using builtin capabilities

The makefile (counterintuitively) checks src/gen/customRuntime to see if
the bytecode is up to date. By simply touch(1)-ing it, we can save
maintaining a patch.
This commit is contained in:
sternenseemann 2021-10-05 14:31:31 +02:00
parent 0d75cef64f
commit 86ad6b5251
2 changed files with 8 additions and 28 deletions

View file

@ -1,15 +0,0 @@
diff --git a/makefile b/makefile
index a5f3d75..f617e25 100644
--- a/makefile
+++ b/makefile
@@ -109,9 +109,7 @@ ${bd}/%.o: src/builtins/%.c
src/gen/customRuntime:
- @echo "Copying precompiled bytecode from the bytecode branch"
- git checkout remotes/origin/bytecode src/gen/{compiler,formatter,runtime0,runtime1,src}
- git reset src/gen/{compiler,formatter,runtime0,runtime1,src}
+ @echo "src/gen/ files retrieved externally"
${bd}/load.o: src/gen/customRuntime
-include $(bd)/*.d

View file

@ -29,23 +29,18 @@ stdenv.mkDerivation rec {
dontConfigure = true;
patches = [
# self-explaining
./001-remove-vendoring.diff
];
postPatch = ''
sed -i '/SHELL =.*/ d' makefile
'';
preBuild =
if genBytecode
then ''
${bqn-path} genRuntime ${mbqn-source}
''
else ''
cp ${cbqn-bytecode-files}/src/gen/{compiler,formatter,runtime0,runtime1,src} src/gen/
'';
preBuild = ''
# inform make we are providing the runtime ourselves
touch src/gen/customRuntime
'' + (if genBytecode then ''
${bqn-path} genRuntime ${mbqn-source}
'' else ''
cp ${cbqn-bytecode-files}/src/gen/{compiler,formatter,runtime0,runtime1,src} src/gen/
'');
makeFlags = [
"CC=${stdenv.cc.targetPrefix}cc"