mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-27 13:26:00 +01:00
Redo version checks and add check for GTK
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This commit is contained in:
parent
117a32c3d4
commit
0c0c3b8903
4 changed files with 28 additions and 13 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -17,4 +17,4 @@ doc/
|
|||
*.tmp
|
||||
zathura.1
|
||||
zathurarc.5
|
||||
girara-version-check
|
||||
.version-checks/
|
||||
|
|
20
Makefile
20
Makefile
|
@ -42,11 +42,15 @@ DOBJECTS = $(patsubst %.c, %.do, $(SOURCE))
|
|||
|
||||
all: options ${PROJECT} po build-manpages
|
||||
|
||||
girara-version-check:
|
||||
ifneq ($(GIRARA_VERSION_CHECK), 0)
|
||||
$(error "The minimum required version of girara is ${GIRARA_MIN_VERSION}")
|
||||
endif
|
||||
$(QUIET)touch girara-version-check
|
||||
# pkg-config based version checks
|
||||
.version-checks/%:
|
||||
$(QUIET)test $($(*)_VERSION_CHECK) -eq 0 || \
|
||||
pkg-config --atleast-version $($(*)_MIN_VERSION) $($(*)_PKG_CONFIG_NAME) || ( \
|
||||
echo "The minium required version of $(*) is $($(*)_MIN_VERSION)" && \
|
||||
false \
|
||||
)
|
||||
@mkdir -p .version-checks
|
||||
$(QUIET)touch $@
|
||||
|
||||
options:
|
||||
@echo ${PROJECT} build options:
|
||||
|
@ -72,8 +76,8 @@ version.h: version.h.in config.mk
|
|||
@mkdir -p .depend
|
||||
$(QUIET)${CC} -c ${CPPFLAGS} ${CFLAGS} ${DFLAGS} -o $@ $< -MMD -MF .depend/$@.dep
|
||||
|
||||
${OBJECTS}: config.mk version.h girara-version-check
|
||||
${DOBJECTS}: config.mk version.h girara-version-check
|
||||
${OBJECTS} ${DOBJECTS}: config.mk version.h \
|
||||
.version-checks/GIRARA .version-checks/GLIB .version-checks/GTK
|
||||
|
||||
${PROJECT}: ${OBJECTS}
|
||||
$(ECHO) CC -o $@
|
||||
|
@ -83,7 +87,7 @@ clean:
|
|||
$(QUIET)rm -rf ${PROJECT} ${OBJECTS} ${PROJECT}-${VERSION}.tar.gz \
|
||||
${DOBJECTS} ${PROJECT}-debug .depend ${PROJECT}.pc doc version.h \
|
||||
*gcda *gcno $(PROJECT).info gcov *.tmp \
|
||||
girara-version-check
|
||||
.version-checks
|
||||
ifneq "$(wildcard ${RSTTOMAN})" ""
|
||||
$(QUIET)rm -f zathura.1 zathurarc.5
|
||||
endif
|
||||
|
|
2
README
2
README
|
@ -5,7 +5,7 @@ girara user interface library and several document libraries.
|
|||
|
||||
Requirements
|
||||
------------
|
||||
gtk2 (>= 2.28)
|
||||
gtk2 (>= 2.18)
|
||||
glib (>= 2.28)
|
||||
girara
|
||||
sqlite3 (optional, >= 3.5.9)
|
||||
|
|
17
config.mk
17
config.mk
|
@ -14,10 +14,21 @@ VERSION = ${ZATHURA_VERSION_MAJOR}.${ZATHURA_VERSION_MINOR}.${ZATHURA_VERSION_RE
|
|||
# note: zathura with GTK+ 3 is broken!
|
||||
ZATHURA_GTK_VERSION ?= 2
|
||||
|
||||
# minimum required zathura version
|
||||
# If you want to disable the check, set GIRARA_VERSION_CHECK to 0.
|
||||
# version checks
|
||||
# If you want to disable any of the checks, set *_VERSION_CHECK to 0.
|
||||
|
||||
# girara
|
||||
GIRARA_VERSION_CHECK ?= 1
|
||||
GIRARA_MIN_VERSION = 0.1.6
|
||||
GIRARA_VERSION_CHECK ?= $(shell pkg-config --atleast-version=$(GIRARA_MIN_VERSION) girara-gtk${ZATHURA_GTK_VERSION}; echo $$?)
|
||||
GIRARA_PKG_CONFIG_NAME = girara-gtk$(ZATHURA_GTK_VERSION)
|
||||
# glib
|
||||
GLIB_VERSION_CHECK ?= 1
|
||||
GLIB_MIN_VERSION = 2.28
|
||||
GLIB_PKG_CONFIG_NAME = glib-2.0
|
||||
# GTK
|
||||
GTK_VERSION_CHECK ?= 1
|
||||
GTK_MIN_VERSION = 2.18
|
||||
GTK_PKG_CONFIG_NAME = gtk+-$(ZATHURA_GTK_VERSION).0
|
||||
|
||||
# database
|
||||
# To disable support for the sqlite backend set WITH_SQLITE to 0.
|
||||
|
|
Loading…
Reference in a new issue