Zenodo packaging hacks draft tip

Mon, 05 Dec 2022 23:50:22 +0200

author
Tuomo Valkonen <tuomov@iki.fi>
date
Mon, 05 Dec 2022 23:50:22 +0200
changeset 80
24e470b278e4
parent 79
b6af27f72492

Zenodo packaging hacks

README.md file | annotate | diff | comparison | revisions
package.sh file | annotate | diff | comparison | revisions
--- a/README.md	Tue Jul 28 22:00:55 2026 -0500
+++ b/README.md	Mon Dec 05 23:50:22 2022 +0200
@@ -20,8 +20,7 @@
 
 Most dependencies are managed by the Cargo build system of [Rust]. You will
 only need to install the “nightly” Rust compiler and the
-[GNU Scientific Library] manually. At the time of writing this README,
-[alg_tools] also needs to be downloaded separately.
+[GNU Scientific Library] manually.
 
 1.  Install the [Rust] infrastructure (including Cargo) with [rustup].
 2.  Install a “nightly” release of the Rust compiler. With rustup, installed in
@@ -39,9 +38,6 @@
     extra `RUSTFLAGS` options to Cargo in the following steps to locate the
     library.
 
-4. Download [alg_tools] and unpack it under the same directory as this
-   package.
-
   [rustup]: https://rustup.rs
   [alg_tools]: https://tuomov.iki.fi/software/alg_tools/
   [Rust]: https://www.rust-lang.org/
@@ -90,3 +86,8 @@
 generated documentation through an ugly workaround. Unfortunately,
 `rustdoc`, akin to Rust largely itself, is stuck in 80's 7-bit gringo ASCII
 world, and does not support modern markdown features, such as mathematics.
+
+## Source repository
+
+A Mercurial repository is available; see
+https://tuomov.iki.fi/software/pointsource_algs/.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/package.sh	Mon Dec 05 23:50:22 2022 +0200
@@ -0,0 +1,24 @@
+#!/bin/sh
+t=$(mktemp -d)
+v=$(sed 's/^version = \"\(.*\)\"/\1/p; d;' Cargo.toml | head -1)
+n="pointsource_algs-$v"
+f="$n.zip"
+if test -f "$f"; then
+    echo "$n already exists"
+    exit 1
+fi
+echo "Assembling $f..."
+hg archive -X .gitignore -X .hgignore "$t/$n"
+rm "$t/$n/package.sh"
+deps="alg_tools pointsource_algs measures"
+for d in $deps; do
+    hg -R ../$d archive -X ../$d/.gitignore -X ../$d/.hgignore "$t/$n/$d"
+done
+mkdir "$t/$n/float_extras/"
+git -C ../float_extras archive HEAD | tar x -C "$t/$n/float_extras/"
+p="$(pwd)"
+cd $t
+for d in $deps float_extras; do
+    perl -p -i -e s:../$d:$d: $n/Cargo.toml
+done
+zip -q -r "$p/$f" "$n"

mercurial