# Copyright 1999-2026 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # $Id: 4560844a359f9e7d3bf834bba15a2497e63cc89e $ EAPI=8 inherit toolchain-funcs DESCRIPTION="Mixed Integer Linear Programming (MILP) solver" HOMEPAGE="https://sourceforge.net/projects/lpsolve/" SRC_URI="https://downloads.sourceforge.net/${PN}/lp_solve_${PV}_source.tar.gz" S="${WORKDIR}"/lp_solve_$(ver_cut 1-2) LICENSE="LGPL-2.1" SLOT="0/55" KEYWORDS="amd64 ~arm arm64 ~loong ~ppc ppc64 ~riscv x86" PATCHES=( "${FILESDIR}"/${PN}-5.5.2.11-misc.patch ) SOVER="${SLOT##*/}" src_prepare() { default local actual_soname=$(grep -iEo -- "-soname,liblpsolve([A-z0-9]+)" lpsolve*/ccc | sed -e 's:-soname,liblpsolve::') if [[ ${actual_soname} != ${SOVER} ]] ; then eerror "Actual SONAME: ${actual_soname}" eerror "Expected SONAME: ${SOVER}" die "Expected SONAME not found! Please update the subslot in the ebuild!" fi } src_compile() { tc-export AR CC RANLIB LD cd lpsolve${SOVER} || die sh -x ccc || die rm bin/ux*/liblpsolve${SOVER}.a || die cd ../lp_solve || die sh -x ccc || die } src_install() { einstalldocs dobin lp_solve/bin/ux*/lp_solve dolib.so lpsolve${SOVER}/bin/ux*/liblpsolve${SOVER}.so insinto /usr/include/lpsolve doins *.h }