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

Merge sundry bugfixes from pre-0.14 #140

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
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
42 changes: 35 additions & 7 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ all: xclip
xclip: $(X11OBJ) $(OBJS)
$(CC) $(OBJS) $(CFLAGS) -o $@ $(X11OBJ) $(LDFLAGS)

install: installbin install.man
install: install.bin install.man install.completion

.PHONY: installbin
installbin: xclip xclip-copyfile xclip-pastefile xclip-cutfile
.PHONY: install.bin
install.bin: xclip xclip-copyfile xclip-pastefile xclip-cutfile
mkdir -p $(DESTDIR)$(bindir)
$(INSTALL) $^ $(DESTDIR)$(bindir)

Expand All @@ -34,6 +34,11 @@ install.man: xclip.1 xclip-copyfile.1
mkdir -p $(DESTDIR)$(mandir)/man1
$(INSTALL) -m 644 $^ $(DESTDIR)$(mandir)/man1

.PHONY: install.completion
install.completion: xclip.bash-completion
mkdir -p $(DESTDIR)/etc/bash_completion.d/
$(INSTALL) -m 755 $^ $(DESTDIR)/etc/bash_completion.d

.PHONY: clean
clean:
rm -f *.o *~ xclip xclip-$(VERSION).tar.gz borked
Expand All @@ -52,32 +57,55 @@ xclip-$(VERSION).tar.gz:
(cd /tmp/xclip-make-dist-dir; \
tar zcvf xclip-$(VERSION)/xclip-$(VERSION).tar.gz \
xclip-$(VERSION)/COPYING \
xclip-$(VERSION)/INSTALL \
xclip-$(VERSION)/README \
xclip-$(VERSION)/ChangeLog \
xclip-$(VERSION)/configure \
xclip-$(VERSION)/configure.ac \
xclip-$(VERSION)/bootstrap \
xclip-$(VERSION)/xclip-copyfile \
xclip-$(VERSION)/xclip-pastefile \
xclip-$(VERSION)/xclip-cutfile \
xclip-$(VERSION)/install-sh \
xclip-$(VERSION)/Makefile.in \
xclip-$(VERSION)/xclip.bash-completion \
xclip-$(VERSION)/xclip-copyfile \
xclip-$(VERSION)/xclip-cutfile \
xclip-$(VERSION)/xclip-pastefile \
xclip-$(VERSION)/xclip.spec \
xclip-$(VERSION)/xctest \
xclip-$(VERSION)/*.c \
xclip-$(VERSION)/*.h \
xclip-$(VERSION)/autogroff.sh \
xclip-$(VERSION)/xclip-copyfile.1 \
xclip-$(VERSION)/xclip.1 )
rm -rf /tmp/xclip-make-dist-dir
rm /tmp/xclip-make-dist-dir/xclip-$(VERSION)
rmdir /tmp/xclip-make-dist-dir

Makefile: Makefile.in configure
./config.status

configure: configure.ac
./bootstrap

# Create documentation from the man page
xclip.pdf: xclip.1
groff -Tpdf -mandoc $^ > $@

xclip.cat: xclip.1
nroff -mandoc $^ > $@

# Run the test script
test: xctest
./xctest

# borked is a test program which intentionally causes errors.
borked: borked.c xclib.o xcprint.o
$(CC) $^ $(CFLAGS) -o $@ $(X11OBJ) $(LDFLAGS)

# For ease of editing the man page, automatically regenerate the PDF every time
# xclip.1 (the groff source code of the man page) is saved. If the document is
# already being viewed in atril or evince, it will be reloaded immediately.
watch:
./autogroff.sh

.SUFFIXES:
.SUFFIXES: .c .o

Expand Down
25 changes: 25 additions & 0 deletions autogroff.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

trap cleanup exit;

cleanup() {
for p in $(jobs -p); do
echo "Killing $p"
kill $p
done
}

for f in *.1; do
file=${f%.1}
groff -Tpdf -P-e -P-pletter -mpdfmark -mandoc $file.1 > $file.pdf
echo "Waiting on $file.1. HIT ^C TO CANCEL"
while inotifywait -e MODIFY $file.1; do
groff -Tpdf -P-e -P-pletter -mpdfmark -mandoc $file.1 > $file.pdf
nroff -mandoc $file.1 > $file.cat
echo "Waiting on $file.1. HIT ^C TO CANCEL"
done &
done

wait


8 changes: 4 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AC_INIT(xclip, 0.13)
AC_INIT([xclip],[0.14])

AC_CONFIG_SRCDIR([xclip.c])

Expand All @@ -8,8 +8,7 @@ if test "$GCC" = yes; then
fi

AC_PROG_INSTALL
AC_LANG_C
AC_HEADER_STDC
AC_LANG([C])
AC_PATH_XTRA
AC_CHECK_TOOL(STRIP, strip, :)
AC_CHECK_HEADER([X11/Xmu/Atoms.h], [], AC_MSG_ERROR([*** X11/Xmu/Atoms.h is missing ***]))
Expand All @@ -19,4 +18,5 @@ AC_CHECK_HEADER([iconv.h],
AC_DEFINE([HAVE_ICONV]), []), [])
AC_CHECK_LIB(Xmu, XmuClientWindow, [], AC_MSG_ERROR([*** libXmu not found ***]))

AC_OUTPUT(Makefile)
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
2 changes: 1 addition & 1 deletion xcdef.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* xcdef.h - definitions for use throughout xclip
* Copyright (C) 2001 Kim Saunders
* Copyright (C) 2007-2008 Peter Åstrand
* Copyright (C) 2007-2022 Peter Åstrand
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down
Loading