[aur-general] Proposed PKGBUILD for next llvm build

Gerardo Exequiel Pozzi vmlinuz386 at yahoo.com.ar
Tue Apr 14 14:57:06 EDT 2009


Hi

While fixing the insecure RPATH in community/llvm package [#1] also
fixed some others issues that I encountered.
(List of files in the generated packaged can viewed here [#2])

This is the list of changes from the original PKGBUILD:

0) Updated to the latest llvm version.
1) Removed libtool dependency, is only needed at build time.
2) Use the license from tarball, instead of downloading it, since is the
same, that are in webpage.
3) Fixed libdir, use /usr/lib/llvm instead of /usr/lib, this is more
apropiated since llvm put some .o files that are relocatable.
4) Fixed insecure rpath in all binary files.
5) Fixed the path from scripts gccld and gccas that points to build
directory instead of /usr/bin
6) Removed the build of sample hello transformation.
7) Use PIC code on x86_64 builds (--enable-pic).
8) Build only for the target machine instead of all supported.
9) Added --enable-bindings=none, since if ocaml is installed will build
some files for it.
10) Put --enable-optimized at configure script intead of make var.
11) Build a more "release" code with options: --disable-assertions and
--disable-expensive-checks
12) Force one job at installation step since more than one job fails.


# Maintainer: Geoffroy Carrier <geoffroy.carrier at aur.archlinux.org>
# Contributor: Gerardo Exequiel Pozzi <vmlinuz386 at yahoo.com.ar>
# Contributor: Tomas Lindquist Olsen <tomas at famolsen.dk>
# Contributor: Roberto Alsina <ralsina at kde.org>

pkgname=llvm
pkgver=2.5
pkgrel=1
pkgdesc="Low Level Virtual Machine"
arch=('i686' 'x86_64')
url="http://llvm.org"
license=('custom':'University of Illinois/NCSA Open Source License')
depends=('libelf')
source=("http://llvm.org/releases/$pkgver/$pkgname-$pkgver.tar.gz")
md5sums=('55df2ea8665c8094ad2ef85187b9fc74')

build() {
  cd $srcdir/$pkgname-$pkgver

  # --sysconfdir to configure apparently isn't enough ...
  sed 's:$(PROJ_prefix)/etc/llvm:/etc/llvm:' \
    -i Makefile.config.in || return 1
  # --libdir to configure apparently isn't enough ...
  sed 's:$(PROJ_prefix)/lib:$(PROJ_prefix)/lib/llvm:' \
    -i Makefile.config.in || return 1
  # Fix insecure rpath http://bugs.archlinux.org/task/14017
  sed 's:-rpath \$(ToolDir)::g' -i Makefile.rules || return 1
  # Fix path that point to the build directory
  sed 's:^TOOLDIR.*:TOOLDIR=/usr/bin:' \
    -i tools/gccld/gccld.sh tools/gccas/gccas.sh || return 1
  # remove docs from the make targets
  sed 's:runtime docs:runtime:' -i Makefile || return 1
  # remove libHello transformation
  sed 's: Hello::' -i lib/Transforms/Makefile || return 1

  if [ "${CARCH}" = "x86_64" ]; then
    _pic_flag="--enable-pic"
  else
    _pic_flag=""
  fi
 
  ./configure --prefix=/usr \
    --libdir=/usr/lib/llvm \
    --sysconfdir=/etc \
    --enable-bindings=none \
    --enable-targets=host-only \
    --enable-optimized \
    --disable-assertions \
    --disable-expensive-checks ${_pic_flag} || return 1
 
  make || return 1

  # install fails with more than one make job
  make -j1 DESTDIR=$pkgdir install || return 1
  install -D LICENSE.TXT $pkgdir/usr/share/licenses/llvm/COPYING

}

Cheers!


[#1] FS#14017 - [llvm] insecure RPATH (
http://bugs.archlinux.org/task/14017 )
[#2] List of files in the package http://djgera.pastebin.com/f95daaa0

-- 
Gerardo Exequiel Pozzi ( djgera )
http://www.djgera.com.ar
KeyID: 0x1B8C330D
Key fingerprint = 0CAA D5D4 CD85 4434 A219  76ED 39AB 221B 1B8C 330D



More information about the aur-general mailing list