commit:     d2b700163970908b03466ad2e07616c5e92623cd
Author:     Maciej Barć <xgqt <AT> gentoo <DOT> org>
AuthorDate: Mon Feb  6 14:12:15 2023 +0000
Commit:     Maciej Barć <xgqt <AT> gentoo <DOT> org>
CommitDate: Mon Feb  6 17:23:18 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d2b70016

sci-mathematics/vampire: fix build on musl

Bug: https://github.com/vprover/vampire/pull/432
Closes: https://bugs.gentoo.org/832834
Signed-off-by: Maciej Barć <xgqt <AT> gentoo.org>

 .../vampire/files/vampire-4.6.1-musl.patch         | 40 ++++++++++++++++++++++
 sci-mathematics/vampire/vampire-4.6.1-r2.ebuild    |  4 ++-
 sci-mathematics/vampire/vampire-4.7-r1.ebuild      | 10 +++---
 3 files changed, 49 insertions(+), 5 deletions(-)

diff --git a/sci-mathematics/vampire/files/vampire-4.6.1-musl.patch 
b/sci-mathematics/vampire/files/vampire-4.6.1-musl.patch
new file mode 100644
index 000000000000..4d3d4c56041e
--- /dev/null
+++ b/sci-mathematics/vampire/files/vampire-4.6.1-musl.patch
@@ -0,0 +1,40 @@
+From 48733f4e2d9500b3bdc54563cf117c7fa07193ed Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Maciej=20Bar=C4=87?= <[email protected]>
+Date: Mon, 6 Feb 2023 14:34:05 +0100
+Subject: [PATCH] Minisat/utils/System.*: use fpu_control only on glibc
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Maciej Barć <[email protected]>
+---
+ Minisat/utils/System.cc | 2 +-
+ Minisat/utils/System.h  | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Minisat/utils/System.cc b/Minisat/utils/System.cc
+index 942ddb712..2936faa5d 100644
+--- a/Minisat/utils/System.cc
++++ b/Minisat/utils/System.cc
+@@ -104,7 +104,7 @@ double Minisat::memUsedPeak(bool) {
+ 
+ void Minisat::setX86FPUPrecision()
+ {
+-#if defined(__linux__) && defined(_FPU_EXTENDED) && defined(_FPU_DOUBLE) && 
defined(_FPU_GETCW)
++#if defined(__GLIBC__) && defined(_FPU_EXTENDED) && defined(_FPU_DOUBLE) && 
defined(_FPU_GETCW)
+     // Only correct FPU precision on Linux architectures that needs and 
supports it:
+     fpu_control_t oldcw, newcw;
+     _FPU_GETCW(oldcw); newcw = (oldcw & ~_FPU_EXTENDED) | _FPU_DOUBLE; 
_FPU_SETCW(newcw);
+diff --git a/Minisat/utils/System.h b/Minisat/utils/System.h
+index ecdde991b..fd501eeec 100644
+--- a/Minisat/utils/System.h
++++ b/Minisat/utils/System.h
+@@ -26,7 +26,7 @@ OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
DEALINGS IN THE SOFTWA
+ #ifndef Minisat_System_h
+ #define Minisat_System_h
+ 
+-#if defined(__linux__)
++#if defined(__GLIBC__)
+ #include <fpu_control.h>
+ #endif
+ 

diff --git a/sci-mathematics/vampire/vampire-4.6.1-r2.ebuild 
b/sci-mathematics/vampire/vampire-4.6.1-r2.ebuild
index d5579bce688d..0d3a66debc59 100644
--- a/sci-mathematics/vampire/vampire-4.6.1-r2.ebuild
+++ b/sci-mathematics/vampire/vampire-4.6.1-r2.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -32,6 +32,8 @@ RDEPEND="
 "
 DEPEND="${RDEPEND}"
 
+PATCHES=( "${FILESDIR}"/${P}-musl.patch )
+
 src_configure() {
        # -Werror=strict-aliasing warnings, bug #863269
        filter-lto

diff --git a/sci-mathematics/vampire/vampire-4.7-r1.ebuild 
b/sci-mathematics/vampire/vampire-4.7-r1.ebuild
index 69e581237127..975da65ac817 100644
--- a/sci-mathematics/vampire/vampire-4.7-r1.ebuild
+++ b/sci-mathematics/vampire/vampire-4.7-r1.ebuild
@@ -1,9 +1,9 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
 
-H=2d02e4655e1b08d1ca9ee7c0aade40f59f046460  # "bump to 4.7"
+[[ ${PV} == 4.7 ]] && COMMIT=2d02e4655e1b08d1ca9ee7c0aade40f59f046460  # "bump 
to 4.7"
 
 inherit flag-o-matic cmake
 
@@ -15,9 +15,9 @@ if [[ ${PV} == *9999* ]] ; then
        EGIT_REPO_URI="https://github.com/vprover/${PN}.git";
        EGIT_SUBMODULES=()
 else
-       SRC_URI="https://github.com/vprover/${PN}/archive/${H}.tar.gz
+       SRC_URI="https://github.com/vprover/${PN}/archive/${COMMIT}.tar.gz
                -> ${P}.tar.gz"
-       S="${WORKDIR}"/${PN}-${H}
+       S="${WORKDIR}"/${PN}-${COMMIT}
        KEYWORDS="~amd64 ~x86"
 fi
 
@@ -36,6 +36,8 @@ RDEPEND="
 "
 DEPEND="${RDEPEND}"
 
+PATCHES=( "${FILESDIR}"/${PN}-4.6.1-musl.patch )
+
 src_configure() {
        # -Werror=strict-aliasing warnings, bug #863269
        filter-lto

Reply via email to