commit:     d92a65a7066fd6bc6467e88a26c33e9e5a152a8e
Author:     Alexander Puck Neuwirth <alexander <AT> neuwirth-informatik <DOT> 
de>
AuthorDate: Mon Apr  8 11:32:34 2024 +0000
Commit:     Alexander Puck Neuwirth <alexander <AT> neuwirth-informatik <DOT> 
de>
CommitDate: Tue Apr  9 13:05:35 2024 +0000
URL:        https://gitweb.gentoo.org/proj/sci.git/commit/?id=d92a65a7

sci-physics/cernlib: split free and non-free

Closes: https://github.com/gentoo/sci/pull/1265
Co-authored-by: Andrew Nowa Ammerlaan <andrewammerlaan <AT> gentoo.org>
Signed-off-by: Alexander Puck Neuwirth <alexander <AT> neuwirth-informatik.de>

 ....31.0.ebuild => cernlib-2023.10.31.0-r1.ebuild} | 28 +++++++++++++++++-----
 sci-physics/cernlib/metadata.xml                   |  3 +++
 2 files changed, 25 insertions(+), 6 deletions(-)

diff --git a/sci-physics/cernlib/cernlib-2023.10.31.0.ebuild 
b/sci-physics/cernlib/cernlib-2023.10.31.0-r1.ebuild
similarity index 70%
rename from sci-physics/cernlib/cernlib-2023.10.31.0.ebuild
rename to sci-physics/cernlib/cernlib-2023.10.31.0-r1.ebuild
index 697a25ef0..326fadde3 100644
--- a/sci-physics/cernlib/cernlib-2023.10.31.0.ebuild
+++ b/sci-physics/cernlib/cernlib-2023.10.31.0-r1.ebuild
@@ -3,14 +3,22 @@ EAPI=8
 CMAKE_MAKEFILE_GENERATOR="emake"
 inherit cmake fortran-2
 
+MY_P="${P}"
 DESCRIPTION="CERN program library for High Energy Physics"
 HOMEPAGE="https://cernlib.web.cern.ch/cernlib/";
-SRC_URI="https://cernlib.web.cern.ch/download/2023_source/tar/${P}-free.tar.gz";
-S="${WORKDIR}/${P}-free"
+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="GPL-3"
+LICENSE="
+       free? ( BSD LGPL-2+ GPL-1+ )
+       !free? ( all-rights-reserved )
+"
 SLOT="0"
 KEYWORDS="~amd64"
+IUSE="+free"
+RESTRICT="mirror"
 
 RDEPEND="
        x11-libs/motif:0
@@ -28,10 +36,18 @@ BDEPEND="
 "
 
 PATCHES=(
-       "${FILESDIR}"/$P-cfortran.patch
-       "${FILESDIR}"/$P-ctest.patch
-       "${FILESDIR}"/$P-man.patch
+       "${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

diff --git a/sci-physics/cernlib/metadata.xml b/sci-physics/cernlib/metadata.xml
index 887c950bc..dcbfb9b47 100644
--- a/sci-physics/cernlib/metadata.xml
+++ b/sci-physics/cernlib/metadata.xml
@@ -18,4 +18,7 @@
   mathematics, data analysis, detectors simulation, data-handling
   etc... applicable to a wide range of problems.
   </longdescription>
+  <use>
+    <flag name="free"> Use free sources </flag>
+  </use>
 </pkgmetadata>

Reply via email to