[arch-commits] Commit in sbcl/trunk (2 files)

Dave Reisner dreisner at archlinux.org
Sat Aug 13 20:11:24 UTC 2011


    Date: Saturday, August 13, 2011 @ 16:11:24
  Author: dreisner
Revision: 135444

upgpkg: sbcl 1.0.50-2
rebuild with kernel version parsing patch from upstream

Added:
  sbcl/trunk/0001-Fix-version-string-parsing-for-Linux-3.0.patch
Modified:
  sbcl/trunk/PKGBUILD

-----------------------------------------------------+
 0001-Fix-version-string-parsing-for-Linux-3.0.patch |   43 +++++++++++
 PKGBUILD                                            |   69 +++++++++---------
 2 files changed, 78 insertions(+), 34 deletions(-)

Added: 0001-Fix-version-string-parsing-for-Linux-3.0.patch
===================================================================
--- 0001-Fix-version-string-parsing-for-Linux-3.0.patch	                        (rev 0)
+++ 0001-Fix-version-string-parsing-for-Linux-3.0.patch	2011-08-13 20:11:24 UTC (rev 135444)
@@ -0,0 +1,43 @@
+From b43c51beeb0569a38900e1e5a78606711f987742 Mon Sep 17 00:00:00 2001
+From: Paul Khuong <pvk at pvk.ca>
+Date: Wed, 3 Aug 2011 10:20:41 -0400
+Subject: [PATCH] Fix version string parsing for Linux 3.0
+
+ Stop assuming the presence of minor and patch version numbers; missing
+ values are defaulted to 0 (e.g. 3.0.0).
+
+ Reported by a few people on IRC.
+---
+ src/runtime/linux-os.c |   14 ++++++++++----
+ 1 files changed, 10 insertions(+), 4 deletions(-)
+
+diff --git a/src/runtime/linux-os.c b/src/runtime/linux-os.c
+index db72fa6..e262f41 100644
+--- a/src/runtime/linux-os.c
++++ b/src/runtime/linux-os.c
+@@ -198,12 +198,18 @@ os_init(char *argv[], char *envp[])
+     int patch_version;
+     char *p;
+     uname(&name);
++
+     p=name.release;
+     major_version = atoi(p);
+-    p=strchr(p,'.')+1;
+-    minor_version = atoi(p);
+-    p=strchr(p,'.')+1;
+-    patch_version = atoi(p);
++    minor_version = patch_version = 0;
++    p=strchr(p,'.');
++    if (p != NULL) {
++            minor_version = atoi(++p);
++            p=strchr(p,'.');
++            if (p != NULL)
++                    patch_version = atoi(++p);
++    }
++
+     if (major_version<2) {
+         lose("linux kernel version too old: major version=%d (can't run in version < 2.0.0)\n",
+              major_version);
+-- 
+1.7.6
+

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2011-08-13 17:34:50 UTC (rev 135443)
+++ PKGBUILD	2011-08-13 20:11:24 UTC (rev 135444)
@@ -2,31 +2,36 @@
 # Contributor: John Proctor <jproctor at prium.net>
 # Contributor: Daniel White <daniel at whitehouse.id.au>
 # Maintainer: Juergen Hoetzel <juergen at archlinux.org>
-# Contributor: Leslie Polzer (skypher) 
+# Contributor: Leslie Polzer (skypher)
 
 pkgname=sbcl
 pkgver=1.0.50
-pkgrel=1
+pkgrel=2
 pkgdesc="Steel Bank Common Lisp"
+url="http://www.sbcl.org/"
 arch=('i686' 'x86_64')
 license=('custom')
 depends=('glibc')
 provides=('common-lisp' 'cl-asdf')
 makedepends=('sbcl' 'texinfo')
-source=("http://downloads.sourceforge.net/project/sbcl/sbcl/$pkgver/$pkgname-$pkgver-source.tar.bz2" "arch-fixes.lisp")
+install=sbcl.install
+source=("http://downloads.sourceforge.net/project/sbcl/sbcl/$pkgver/$pkgname-$pkgver-source.tar.bz2"
+        "arch-fixes.lisp"
+        "0001-Fix-version-string-parsing-for-Linux-3.0.patch")
 md5sums=('74ce9b24516885d066ec4287cde52e8c'
-         '7ac0c1936547f4278198b8bf7725204d')
-url="http://www.sbcl.org/"
-install=sbcl.install
+         '7ac0c1936547f4278198b8bf7725204d'
+         '7af58d1de2d788ad6a8d82c89279a75f')
 
 build() {
-  export CFLAGS="${CFLAGS} -DSBCL_HOME=\\\"/usr/lib/sbcl\\\""
+  cd "$srcdir/$pkgname-$pkgver"
+
+  export CFLAGS+=" -DSBCL_HOME=\\\"/usr/lib/sbcl\\\""
   export GNUMAKE="make -e"
 
   # build system uses LINKFLAGS and OS_LIBS to build LDFLAGS
-  export LINKFLAGS="$LD_FLAGS" 
+  export LINKFLAGS="$LDFLAGS"
   unset LDFLAGS
-  cd ${startdir}/src/${pkgname}-${pkgver}
+
   # Make a multi-threaded SBCL, disable LARGEFILE  
   cat >customize-target-features.lisp <<EOF
 (lambda (features)
@@ -36,38 +41,34 @@
   (disable :largefile)))
 EOF
 
