From 42e5f21bc0357e5a11ec584cc3f0a3d2324d62cb Mon Sep 17 00:00:00 2001 From: Christopher Byrne Date: Mon, 18 Nov 2024 19:31:24 -0600 Subject: [PATCH] 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 Closes: https://github.com/gentoo/gentoo/pull/39367 Signed-off-by: Sam James --- ..._p20200924-Use-pkgconf-for-libgcrypt.patch | 18 ++++++++++++++ ...nd-1.0_p20200924-fix-loff_t-for-musl.patch | 24 +++++++++++++++++++ .../suspend/suspend-1.0_p20200924.ebuild | 8 +++++-- 3 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 sys-power/suspend/files/suspend-1.0_p20200924-Use-pkgconf-for-libgcrypt.patch create mode 100644 sys-power/suspend/files/suspend-1.0_p20200924-fix-loff_t-for-musl.patch 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 0000000000000..ea77ab450e719 --- /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 0000000000000..37a77118f0c7a --- /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 + #include + #include diff --git a/sys-power/suspend/suspend-1.0_p20200924.ebuild b/sys-power/suspend/suspend-1.0_p20200924.ebuild index 56be503b7da84..b4d67354418ae 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