mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-09-16 14:29:05 -07:00
sci-mathematics/minisat: fix build on musl
Bug: https://github.com/stp/minisat/pull/6 Closes: https://bugs.gentoo.org/832519 Signed-off-by: Maciej Barć <xgqt@gentoo.org>
This commit is contained in:
41
sci-mathematics/minisat/files/minisat-2.2.1-musl.patch
Normal file
41
sci-mathematics/minisat/files/minisat-2.2.1-musl.patch
Normal file
@@ -0,0 +1,41 @@
|
||||
From 4c8afcd6bfbf2cbdb5ebe271f20503a6d34d7d49 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Maciej=20Bar=C4=87?= <xgqt@gentoo.org>
|
||||
Date: Mon, 6 Feb 2023 17:09:18 +0100
|
||||
Subject: [PATCH] utils/System.*: use fpu_control only on glibc
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Bug: https://github.com/vprover/vampire/pull/432
|
||||
Signed-off-by: Maciej Barć <xgqt@gentoo.org>
|
||||
---
|
||||
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 282f98ed..112708f7 100644
|
||||
--- a/minisat/utils/System.cc
|
||||
+++ b/minisat/utils/System.cc
|
||||
@@ -97,7 +97,7 @@ double Minisat::memUsedPeak(bool /*strictlyPeak*/) { return 0; }
|
||||
|
||||
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 a51d4c2e..189fcbff 100644
|
||||
--- a/minisat/utils/System.h
|
||||
+++ b/minisat/utils/System.h
|
||||
@@ -21,7 +21,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
|
||||
|
||||
@@ -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
|
||||
@@ -6,10 +6,11 @@ EAPI=8
|
||||
inherit cmake
|
||||
|
||||
DESCRIPTION="Small yet efficient SAT solver with reference paper"
|
||||
HOMEPAGE="http://minisat.se/Main.html"
|
||||
HOMEPAGE="http://minisat.se/Main.html
|
||||
https://github.com/stp/minisat/"
|
||||
SRC_URI="https://github.com/stp/${PN}/archive/releases/${PV}.tar.gz -> ${P}.tar.gz
|
||||
doc? ( http://minisat.se/downloads/MiniSat.pdf )"
|
||||
S="${WORKDIR}/${PN}-releases-${PV}"
|
||||
S="${WORKDIR}"/${PN}-releases-${PV}
|
||||
|
||||
LICENSE="MIT"
|
||||
SLOT="0/${PV}"
|
||||
@@ -19,9 +20,13 @@ IUSE="doc"
|
||||
RDEPEND="sys-libs/zlib:="
|
||||
DEPEND="${RDEPEND}"
|
||||
|
||||
PATCHES=( "${FILESDIR}"/${P}-cmake.patch )
|
||||
PATCHES=(
|
||||
"${FILESDIR}"/${P}-cmake.patch
|
||||
"${FILESDIR}"/${P}-musl.patch
|
||||
)
|
||||
|
||||
src_install() {
|
||||
cmake_src_install
|
||||
|
||||
use doc && dodoc "${DISTDIR}"/MiniSat.pdf
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user