diff options
author | Lars Wirzenius <liw@liw.fi> | 2021-09-06 18:20:21 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2021-09-06 18:55:33 +0300 |
commit | cca316622dfcfe07a3387a109a2ce6696c45722a (patch) | |
tree | 396eed986f0b8c7dd3b3063afd2893698112ca24 /build.rs | |
parent | 5f37ad91b0370aa9fd441ec73c1937941006a9ea (diff) | |
download | subplot-cca316622dfcfe07a3387a109a2ce6696c45722a.tar.gz |
fix: build resources into subplot binary even in Debian package
Once upon a time, in a galaxy far, far away, we decided to not build
the share/* resource files into the subplot binary, when building it
for a Debian package. Much later, we were much surprised when this was
not the case and tests fail when run during the Debian package build.
Because it's surprising to not build in the resources for a Debian
package, we hereby undo that decision.
Sponsored-by: author
Diffstat (limited to 'build.rs')
-rw-r--r-- | build.rs | 12 |
1 files changed, 1 insertions, 11 deletions
@@ -11,10 +11,6 @@ //! the build script for subplot (by watching the share/ tree) and also a file //! which is included directly as the `EMBEDDED_FILES` constant in the //! `src/resources.rs` file. -//! -//! Finally the script checks for the `DEB_BUILD_OPTS` environment variable and -//! if set, it causes a resource fallback path of `/usr/share/subplot` to be -//! added to the resources search path automatically. use anyhow::{anyhow, Result}; use std::io::Write; @@ -145,13 +141,7 @@ fn adopt_env_var(var: &str, def: &str) { fn main() { println!("cargo:rerun-if-env-changed=DEB_BUILD_OPTIONS"); - let paths = if std::env::var("DEB_BUILD_OPTIONS").is_err() { - println!("cargo:rustc-env=FALLBACK_PATH="); - gather_share_files().expect("Unable to scan the share tree") - } else { - println!("cargo:rustc-env=FALLBACK_PATH=/usr/share/subplot"); - vec![] - }; + let paths = gather_share_files().expect("Unable to scan the share tree"); write_out_resource_file(paths.iter().map(PathBuf::as_path)) .expect("Unable to write the resource file out"); adopt_env_var("DOT_PATH", "dot"); |