commit:     642055cfaedfc2942dee8dd5e1ac7a2a103ea599
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Sun Jul  5 00:23:15 2020 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Sun Jul  5 00:23:15 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=642055cf

dev-libs/libbulletml: Pass AR/CXX to build system

Closes: https://bugs.gentoo.org/600684
Closes: https://bugs.gentoo.org/723040
Package-Manager: Portage-2.3.103, Repoman-2.3.23
Signed-off-by: David Seifert <soap <AT> gentoo.org>

 .../files/libbulletml-0.0.6-Makefile.patch         | 119 +++++++++++++++++++++
 dev-libs/libbulletml/libbulletml-0.0.6.ebuild      |  17 +--
 2 files changed, 128 insertions(+), 8 deletions(-)

diff --git a/dev-libs/libbulletml/files/libbulletml-0.0.6-Makefile.patch 
b/dev-libs/libbulletml/files/libbulletml-0.0.6-Makefile.patch
new file mode 100644
index 00000000000..05400d2c506
--- /dev/null
+++ b/dev-libs/libbulletml/files/libbulletml-0.0.6-Makefile.patch
@@ -0,0 +1,119 @@
+--- a/Makefile
++++ b/Makefile
+@@ -1,10 +1,5 @@
+-CC = g++
+ INCLUDES = -I.
+ LIBS = tinyxml/tinyxml.o tinyxml/tinyxmlparser.o tinyxml/tinyxmlerror.o
+-#CXXFLAGS = -g -W -Wall -ansi -pedantic
+-#CXXFLAGS = -pg -g -W -Wall -ansi -pedantic
+-CXXFLAGS = -O2 -W -Wall -ansi -pedantic
+-CFLAGS = -O2
+ OBJS = bulletmlparser-tinyxml.o bulletmlparser.o bulletmltree.o calc.o 
formula-variables.o bulletmlrunner.o bulletmlrunnerimpl.o
+ 
+ all: libbulletml.a
+@@ -21,7 +16,7 @@
+       bison -y   calc.yy && mv y.tab.c calc.cpp
+ 
+ $(OBJS): %.o: %.cpp
+-      $(CC) -c $(CXXFLAGS) $(INCLUDES) $<
++      $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(INCLUDES) -c $< -o $@
+ 
+ doxy:
+       doxygen
+--- a/tinyxml/Makefile
++++ b/tinyxml/Makefile
+@@ -14,41 +14,6 @@
+ PROFILE        := NO
+ 
+ #****************************************************************************
+-
+-CC     := gcc
+-CXX    := g++
+-LD     := g++
+-AR     := ar rc
+-RANLIB := ranlib
+-
+-DEBUG_CFLAGS     := -Wall -Wno-unknown-pragmas -Wno-format -g -DDEBUG
+-RELEASE_CFLAGS   := -Wall -Wno-unknown-pragmas -Wno-format -O2
+-
+-LIBS           :=
+-
+-DEBUG_CXXFLAGS   := ${DEBUG_CFLAGS} 
+-RELEASE_CXXFLAGS := ${RELEASE_CFLAGS}
+-
+-DEBUG_LDFLAGS    := -g
+-RELEASE_LDFLAGS  :=
+-
+-ifeq (YES, ${DEBUG})
+-   CFLAGS       += ${DEBUG_CFLAGS}
+-   CXXFLAGS     += ${DEBUG_CXXFLAGS}
+-   LDFLAGS      += ${DEBUG_LDFLAGS}
+-else
+-   CFLAGS       += ${RELEASE_CFLAGS}
+-   CXXFLAGS     += ${RELEASE_CXXFLAGS}
+-   LDFLAGS      += ${RELEASE_LDFLAGS}
+-endif
+-
+-ifeq (YES, ${PROFILE})
+-   CFLAGS   := ${CFLAGS} -pg
+-   CXXFLAGS := ${CXXFLAGS} -pg
+-   LDFLAGS  := ${LDFLAGS} -pg
+-endif
+-
+-#****************************************************************************
+ # Preprocessor directives
+ #****************************************************************************
+ 
+@@ -70,8 +35,8 @@
+ # Makefile code common to all platforms
+ #****************************************************************************
+ 
+-CFLAGS   := ${CFLAGS}   ${DEFS}
+-CXXFLAGS := ${CXXFLAGS} ${DEFS}
++CFLAGS   += ${DEFS}
++CXXFLAGS += ${DEFS}
+ 
+ #****************************************************************************
+ # Targets of the build
+@@ -98,7 +63,7 @@
+ #****************************************************************************
+ 
+ ${OUTPUT}: ${OBJS}
+-      ${LD} -o $@ ${LDFLAGS} ${OBJS} ${LIBS} ${EXTRA_LIBS}
++      ${CXX} ${LDFLAGS} -o $@ ${OBJS} ${LIBS} ${EXTRA_LIBS}
+ 
+ #****************************************************************************
+ # common rules
+@@ -106,10 +71,10 @@
+ 
+ # Rules for compiling source files to object files
+ %.o : %.cpp
+-      ${CXX} -c ${CXXFLAGS} ${INCS} $< -o $@
++      ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${INCS} -c $< -o $@
+ 
+ %.o : %.c
+-      ${CC} -c ${CFLAGS} ${INCS} $< -o $@
++      ${CC} ${CFLAGS} ${CPPFLAGS} ${INCS} -c $< -o $@
+ 
+ clean:
+       -rm -f core ${OBJS} ${OUTPUT}
+--- a/ygg/Makefile
++++ b/ygg/Makefile
+@@ -2,8 +2,6 @@
+ LIBS = 
+ #CXXFLAGS = -g -W -Wall
+ #CXXFLAGS = -pg -g -W -Wall
+-CXXFLAGS = -O2 -W -Wall
+-CFLAGS = -O2
+ OBJS = ygg.o
+ 
+ all: $(OBJS)
+@@ -12,7 +10,7 @@
+       rm -f *.o *.a
+ 
+ $(OBJS): %.o: %.cpp
+-      $(CXX) -c $(CXXFLAGS) $(INCLUDES) $<
++      $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(INCLUDES) -c $< -o $@
+ 
+ distdir:
+ 

