From 86ad6b525104531796b68dda4f76aa5e8fc14193 Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Tue, 5 Oct 2021 14:31:31 +0200 Subject: [PATCH] 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. --- .../bqn/cbqn/001-remove-vendoring.diff | 15 ------------- .../interpreters/bqn/cbqn/default.nix | 21 +++++++------------ 2 files changed, 8 insertions(+), 28 deletions(-) delete mode 100644 pkgs/development/interpreters/bqn/cbqn/001-remove-vendoring.diff diff --git a/pkgs/development/interpreters/bqn/cbqn/001-remove-vendoring.diff b/pkgs/development/interpreters/bqn/cbqn/001-remove-vendoring.diff deleted file mode 100644 index 253740df8b88..000000000000 --- a/pkgs/development/interpreters/bqn/cbqn/001-remove-vendoring.diff +++ /dev/null @@ -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 diff --git a/pkgs/development/interpreters/bqn/cbqn/default.nix b/pkgs/development/interpreters/bqn/cbqn/default.nix index 68bd9a2b8740..71fdcae005be 100644 --- a/pkgs/development/interpreters/bqn/cbqn/default.nix +++ b/pkgs/development/interpreters/bqn/cbqn/default.nix @@ -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"