You are not logged in.

#1 2013-05-21 16:29:23

johnLate
Member
Registered: 2012-03-26
Posts: 8

first PKGBUILD: aspectc++-svn (from subversion repo with externals)

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:

  1. Build a previous stable version from a pre-woven source tar, then use it to build the current version. Problem: build failed (C++ errors).

  2. 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.

  3. 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

#2 2013-05-29 11:58:01

johnLate
Member
Registered: 2012-03-26
Posts: 8

Re: first PKGBUILD: aspectc++-svn (from subversion repo with externals)

I have uploaded my current version: https://aur.archlinux.org/packages/aspectc%2B%2B-svn/

Offline

#3 2013-06-05 22:08:56

tdy
Member
From: Sacremende
Registered: 2008-12-14
Posts: 438

Re: first PKGBUILD: aspectc++-svn (from subversion repo with externals)

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++.


dots (or just the awesomewm config)

$ whatis this?
this?: nothing appropriate.

Offline

#4 2013-06-06 06:09:51

Stebalien
Member
Registered: 2010-04-27
Posts: 1,218
Website

Re: first PKGBUILD: aspectc++-svn (from subversion repo with externals)

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

#5 2013-06-06 07:43:16

johnLate
Member
Registered: 2012-03-26
Posts: 8

Re: first PKGBUILD: aspectc++-svn (from subversion repo with externals)

@tdy, @Stebalien: Thanks for your suggestions and feedback. I have uploaded an updated version.

Offline

Board footer

Powered by FluxBB