Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=interim.git;a=commitdiff;h=f61a0fa326a3c3bd4e8ad9cdff434555bafb4fc2

commit f61a0fa326a3c3bd4e8ad9cdff434555bafb4fc2
Author: crazy <[EMAIL PROTECTED]>
Date:   Wed Jul 16 10:05:50 2008 +0200

pacman-g2-3.7.0-2-x86_64
* release bump
* added an patch and updated install script and build()
* for generic switch

diff --git a/source/base/pacman-g2/FrugalBuild 
b/source/base/pacman-g2/FrugalBuild
index d6d650a..fe9398a 100644
--- a/source/base/pacman-g2/FrugalBuild
+++ b/source/base/pacman-g2/FrugalBuild
@@ -6,13 +6,13 @@ USE_DEVEL=${USE_DEVEL:-"n"}
pkgname=pacman-g2
pkgver=3.7.0
Fuse $USE_DEVEL && pkgver=3.6.5.25.gf2bbdac
-pkgrel=1
+pkgrel=2
pkgdesc="A .tar.bz2 based package manager library (libpacman) and client 
(pacman-g2) with dependency support."
url="http://ftp.frugalware.org/pub/other/pacman-g2/";
backup=(etc/{makepkg,pacman-g2}.conf 
etc/pacman-g2/repos/{frugalware,frugalware-current})
depends=('libarchive>=2.4.8-2' 'glibc>=2.7-3' 'grep>=2.5.3-3' 
'util-linux-ng>=2.13.1-2')
makedepends=('doxygen' 'po4a' 'swig' 'java-gcj-compat>=1.0.77-2' 'ecj>=3.2.2-4' 
'mono' \
-       'asciidoc' 'docbook-xsl' 'docbook-xml' 'sgml-common')
+       'asciidoc' 'docbook-xsl' 'docbook-xml' 'sgml-common' 'cvs')
Fuse $USE_DEVEL && makedepends=([EMAIL PROTECTED] 'intltool')
Finclude mono
groups=('base' 'chroot-core')
@@ -20,8 +20,8 @@ archs=('i686' 'x86_64' 'ppc')
_F_archive_nosort=y
up2date="lynx -dump $url/releases/ |Flasttar"
if ! Fuse $USE_DEVEL; then
-       source=($url/releases/$pkgname-$pkgver.tar.gz)
-       signatures=("$source.asc")
+       source=($url/releases/$pkgname-$pkgver.tar.gz generic-switch.patch)
+       signatures=("$source.asc" '')
else
_F_scm_type="git"
_F_scm_url="git://git.frugalware.org/pub/other/pacman-g2/pacman-g2"
@@ -39,7 +39,22 @@ build()
fi

CFLAGS=${CFLAGS/O2/O0}
-       Fbuild_mono --disable-debug
+       ## avoid building it twice while generic switch
+       if [ "$CARCH" == "i686" ]; then
+               CFLAGS=${CFLAGS/-march=i686/-march=i686 -mtune-generic}
+               CXXFLAGS=${CXXFLAGS/-march=i686/-march=i686 -mtune-generic}
+       else
+               CFLAGS=${CFLAGS/-march=k8/-march=x86-64 -mtune-generic}
+               CXXFLAGS=${CXXFLAGS/-march=k8/-march=x86-64 -mtune-generic}
+       fi
+       unset MAKEFLAGS
+       Fcd
+       Fpatchall
+       Fautoreconf
+       Fmonoexport
+       Fmake --disable-debug
+       Fmakeinstall
+       Fmonocleanup
}

