Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make libnotify & dunstify optional #1129

Merged
merged 1 commit into from
Nov 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ DEPS := ${SRC:.c=.d} ${TEST_SRC:.c=.d}


.PHONY: all debug
all: doc dunst dunstify service
all: doc dunst service

debug: CFLAGS += ${CPPFLAGS_DEBUG} ${CFLAGS_DEBUG}
debug: LDFLAGS += ${LDFLAGS_DEBUG}
Expand All @@ -64,8 +64,11 @@ ${OBJ} ${TEST_OBJ}: Makefile config.mk
dunst: ${OBJ} main.o
${CC} -o ${@} ${OBJ} main.o ${CFLAGS} ${LDFLAGS}

ifneq (0,${DUNSTIFY})
all: dunstify
dunstify: dunstify.o
${CC} -o ${@} dunstify.o ${CFLAGS} ${LDFLAGS}
endif

.PHONY: test test-valgrind test-coverage
test: test/test clean-coverage-run
Expand Down Expand Up @@ -181,7 +184,7 @@ clean-wayland-protocols:
uninstall uninstall-dunstctl uninstall-dunstrc \
uninstall-service uninstall-service-dbus uninstall-service-systemd \
uninstall-keepconf uninstall-purge
install: install-dunst install-dunstctl install-dunstrc install-service install-dunstify
install: install-dunst install-dunstctl install-dunstrc install-service

install-dunst: dunst doc
install -Dm755 dunst ${DESTDIR}${BINDIR}/dunst
Expand All @@ -206,8 +209,11 @@ install-service-systemd: service-systemd
install -Dm644 dunst.systemd.service ${DESTDIR}${SERVICEDIR_SYSTEMD}/dunst.service
endif

ifneq (0,${DUNSTIFY})
install: install-dunstify
install-dunstify: dunstify
install -Dm755 dunstify ${DESTDIR}${BINDIR}/dunstify
endif

uninstall: uninstall-keepconf
uninstall-purge: uninstall-keepconf uninstall-dunstrc
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ distro's repositories, don't worry, it's not hard to build it yourself.
- libxss
- glib
- pango/cairo
- libnotify (optional, for dunstify)
- libnotify (can build without, for dunstify, see [make parameters](#make-parameters))
- wayland-client (can build without, see [make parameters](#make-parameters))
- wayland-protocols (optional, for recompiling protocols)
- xdg-utils (optional, xdg-open is the default 'browser' for opening URLs)
Expand Down Expand Up @@ -113,6 +113,7 @@ sudo make install
- `MANDIR=<PATH>`: Set the prefix of the manpage. (Default: `${DATADIR}/man`)
- `SYSTEMD=(0|1)`: Disable/Enable the systemd unit. (Default: autodetect systemd)
- `WAYLAND=(0|1)`: Disable/Enable wayland support. (Default: 1 (enabled))
- `DUNSTIFY=(0|1)`: Disable/Enable the libnotify dunstctl utility. (Default: 1 (enabled))
- `SERVICEDIR_SYSTEMD=<PATH>`: The path to put the systemd user service file. Unused, if `SYSTEMD=0`. (Default: `${PREFIX}/lib/systemd/user`)
- `SERVICEDIR_DBUS=<PATH>`: The path to put the dbus service file. (Default: `${DATADIR}/dbus-1/services`)
- `EXTRA_CFLAGS=<FLAGS>`: Additional flags for the compiler.
Expand Down
8 changes: 8 additions & 0 deletions config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ VALGRIND ?= valgrind
# You can also use "make WAYLAND=0" to build without wayland
# WAYLAND ?= 0

# Disable dependency on libnotify. this will remove the ability
# to easily send notifications using dunstify or notify-send via D-Bus.
# Do this if you have your own utility to send notifications.
# Other applications will continue to work, as they use direct D-Bus.
# DUNSTIFY ?=0

ifneq (0, ${WAYLAND})
ENABLE_WAYLAND= -DENABLE_WAYLAND
endif
Expand All @@ -54,8 +60,10 @@ pkg_config_packs := gio-2.0 \
xscrnsaver \


ifneq (0,${DUNSTIFY})
# dunstify also needs libnotify
pkg_config_packs += libnotify
endif

ifneq (0,${WAYLAND})
pkg_config_packs += wayland-client
Expand Down