Commits

Uelsk8s  committed 15127e3

retry gcc

  • Participants
  • Parent commits 8b74bd9

Comments (0)

Files changed (1)

File var/vabs/gcc/src/gcc.SlackBuild

 #--------------------------------------------
 
 CWD=$(pwd)
+cd ../
+PKGDIR=$(pwd)
+cd $CWD
 # Temporary build location.  This should *NOT* be a directory
 # path a non-root user could create later...
 TMP=/gcc-$(mcookie)
     $PKG2/usr/doc/gcc-${VERSION}/libstdc++-v3
   )
 )
+
+# Add fastjar to the gcc-java package:
+( cd $TMP
+  FASTJARVER=$(echo $CWD/fastjar-*.tar.xz | rev | cut -f 3- -d . | cut -f 1 -d - | rev)
+  echo
+  echo "Building fastjar-$FASTJARVER first"
+  echo
+  rm -rf fastjar-$FASTJARVER
+  tar xvf $CWD/fastjar-$FASTJARVER.tar.xz || exit 1
+  cd fastjar-$FASTJARVER || exit
+  chown -R root:root .
+  find . \
+    \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
+    -exec chmod 755 {} \; -o \
+    \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
+    -exec chmod 644 {} \;
+  for patch in $CWD/fastjar-patches/*.gz ; do
+    zcat $patch | patch -p1 --verbose || exit 1
+  done
+  CFLAGS="$SLKCFLAGS" \
+  CXXFLAGS="$SLKCFLAGS" \
+  ./configure \
+     --prefix=/usr \
+     --libdir=/usr/lib$LIBDIRSUFFIX \
+     --mandir=/usr/man \
+     --infodir=/usr/info \
+     --build=$TARGET
+  make $NUMJOBS || exit 1
+  make install DESTDIR=$PKG5 || exit 1
+  mkdir -p $PKG5/usr/doc/fastjar-$FASTJARVER
+  cp -a \
+    AUTHORS CHANGES COPYING* INSTALL NEWS README* TODO \
+    $PKG5/usr/doc/fastjar-$FASTJARVER
+  # If there's a ChangeLog, installing at least part of the recent history
+  # is useful, but don't let it get totally out of control:
+  if [ -r ChangeLog ]; then
+    DOCSDIR=$(echo $PKG5/usr/doc/fastjar-$FASTJARVER)
+    cat ChangeLog | head -n 1000 > $DOCSDIR/ChangeLog
+    touch -r ChangeLog $DOCSDIR/ChangeLog
+  fi
+  find $PKG5 | xargs file | grep -e "executable" -e "shared object" | grep ELF \
+    | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
+  # Compress and if needed symlink the man pages:
+  if [ -d $PKG5/usr/man ]; then
+    ( cd $PKG5/usr/man
+      for manpagedir in $(find . -type d -name "man*") ; do
+        ( cd $manpagedir
+          for eachpage in $( find . -type l -maxdepth 1) ; do
+            ln -s $( readlink $eachpage ).gz $eachpage.gz
+            rm $eachpage
+          done
+          gzip -9 *.?
+        )
+      done
+    )
+  fi
+  # Compress info files, if any:
+  if [ -d $PKG5/usr/info ]; then
+    ( cd $PKG5/usr/info
+      rm -f dir
+      gzip -9 *
+    )
+  fi
+  echo
+) || exit 1
+
 # build gcc
 ( mkdir gcc.build.lnx;
   cd gcc.build.lnx;
   rm -f $PKG1/usr/lib/libiberty.a # catch-all
 
   # Fix stuff up:
+  ( cd $PKG1/usr/;mv share/info . )
   ( cd $PKG1/usr/info ; rm dir ; gzip -9 * )
   ( cd $PKG1
     # *not* ${LIBDIRSUFFIX}
 
 # gcc-java:
 ( cd $PKG5
+  mkdir -p usr/share/java/
+  cp -v $CWD/ecj-4.5.jar usr/share/java/eclipse-ecj.jar
   mkdir -p usr/bin
   mv $PKG1/usr/bin/addr2name.awk usr/bin
   # mv $PKG1/usr/bin/fastjar usr/bin
   mv $PKG1/usr/man/man1/jv-scan.1.gz usr/man/man1
   mkdir -p usr/share
   mv $PKG1/usr/share/java usr/share
+  # The ecj wrapper script:
+  cat $CWD/ecj.sh | sed -e "s,@JAVADIR@,/usr/share/java," > usr/bin/ecj
+  cat $CWD/ecj1 | sed -e "s,@JAVADIR@,/usr/share/java," > usr/bin/ecj1
+  chmod 755 usr/bin/ecj
+  chmod 755 usr/bin/ecj1
 )
 
 # gcc-objc:
 done
 
 ( cd $PKG1
-  makepkg -l y -c n $TMP/gcc-$VERSION-$ARCH-$BUILD.txz )
+  makepkg -l y -c n $PKGDIR/gcc-$VERSION-$ARCH-$BUILD.txz )
 ( cd $PKG2
-  makepkg -l y -c n $TMP/gcc-g++-$VERSION-$ARCH-$BUILD.txz )
+  makepkg -l y -c n $PKGDIR/gcc-g++-$VERSION-$ARCH-$BUILD.txz )
 ( cd $PKG3
-  makepkg -l y -c n $TMP/gcc-gfortran-$VERSION-$ARCH-$BUILD.txz )
+  makepkg -l y -c n $PKGDIR/gcc-gfortran-$VERSION-$ARCH-$BUILD.txz )
 #( cd $PKG4
-#  makepkg -l y -c n $TMP/gcc-gnat-$VERSION-$ARCH-$BUILD.txz )
+#  makepkg -l y -c n $PKGDIR/gcc-gnat-$VERSION-$ARCH-$BUILD.txz )
 ( cd $PKG5
-  makepkg -l y -c n $TMP/gcc-java-$VERSION-$ARCH-$BUILD.txz )
+  makepkg -l y -c n $PKGDIR/gcc-java-$VERSION-$ARCH-$BUILD.txz )
 #( cd $PKG6
-#  makepkg -l y -c n $TMP/gcc-objc-$VERSION-$ARCH-$BUILD.txz )
+#  makepkg -l y -c n $PKGDIR/gcc-objc-$VERSION-$ARCH-$BUILD.txz )
 #( cd $PKG7
-#  makepkg -l y -c n $TMP/gcc-g++-gch-$VERSION-$ARCH-$BUILD.txz )
+#  makepkg -l y -c n $PKGDIR/gcc-g++-gch-$VERSION-$ARCH-$BUILD.txz )
+#( cd $PKG8
+#  makepkg -l y -c n $PKGDIR/gcc-go-$VERSION-$ARCH-$BUILD.txz )
 
 echo
 echo "Slackware GCC package build complete!"