diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..4716187 --- /dev/null +++ b/Makefile @@ -0,0 +1,38 @@ +PREFIX=/usr +DATADIR=$${datarootdir} +DATAROOTDIR=$${prefix}/share + +unstable_protocols = \ + unstable/wlr-export-dmabuf-unstable-v1.xml \ + unstable/wlr-gamma-control-unstable-v1.xml \ + unstable/wlr-input-inhibitor-unstable-v1.xml \ + unstable/wlr-layer-shell-unstable-v1.xml \ + unstable/wlr-screencopy-unstable-v1.xml + +check: + ./check.sh + +clean: + rm -f wlr-protocols.pc + +wlr-protocols.pc: wlr-protocols.pc.in + sed \ + -e 's:@prefix@:$(PREFIX):g' \ + -e 's:@datadir@:$(DATADIR):g' \ + -e 's:@datarootdir@:$(DATAROOTDIR):g' \ + <$< >$@ + +install-unstable: $(unstable_protocols) + mkdir -p $(DESTDIR)$(PREFIX)/share/wlr-protocols/unstable + for protocol in $^ ; \ + do \ + install -Dm644 $$protocol \ + $(DESTDIR)$(PREFIX)/share/wlr-protocols/$$protocol ; \ + done + +install-pc: wlr-protocols.pc + mkdir -p $(DESTDIR)$(PREFIX)/share/pkgconfig/ + install -Dm644 wlr-protocols.pc \ + $(DESTDIR)$(PREFIX)/share/pkgconfig/wlr-protocols.pc + +install: install-unstable install-pc diff --git a/check.sh b/check.sh index a5188ca..33fa26d 100755 --- a/check.sh +++ b/check.sh @@ -1,8 +1,7 @@ -#!/bin/sh +#!/bin/sh -eux -set -e - -for f in $(echo unstable/*.xml); do +for f in $(echo unstable/*.xml) +do wayland-scanner -s client-header "$f" /dev/null wayland-scanner -s server-header "$f" /dev/null wayland-scanner -s public-code "$f" /dev/null diff --git a/wlr-protocols.pc.in b/wlr-protocols.pc.in new file mode 100644 index 0000000..5acfbe8 --- /dev/null +++ b/wlr-protocols.pc.in @@ -0,0 +1,7 @@ +prefix=@prefix@ +datarootdir=@datarootdir@ +pkgdatadir=${pc_sysrootdir}@datadir@/wlr-protocols + +Name: wlroots Wayland protocols +Description: Wayland protocol files +Version: 1.0