[arch-commits] Commit in sane-airscan/trunk (Makefile.patch PKGBUILD)

Andreas Radke andyrtr at archlinux.org
Mon Jul 13 06:30:21 UTC 2020


    Date: Monday, July 13, 2020 @ 06:30:21
  Author: andyrtr
Revision: 391767

upgpkg: sane-airscan 0.99.9-2: fix linking; add optional dependency on ipp-usb; drop meson build system per upstream recommendation

Added:
  sane-airscan/trunk/Makefile.patch
Modified:
  sane-airscan/trunk/PKGBUILD

----------------+
 Makefile.patch |   87 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 PKGBUILD       |   22 ++++++-------
 2 files changed, 98 insertions(+), 11 deletions(-)

Added: Makefile.patch
===================================================================
--- Makefile.patch	                        (rev 0)
+++ Makefile.patch	2020-07-13 06:30:21 UTC (rev 391767)
@@ -0,0 +1,87 @@
+diff --git a/Makefile b/Makefile
+index 70555a8..01b1f79 100644
+--- a/Makefile
++++ b/Makefile
+@@ -34,23 +34,36 @@ MAN_DISCOVER = $(DISCOVER).1
+ MAN_DISCOVER_TITLE = "SANE Scanner Access Now Easy"
+ MAN_BACKEND = sane-airscan.5
+ MAN_BACKEND_TITLE = "AirScan (eSCL) and WSD SANE backend"
+-DEPENDS	:= avahi-client avahi-glib libjpeg libsoup-2.4 libxml-2.0
+-DEPENDS += libpng
++DEPS_COMMON := avahi-client avahi-glib libsoup-2.4 libxml-2.0
++DEPS_CODECS := libjpeg libpng
+ 
+ # Sources and object files
+ SRC	= $(wildcard airscan-*.c) sane_strstatus.c
+ OBJ	= $(addprefix $(OBJDIR), $(SRC:.c=.o))
+ 
+ # Obtain CFLAGS and LDFLAGS for dependencies
+-airscan_CFLAGS	= $(CFLAGS)
+-airscan_CFLAGS += -fPIC
+-airscan_CFLAGS += $(foreach lib, $(DEPENDS), $(shell pkg-config --cflags $(lib)))
++deps_CFLAGS		:= $(foreach lib, $(DEPS_COMMON), $(shell pkg-config --cflags $(lib)))
++deps_CFLAGS		+= $(foreach lib, $(DEPS_CODECS), $(shell pkg-config --cflags $(lib)))
+ 
+-airscan_LIBS := $(foreach lib, $(DEPENDS), $(shell pkg-config --libs $(lib))) -lm
++deps_LIBS 		:= $(foreach lib, $(DEPS_COMMON), $(shell pkg-config --libs $(lib))) -lm
++deps_LIBS_CODECS 	:= $(foreach lib, $(DEPS_CODECS), $(shell pkg-config --libs $(lib)))
+ 
+-airscan_LDFLAGS = $(LDFLAGS)
+-airscan_LDFLAGS += $(airscan_LIBS)
+-airscan_LDFLAGS += -Wl,--version-script=airscan.sym
++# Compute CFLAGS and LDFLAGS for backend and tools
++#
++# Note, CFLAGS are common, for simplicity, while LDFLAGS are not, to
++# avoid linking unneeded libraries
++common_CFLAGS		:= $(CFLAGS) $(deps_CFLAGS)
++common_CFLAGS 		+= -fPIC
++
++backend_LDFLAGS 	:= $(LDFLAGS)
++backend_LDFLAGS 	+= $(deps_LIBS) $(deps_LIBS_CODECS)
++backend_LDFLAGS 	+= -Wl,--version-script=airscan.sym
++
++tools_LDFLAGS 		:= $(LDFLAGS)
++tools_LDFLAGS 		+= $(deps_LIBS)
++tools_LDFLAGS 		+= -fPIE
++
++tests_LDFLAGS		:= $(tools_LDFLAGS) $(deps_LIBS_CODECS)
+ 
+ # This magic is a workaround for libsoup bug.
+ #
+@@ -65,11 +78,11 @@ airscan_LDFLAGS += -Wl,--version-script=airscan.sym
+ # The workaround is to prevent our backend's shared object from being
+ # unloaded when not longer in use, and these magical options do it
+ # by adding NODELETE flag to the resulting ELF shared object
+-airscan_LDFLAGS += -Wl,-z,nodelete
++backend_LDFLAGS += -Wl,-z,nodelete
+ 
+ $(OBJDIR)%.o: %.c Makefile airscan.h
+ 	mkdir -p $(OBJDIR)
+-	$(CC) -c -o $@ $< $(CPPFLAGS) $(airscan_CFLAGS)
++	$(CC) -c -o $@ $< $(CPPFLAGS) $(common_CFLAGS)
+ 
+ .PHONY: all clean install man
+ 
+@@ -79,10 +92,10 @@ tags: $(SRC) airscan.h test.c test-decode.c
+ 	-ctags -R .
+ 
+ $(BACKEND): $(OBJDIR)airscan.o $(LIBAIRSCAN) airscan.sym
+-	$(CC) -o $(BACKEND) -shared $(OBJDIR)/airscan.o $(LIBAIRSCAN) $(airscan_LDFLAGS)
++	$(CC) -o $(BACKEND) -shared $(OBJDIR)/airscan.o $(LIBAIRSCAN) $(backend_LDFLAGS)
+ 
+ $(DISCOVER): $(OBJDIR)discover.o $(LIBAIRSCAN)
+-	 $(CC) -o $(DISCOVER) discover.c $(CPPFLAGS) $(airscan_CFLAGS) $(LIBAIRSCAN) $(airscan_LIBS) $(LDFLAGS) -fPIE
++	 $(CC) -o $(DISCOVER) discover.c $(CPPFLAGS) $(common_CFLAGS) $(LIBAIRSCAN) $(tools_LDFLAGS)
+ 
+ $(LIBAIRSCAN): $(OBJ) Makefile
+ 	ar cru $(LIBAIRSCAN) $(OBJ)
+@@ -121,7 +134,7 @@ $(MAN_BACKEND): $(MAN_BACKEND).md
+ 	ronn --roff --manual=$(MAN_BACKEND_TITLE) $(MAN_BACKEND).md
+ 
+ test:	$(BACKEND) test.c
+-	$(CC) -o test test.c $(BACKEND) -Wl,-rpath . $(LDFLAGS) ${airscan_CFLAGS}
++	$(CC) -o test test.c $(BACKEND) -Wl,-rpath . $(LDFLAGS) ${common_CFLAGS}
+ 
+ test-decode: test-decode.c $(LIBAIRSCAN)
+-	 $(CC) -o test-decode test-decode.c $(CPPFLAGS) $(airscan_CFLAGS) $(LIBAIRSCAN) $(LDFLAGS) $(airscan_LIBS)
++	 $(CC) -o test-decode test-decode.c $(CPPFLAGS) $(common_CFLAGS) $(LIBAIRSCAN) $(tests_LDFLAGS)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2020-07-13 01:27:19 UTC (rev 391766)
+++ PKGBUILD	2020-07-13 06:30:21 UTC (rev 391767)
@@ -3,7 +3,7 @@
 
 pkgname=sane-airscan
 pkgver=0.99.9
