You are not logged in.

#1 2010-09-02 22:06:25

Compintuit
Member
Registered: 2010-03-19
Posts: 19

[Request][Solved] cube-escape

I'm trying to make my first ever pkgbuild, which is more difficult than normal because the software doesn't come with rules for an install. I got the files to install, I just can't get it to run right:

# Maintainer: Compintuit <permanentlylostinsightofland at gmail dot com>

pkgname=cube-escape
pkgver=0.8
pkgrel=1
pkgdesc="Progress over a maze etched on the surface of a cube"
arch=('i686' 'x86_64')
url="http://code.google.com/p/cube-escape/"
license=('GPL')
groups=()
depends=('sdl' 'sdl_image' 'sdl_ttf')
makedepends=()
optdepends=()
provides=()
conflicts=()
replaces=()
backup=()
options=()
install=
source=(http://cube-escape.googlecode.com/files/$pkgname-$pkgver-src.tar.gz cube-escape.desktop)
noextract=()
md5sums=('252d0d39b83845a9205346ca55f0983a' '05431cf98ecabf6064e78612d685cc08') #generate with 'makepkg -g'

build() {
  cd $srcdir/$pkgname-$pkgver
  make
  mkdir -p ${pkgdir}/usr/share/games/cube-escape/
  #mkdir ${pkgdir}/usr/bin
  install -Dm755 ${srcdir}/$pkgname-$pkgver/cube-escape ${pkgdir}/usr/share/games/cube-escape/    
  #ln -s ${pkgdir}/usr/share/games/cube-escape/cube-escape ${pkgdir}/usr/bin/cube-escape
  cp -r ${srcdir}/$pkgname-$pkgver/data ${pkgdir}/usr/share/games/cube-escape/
  install -Dm644 ${srcdir}/$pkgname-$pkgver/data/icon.png ${pkgdir}/usr/share/pixmaps/cube-escape.png
  install -Dm644 ${srcdir}/cube-escape.desktop ${pkgdir}/usr/share/applications/cube-escape.desktop
}

.desktop:

[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Comment=Progress over a maze etched on the surface of a cube
Terminal=false
Exec=/usr/share/games/cube-escape/cube-escape
Hidden=False
Icon=/usr/share/pixmaps/cube-escape.png
Categories=Game; Puzzle Game

Any help would be appreciated, I don't have a clue what I'm doing smile

Last edited by Compintuit (2010-09-02 23:48:13)

Offline

#2 2010-09-02 22:33:18

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: [Request][Solved] cube-escape

This works for the install. However, the moment I try to start the game, it gives me a Segmentation fault -- which should probably be reported upstream.
All you needed was a script that would invoke the game. Normally this script should be under /usr/bin (which is always in the PATH).
Also check the difference between your PKGBUILD and mine, Try to use $pkgname instead of actual package name.
PKGBUILD

# Maintainer: Compintuit <permanentlylostinsightofland at gmail dot com>

pkgname=cube-escape
pkgver=0.8
pkgrel=1
pkgdesc="Progress over a maze etched on the surface of a cube"
arch=('i686' 'x86_64')
url="http://code.google.com/p/cube-escape/"
license=('GPL')
groups=()
depends=('sdl' 'sdl_image' 'sdl_ttf')
makedepends=()
optdepends=()
provides=()
conflicts=()
replaces=()
backup=()
options=()
install=
source=(http://cube-escape.googlecode.com/files/$pkgname-$pkgver-src.tar.gz 
    $pkgname.desktop 
    $pkgname.sh)
noextract=()

md5sums=('252d0d39b83845a9205346ca55f0983a'
         '6d557e9a06550a97f599fea4a3752c0a'
         '0f5b792dfc9da10b036e152d61360fd2')

build() {
  cd $srcdir/$pkgname-$pkgver
  make || return 1
  mkdir -p ${pkgdir}/usr/share/games/$pkgname/
  install -Dm755 ${srcdir}/$pkgname-$pkgver/$pkgname ${pkgdir}/usr/share/games/$pkgname/
  cp -r ${srcdir}/$pkgname-$pkgver/data ${pkgdir}/usr/share/games/$pkgname/
  install -Dm644 ${srcdir}/$pkgname-$pkgver/data/icon.png ${pkgdir}/usr/share/pixmaps/$pkgname.png
  install -Dm644 ${srcdir}/$pkgname.desktop ${pkgdir}/usr/share/applications/$pkgname.desktop
  install -Dm755 ${srcdir}/$pkgname.sh $pkgdir/usr/bin/$pkgname
}

$pkgname.desktop

[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Comment=Progress over a maze etched on the surface of a cube
Terminal=false
Exec=/usr/share/games/cube-escape/cube-escape
Hidden=False
Icon=/usr/share/pixmaps/cube-escape.png
Categories=Game; Puzzle Game

$pkgname.sh

#!/bin/bash

/usr/share/games/cube-escape/cube-escape

Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#3 2010-09-02 23:42:17

Compintuit
Member
Registered: 2010-03-19
Posts: 19

Re: [Request][Solved] cube-escape

The thing I don't get is that if the working directory is where it is, it will run fine. Thus I have managed to solve my problem with this script:

#!/bin/bash
cd  /usr/share/games/cube-escape/
./cube-escape

Thanks for the idea to start it from a script.

Offline

#4 2010-09-03 06:50:12

sand_man
Member
From: Australia
Registered: 2008-06-10
Posts: 2,164

Re: [Request][Solved] cube-escape

Compintuit wrote:

The thing I don't get is that if the working directory is where it is, it will run fine. Thus I have managed to solve my problem with this script:

#!/bin/bash
cd  /usr/share/games/cube-escape/
./cube-escape

Thanks for the idea to start it from a script.

I would still blame bad coding on that.


neutral

Offline

Board footer

Powered by FluxBB