chiark / gitweb /
config: Provide libexec_dir and usvg_bin
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 13 May 2021 00:50:37 +0000 (01:50 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 13 May 2021 09:22:01 +0000 (10:22 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Makefile
apitest/apitest.rs
server-test-zealot.toml
server-test.toml
src/config.rs

index 9461ac4e1740bd8cff7be6a7efffaa30fda1ee5d..3fba3625eef1ae9efee3801b3007c450650a8ab8 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -390,6 +390,7 @@ DEPLOY_FINISH=/home/Otter/etc/deploy-finish
 for-deploy: stamp/cargo.deploy-build
 deploy: for-deploy bundled-sources assets libraries
        rsync -zv --progress $(addprefix $(DEPLOY_TARGET_DIR)/,$(PROGRAMS)) $(DEPLOY_BASE)/bin/
+       rsync -zv --progress $(TARGET_DIR)/release/usvg $(DEPLOY_BASE)/libexec/
        rsync -rv --progress $(TARGET_DIR)/bundled-sources/. $(DEPLOY_BASE)/bundled-sources
        rsync -r README.md $(DEPLOY_BASE)/.
        rsync -r --delete --exclude=\*~ library specs $(DEPLOY_BASE)/.
index c5fd1da92bf9a6aaa665a742b16f910487593639..7fa9474bdcbb3a1e8e0dfea0f5854e8c601b5e42 100644 (file)
@@ -609,6 +609,8 @@ nwtemplate_dir = "@src@/nwtemplates"
 bundled_sources = "@target@/bundled-sources"
 wasm_dir = "@target@/packed-wasm"
 shapelibs = [ "@src@/library/*.toml" ]
+libexec_dir = "@target@/debug"
+usvg_bin = "@target@/release/usvg"
 
 debug_js_inject_file = "@src@/templates/log-save.js"
 check_bundled_sources = false # For testing only! see LICENCE!
index aa232bba36635855a6390460e6f7598514fc6d6a..e78230f6320aa536c86b7fa1d9818e63e1107466 100644 (file)
@@ -14,6 +14,8 @@ template_dir = "/home/ian/Rustup/Game/server/templates"
 nwtemplate_dir = "/home/ian/Rustup/Game/server/nwtemplates"
 bundled_sources = "/home/rustcargo/Rustup/Game/server/target/bundled-sources"
 wasm_dir = "/home/rustcargo/Rustup/Game/server/target/packed-wasm"
+libexec_dir = "/home/rustcargo/Rustup/Game/server/target/debug"
+usvg_bin = "/home/rustcargo/Rustup/Game/server/target/release/usvg"
 
 shapelibs = [ "/home/ian/Rustup/Game/server/library/*.toml" ]
 
index 7f387bf487060df3c11df714ec8d91d913191c68..f4233c1c15f0c2f9eeb4ff6e93446fd80643a1a2 100644 (file)
@@ -11,6 +11,8 @@ bundled_sources = "target/bundled-sources"
 save_dir = "."
 template_dir = "templates"
 wasm_dir = "target/packed-wasm"
+libexec_dir = "target/debug"
+usvg_bin = "target/release/usvg"
 
 #save_dir = "/home/rustcargo/Rustup/Game/server"
 
index f4fae7b471ee4b85c48fb3503385442d268e7422..b8041ab2bcc135dec9671e7599b65738506ef827 100644 (file)
@@ -22,6 +22,8 @@ pub struct ServerConfigSpec {
   pub change_directory: Option<String>,
   pub base_dir: Option<String>,
   pub save_dir: Option<String>,
+  pub libexec_dir: Option<String>,
+  pub usvg_bin: Option<String>,
   pub command_socket: Option<String>,
   pub debug: Option<bool>,
   pub http_port: Option<u16>,
@@ -59,6 +61,8 @@ pub struct ServerConfig {
   pub template_dir: String,
   pub nwtemplate_dir: String,
   pub wasm_dir: String,
+  pub libexec_dir: String,
+  pub usvg_bin: String,
   pub bundled_sources: String,
   pub shapelibs: Vec<shapelib::Config1>,
   pub sendmail: String,
@@ -111,7 +115,7 @@ impl ServerConfigSpec {
     let ServerConfigSpec {
       change_directory, base_dir, save_dir, command_socket, debug,
       http_port, public_url, sse_wildcard_url, rocket_workers,
-      template_dir, nwtemplate_dir, wasm_dir,
+      template_dir, nwtemplate_dir, wasm_dir, libexec_dir, usvg_bin,
       log, bundled_sources, shapelibs, sendmail,
       debug_js_inject_file, check_bundled_sources, fake_rng,
     } = self;
@@ -139,9 +143,13 @@ impl ServerConfigSpec {
     let template_dir    = defpath(template_dir,    "assets"            );
     let wasm_dir        = defpath(wasm_dir,        "assets"            );
     let nwtemplate_dir  = defpath(nwtemplate_dir,  "nwtemplates"       );
+    let libexec_dir     = defpath(libexec_dir,     "libexec"           );
     let bundled_sources = defpath(bundled_sources, "bundled-sources"   );
     const DEFAULT_LIBRARY_GLOB: &str = "library/*.toml";
 
+    let usvg_bin = usvg_bin.unwrap_or_else(
+      || format!("{}/usvg", &libexec_dir));
+
     let shapelibs = shapelibs.unwrap_or_else(||{
       let glob = defpath(None, DEFAULT_LIBRARY_GLOB);
       vec![ shapelib::Config1::PathGlob(glob) ]
@@ -220,8 +228,8 @@ impl ServerConfigSpec {
     let server = ServerConfig {
       save_dir, command_socket, debug,
       http_port, public_url, sse_wildcard_url, rocket_workers,
-      template_dir, nwtemplate_dir, wasm_dir,
-      bundled_sources, shapelibs, sendmail,
+      template_dir, nwtemplate_dir, wasm_dir, libexec_dir,
+      bundled_sources, shapelibs, sendmail, usvg_bin,
       debug_js_inject, check_bundled_sources, game_rng, prctx,
     };
     trace_dbg!("config resolved", &server);