From 1ab1e11fd5811f388dce41df370ef84a34824af8 Mon Sep 17 00:00:00 2001
From: "Alex Xu (Hello71)" <alex_y_xu@yahoo.ca>
Date: Fri, 6 Aug 2021 20:57:14 -0400
Subject: [PATCH] main/cups: disable upstream stripping

patch is a bit overkill but i'm pissed that the crap build system
silently strips and can't be turned off and also silently runs all
commands and can't be turned off
---
 main/cups/APKBUILD           | 10 ++++--
 main/cups/cups-nostrip.patch | 68 ++++++++++++++++++++++++++++++++++++
 2 files changed, 75 insertions(+), 3 deletions(-)
 create mode 100644 main/cups/cups-nostrip.patch

diff --git a/main/cups/APKBUILD b/main/cups/APKBUILD
index 1a9d13421106..632679546876 100644
--- a/main/cups/APKBUILD
+++ b/main/cups/APKBUILD
@@ -1,7 +1,7 @@
 # Maintainer: Natanael Copa <ncopa@alpinelinux.org>
 pkgname=cups
 pkgver=2.3.3
-pkgrel=3
+pkgrel=4
 pkgdesc="The CUPS Printing System"
 url="https://www.cups.org/"
 arch="all"
@@ -19,6 +19,7 @@ source="$pkgname-$pkgver.tar.gz::https://github.com/OpenPrinting/cups/archive/v$
 	$pkgname.logrotate
 	cupsd.initd
 	cups-no-export-ssllibs.patch
+	cups-nostrip.patch
 	default-config-no-gssapi.patch
 	"
 
@@ -131,8 +132,11 @@ _mv() {
 	done
 }
 
-sha512sums="5a43ef98f83c1783221155c01de940f3679023251709931ef28572c7b00620b36252afe894e86f2f08a527008dc2c95dc8af4129f0ab28a28663be8d3ccc3418  cups-2.3.3.tar.gz
+sha512sums="
+5a43ef98f83c1783221155c01de940f3679023251709931ef28572c7b00620b36252afe894e86f2f08a527008dc2c95dc8af4129f0ab28a28663be8d3ccc3418  cups-2.3.3.tar.gz
 cf64211da59e79285f99d437c02fdd7db462855fb2920ec9563ba47bd8a9e5cbd10555094940ceedeb41ac805c4f0ddb9147481470112a11a76220d0298aef79  cups.logrotate
 2c2683f755a220166b3a1653fdd1a6daa9718c8f0bbdff2e2d5e61d1133306260d63a83d3ff41619b5cf84c4913fae5822b79553e2822858f38fa3613f4c7082  cupsd.initd
 7a8cd9ac33b0dd4627c72df4275db8ccd7cf8e201bce3833719b42f532f526bb347b842e3ea1ef0d61855b5c6e1088b5d20b68942f2c2c0acf504d8d9728efd3  cups-no-export-ssllibs.patch
-ac1ec4453d6a4b641d40089c77d3b776963d90efb092851c8d93deceb6068b111dee71171967ffb7ad0f5adb424398a43f51feb7d5d9734287cfb9e419efaa93  default-config-no-gssapi.patch"
+f9f465c0a0125e15d969e4992e94657277211045b393247808b028ba5f8e010f753b750b7a01e4272da03188955866cbe6db1970fc865f883e8377a7e432ba65  cups-nostrip.patch
+ac1ec4453d6a4b641d40089c77d3b776963d90efb092851c8d93deceb6068b111dee71171967ffb7ad0f5adb424398a43f51feb7d5d9734287cfb9e419efaa93  default-config-no-gssapi.patch
+"
diff --git a/main/cups/cups-nostrip.patch b/main/cups/cups-nostrip.patch
new file mode 100644
index 000000000000..62b3ce23449e
--- /dev/null
+++ b/main/cups/cups-nostrip.patch
@@ -0,0 +1,68 @@
+diff -ru a/config-scripts/cups-compiler.m4 b/config-scripts/cups-compiler.m4
+--- a/config-scripts/cups-compiler.m4	2020-04-27 14:04:29.000000000 -0400
++++ b/config-scripts/cups-compiler.m4	2021-08-06 20:53:29.316010169 -0400
+@@ -9,9 +9,6 @@
+ 
+ dnl Clear the debugging and non-shared library options unless the user asks
+ dnl for them...
+-INSTALL_STRIP=""
+-AC_SUBST(INSTALL_STRIP)
+-
+ AC_ARG_WITH(optim, [  --with-optim            set optimization flags ],
+ 	OPTIM="$withval",
+ 	OPTIM="")
+@@ -25,8 +22,6 @@
+ dnl For debugging, keep symbols, otherwise strip them...
+ if test x$enable_debug = xyes -a "x$OPTIM" = x; then
+ 	OPTIM="-g"
+-else
+-	INSTALL_STRIP="-s"
+ fi
+ 
+ dnl Debug printfs can slow things down, so provide a separate option for that
+diff -ru a/configure b/configure
+--- a/configure	2020-04-27 14:04:29.000000000 -0400
++++ b/configure	2021-08-06 20:54:01.585892266 -0400
+@@ -694,7 +694,6 @@
+ ARCHFLAGS
+ UNITTESTS
+ OPTIM
+-INSTALL_STRIP
+ LIBTOOL_INSTALL
+ LIBTOOL_CXX
+ LIBTOOL_CC
+@@ -6662,7 +6661,6 @@
+ 
+ 
+ 
+-INSTALL_STRIP=""
+ 
+ 
+ 
+@@ -6698,8 +6696,6 @@
+ 
+ if test x$enable_debug = xyes -a "x$OPTIM" = x; then
+ 	OPTIM="-g"
+-else
+-	INSTALL_STRIP="-s"
+ fi
+ 
+ if test x$enable_debug_printfs = xyes; then
+diff -ru a/Makedefs.in b/Makedefs.in
+--- a/Makedefs.in	2020-04-27 14:04:29.000000000 -0400
++++ b/Makedefs.in	2021-08-06 20:53:42.565961754 -0400
+@@ -45,12 +45,12 @@
+ # Installation programs...
+ #
+ 
+-INSTALL_BIN	=	@LIBTOOL_INSTALL@ $(INSTALL) -c -m @CUPS_EXE_FILE_PERM@ @INSTALL_STRIP@
++INSTALL_BIN	=	@LIBTOOL_INSTALL@ $(INSTALL) -c -m @CUPS_EXE_FILE_PERM@
+ INSTALL_COMPDATA =	$(INSTALL) -c -m 444 @INSTALL_GZIP@
+ INSTALL_CONFIG	=	$(INSTALL) -c -m @CUPS_CONFIG_FILE_PERM@
+ INSTALL_DATA	=	$(INSTALL) -c -m 444
+ INSTALL_DIR	=	$(INSTALL) -d
+-INSTALL_LIB	=	@LIBTOOL_INSTALL@ $(INSTALL) -c -m @CUPS_EXE_FILE_PERM@ @INSTALL_STRIP@
++INSTALL_LIB	=	@LIBTOOL_INSTALL@ $(INSTALL) -c -m @CUPS_EXE_FILE_PERM@
+ INSTALL_MAN	=	$(INSTALL) -c -m 444
+ INSTALL_SCRIPT	=	$(INSTALL) -c -m @CUPS_EXE_FILE_PERM@
+ 
-- 
GitLab