]> Cypherpunks repositories - keks.git/commitdiff
Workspace creation helper
authorSergey Matveev <stargrave@stargrave.org>
Mon, 12 May 2025 11:36:52 +0000 (14:36 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Mon, 12 May 2025 11:37:09 +0000 (14:37 +0300)
go/cm/utils/mk-bin
go/utils/mk-bin
go/utils/mk-work [new file with mode: 0755]

index 726a79e803d1af0649cf0961cee354f6f0a5696e691d03c2514a61a32b70105c..ee594388588bc4b4f8cda132846950cfdeb89bdf87723e62b9a7f1c6cc9d2e27 100755 (executable)
@@ -1,5 +1,10 @@
 #!/bin/sh -e
 
+[ -d cmd/cmkeytool ] || {
+    echo must be in keks/go/cm/ >&2
+    exit 1
+}
+
 GO_LDFLAGS="${GO_LDFLAGS:--s}"
 root="$(dirname "$(realpath -- "$0")")"
 cd "$root/.."
index f9d150873f8aa66ddea6e36c66147dcbe5f18fe848a94df1259775ebc03019db..0848ee255bf0ea0103b2246eadab0ce0be451e54adfe2786ee489081c27e94bd 100755 (executable)
@@ -1,11 +1,15 @@
 #!/bin/sh -e
 
+[ -d cmd/pp ] || {
+    echo must be in keks/go/ >&2
+    exit 1
+}
+
 GO_LDFLAGS="${GO_LDFLAGS:--s}"
 root="$(dirname "$(realpath -- "$0")")"
 cd "$root/.."
 mkdir -p bin
 bin=$(realpath bin)
+go build -o $bin/keks-schema-validate -ldflags "$GO_LDFLAGS" ./cmd/schema-validate
 cd cmd/pp
 go build -o $bin/kekspp -ldflags "$GO_LDFLAGS"
-cd ../schema-validate
-go build -o $bin/keks-schema-validate -ldflags "$GO_LDFLAGS"
diff --git a/go/utils/mk-work b/go/utils/mk-work
new file mode 100755 (executable)
index 0000000..1e19a8e
--- /dev/null
@@ -0,0 +1,52 @@
+#!/bin/sh -ex
+# Prepare deps/ directory with non-go-get-able dependencies and
+# add them to initialised go.work
+
+command -v fetch >/dev/null && DL="fetch -o" || DL="wget -O"
+command -v sha512 >/dev/null && SHA512="sha512" || SHA512="sha512sum --binary"
+
+[ -d cmd/pp ] || {
+    echo must be in keks/go/ >&2
+    exit 1
+}
+if [ -d deps ] ; then
+    echo deps/ already exists >&2
+    exit 1
+fi
+if [ -r go.work ] ; then
+    echo go.work already exists >&2
+    exit 1
+fi
+
+mkdir deps
+cd deps
+
+dl() {
+    fn=$1
+    url="$2"
+    hsh=$3
+    [ -s "$fn" ] || {
+        $DL $fn.tmp "$url"
+        mv $fn.tmp $fn
+    }
+    our=$($SHA512 <$fn | { read our rem ; echo $our ; })
+    [ "$hsh" = "$our" ]
+}
+
+dl tai64n-v4.1.1.zip http://proxy.go.cypherpunks.su/go.cypherpunks.su/tai64n/v4/@v/v4.1.1.zip 3833d458d380c1058f37f99666fa5e3dec00392fda4975a18bd77d0784c911a23a7e8be2f9428b8c3a47a75392bf9ca0ca8685e33a288d1c4a321a0f6d804af0
+dl balloon-v3.0.0.zip http://proxy.go.cypherpunks.su/go.cypherpunks.su/balloon/v3/@v/v3.0.0.zip 2273c463432fa85ca5bee321f7f0a189b51ec0bfe7eb7cfced28ce94420528915300ef87d76c4f91e0986e42862d44af511112763f2775d0b096fa82ebe41e0e
+dl gogost-6.1.0.tar.zst http://www.gogost.cypherpunks.su/gogost-6.1.0.tar.zst 80eb41675833b7476b99423bba23f431e48644dfc05510aa6c70efb2bdd10ce8cce56666404daf8dd4b7d748cd2d016b323db9a492ec82c79aab83f4f52553f1
+unzip tai64n-v4.1.1.zip
+unzip balloon-v3.0.0.zip
+rm -fr gogost-6.1.0
+tar xf gogost-6.1.0.tar.zst
+mkdir -p go.cypherpunks.su/gogost
+mv gogost-6.1.0 go.cypherpunks.su/gogost/v6@v6.1.0
+
+( cd .. ; go work init )
+( cd .. ; go work use . )
+( cd ../cmd/pp ; go work use . )
+( cd ../cm ; go work use . )
+( cd go.cypherpunks.su/tai64n/v4@v4.1.1 ; go work use . )
+( cd go.cypherpunks.su/balloon/v3@v3.0.0 ; go work use . )
+( cd go.cypherpunks.su/gogost/v6@v6.1.0 ; go work use . )