You are not logged in.

#1 2010-04-16 17:26:09

aardwolf
Member
From: Belgium
Registered: 2005-07-23
Posts: 305

My first PKGBUILD! (for LodePaint)

Hello,

I made the painting program LodePaint, and now also made an Archlinux package for it (had to figure out both how makefiles work and how the arch build system works).

The PKGBUILD is as follows:

# Contributor: Lode Vandevenne
pkgname=lodepaint-svn
pkgver=16
pkgrel=1
pkgdesc="Painting program with many tools and filters"
url="http://sourceforge.net/projects/lodepaint/"
arch=('i686' 'x86_64')
license=('GPL3')
depends=('sdl')
makedepends=('subversion')
source=()
md5sums=()

_svntrunk=https://lodepaint.svn.sourceforge.net/svnroot/lodepaint
_svnmod=lodepaint

build() {
cd "$srcdir"

LANG=C
  if [ -d $_svnmod/.svn ]; then
    (cd $_svnmod && svn up -r $pkgver)
  else
    svn co $_svntrunk --config-dir ./ -r $pkgver $_svnmod
  fi

  msg "SVN checkout done or server timeout"
  msg "Starting make..."

  rm -rf "$srcdir/$_svnmod-build"
  cp -r "$srcdir/$_svnmod" "$srcdir/$_svnmod-build"
  cd "$srcdir/$_svnmod-build/trunk"

  #
  # BUILD
  #
  make DESTDIR=$pkgdir || return 1
  make DESTDIR=$pkgdir install || return 1
}

The makefile can be seen here, in case you want to check what commands it contains.

http://lodepaint.svn.sourceforge.net/vi … evision=16

And if you don't want to mess with making anything, you can also get a binary version where you just have to unzip and run it here: https://sourceforge.net/projects/lodepaint/files/

First of all, the program LodePaint is intended to be a handy new painting program that can fill some gaps next to Gimp (by having the inverse design decision for many things compared to Gimp). Do you like this program? Do you think it could go somewhere? Any suggestions?

And secondly, this are my first makefile and first PKGBUILD ever (note: there's no "configure" because I didn't study that yet). Do you have any comments on those? Is what I'm doing in there correct? And is it flexible enough?

And finally, is it possible to put such a PKGBUILD somewhere in a community repository for Archlinux, and if so, how?

Last edited by aardwolf (2010-04-16 17:36:09)

Offline

#2 2010-04-16 22:13:33

dcc24
Member
Registered: 2009-10-31
Posts: 732

Re: My first PKGBUILD! (for LodePaint)

PKGBUILD seems fine to me. Congrats for your first Arch package smile We have AUR (Arch User Repositories), so you can upload it there (aur.archlinux.org). But first, you must create the source package with "makepkg --source".

Edit: For "configure", if the script supports it, you can use this line:

./configure || return 1

Last edited by dcc24 (2010-04-16 22:15:01)


It is better to keep your mouth shut and be thought a fool than to open it and remove all doubt. (Mark Twain)

My AUR packages

Offline

#3 2010-04-16 22:22:55

aardwolf
Member
From: Belgium
Registered: 2005-07-23
Posts: 305

Re: My first PKGBUILD! (for LodePaint)

In the script, I needed to do this:

  make DESTDIR=$pkgdir || return 1
  make DESTDIR=$pkgdir install || return 1

Instead of this:

  make || return 1
  make DESTDIR=$pkgdir install || return 1

So I have to give this DESTDIR to both make and make install. I don't know how I can make it work without that. When doing make, it compiles and gives the DESTDIR as a #define to the g++ compile command, and then the path is compiled into the executable, because otherwise the executable doesn't know where to find data files (the png files under usr/share/lodepaint).

However I see that normally scripts don't have to do this. So I'm probably doing something abnormal. Is this ok what I'm doing or are there better ways for this?

Last edited by aardwolf (2010-04-16 22:23:35)

Offline

#4 2010-05-28 23:29:51

aardwolf
Member
From: Belgium
Registered: 2005-07-23
Posts: 305

Re: My first PKGBUILD! (for LodePaint)

It's been a while, but finally I made the package built with --source and placed it on AUR!

Here: http://aur.archlinux.org/packages.php?ID=37597

Does it work?

Let me know what you think.

Offline

Board footer

Powered by FluxBB