You are not logged in.

#1 2007-11-05 15:19:37

tkjacobsen
Member
From: Denmark
Registered: 2007-07-07
Posts: 29

Interactive makepkg

I have made a little experiment and would like your comments.

Like in FreeBSD this PKGBUILD is able to ask the user which configure flags to use. The variable INTERACTIVE should be set to 1 or the PKGBUILD will work as usual. This PKGBUILD replaces the current one for xmoto in extra (version 3.4). Please try it and comment below.

NOTE: this is just the basic idea. Ideally this should be implemented in makepkg, so the packager easily can decide which flags the user can choose and the defaults.

NOTE2: You still need xmoto.desktop and xmoto.install from /var/abs/extra/games/xmoto

run with:
INTERACTIVE=1 makepkg

pkgname=xmoto
pkgver=0.3.4
pkgrel=1
pkgdesc="A challenging 2D motocross platform game, where physics play an important role in gameplay."
arch=('i686' 'x86_64')
url="http://xmoto.tuxfamily.org"
license=('GPL')
depends=('bzip2' 'libjpeg' 'libpng' 'lua' 'sdl_mixer' 'ode' 'curl>=7.16.2' 
     'mesa' 'libxdamage' 'libxfixes' 'sqlite3' 'sdl_ttf' 'desktop-file-utils')
install=xmoto.install
source=(http://download.tuxfamily.org/$pkgname/$pkgname/$pkgver/$pkgname-$pkgver-src.tar.gz xmoto.desktop)
md5sums=('cd2041652586119f68655c789c0ce7b3'
         '6db4ee410eadb61db14c74576f279ce7')

#BEGIN OF CONFIGURE MENU
config_menu() {
CONFIGURE="./configure --prefix=/usr"

CHOICE=`dialog --stdout --separate-output --title "Configure xmoto" \
    --checklist "Choose configure options" 15 50 5 \
    "zoom" "Enable zoom" "on"\
    "opengl" "OpenGl" "on"\
    "sdl" "sdlGfx" "off"`
clear

for i in ${CHOICE[@]};do
    case $i in
    'zoom')
        CONFIGURE="$CONFIGURE --with-enable-zoom=1" 
        ;;
    'opengl')
        CONFIGURE="$CONFIGURE --with-renderer-openGl=1" 
        ;;
    'sdl')
        CONFIGURE="$CONFIGURE --with-renderer-sdlGfx=1" 
        ;;
    *)    
        ;;
    esac
done

dialog  --title "Continue?" --yesno "Will you continue with these options\n$CONFIGURE" 10 50

[ "$?" = "1" ] && exit 1
}
# END OF CONFIGURE MENU

build() {
  cd $startdir/src/xmoto-$pkgver

#If variable INTERACTIVE is set to one, use the configuration dialog,
#else configure with default flags.
  if [ "$INTERACTIVE" = 1 ];then
  config_menu
      $CONFIGURE
  else
      ./configure --prefix=/usr
  fi  

  make || return 1
  make DESTDIR=$startdir/pkg mangdir=/usr/man/man6 install

  #install desktop file
  install -Dm0644 $startdir/src/xmoto.desktop $startdir/pkg/usr/share/applications/xmoto.desktop
}

Last edited by tkjacobsen (2007-11-05 15:22:54)


To save time, reboot your computer in the background using "reboot &"

Offline

#2 2007-11-06 19:46:09

delco
Member
From: Germany
Registered: 2003-02-07
Posts: 19

Re: Interactive makepkg

Hi,

nice idea. That's what I'm still missing smile
I love it in FreeBSD and the lunar-linux variant is also very usefull. It could make srcpac unnecessary.

A solution for not selected options is also needed.
E.g. not selected

   configure --without-*=...

selected

  configure --with-*=...


delco

Last edited by delco (2007-11-07 07:26:38)

Offline

Board footer

Powered by FluxBB