Support stable rust

This removes use of Option.contains(), and provides a fallback pidfd
implementation for stable.
This commit is contained in:
2022-05-05 12:16:50 -07:00
parent 04650b3c53
commit 23fef4d9e3
7 changed files with 103 additions and 22 deletions

View File

@ -17,15 +17,22 @@ HELPERS = \
INSTALL ?= install
RUST_RELEASE_CHANNEL = nightly
ifeq ($(RUST_RELEASE_CHANNEL),nightly)
RUST_RELEASE_CHANNEL_ARG = +nightly
else
FEATURES_ARGS = --no-default-features
endif
DEV_LOG_LEVEL = debug
all: release
release:
HELPER_DIR=$(HELPER_DIR) cargo build --release
HELPER_DIR=$(HELPER_DIR) cargo $(RUST_RELEASE_CHANNEL_ARG) build $(FEATURES_ARGS) --release
dev:
HELPER_DIR=target/debug cargo build
HELPER_DIR=target/debug cargo $(RUST_RELEASE_CHANNEL_ARG) build $(FEATURES_ARGS)
install: release
$(INSTALL) -m 0755 -d $(BINDIR) $(HELPER_DIR) $(CONFIG_DIR) $(APPLICATIONS_DIR)
@ -35,7 +42,7 @@ install: release
$(INSTALL) -m 0644 settings/bscreensaver-settings.desktop $(APPLICATIONS_DIR)
clean:
cargo clean
cargo $(RUST_RELEASE_CHANNEL_ARG) clean
uninstall:
rm -f $(BINDIR)/bscreensaver $(BINDIR)/bscreensaver-command $(BINDIR)/bscreensaver-settings $(addprefix $(HELPER_DIR)/,$(HELPERS)) || true
@ -50,10 +57,10 @@ run: dev
BSCREENSAVER_SYSTEMD_LOG=$(DEV_LOG_LEVEL) \
BSCREENSAVER_DIALOG_GTK3_LOG=$(DEV_LOG_LEVEL) \
HELPER_DIR=target/debug \
cargo run --bin bscreensaver
cargo $(RUST_RELEASE_CHANNEL_ARG) run $(FEATURES_ARGS) --bin bscreensaver
run-dialog:
RUST_BACKTRACE=1 \
BSCREENSAVER_DIALOG_GTK3_LOG=$(DEV_LOG_LEVEL) \
BSCREENSAVER_DIALOG_STANDALONE=1 \
cargo run --bin bscreensaver-dialog-gtk3
cargo $(RUST_RELEASE_CHANNEL_ARG) run $(FEATURES_ARGS) --bin bscreensaver-dialog-gtk3