set -eu cat <<'END' # File generated by confninja.sh; DO NOT EDIT! ninja_required_version = 1.11 rule cargo command = cd $extractrs_dir && cargo build $rust_mode && cp $rs_bin ../bin description = CARGO $out rule scss command = sass --load-path=node_modules/ $scss_mode $in $out description = SCSS $out rule bundle command = esbuild --log-level=warning --bundle $bundle_mode --outfile=$out $in description = BUNDLE $out rule dist command = tar -a -cf $out $in description = DIST $out rule cpy command = cp $in $out description = CPY $out rule instexec command = install -T $in $out description = INSTEXEC $out rule instdata command = install -m0644 -T $in $out description = INSTDATA $out rule perltest command = prove -l t/ description = PERLTEST rule configure command = ./configure $confargs description = CONFIGURE generator = 1 build test: perltest END # CONFIGURE echo "confargs = $CONFARGS" echo "build build.ninja lib/JWebmail/Config.pm: configure configure confninja.sh lib/JWebmail/Config.pm.in" case "$JWM_MODE" in (development) echo 'bundle_mode = --sourcemap' echo 'rs_bin = target/debug/jwebmail-extract' ;; (production) echo 'bundle_mode = --minify' echo 'sass_mode = --style=compress --no-source-maps' echo 'rust_mode = --release --target x86_64-unknown-linux-musl' echo 'rs_bin = target/x86_64-unknown-linux-musl/release/jwebmail-extract' ;; esac # EXTRACTRS case "$MAILDIR_EXTRACTOR_NAME" in (extractrs) echo "extractrs_dir = $JWM_EXTRACTRS_DIR" echo -n 'build bin/jwebmail-extract: cargo $extractrs_dir/Cargo.toml' FILES_RS='arguments.rs cmd.rs error.rs main.rs rfc822.rs cmd/count.rs cmd/folders.rs cmd/list.rs cmd/raw.rs' for f in $FILES_RS do echo -n " \$extractrs_dir/src/$f" done echo ;; esac # PUBLIC FILES_JS='src/displayheaders.js src/rendermail.js' if [ "$LOGIN_SCHEME" = cram_md5 ] then FILES_JS="$FILES_JS src/login_cram.js" fi for f in $FILES_JS do case "$JWM_MODE" in (development) echo "build public/$f | public/$f.map: bundle $f";; (production) echo "build public/$f: bundle $f";; esac done FILES_CSS='my_bulma' for f in $FILES_CSS do case "$JWM_MODE" in (development) echo "build public/css/$f.css | public/css/$f.css.map: scss scss/$f.scss";; (production) echo "build public/css/$f.css: scss scss/$f.scss";; esac done # BINDIST #while read f #do [ -n "$f" ] && echo "build JWebmail-bindist/$f: cpy $f" #done /dev/null #then echo -n "build JWebmail-bindist.tar.zstd: dist" #else echo -n "build JWebmail-bindist.tar.gz: dist" #fi #while read f #do [ -n "$f" ] && echo -n " JWebmail-bindist/$f" #done