commit:     7acdbf6f87135fc59c5f94d6b154760a004e2f91
Author:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 14 22:53:29 2025 +0000
Commit:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Sat Jan  3 02:29:10 2026 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7acdbf6f

sci-mathematics/highs: new package, add 1.12.0

Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>

 sci-mathematics/highs/Manifest                     |   1 +
 .../files/highs-1.12.0-hipo-search-paths.patch     |  30 ++++++
 sci-mathematics/highs/highs-1.12.0.ebuild          | 106 +++++++++++++++++++++
 sci-mathematics/highs/metadata.xml                 |  21 ++++
 4 files changed, 158 insertions(+)

diff --git a/sci-mathematics/highs/Manifest b/sci-mathematics/highs/Manifest
new file mode 100644
index 000000000000..94adef4c31df
--- /dev/null
+++ b/sci-mathematics/highs/Manifest
@@ -0,0 +1 @@
+DIST highs-1.12.0.tar.gz 5458281 BLAKE2B 
96c041567f349bea450890402baf5daa2a97f62ed628a5f228c33bee5344a4b56c59c5ad7a71aad96d4fc2ca90f1b79b987cea443ca53c65c1d1fdd722ac9a83
 SHA512 
901ef60e99bb0f193408082fc64769775958b31d721b06852d59c8535a54c97a6e14d82943bed5e4c60943aac683a80b265a1a8e5406efb3c2d20a62c1c901df

diff --git a/sci-mathematics/highs/files/highs-1.12.0-hipo-search-paths.patch 
b/sci-mathematics/highs/files/highs-1.12.0-hipo-search-paths.patch
new file mode 100644
index 000000000000..a6744b38f7c7
--- /dev/null
+++ b/sci-mathematics/highs/files/highs-1.12.0-hipo-search-paths.patch
@@ -0,0 +1,30 @@
+commit 1e589290311a82fc1d5e78a63003fcb8ac134b03
+Author: Michael Orlitzky <[email protected]>
+Date:   Tue Dec 16 12:21:31 2025 -0500
+
+    cmake/FindHipoDeps.cmake: fix metis search path
+
+diff --git a/cmake/FindHipoDeps.cmake b/cmake/FindHipoDeps.cmake
+index 881b987..51c7a9e 100644
+--- a/cmake/FindHipoDeps.cmake
++++ b/cmake/FindHipoDeps.cmake
+@@ -153,17 +153,13 @@ if(metis_FOUND)
+ else()
+     find_path(METIS_PATH
+         NAMES "metis.h"
+-        REQUIRED
+-        PATHS "${METIS_ROOT}/include"
+-        NO_DEFAULT_PATH)
++        REQUIRED)
+ 
+     message(STATUS "Found Metis header at ${METIS_PATH}")
+ 
+     find_library(METIS_LIB
+         NAMES metis libmetis
+-        REQUIRED
+-        PATHS "${METIS_ROOT}/lib" "${METIS_ROOT}/bin"
+-        NO_DEFAULT_PATH)
++        REQUIRED)
+ 
+     if(METIS_LIB)
+         message(STATUS "Found Metis library at ${METIS_LIB}")

