commit:     db37f5e3fdac78d13dd51738a1b27ad269a41e6d
Author:     Mark Wright <gienah <AT> gentoo <DOT> org>
AuthorDate: Mon Jul 18 04:21:22 2022 +0000
Commit:     Mark Wright <gienah <AT> gentoo <DOT> org>
CommitDate: Mon Jul 18 04:21:22 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=db37f5e3

dev-lang/teyjus: Use CC,LD,AR,AS,CPP.

Use the environment variables CC, LD, AR, AS, CPP to configure the
build environment. Specify the ocaml -cc option to instruct ocamlopt.opt
to call the specified C compiler. Builds with gcc or clang. Remove the
superflous sys-devel/binutils and sys-devel/gcc dependencies. Thanks to
Agostino Sarubbo for reporting.

Closes: https://bugs.gentoo.org/858572
Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: Mark Wright <gienah <AT> gentoo.org>

 dev-lang/teyjus/teyjus-2.1-r2.ebuild | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/dev-lang/teyjus/teyjus-2.1-r2.ebuild 
b/dev-lang/teyjus/teyjus-2.1-r2.ebuild
index d19b8ef93092..b2cf755e19a0 100644
--- a/dev-lang/teyjus/teyjus-2.1-r2.ebuild
+++ b/dev-lang/teyjus/teyjus-2.1-r2.ebuild
@@ -14,9 +14,7 @@ KEYWORDS="~amd64 ~x86"
 LICENSE="GPL-3"
 IUSE="emacs examples"
 
-RDEPEND=">=sys-devel/binutils-2.17:*
-       >=sys-devel/gcc-2.95.3:*
-       >=dev-lang/ocaml-3.10[ocamlopt]
+RDEPEND="dev-lang/ocaml[ocamlopt]
        emacs? ( >=app-editors/emacs-23.1:* )"
 DEPEND="${RDEPEND}
        app-text/dos2unix
@@ -34,7 +32,7 @@ PATCHES=( 
"${FILESDIR}/${P}-p001-Fixes-arity-for-pervasive-modulo-operation.patc
 src_prepare() {
        rm -rf source/front/caml \
                || die "Could not remove bundled ocaml header files"
-       find . -type f -exec dos2unix {} \; \
+       find . -type f -exec dos2unix --quiet {} \; \
                || die "Could not convert files from DOS to Unix format"
        mv source/front/ccode_stubs.c source/front/ccode_stubs_c.c \
           || die "Could not rename source/front/ccode_stubs.c to 
source/front/ccode_stubs_c.c"
@@ -51,8 +49,15 @@ src_prepare() {
        do
                lflags="${lflags} -cclib ${i}"
        done
-       sed     -e "s@\(OCAMLFLAGS= -w -A\)@\1 ${cflags}${lflags}@" \
-               -e "s@\(CFLAGS +=\) -g@\1 ${CFLAGS}\nLDFLAGS += ${LDFLAGS}@" \
+       local bs="LDFLAGS += ${LDFLAGS}\n"
+       bs+="CC = ${CC:-gcc}\n"
+       bs+="CPP = ${CPP:-cpp}\n"
+       bs+="LD = ${LD:-ld}\n"
+       bs+="AR(name) =\n"
+       bs+="    return(${AR:-ar} cq \$(name))\n"
+       bs+="AS = ${AS:-as}"
+       sed     -e "s@\(OCAMLFLAGS= -w -A\)@\1 -cc ${CC:-gcc} 
${cflags}${lflags}@" \
+               -e "s@\(CFLAGS +=\) -g@\1 ${CFLAGS}\n${bs}@" \
                -i "${S}/source/OMakefile" \
                || die "Could not set flags in ${S}/source/OMakefile"
 }

Reply via email to