commit:     f0dd4ad7f7cb1a2c1e40b32155103b951da1aa77
Author:     Jason A. Donenfeld <zx2c4 <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 25 13:29:10 2021 +0000
Commit:     Jason A. Donenfeld <zx2c4 <AT> gentoo <DOT> org>
CommitDate: Thu Nov 25 13:30:13 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f0dd4ad7

media-gfx/sane-airscan: send fixes upstream and include patch downstream

Package-Manager: Portage-3.0.28, Repoman-3.0.3
Signed-off-by: Jason A. Donenfeld <zx2c4 <AT> gentoo.org>

 .../sane-airscan-0.99.27-makefile-fixes.patch      | 56 ++++++++++++++++++++++
 media-gfx/sane-airscan/sane-airscan-0.99.27.ebuild |  5 +-
 2 files changed, 57 insertions(+), 4 deletions(-)

diff --git 
a/media-gfx/sane-airscan/files/sane-airscan-0.99.27-makefile-fixes.patch 
b/media-gfx/sane-airscan/files/sane-airscan-0.99.27-makefile-fixes.patch
new file mode 100644
index 000000000000..204d1a5466a7
--- /dev/null
+++ b/media-gfx/sane-airscan/files/sane-airscan-0.99.27-makefile-fixes.patch
@@ -0,0 +1,56 @@
+From 8e9d059fa88606cba97291232ec16732f552bd48 Mon Sep 17 00:00:00 2001
+From: "Jason A. Donenfeld" <[email protected]>
+Date: Thu, 25 Nov 2021 14:24:25 +0100
+Subject: [PATCH] Makefile: abstract ar to $(AR) and remove tags from all
+
+Build systems need to be able to use a custom `ar` binary. Also, running
+ctags is generally not desirable for the default target.
+
+Signed-off-by: Jason A. Donenfeld <[email protected]>
+---
+Sent upstream as: https://github.com/alexpevzner/sane-airscan/pull/197
+
+ Makefile | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 4c7e202..415d489 100644
+--- a/Makefile
++++ b/Makefile
+@@ -7,6 +7,7 @@
+ #   ----     -------                    -----------
+ #   DESTDIR                             Destination directory for make install
+ #   CC         gcc                      C compiler
++#   AR         ar                       Archiver
+ #   CPPFLAGS                            C preprocessor flags
+ #   CFLAGS     -O2 -g -W -Wall -Werror  C compiler flags
+ #   LDFLAGS                             Linker flags
+@@ -28,6 +29,7 @@
+ #
+ 
+ CC            = gcc
++AR            = ar
+ COMPRESS      = gzip -n
+ CFLAGS                += -O2 -g -W -Wall -Werror -pthread $(CPPFLAGS)
+ PKG_CONFIG    = pkg-config
+@@ -101,7 +103,7 @@ $(OBJDIR)%.o: %.c Makefile airscan.h
+ 
+ .PHONY: all clean install man
+ 
+-all:  tags $(BACKEND) $(DISCOVER) test test-decode test-multipart 
test-zeroconf test-uri
++all:  $(BACKEND) $(DISCOVER) test test-decode test-multipart test-zeroconf 
test-uri
+ 
+ tags: $(SRC) airscan.h test.c test-decode.c test-multipart.c test-zeroconf.c 
test-uri.c
+       -ctags -R .
+@@ -113,7 +115,7 @@ $(DISCOVER): $(OBJDIR)discover.o $(LIBAIRSCAN)
+        $(CC) -o $(DISCOVER) discover.c $(CPPFLAGS) $(common_CFLAGS) 
$(LIBAIRSCAN) $(tools_LDFLAGS)
+ 
+ $(LIBAIRSCAN): $(OBJ) Makefile
+-      ar cru $(LIBAIRSCAN) $(OBJ)
++      $(AR) cru $(LIBAIRSCAN) $(OBJ)
+ 
+ install: all
+       mkdir -p $(DESTDIR)/$(bindir)
+-- 
+2.34.1
+

diff --git a/media-gfx/sane-airscan/sane-airscan-0.99.27.ebuild 
b/media-gfx/sane-airscan/sane-airscan-0.99.27.ebuild
index f1d4d9176344..61f7cc9da931 100644
--- a/media-gfx/sane-airscan/sane-airscan-0.99.27.ebuild
+++ b/media-gfx/sane-airscan/sane-airscan-0.99.27.ebuild
@@ -24,10 +24,7 @@ RDEPEND="${DEPEND}
        media-gfx/sane-backends
 "
 
-src_prepare() {
-       default
-       sed -i 's/ar cru/$(AR) cru/' Makefile || die "Unable to patch makefile"
-}
+PATCHES=( "${FILESDIR}/${PN}-0.99.27-makefile-fixes.patch" )
 
 src_compile() {
        emake \

Reply via email to