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 27
a848c2c5a2e4
parent 26
acf57c458740

Zenodo packaging hacks

Cargo.toml file | annotate | diff | comparison | revisions
README.md file | annotate | diff | comparison | revisions
package.sh file | annotate | diff | comparison | revisions
--- a/Cargo.toml	Wed Mar 22 20:37:49 2023 +0200
+++ b/Cargo.toml	Mon Dec 05 23:50:22 2022 +0200
@@ -22,7 +22,7 @@
 categories = ["mathematics", "science", "computer-vision"]
 
 [dependencies]
-alg_tools = { version = "~0.1.0", path = "../alg_tools", default-features = false }
+alg_tools = { version = "~0.1.0", path = "./alg_tools", default-features = false }
 serde = { version = "1.0", features = ["derive"] }
 num-traits = { version = "~0.2.14", features = ["std"] }
 rand = "~0.8.5"
--- a/README.md	Wed Mar 22 20:37:49 2023 +0200
+++ 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. On Windows, you will likely 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/
@@ -95,3 +91,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,16 @@
+#!/bin/sh
+t=$(mktemp -d)
+v=$(cat Cargo.toml |sed 's/^version = \"\(.*\)\"/\1/p; d;')
+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
+zip -q -r "$p/$f" "$n"

mercurial