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.
main
sternenseemann 3 years ago
parent 0d75cef64f
commit 86ad6b5251
  1. 15
      pkgs/development/interpreters/bqn/cbqn/001-remove-vendoring.diff
  2. 21
      pkgs/development/interpreters/bqn/cbqn/default.nix

@ -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

@ -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"

Loading…
Cancel
Save