Skip to content

Commit

Permalink
dev-ada/gnatcoll: Add use flags gnat_2016 & gnat_2017
Browse files Browse the repository at this point in the history
Package-Manager: Portage-2.3.6, Repoman-2.3.1
  • Loading branch information
atupone committed Jun 27, 2017
1 parent 57d85e5 commit 51f0ec9
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 35 deletions.
40 changes: 20 additions & 20 deletions dev-ada/gnatcoll/gnatcoll-2016.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ SRC_URI="http://mirrors.cdn.adacore.com/art/5739942ac7a447658d00e1e7
LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~amd64"
IUSE="gmp gtk iconv postgresql pygobject projects readline +shared sqlite
static syslog"
IUSE="gmp gnat_2016 gnat_2017 gtk iconv postgresql pygobject projects readline
+shared sqlite static syslog"

RDEPEND="dev-lang/gnat-gpl:*
RDEPEND="gnat_2016? ( dev-lang/gnat-gpl:4.9.4 )
gnat_2017? ( dev-lang/gnat-gpl:6.3.0 )
${PYTHON_DEPS}
gmp? ( dev-libs/gmp:* )
gtk? (
Expand All @@ -37,35 +38,31 @@ RDEPEND="dev-lang/gnat-gpl:*
=dev-ada/gprbuild-2016[static?,shared?]
)"
DEPEND="${RDEPEND}
dev-ada/gprbuild"
dev-ada/gprbuild[gnat_2016=,gnat_2017=]"

REQUIRED_USE="${PYTHON_REQUIRED_USE}
pygobject? ( gtk )"
pygobject? ( gtk )
^^ ( gnat_2016 gnat_2017 )"

S="${WORKDIR}"/${MYP}-src

PATCHES=( "${FILESDIR}"/${P}-gentoo.patch )

pkg_setup() {
GCC=${ADA:-$(tc-getCC)}
GNATMAKE="${GCC/gcc/gnatmake}"
GNATCHOP="${GCC/gcc/gnatchop}"
if [[ -z "$(type ${GNATMAKE} 2>/dev/null)" ]] ; then
eerror "You need a gcc compiler that provides the Ada Compiler:"
eerror "1) use gcc-config to select the right compiler or"
eerror "2) set ADA=gcc-4.9.4 in make.conf"
die "ada compiler not available"
fi
python-single-r1_pkg_setup
}

src_prepare() {
default
mv configure.{in,ac} || die
eautoreconf
}

src_configure() {
if use gnat_2016; then
GCC_PV=4.9.4
else
GCC_PV=6.3.0
fi
GCC=${CHOST}-gcc-${GCC_PV}
GNATMAKE=${CHOST}-gnatmake-${GCC_PV}
GNATCHOP=${CHOST}-gnatchop-${GCC_PV}
if use sqlite; then
myConf="--with-sqlite=$(get_libdir)"
else
Expand All @@ -91,15 +88,18 @@ src_configure() {
--with-python-exec=${EPYTHON} \
--enable-shared-python \
--disable-pygtk \
CC=${GCC} \
$myConf
}

src_compile() {
if use shared; then
emake PROCESSORS=$(makeopts_jobs) build_library_type/relocatable
emake PROCESSORS=$(makeopts_jobs) GPRBUILD_OPTIONS=-v GCC=${GCC} \
build_library_type/relocatable
fi
if use static; then
emake PROCESSORS=$(makeopts_jobs) build_library_type/static
emake PROCESSORS=$(makeopts_jobs) GPRBUILD_OPTIONS=-v GCC=${GCC} \
build_library_type/static
fi
python_fix_shebang .
}
Expand Down
20 changes: 5 additions & 15 deletions dev-ada/gnatcoll/gnatcoll-2017.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ KEYWORDS="~amd64"
IUSE="gmp gtk iconv postgresql pygobject projects readline +shared sqlite
static syslog"

RDEPEND="dev-lang/gnat-gpl:*
RDEPEND="dev-lang/gnat-gpl:6.3.0
${PYTHON_DEPS}
gmp? ( dev-libs/gmp:* )
gtk? (
Expand All @@ -37,7 +37,7 @@ RDEPEND="dev-lang/gnat-gpl:*
>=dev-ada/gprbuild-2017[static?,shared?]
)"
DEPEND="${RDEPEND}
dev-ada/gprbuild"
dev-ada/gprbuild[gnat_2017]"

REQUIRED_USE="${PYTHON_REQUIRED_USE}
pygobject? ( gtk )"
Expand All @@ -46,26 +46,16 @@ S="${WORKDIR}"/${MYP}-src

PATCHES=( "${FILESDIR}"/${P}-gentoo.patch )

pkg_setup() {
GCC=${ADA:-$(tc-getCC)}
GNATMAKE="${GCC/gcc/gnatmake}"
GNATCHOP="${GCC/gcc/gnatchop}"
if [[ -z "$(type ${GNATMAKE} 2>/dev/null)" ]] ; then
eerror "You need a gcc compiler that provides the Ada Compiler:"
eerror "1) use gcc-config to select the right compiler or"
eerror "2) set ADA=gcc-4.9.4 in make.conf"
die "ada compiler not available"
fi
python-single-r1_pkg_setup
}

src_prepare() {
default
mv configure.{in,ac} || die
eautoreconf
}

src_configure() {
GCC=${CHOST}-gcc-6.3.0
GNATMAKE=${CHOST}-gnatmake-6.3.0
GNATCHOP=${CHOST}-gnatchop-6.3.0
if use sqlite; then
myConf="--with-sqlite=$(get_libdir)"
else
Expand Down
2 changes: 2 additions & 0 deletions dev-ada/gnatcoll/metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
<name>Tupone Alfredo</name>
</maintainer>
<use>
<flag name="gnat_2016">Compile with dev-lang/gnat-gpl-2016</flag>
<flag name="gnat_2017">Compile with dev-lang/gnat-gpl-2017</flag>
<flag name="postgresql">Adds support for postgresql</flag>
<flag name="projects">Adds support for projects</flag>
<flag name="pygobject">Adds support for pygobject</flag>
Expand Down

0 comments on commit 51f0ec9

Please sign in to comment.