You are not logged in.
I can not build https://aur.archlinux.org/packages.php?ID=56107. So I am trying to create a PKGBUILD for the current version from svn.
[edit]The following code is outdated, current version at https://aur.archlinux.org/packages/as/a … n/PKGBUILD[/edit]
pkgname=aspectc++-svn
pkgver=0.0.0.0
pkgrel=1
pkgdesc="A set of C++ language extensions to facilitate aspect-oriented programming with C/C++."
arch=('i686' 'x86_64')
url="http://aspectc.org/"
license=('GPL') # Puma/COPYING, AspectC++/version.h, Ag++/version.h
groups=()
depends=('libxml2' 'gcc-libs')
makedepends=('subversion')
optdepends=()
provides=('aspectc++')
conflicts=('aspectc++')
replaces=()
backup=()
options=()
install=
changelog=
_svnname=aspectc++ # equal to base directory name in tar of bootstrap version
_bootstrapver=1.0 # 1.1 segfaults
source=("$_svnname::svn+https://svn.aspectc.org/repos/AspectC++-Project/trunk"
"http://aspectc.org/fileadmin/downloads/ac/$_bootstrapver/ac-bin-linux-${_bootstrapver}.tar.gz")
noextract=()
md5sums=('SKIP'
'777173bf359feaa66bef8ec3c0632d32')
sha512sums=('SKIP'
'b9968300c0816c0d91a4785eb4486e174f406e069f983bdd50f6654d112a6b2eaba65cfe26a0a1a742cfd9501bc7df7ce1d09259485e2ab4817124893b30c795')
pkgver() {
cd $_svnname
# incorporate revision numbers of svn externals
echo -n `svnversion | tr -d [A-z]`
echo -n .`svnversion Puma | tr -d [A-z]`
echo -n .`svnversion AspectC++ | tr -d [A-z]`
echo .`svnversion Ag++ | tr -d [A-z]`
}
build() {
cd $_svnname
# -D__STRICT_ANSI__: disables __int128 in cstdlib
make -C Puma AC="$(pwd)/ac++" AC_OPTFLAGS="-D__STRICT_ANSI__"
make -C AspectC++ SHARED=1
make -C Ag++
}
package() {
_bindir=$pkgdir/usr/bin
mkdir -p $_bindir
cd $_svnname
make -C Puma install PREFIX=$pkgdir/usr
install -D ./AspectC++/bin/linux-release/ac++ $_bindir/
install -D ./Ag++/bin/linux-release/ag++ $_bindir/
# TODO: docs
}
Questions:
The upstream repository actually consists of 4 repositories (3 svn externals in the main repository). Therefore I generate the version number by concatenating the revision numbers of all repositories. Is this ok? Is there a better way?
Is it ok to leave pkgver at 0.0.0.0 when uploading to AUR? Or should I use the current result of pkgver()?
To build (bootstrap) AspectC++, a previous version is required. I had several options:
Build a previous stable version from a pre-woven source tar, then use it to build the current version. Problem: build failed (C++ errors).
Download the current nightly binary release first, use it to build the current version. Problem: You can only download the most recent nightly, as a result one can not use a checksum.
Download a previous stable binary version, use it to build the current version. Problem: Build process requires external binary instead of just source files.
I chose variant 3, is this reasonable?
Is there anything else I should change or fix?
I use x86_64. Can somebody test if it works on i686?
Last edited by johnLate (2013-06-06 07:42:23)
Offline
I have uploaded my current version: https://aur.archlinux.org/packages/aspectc%2B%2B-svn/
Offline
Double quote any variable that could possibly have spaces, i.e. anything related to $HOME.
You might as well add the "-m 755" flag to those install commands for ag++ and ac++.
Offline
The PKGBUILD is quite clean and good. Here are a few nit-picky stylistic points:
- Remove the unused (empty) variables.
- Remove the period at the end of the description.
- Don't bother including the md5sums array (just the shaXsums). MD5's collision resistance has been broken.
- Use $() instead of backticks (``). Actually, just avoid backticks in general.
- Instead of `mkdir -p $_bindir`, use `install -dm755 $_bindir`. That way the permissions are guaranteed to be correct no matter what the user's umask is.
Steven [ web : git ]
GPG: 327B 20CE 21EA 68CF A7748675 7C92 3221 5899 410C
Do not email: honeypot@stebalien.com
Offline
@tdy, @Stebalien: Thanks for your suggestions and feedback. I have uploaded an updated version.
Offline