# optimization OK
diff --git a/source/base/pacman-g2/generic-switch.patch 
b/source/base/pacman-g2/generic-switch.patch
new file mode 100644
index 0000000..52a79bb
--- /dev/null
+++ b/source/base/pacman-g2/generic-switch.patch
@@ -0,0 +1,95 @@
+diff --git a/configure.ac b/configure.ac
+index e594952..99d3d4e 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -101,10 +101,10 @@ case "$host" in
+               MARCHFLAG="march"
+               ;;
+       x86_64-*) AC_DEFINE_UNQUOTED([CARCH], ["x86_64"], [Architecture])
+-              AC_DEFINE_UNQUOTED([CARCHFLAGS], ["k8"], [Architecture])
++              AC_DEFINE_UNQUOTED([CARCHFLAGS], ["x86-64"], [Architecture])
+               AC_DEFINE_UNQUOTED([MARCHFLAG], ["march"], [Architecture])
+               CARCH="x86_64"
+-              CARCHFLAGS="k8"
++              CARCHFLAGS="x86-64"
+               MARCHFLAG="march"
+               ;;
+       ia64-*) AC_DEFINE_UNQUOTED([CARCH], ["ia64"], [Architecture])
+diff --git a/etc/makepkg.conf.in b/etc/makepkg.conf.in
+index c2cbc5d..b7dad35 100644
+--- a/etc/makepkg.conf.in
++++ b/etc/makepkg.conf.in
+@@ -15,12 +15,10 @@ export CHOST="@CHOST@"
+
+ # Pentium Pro/Pentium II/Pentium III+/Pentium 4/Athlon exclusive (binaries
+ # will use the P6 instruction set and only run on P6+ systems)
+-export CFLAGS="[EMAIL PROTECTED]@[EMAIL PROTECTED]@ -O2 -pipe"
+-export CXXFLAGS="[EMAIL PROTECTED]@[EMAIL PROTECTED]@ -O2 -pipe"
+-# Pentium Pro/Pentium II/Pentium III+/Pentium 4/Athlon optimized (but binaries
+-# will run on any x86 system)
+-#export CFLAGS="-mcpu=i686 -O2 -pipe"
+-#export CXXFLAGS="-mcpu=i686 -O2 -pipe"
++# As of GCC 4.2 -mtune=generic can be used to generate code running well on
++# common x86 chips.
++export CFLAGS="[EMAIL PROTECTED]@[EMAIL PROTECTED]@ --mtune=generic -O2 -pipe"
++export CXXFLAGS="[EMAIL PROTECTED]@[EMAIL PROTECTED]@ --mtune=generic -O2 
-pipe"
+
+ # SMP Systems
+ #export MAKEFLAGS="-j2"
+diff --git a/scripts/makepkg b/scripts/makepkg
+index 6fefcae..7623725 100755
+--- a/scripts/makepkg
++++ b/scripts/makepkg
+@@ -124,13 +124,51 @@ if [ -e /etc/frugalware-release ] && $ECHO $CHOST|grep 
-q linux-gnu; then
+ fi
+
+ # we need -fno-strict-aliasing for gcc 4.2*++
++_gccminver_generic="4.2"
+ _gccver=`type -p gcc >/dev/null && gcc -dumpversion`
+-if [ "${_gccver%%.?}" == "4.3" ]; then
++if [[ "${_gccver%%.?}" == "${_gccminver_generic}" ]] || [[ "${_gccver%%.?}" > 
"${_gccminver_generic}" ]]; then
+         export CFLAGS="$CFLAGS -fno-strict-aliasing"
+         export CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"
+ fi
+
+
++## another hack for syncpkgd almost , before 1.0 this should be removed
++_glibcver_generic="2.8"
++_glibcver=`ldd --version|head -n1 |sed 's/.*) //'`
++if [ -e /etc/frugalware-release ]; then
++      if [[ "${_glibcver} == ${_glibcver_generic}" ]] || [[ "${_glibcver}" > 
"${_glibcver_generic}" ]]; then
++              if [ "$CARCH" == "i686" ]; then
++                      if ! $ECHO ${CFLAGS}|grep -q "mtune=genric"; then
++                              export CFLAGS="$CFLAGS -mtune=generic"
++                      fi
++                      if ! $ECHO ${CXXFLAGS}|grep -q "mtune=generic"; then
++                              export CXXFLAGS="$CXXFLAGS -mtune=generic"
++                      fi
++              fi
++
++              if [ "$CARCH" == "x86_64" ]; then
++                      ## so test for k8 since when is there this system 
doesn't uses x86-64 generic
++                      if $ECHO ${CFLAGS}|grep -q "march=k8"; then
++                              CFLAGS=${CFLAGS/-march=k8}
++                              export CFLAGS="-march=x86-64 -mtune=generic 
$CFLAGS"
++                      fi
++                      if $ECHO ${CXXFLAGS}|grep -q "march=k8"; then
++                              CXXFLAGS=${CXXFLAGS/-march=k8}
++                              export CXXFLAGS="-march=x86-64 -mtune=generic 
$CXXFLAGS"
++                      fi
++              fi
++      fi
++fi
++
++## this has to stay here until we remove oldish gcc versions
++if [[ "${_gccver%%.?}" < "${_gccminver_generic}" ]]; then
++        # well we have gcc 3.3 and gcc 4.1 , these doesn't support 
-mtune=generic
++        # so kill generic for these
++        export CFLAGS="${CFLAGS/-mtune=generic}"
++        export CXXFLAGS="${CXXFLAGS/-mtune=generic}"
++fi
++
++
+ INFAKEROOT=
+ if [ "$1" = "-F" ]; then
+       INFAKEROOT=1
diff --git a/source/base/pacman-g2/pacman-g2.install 
b/source/base/pacman-g2/pacman-g2.install
index 46e1683..78c70cf 100644
--- a/source/base/pacman-g2/pacman-g2.install
+++ b/source/base/pacman-g2/pacman-g2.install
@@ -15,6 +15,15 @@ post_upgrade()
fi
## yeah I know ppc but ..
fi
+       if [ "$PARCH" = "i686" ]; then
+               if ! grep -q "mtune=genric" /etc/makepkg.conf; then
+                       sed -e 's/-march=i686/-march=i686 -mtune=generic/' -i 
/etc/makepkg.conf*
+               fi
+       else
+               if grep -q "march=k8" /etc/makepkg.conf; then
+                       sed -e 's/-march=k8/-march=x86-64 -mtune=generic/' -i 
/etc/makepkg.conf*
+               fi
+       fi
}

op=$1
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to