diff --git a/dev-libs/libbulletml/libbulletml-0.0.6.ebuild 
b/dev-libs/libbulletml/libbulletml-0.0.6.ebuild
index 045879e2c0f..5bd9fa9717b 100644
--- a/dev-libs/libbulletml/libbulletml-0.0.6.ebuild
+++ b/dev-libs/libbulletml/libbulletml-0.0.6.ebuild
@@ -1,8 +1,10 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
 
+inherit toolchain-funcs
+
 DESCRIPTION="A Library of Bullet Markup Language"
 HOMEPAGE="https://shinh.skr.jp/libbulletml/index_en.html";
 SRC_URI="https://shinh.skr.jp/libbulletml/${P}.tar.bz2";
@@ -10,25 +12,24 @@ SRC_URI="https://shinh.skr.jp/libbulletml/${P}.tar.bz2";
 LICENSE="BSD"
 SLOT="0"
 KEYWORDS="amd64 ppc x86"
-IUSE=""
 
 DEPEND="dev-libs/boost"
 RDEPEND=${DEPEND}
 
-PATCHES=( "${FILESDIR}"/${P}-gcc4{3,6}.patch )
+PATCHES=(
+       "${FILESDIR}"/${P}-gcc4{3,6}.patch
+       "${FILESDIR}"/${P}-Makefile.patch
+)
 
 S="${WORKDIR}"/${PN#lib}/src
 
 src_prepare() {
        default
        rm -r boost || die
-
-       # don't override the system-wide flags
-       sed -i -e '/^CFLAGS =/d;/^CXXFLAGS =/d' Makefile ygg/Makefile || die
 }
 
-src_compile() {
-       emake CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}"
+src_configure() {
+       tc-export AR CXX
 }
 
 src_install() {

Reply via email to