You are not logged in.

#1 2010-07-07 00:26:45

jac
Member
From: /home/jac
Registered: 2009-05-19
Posts: 431
Website

sdl-hg PKGBUILD

Looking for SDL 1.3 on AUR, I see that the old sdl-svn has been abandoned because SDL has moved to using hg, but no new PKGBUILD has been uploaded. So, I've tried my hand at an sdl-hg PKGBUILD.

# Maintainer: Jeff Chapman II <JAChapmanII at GMail dot com>
pkgname=sdl-hg
pkgver=4487
pkgrel=1
pkgdesc="A library for portable low-level access to a video framebuffer, audio output, mouse, and keyboard"
arch=('i686' 'x86_64')
url="http://www.libsdl.org/"
license=('LGPL')
makedepends=('mercurial')
provides=('sdl=1.2.99')
conflicts=('sdl')
options=('!libtool')
_hgroot="http://hg.libsdl.org/"
_hgrepo="SDL"

build() {
  cd "$srcdir"
  msg "Connecting to Mercurial server...."

  if [ -d $_hgrepo ] ; then
    cd $_hgrepo
    hg pull -u || return 1
    msg "The local files are updated."
  else
    hg clone $_hgroot/$_hgrepo || return 1
  fi

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

  rm -rf "$srcdir/$_hgrepo-build"
  cp -r "$srcdir/$_hgrepo" "$srcdir/$_hgrepo-build"
  cd "$srcdir/$_hgrepo-build"

  ./autogen.sh
  ./configure --prefix=/usr
  make || return 1
}

package() {
  cd "$srcdir/$_hgrepo-build"

  make DESTDIR="$pkgdir/" install || return 1
}

# vim:set ts=2 sw=2 et:

I don't know much about mecurial, or how makepkg handles them now. I tried to base this off of both the regular proto PKGBUILD, the hg proto PKGBUILD, and a few on AUR. Should I remove/add logic/pieces?
This is my first one, so I'm not sure if there's something more I should{,n't} do before (other than test it more) before I call it done and upload it to AUR. Some questions:

The !libtool option was added after looking at the sdl-svn packages, I'm not sure if it's necessary or not? The provides line is also based off of sdl-svn, because it seems some things work just fine with the new SDL, but that leads to a different problem:

This breaks at least smc (haven't looked into seeing if it's fixed on recompile). Should I assume that people installing this know what happens and not worry about that? Maybe an install note/just a comment on the AUR page?

sdl-svn has more configure options, but it took me the last half hour to get this to make a package in the first place, should I options as people ask for them on the AUR page? Where do I find these options?

Edit: I found namcap and it says that 'sh' is a dependency, should I include that even though it's really unlikely somebody doesn't have it? With -i it also says 'tzdata' 'linux-api-headers' 'readline' 'glibc' and 'ncurses' are dependencies. What about these, since they are all in core? Out of these, only glibc is listed in sdl/sdl-svn PKGBUILDs
sdl-svn/sdl also have more dependencies that this probably needs, is there a way to test this? (other than removing those packages and see if it still works?)

If somebody has a specific PKGBUILD to look at as a good example, I'm more than willing to do that.

Thank you for all of your help, I know that was long smile [Good news is it's already a few questions shorter]

Last edited by jac (2010-07-07 01:32:56)

Offline

Board footer

Powered by FluxBB