Zenodo packaging hacks draft

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

author
Tuomo Valkonen <tuomov@iki.fi>
date
Mon, 05 Dec 2022 23:50:22 +0200
changeset 56
3a784e6e475a
parent 55
19e2140ba458

Zenodo packaging hacks

README.md file | annotate | diff | comparison | revisions
package.sh file | annotate | diff | comparison | revisions
--- a/README.md	Mon Feb 17 14:40:59 2025 -0500
+++ b/README.md	Mon Dec 05 23:50:22 2022 +0200
@@ -21,8 +21,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 @@
     crate documentation. You may need to pass 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,7 @@
 `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,17 @@
+#!/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 "$t/$n"
+rm "$t/$n/package.sh"
+hg -R ../alg_tools archive "$t/$n/alg_tools"
+p="$(pwd)"
+cd $t
+perl -p -i -e s:../alg_tools:alg_tools: $n/Cargo.toml
+zip -q -r "$p/$f" "$n"

mercurial