-pkgrel=1
+pkgrel=2
 pkgdesc="SANE - SANE backend for AirScan (eSCL) and WSD document scanners"
 url="https://github.com/alexpevzner/sane-airscan"
 arch=('x86_64')
@@ -10,23 +10,23 @@
 license=('GPL2')
 depends=('sane' 'libsoup')
 #makedepends=('meson')
-source=("$pkgname-$pkgver.tar.gz"::"https://github.com/alexpevzner/${pkgname}/archive/${pkgver}.tar.gz")
-sha256sums=('2773a18007eb7b191fe02b30a82a20cf196f567fb32d4601a007f48ee6f34e21')
+optdepends=('ipp-usb: allows to send HTTP requests via a USB connection on devices without Ethernet or WiFi connections')
+source=("$pkgname-$pkgver.tar.gz"::"https://github.com/alexpevzner/${pkgname}/archive/${pkgver}.tar.gz"
+        Makefile.patch)
+sha256sums=('2773a18007eb7b191fe02b30a82a20cf196f567fb32d4601a007f48ee6f34e21'
+            '4b6677e7ed755afd3cf0e1bd1ca5c9426d252922ce7a2536d39db892da7f5446')
+prepare() {
+    cd ${pkgname}-${pkgver}
+    # https://github.com/alexpevzner/sane-airscan/issues/53
+    patch -Np1 -i ../Makefile.patch
+}
 
-# https://github.com/alexpevzner/sane-airscan/issues/53
-
 build() {
-#    arch-meson $pkgname-$pkgver build
-#    ninja -C build
-
     cd ${pkgname}-${pkgver}
     make
 }
 
 package() {
-#    DESTDIR="${pkgdir}" ninja -C build install
-#    install -Dm644 ${pkgname}-${pkgver}/README.md "${pkgdir}/usr/share/doc/${pkgname}/README"
-
     cd ${pkgname}-${pkgver}
     make DESTDIR="${pkgdir}" install
     install -Dm644 README.md "${pkgdir}/usr/share/doc/${pkgname}/README"



More information about the arch-commits mailing list