diff options
Diffstat (limited to 'sci-physics/cernlib/cernlib-2023.10.31.0-r2.ebuild')
-rw-r--r-- | sci-physics/cernlib/cernlib-2023.10.31.0-r2.ebuild | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/sci-physics/cernlib/cernlib-2023.10.31.0-r2.ebuild b/sci-physics/cernlib/cernlib-2023.10.31.0-r2.ebuild new file mode 100644 index 000000000..93220dffb --- /dev/null +++ b/sci-physics/cernlib/cernlib-2023.10.31.0-r2.ebuild @@ -0,0 +1,79 @@ +EAPI=8 + +CMAKE_MAKEFILE_GENERATOR="emake" +inherit cmake fortran-2 flag-o-matic + +DESCRIPTION="CERN program library for High Energy Physics" +HOMEPAGE="https://cernlib.web.cern.ch/cernlib/" +SRC_URI=" + free? ( https://cernlib.web.cern.ch/download/2023_source/tar/${P}-free.tar.gz ) + !free? ( https://cernlib.web.cern.ch/download/2023_source/tar/${P}.tar.gz ) +" + +LICENSE=" + free? ( BSD LGPL-2+ GPL-1+ ) + !free? ( all-rights-reserved ) +" +SLOT="0" +KEYWORDS="~amd64" +# static-libs as default since otherwise test fail... +IUSE="+free +static-libs" +RESTRICT="mirror" + +RDEPEND=" + x11-libs/motif:0 + x11-libs/libXaw + x11-libs/libXau + virtual/lapack + dev-lang/cfortran + x11-libs/xbae + net-libs/libnsl + virtual/libcrypt:= +" +DEPEND="${RDEPEND}" +BDEPEND=" + virtual/pkgconfig +" + +PATCHES=( + "${FILESDIR}"/${P}-cfortran.patch + "${FILESDIR}"/${P}-ctest.patch + "${FILESDIR}"/${P}-man.patch +) + +src_unpack() { + default + if use free; then + mv ${P}-free ${P} || die + fi +} + +src_prepare() { + cmake_src_prepare + # cfortran.patch + # Remove cfortran.h since it is already installed from dev-lang/cfortran + # thereby we avoid collisions if e.g. sci-physics/root[fortran] is installed. + rm cfortran/cfortran.h || die +} + +src_configure() { + # docs follow rpm like spliting into packages cernlib, cernlib-devel, etc. + # we move them into a folder that agrees with gentoo doc structure. + sed -i "s#/doc/#/doc/${PF}/#g" CMakeLists.txt || die + # with -O2 some tests fail + # let upstream decide on optimization (-O0) since code is fragile + filter-flags -O1 -O2 -O3 -Os -Oz -Og -Ofast + local mycmakeargs=( + -DBUILD_SHARED_LIBS=$(usex static-libs OFF ON) + ) + cmake_src_configure +} + +src_install() { + cmake_src_install + # man.patch + # The CMakeLists.txt already compresses the manual before install + # therefore we install it manually and avoid QA problems. + doman contrib/man/man1/*.1 + doman contrib/man/man8/*.8 +} |