summaryrefslogtreecommitdiff
path: root/ctftilde/gen-pre-inst-config-scm
diff options
context:
space:
mode:
authorW. Kosior <koszko@koszko.org>2024-05-18 01:00:12 +0200
committerW. Kosior <koszko@koszko.org>2024-05-18 01:00:22 +0200
commit2b55cf92033ed02cabd545540241585e05f1fbb0 (patch)
tree9da86016dea518287552b56aaf457da970d4220f /ctftilde/gen-pre-inst-config-scm
downloadAGH-ctf-course-2024-2b55cf92033ed02cabd545540241585e05f1fbb0.tar.gz
AGH-ctf-course-2024-2b55cf92033ed02cabd545540241585e05f1fbb0.zip
Initial commit.
Diffstat (limited to 'ctftilde/gen-pre-inst-config-scm')
-rwxr-xr-xctftilde/gen-pre-inst-config-scm20
1 files changed, 20 insertions, 0 deletions
diff --git a/ctftilde/gen-pre-inst-config-scm b/ctftilde/gen-pre-inst-config-scm
new file mode 100755
index 0000000..85b3220
--- /dev/null
+++ b/ctftilde/gen-pre-inst-config-scm
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+builddir="$(cd "$(dirname "$0")" && pwd -P)"
+cd "$builddir"
+
+eval "$(awk '/^srcdir=/ {print $0; exit(0);}' "$builddir"/config.status)"
+srcdir="$(cd "$srcdir" && pwd -P)"
+
+printf '%s' '
+(define-module ('"$1"' pre-inst-config)
+ #:export (config))
+
+(define datarootpath
+ (map (lambda (base)
+ (string-append base "/src/resources"))
+ `("'"$builddir"'" "'"$srcdir"'")))
+
+(define config
+ `((datarootpath . ,datarootpath)))
+'