commit:     42e5f21bc0357e5a11ec584cc3f0a3d2324d62cb
Author:     Christopher Byrne <salah.coronya <AT> gmail <DOT> com>
AuthorDate: Tue Nov 19 01:31:24 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Nov 23 18:29:26 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=42e5f21b

sys-power/suspend: Fix compile on musl and newer libgcrypt

Closes: https://bugs.gentoo.org/939507
Closes: https://bugs.gentoo.org/936933
Closes: https://bugs.gentoo.org/832981

Signed-off-by: Christopher Byrne <salah.coronya <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/39367
Signed-off-by: Sam James <sam <AT> gentoo.org>

 ...d-1.0_p20200924-Use-pkgconf-for-libgcrypt.patch | 18 ++++++++++++++++
 ...suspend-1.0_p20200924-fix-loff_t-for-musl.patch | 24 ++++++++++++++++++++++
 sys-power/suspend/suspend-1.0_p20200924.ebuild     |  8 ++++++--
 3 files changed, 48 insertions(+), 2 deletions(-)

diff --git 
a/sys-power/suspend/files/suspend-1.0_p20200924-Use-pkgconf-for-libgcrypt.patch 
b/sys-power/suspend/files/suspend-1.0_p20200924-Use-pkgconf-for-libgcrypt.patch
new file mode 100644
index 000000000000..ea77ab450e71
--- /dev/null
+++ 
b/sys-power/suspend/files/suspend-1.0_p20200924-Use-pkgconf-for-libgcrypt.patch
@@ -0,0 +1,18 @@
+diff --git a/configure.ac b/configure.ac
+index 5f3adb5..b7f21eb 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -211,7 +211,12 @@ fi
+ if test "${enable_encrypt}" = "yes"; then
+       CONFIG_FEATURES="${CONFIG_FEATURES} encrypt"
+       AC_DEFINE([CONFIG_ENCRYPT], [1], [Define if encryption enabled])
+-      AM_PATH_LIBGCRYPT([1:1.6.3], [], [AC_MSG_ERROR([Cannot locate 
>=libgcrypt-1.6.3])])
++      PKG_CONFIG="pkg-config --static"
++              PKG_CHECK_MODULES([LIBGCRYPT],
++                                [libgcrypt >= 1.6.3],
++                                ,
++                                [AC_MSG_ERROR("Cannot locate 
>=libgcrypt-1.6.3")]
++              )
+ fi
+ 
+ if test "${enable_splashy}" = "yes"; then

diff --git 
a/sys-power/suspend/files/suspend-1.0_p20200924-fix-loff_t-for-musl.patch 
b/sys-power/suspend/files/suspend-1.0_p20200924-fix-loff_t-for-musl.patch
new file mode 100644
index 000000000000..37a77118f0c7
--- /dev/null
+++ b/sys-power/suspend/files/suspend-1.0_p20200924-fix-loff_t-for-musl.patch
@@ -0,0 +1,24 @@
+diff --git a/configure.ac b/configure.ac
+index 5f3adb5..0c544c8 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -126,6 +126,7 @@ AC_CHECK_PROGS([M4], [m4])
+ AC_CHECK_PROG(PERL, perl, perl)
+ 
+ AC_SYS_LARGEFILE
++AC_USE_SYSTEM_EXTENSIONS
+ 
+ if test "${enable_create_device}" = "yes"; then
+       AC_CHECK_PROGS([MKNOD], [mknod])
+diff --git a/swsusp.h b/swsusp.h
+index 5f89902..6f4863e 100644
+--- a/swsusp.h
++++ b/swsusp.h
+@@ -9,6 +9,7 @@
+  *
+  */
+ 
++#include "config.h"
+ #include <stdint.h>
+ #include <linux/fs.h>
+ #include <linux/suspend_ioctls.h>

diff --git a/sys-power/suspend/suspend-1.0_p20200924.ebuild 
b/sys-power/suspend/suspend-1.0_p20200924.ebuild
index 56be503b7da8..b4d67354418a 100644
--- a/sys-power/suspend/suspend-1.0_p20200924.ebuild
+++ b/sys-power/suspend/suspend-1.0_p20200924.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
@@ -32,7 +32,11 @@ BDEPEND="
 
 S="${WORKDIR}/${PN}"
 
-PATCHES=( "${WORKDIR}/${P}.patch" )
+PATCHES=(
+       "${WORKDIR}/${P}.patch"
+       "${FILESDIR}/${PN}-1.0_p20200924-Use-pkgconf-for-libgcrypt.patch"
+       "${FILESDIR}/${PN}-1.0_p20200924-fix-loff_t-for-musl.patch"
+       )
 
 src_prepare() {
        default

Reply via email to