+  # fix build against 3.0-ARCH
+  patch -Np1 < "$srcdir/0001-Fix-version-string-parsing-for-Linux-3.0.patch"
+
   sh make.sh sbcl
-  mkdir -p ${startdir}/pkg/usr
-  pushd doc/manual
-  make info || return 1
-  popd 
-  INSTALL_ROOT=${startdir}/pkg/usr sh install.sh
+  make -C doc/manual info
+}
 
+package() {
+  cd "$srcdir/$pkgname-$pkgver"
+
+  INSTALL_ROOT="$pkgdir/usr" sh install.sh
+
   src/runtime/sbcl --core output/sbcl.core --script ${startdir}/src/arch-fixes.lisp
   mv sbcl-new.core ${startdir}/pkg/usr/lib/sbcl/sbcl.core
 
-# sources
-  mkdir -p ${startdir}/pkg/usr/share/sbcl-source
-  cp -R -t ${startdir}/pkg/usr/share/sbcl-source \
-    ${startdir}/src/${pkgname}-${pkgver}/{src,contrib}
+  # sources
+  mkdir -p "$pkgdir/usr/share/sbcl-source"
+  cp -R -t "$pkgdir/usr/share/sbcl-source" "$srcdir/$pkgname-$pkgver/"{src,contrib}
 
-# drop unwanted files
-  find ${startdir}/pkg/usr/share/sbcl-source -type f \
-    -name \*.fasl -or \
-    -name \*.o -or \
-    -name \*.log -or \
-    -name \*.so -or \
-    -name a.out -delete
+  # license
+  install -D -m644 "$srcdir/$pkgname-$pkgver/COPYING" \
+                   "$pkgdir/usr/share/licenses/$pkgname/license.txt"
 
-  rm ${startdir}/pkg/usr/share/sbcl-source/src/runtime/sbcl
-  rm ${startdir}/pkg/usr/share/sbcl-source/src/runtime/sbcl.nm
+  # drop unwanted files
+  find "$pkgdir" \( -name Makefile -o -name .cvsignore \) -delete
+  find "$pkgdir/usr/share/sbcl-source" -type f \
+    \( -name \*.fasl -o -name \*.o -o -name \*.log -o -name \*.so -o -name a.out \) -delete
 
-  find ${startdir}/pkg \( -name Makefile -o -name .cvsignore \) -delete
+  rm "$pkgdir/usr/share/sbcl-source/src/runtime/sbcl"{,.nm}
 
-  rm $startdir/pkg/usr/share/info/dir
-  gzip -9nf $startdir/pkg/usr/share/info/*
-
-  # license
-  install -D -m644 ${startdir}/src/${pkgname}-${pkgver}/COPYING \
-                   ${startdir}/pkg/usr/share/licenses/${pkgname}/license.txt
 }




More information about the arch-commits mailing list