diff --git a/sci-mathematics/highs/highs-1.12.0.ebuild 
b/sci-mathematics/highs/highs-1.12.0.ebuild
new file mode 100644
index 000000000000..7808905eef34
--- /dev/null
+++ b/sci-mathematics/highs/highs-1.12.0.ebuild
@@ -0,0 +1,106 @@
+# Copyright 1999-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake
+
+DESCRIPTION="Modern solver for linear, quadratic, and mixed-integer programs"
+HOMEPAGE="https://highs.dev/
+       https://github.com/ERGO-Code/HiGHS";
+SRC_URI="https://github.com/ERGO-Code/HiGHS/releases/download/v${PV}/source-archive.tar.gz
+       -> ${P}.tar.gz"
+S="${WORKDIR}/HiGHS"
+LICENSE="MIT"
+SLOT="0/1"  # soname major
+KEYWORDS="~riscv"
+IUSE="examples hipo index64 test +threads zlib"
+
+# The tests fail for me due to precision issues (gcc) and something
+# worse (clang): https://github.com/ERGO-Code/HiGHS/issues/2690
+RESTRICT="test"
+
+# An old version of dev-cpp/catch (header only) is bundled for tests
+# under extern/catch.hpp.
+RDEPEND="
+       hipo? (
+               sci-libs/metis
+               virtual/cblas
+       )
+"
+DEPEND="${RDEPEND}"
+
+DOCS=(
+       AUTHORS
+       CITATION.cff
+       CODE_OF_CONDUCT.md
+       CONTRIBUTING.md
+       FEATURES.md
+       README.md
+)
+
+PATCHES=(
+       "${FILESDIR}/highs-1.12.0-hipo-search-paths.patch"
+)
+
+src_prepare() {
+       # Sometimes the .git directory makes it into the release tarballs
+       # and cmake will waste time computing the latest commit.
+       rm -rf .git || die
+
+       # Remove docs for stuff we don't install
+       rm -r docs/src/assets || die
+       rm docs/src/interfaces/{csharp,fortran}.md || die
+
+       cmake_src_prepare
+}
+
+src_configure() {
+       # Without FAST_BUILD=ON, some options aren't even available.
+       #
+       # It would be easy to support USE=fortran with virtual/fortran, but
+       # unless someone needs it, it's simpler to leave the fortran
+       # interface disabled.
+       #
+       # The python interface can't be built at the same time as the C/C++
+       # bits. In any case, we should probably package dev-python/highspy
+       # separately since that's how people will look for it.
+       local mycmakeargs=(
+               -DALL_TESTS=$(usex test)
+               -DBLA_PKGCONFIG_BLAS=cblas
+               -DBUILD_CSHARP_EXAMPLE=OFF
+               -DBUILD_CXX_EXAMPLE=$(usex examples)
+               -DBUILD_CXX=ON
+               -DBUILD_CXX_EXE=ON
+               -DBUILD_EXAMPLES=$(usex examples)
+               -DBUILD_DOTNET=OFF
+               -DBUILD_TESTING=$(usex test)
+               -DCSHARP=OFF
+               -DCUPDLP_GPU=OFF
+               -DCUPDLP_FIND_CUDA=OFF
+               -DEMSCRIPTEN_HTML=OFF
+               -DFAST_BUILD=ON
+               -DFORTRAN=OFF
+               -DHIGHS_COVERAGE=OFF
+               -DHIGHS_NO_DEFAULT_THREADS=$(usex threads OFF ON)
+               -DHIGHSINT64=$(usex index64)
+               -DHIPO=$(usex hipo)
+               -DMETIS_ROOT="${EPREFIX}/usr"
+               -DPYTHON_BUILD_SETUP=OFF
+               -DUSE_DOTNET_STD_21=OFF
+               -DZLIB=$(usex zlib)
+       )
+       cmake_src_configure
+}
+
+src_install() {
+       cmake_src_install
+
+       docinto manual
+       dodoc -r docs/src/*
+
+       if use examples; then
+               docinto examples
+               dodoc examples/*.{c,cpp,py}
+       fi
+}

diff --git a/sci-mathematics/highs/metadata.xml 
b/sci-mathematics/highs/metadata.xml
new file mode 100644
index 000000000000..9cb3b1db6b78
--- /dev/null
+++ b/sci-mathematics/highs/metadata.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+  <maintainer type="person">
+    <email>[email protected]</email>
+  </maintainer>
+  <maintainer type="project">
+    <email>[email protected]</email>
+  </maintainer>
+
+  <upstream>
+    <remote-id type="github">ERGO-Code/HiGHS</remote-id>
+  </upstream>
+
+  <use>
+    <flag name="hipo">
+      Build the new factorization-based interior-point solver requiring
+      <pkg>sci-libs/metis</pkg>.
+    </flag>
+  </use>
+</pkgmetadata>

Reply via email to