From b33ae7b649fdab3d259af42c0430bc620de16542 Mon Sep 17 00:00:00 2001 From: Steve Arnold Date: Thu, 16 Oct 2008 06:02:44 +0000 Subject: Updated to fix borked JAVA_HOME and CFLAGS (Portage version: 2.2_rc11/cvs/Linux 2.6.26.5 x86_64) --- dev-util/astyle/ChangeLog | 9 +++- dev-util/astyle/astyle-1.22.ebuild | 53 ++++++++---------------- dev-util/astyle/files/astyle-1.22-Makefile.patch | 52 +++++++++++++++++++++++ dev-util/astyle/files/astyle-1.22-strip.patch | 29 ------------- 4 files changed, 77 insertions(+), 66 deletions(-) create mode 100644 dev-util/astyle/files/astyle-1.22-Makefile.patch delete mode 100644 dev-util/astyle/files/astyle-1.22-strip.patch (limited to 'dev-util/astyle') diff --git a/dev-util/astyle/ChangeLog b/dev-util/astyle/ChangeLog index 2632fd75ccc7..219fd81731b1 100644 --- a/dev-util/astyle/ChangeLog +++ b/dev-util/astyle/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog for dev-util/astyle # Copyright 2002-2008 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-util/astyle/ChangeLog,v 1.26 2008/09/10 13:06:01 fmccor Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-util/astyle/ChangeLog,v 1.27 2008/10/16 06:02:44 nerdboy Exp $ + + 28 Sep 2008; Steve Arnold astyle-1.22.ebuild, + +filers/astyle-1.22-Makefile.patch, -files/astyle-1.22-strip.patch: + Updated to fix borked JAVA_HOME and CFLAGS; requires a 1.6 JDK now... + Tested on amd64 with Sun JDK. 10 Sep 2008; Ferris McCormick astyle-1.21.ebuild: Sparc stable --- Bug #220739 --- seems to work fine. @@ -34,7 +39,7 @@ Dropped ppc-macos keyword, see you in prefix 14 Nov 2007; Robin H. Johnson astyle-1.21.ebuild: - Fix $Header: /var/cvsroot/gentoo-x86/dev-util/astyle/ChangeLog,v 1.26 2008/09/10 13:06:01 fmccor Exp $ string. + Fix $Header: /var/cvsroot/gentoo-x86/dev-util/astyle/ChangeLog,v 1.27 2008/10/16 06:02:44 nerdboy Exp $ string. *astyle-1.21 (07 Oct 2007) diff --git a/dev-util/astyle/astyle-1.22.ebuild b/dev-util/astyle/astyle-1.22.ebuild index 75d6ac5aee2f..f451e6b91fe2 100644 --- a/dev-util/astyle/astyle-1.22.ebuild +++ b/dev-util/astyle/astyle-1.22.ebuild @@ -1,8 +1,8 @@ # Copyright 1999-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-util/astyle/astyle-1.22.ebuild,v 1.3 2008/05/30 18:53:54 corsair Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-util/astyle/astyle-1.22.ebuild,v 1.4 2008/10/16 06:02:44 nerdboy Exp $ -inherit eutils java-pkg-opt-2 +inherit eutils java-pkg-2 java-pkg-opt-2 toolchain-funcs DESCRIPTION="Artistic Style is a reindenter and reformatter of C++, C and Java source code" HOMEPAGE="http://astyle.sourceforge.net/" @@ -14,29 +14,35 @@ KEYWORDS="~alpha ~amd64 ~ppc -ppc64 ~sparc ~x86" IUSE="debug java libs" -RDEPEND="java? ( >=virtual/jre-1.5 )" +RDEPEND="java? ( >=virtual/jre-1.6 )" -DEPEND="java? ( >=virtual/jre-1.5 )" +DEPEND="java? ( >=virtual/jre-1.6 )" S=${WORKDIR}/${PN} pkg_setup() { - use java && java-pkg-2_pkg_setup + if use java ; then + java-pkg-2_pkg_setup - if use x86; then - jvmarch=i386 - else - jvmarch=${ARCH} + if use x86; then + jvmarch=i386 + else + jvmarch=${ARCH} + fi fi } src_unpack() { unpack ${A} cd "${S}" - epatch "${FILESDIR}"/${P}-strip.patch # Add basic soname to make QA happy... sed -i -e "s:-shared:-shared -Wl,-soname,\$@ :g" buildgcc/Makefile - use java && setup-jvm-opts + # Fix JAVA_HOME + sed -i -e \ + "s:/usr/lib/jvm/java-6-sun-1.6.0.00:$(java-config --jdk-home):g" \ + buildgcc/Makefile || die "sed failed" + # respect CFLAGS, remove strip and other hard-coded crap + epatch "${FILESDIR}"/${P}-Makefile.patch } src_compile() { @@ -45,7 +51,7 @@ src_compile() { local build_targets="all" use java && build_targets="${build_targets} javaall" - emake ${build_targets} || die "build failed" + emake CXX="$(tc-getCXX)" ${build_targets} || die "build failed" } src_install() { @@ -54,7 +60,6 @@ src_install() { newlib.a bin/libastyled.a libastyle.a \ || die "install debug static lib failed" if use libs ; then - # shared lib got a soname patch newlib.so bin/libastyled.so libastyle.so \ || die "install debug shared lib failed" if use java ; then @@ -80,25 +85,3 @@ src_install() { dohtml doc/*.html } -setup-jvm-opts() { - # Figure out correct boot classpath - # stolen from eclipse-sdk ebuild - local bp="$(java-config --jdk-home)/jre/lib" - local bootclasspath=$(java-config --runtime) - if java-config --java-version | grep -q IBM ; then - # IBM JDK - JAVA_LIB_DIR="$(java-config --jdk-home)/jre/bin" - else - # Sun derived JDKs (Blackdown, Sun) - JAVA_LIB_DIR="$(java-config --jdk-home)/jre/lib/${jvmarch}" - fi - - einfo "Using bootclasspath ${bootclasspath}" - einfo "Using JVM library path ${JAVA_LIB_DIR}" - - if [[ ! -f ${JAVA_LIB_DIR}/libawt.so ]] ; then - die "Could not find libawt.so native library" - fi - - export AWT_LIB_PATH=${JAVA_LIB_DIR} -} diff --git a/dev-util/astyle/files/astyle-1.22-Makefile.patch b/dev-util/astyle/files/astyle-1.22-Makefile.patch new file mode 100644 index 000000000000..aa1dd25c21ff --- /dev/null +++ b/dev-util/astyle/files/astyle-1.22-Makefile.patch @@ -0,0 +1,52 @@ +--- buildgcc/Makefile.orig 2008-10-14 20:31:23.645424162 -0700 ++++ buildgcc/Makefile 2008-10-14 20:36:36.484423984 -0700 +@@ -36,14 +36,14 @@ + ################################################## + + # define compile options for each build +-CFLAGS = -DNDEBUG -O3 $(CBASEFLAGS) +-CFLAGSd = -g $(CBASEFLAGS) +-CFLAGSs = -DNDEBUG -DASTYLE_LIB -O3 -fpic $(CBASEFLAGS) +-CFLAGSsd = -DASTYLE_LIB -g -fpic $(CBASEFLAGS) +-CFLAGSa = -DNDEBUG -DASTYLE_LIB -O3 $(CBASEFLAGS) +-CFLAGSad = -DASTYLE_LIB -g $(CBASEFLAGS) +-CFLAGSsj = -DNDEBUG -DASTYLE_JNI -O3 -fpic $(CBASEFLAGS) $(JAVAINCS) +-CFLAGSsjd = -DASTYLE_JNI -g -fpic $(CBASEFLAGS) $(JAVAINCS) ++CFLAGSb = -DNDEBUG $(CFLAGS) ++CFLAGSd = -g $(CFLAGS) ++CFLAGSs = -DNDEBUG -DASTYLE_LIB -fPIC $(CFLAGS) ++CFLAGSsd = -DASTYLE_LIB -g -fPIC $(CFLAGS) ++CFLAGSa = -DNDEBUG -DASTYLE_LIB $(CFLAGS) ++CFLAGSad = -DASTYLE_LIB -g $(CFLAGS) ++CFLAGSsj = -DNDEBUG -DASTYLE_JNI -fPIC $(CFLAGS) $(JAVAINCS) ++CFLAGSsjd = -DASTYLE_JNI -g -fPIC $(CFLAGS) $(JAVAINCS) + + # object files are built from the source list $(SRC) + # a suffix is added for each build +@@ -61,7 +61,7 @@ + # OBJ + $(objdir)/%.o: %.cpp astyle.h + @ mkdir -p $(objdir) +- $(CXX) $(CFLAGS) -c -o $@ $< ++ $(CXX) $(CFLAGSb) -c -o $@ $< + + # OBJd + $(objdir)/%_d.o: %.cpp astyle.h +@@ -104,7 +104,7 @@ + release: astyle + astyle: $(OBJ) + @ mkdir -p $(bindir) +- $(CXX) -s -o $(bindir)/$@ $^ ++ $(CXX) -o $(bindir)/$@ $^ + @ echo + + debug: astyled +@@ -116,7 +116,7 @@ + shared: libastyle.so + libastyle.so: $(OBJs) + @ mkdir -p $(bindir) +- $(CXX) -shared -Wl,-soname,$@ -s -o $(bindir)/$@ $^ ++ $(CXX) -shared -Wl,-soname,$@ -o $(bindir)/$@ $^ + @ echo + + shareddebug: libastyled.so diff --git a/dev-util/astyle/files/astyle-1.22-strip.patch b/dev-util/astyle/files/astyle-1.22-strip.patch deleted file mode 100644 index 3015ec12be08..000000000000 --- a/dev-util/astyle/files/astyle-1.22-strip.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- astyle.orig/buildgcc/Makefile 2008-04-11 11:25:13.000000000 +0200 -+++ astyle/buildgcc/Makefile 2008-04-11 11:25:52.000000000 +0200 -@@ -104,7 +104,7 @@ - release: astyle - astyle: $(OBJ) - @ mkdir -p $(bindir) -- $(CXX) -s -o $(bindir)/$@ $^ -+ $(CXX) -o $(bindir)/$@ $^ - @ echo - - debug: astyled -@@ -116,7 +116,7 @@ - shared: libastyle.so - libastyle.so: $(OBJs) - @ mkdir -p $(bindir) -- $(CXX) -shared -s -o $(bindir)/$@ $^ -+ $(CXX) -shared -o $(bindir)/$@ $^ - @ echo - - shareddebug: libastyled.so -@@ -140,7 +140,7 @@ - java: libastylej.so - libastylej.so: $(OBJsj) - @ mkdir -p $(bindir) -- $(CXX) -shared -s -o $(bindir)/$@ $^ -+ $(CXX) -shared -o $(bindir)/$@ $^ - @ echo - - javadebug: libastylejd.so -- cgit v1.2.3-65-gdbad