You are not logged in.

#1 2013-05-23 02:44:35

gandalf3
Member
From: ~/
Registered: 2013-05-18
Posts: 34

First PKGBUILD, Faulty when Installed by Pacman?

I'm trying to package this:
Enigma-dev (git)
http://enigma-dev.org/

I'm having a problem with it when it gets installed by pacman, where it tries to compile itself again..
PKGBUILD:

pkgname=enigma-dev-git
pkgver=0.0.0
pkgrel=1
pkgdesc="ENIGMA, the Extensible Non-Interpreted Game Maker Augmentation."
url="http://enigma-dev.org"
arch=('x86_64' 'i686')
license=('GPL')
depends=('alure' 'zlib' 'openal' 'libx11' 'libgl' 'mesa' 'gtk2' 'dumb' 'jre7-openjdk') # gcc in base-devel, not required to be listed.
optdepends=()
makedepends=('git' 'python')
conflicts=('lateralgm')
provides=('lateralgm')
replaces=()
backup=()
source=('http://enigma-dev.org/docs/wiki/images/4/47/Lateralgmlogo.png') # putting the git url in here causes the python configuration to fail for some reason..
md5sums=('e6daacba04f0491b256f8a4d2cc9181a')

build() {
  if [[ -d $pkgname ]]; then
    msg "previous cloned repo detected, removing"
    rm -rf $pkgname
  fi
  msg "Cloning git repo.."
  git clone git://github.com/enigma-dev/enigma-dev.git ${pkgname}
  cd "${srcdir}/${pkgname}"
  msg "Starting python config.."
  python install.py
  cd "${srcdir}/${pkgname}/ENIGMAsystem/SHELL/"
  msg "Starting compile.."
#   make # fix for some errors.. stopped happening, so commenting this out.
  cd "${srcdir}/${pkgname}"
  make
  }
  
pkgver () {
# this doesn't really work because pkgver is executed before build, so there is no local repo. and there is no apparent way to get remote revision numbers if there are no tags..
# I tried cloning the repo here instead of in build, but that didn't work either.. so basically this only returns anything useful if you try and install it twice.
  cd "${srcdir}/${pkgname}"
  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
  }

package() {
  cd "${srcdir}/${pkgname}"
  install -Dm644 ./pluginsource/COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"
  cp -r ./packages/linux/usr/share "${pkgdir}/usr"
  cp -r ./packages/linux/usr/bin "${pkgdir}/usr/bin"
  cp -r "${srcdir}/${pkgname}" "${pkgdir}/usr/share/${pkgname}"
  cd "${pkgdir}/usr/share/applications/"
  cat <<EOF > lateralgm.desktop # a quick hack for a lateralgm.desktop
[Desktop Entry]
Type=Application
Name=LateralGM
Exec=lateralgm
Comment=Game Development IDE for Enigma written in java
Icon=lateralgm
Terminal=false
Path=/usr/bin/
Categories=Application;Development;IDE;
StartupNotify=false
MimeType=application;application/x-gm81;application/x-gmk;application/x-gm6;application/x-gmd;application/x-egm;application/x-gm50;application/x-gm51;application/x-gm52;application/x-gm53;application/x-gm60;application/x-gm61;application/x-gm71;application/x-gm80;application/x-gm81;
EOF
  chmod +x lateralgm.desktop
  chmod +x enigma-dev.desktop
  cd "${pkgdir}/usr/bin/"
  cat <<EOF > lateralgm # and another so lateralgm exists in $PATH
#   excute lateralgm jar file.
cd /usr/share/$pkgname/ # fix for strange bug, where you have to be in the same directory as lgm12b4.jar.
java -jar lgm16b4.jar
EOF
  chmod +x lateralgm
  cd ${pkgdir}
  mkdir -p ./usr/share/icons/hicolor/128x128/apps/
  mkdir -p ./usr/share/icons/hicolor/scalable/apps/
  mv "${startdir}/Lateralgmlogo.png" ${pkgdir}/usr/share/icons/hicolor/128x128/apps/lateralgm.png
  cd "${pkgdir}/usr/share/"
  cp ./pixmaps/enigma-dev.svg "${pkgdir}/usr/share/icons/hicolor/scalable/apps/enigma-dev.svg"
# remove some extra stuff to help reduce package size; more of this is may be possible.
  rm -rf "${pkgdir}/usr/share/${pkgname}/packages"
}

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

based of these installation directions:

http://enigma-dev.org/docs/Wiki/Install:Git

(which I have followed and work fine)
For one thing, there doesn't seem to be a install target for make, so I just copied the whole thing into /usr/share/  tongue

My main problem is that normally the compilation is handeld by the java lateralgm program the first time it's run, though just running make works fine.

until pacman installs it, that is.
It still works after being copied, I can run it in $srcdir/enigma-dev-git/ ,
but when I try and run it both by just running lateralgm and cd ing to /usr/share/enigma-dev-git/ then java -jar lgm16b4.jar it will try and compile enigma like it never was compiled in the first place (of course, it can't because it doesn't have root permissions)..
I didn't see any diference in the permissions between $srcdir/enigma-dev-git/ and /usr/share/enigma-dev-git.

I even tried having it install into ~/ with pacman just to see what happened but same thing..
However, I can copy the contence of $srcdir to ~/ and it will work..

Anyone know what might be the issue? (or how to improve anything else?)

Thanks

Last edited by gandalf3 (2013-05-23 18:37:36)


Ryzen 7 2700X | Vega 64 | 16GB | Arch | Bspwm

Offline

#2 2013-05-23 11:50:12

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,463

Re: First PKGBUILD, Faulty when Installed by Pacman?

Java apps are kind of a mess.

Stick the git URL in the source array. I just tried it, python config only fails if you cd to the wrong dir.

If you're going to copy over a whole mess like that, it's usually better to do it all to /opt. Check this page: https://wiki.archlinux.org/index.php/Ja … Guidelines

You should depend on 'java-runtime' instead of 'jre7-openjdk' if this works with Oracle's official jre.

Desktop files are usually just included in the source array, not cat'd in the package function. They also don't need to be executable (chmod +x).

Instead of mkdir and mv or cp for the icons, use "install". When you do use cp, use it with -a to keep permissions intact.

Don't use $startdir if you can help it. All sources should be in $srcdir.

Last edited by Scimmia (2013-05-23 12:04:45)

Offline

#3 2013-05-23 18:08:49

Josh @ Dreamland
Member
Registered: 2013-05-23
Posts: 1

Re: First PKGBUILD, Faulty when Installed by Pacman?

Hi there;

ENIGMA is not really designed to be packaged, at the moment. Its files are built and modified in the same directory that it is unpacked, meaning it needs write permissions to wherever you unpack it. That means that if you unpacked it in /opt, which would be my only recommendation apart from ~/, you would need to give the folder lax permissions (which probably is not what you want). The repository also goes through relatively frequent changes, which, due to disorganization in how we run pull requests, often break something. So maintaining a package is a difficult prospect, presently.

A lot of planning is going into modifying the system to support additional build languages, and during this redesign, we are discussing ways to allow unpacking the engine source to arbitrary locations. You might want to hold off on a package until then, at which point we will likely automate a package build to help keep up with the rate at which the repository changes.

I'll keep an eye on this thread, or you can find us on ENIGMA's forums/IRC.

Cheers

Offline

#4 2013-05-23 21:26:34

gandalf3
Member
From: ~/
Registered: 2013-05-18
Posts: 34

Re: First PKGBUILD, Faulty when Installed by Pacman?

Scimmia wrote:

Don't use $startdir if you can help it. All sources should be in $srcdir.

I must be doing something else wrong.. the lateralgmlogo.png was in just being symlinked to $srcdir.. (the actual file was going into $startdir)

Josh @ Dreamland wrote:

Its files are built and modified in the same directory that it is unpacked,
meaning it needs write permissions to wherever you unpack it.

Even after it's been compiled?

Also, just to be clear, I'm really packaging two programs, Lateragm and ENIGMA. (though they kind of come together)


Ryzen 7 2700X | Vega 64 | 16GB | Arch | Bspwm

Offline

#5 2013-05-23 22:27:50

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,463

Re: First PKGBUILD, Faulty when Installed by Pacman?

gandalf3 wrote:
Scimmia wrote:

Don't use $startdir if you can help it. All sources should be in $srcdir.

I must be doing something else wrong.. the lateralgmlogo.png was in just being symlinked to $srcdir.. (the actual file was going into $startdir)

A symlink works no different than the file, just copy it and you'll get what you want.

Offline

#6 2013-05-27 01:38:32

gandalf3
Member
From: ~/
Registered: 2013-05-18
Posts: 34

Re: First PKGBUILD, Faulty when Installed by Pacman?

Here's an updated PKGBUILD,

pkgname=enigma-dev-git
pkgver=1353.b086c4b
pkgrel=1
pkgdesc="ENIGMA, the Extensible Non-Interpreted Game Maker Augmentation."
url="http://enigma-dev.org"
arch=('x86_64' 'i686')
license=('GPL')
depends=('alure' 'zlib' 'openal' 'libx11' 'libgl' 'mesa' 'gtk2' 'dumb' 'java-runtime') # gcc also a dependency, but in base-devel.
optdepends=()
makedepends=('git' 'python')
conflicts=('lateralgm')
provides=('lateralgm')
replaces=()
backup=()
source=('lateralgm' 'lateralgm.desktop' 'git://github.com/enigma-dev/enigma-dev.git' 'http://enigma-dev.org/docs/wiki/images/4/47/Lateralgmlogo.png') # putting the git url in here causes the python configuration to fail for some reason..
md5sums=('c41602b12926d8462fb1cdb4753e4be7' 'd4894261248f2657614a177cd1a94bc3' 'SKIP' 'e6daacba04f0491b256f8a4d2cc9181a')

build() {
  cd "${srcdir}/enigma-dev"
  msg "Starting python config.."
  python install.py
  cd "${srcdir}/enigma-dev/ENIGMAsystem/SHELL/"
  msg "Starting compile.."
#   make # fix for some errors.. stopped happening, so commenting this out.
  cd "${srcdir}/enigma-dev"
  make
  }
  
pkgver () {
  cd "${srcdir}/enigma-dev"
  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
  }

package() {
  mkdir "${pkgdir}/opt/"
  install -Dm644 "${srcdir}/enigma-dev/pluginsource/COPYING" "$pkgdir/usr/share/licenses/$pkgname/COPYING"
  cp -r -a "${srcdir}/enigma-dev/packages/linux/usr/share" "${pkgdir}/usr"
  cp -r -a "${srcdir}/enigma-dev/packages/linux/usr/bin" "${pkgdir}/usr/bin"
  cp -r -a "${srcdir}/enigma-dev" "${pkgdir}/opt/${pkgname}"
  cd "${pkgdir}/usr/bin/"
  install -D "${srcdir}/lateralgm" "${pkgdir}/usr/bin/lateralgm"
  chmod +x "${pkgdir}/usr/bin/lateralgm" "${pkgdir}/usr/share/applications/lateralgm.desktop"
  install -D "${srcdir}/lateralgm.desktop"
  install -D "${srcdir}/Lateralgmlogo.png" ${pkgdir}/usr/share/icons/hicolor/128x128/apps/lateralgm.png
  install -D "${pkgdir}/usr/share/pixmaps/enigma-dev.svg" "${pkgdir}/usr/share/icons/hicolor/scalable/apps/enigma-dev.svg"
# remove some extra stuff to help reduce package size; more of this is may be possible.
  rm -rf "${pkgdir}/usr/share/${pkgname}/packages"
}

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

how ever, when i try and run it, it crashes with

Java Version: 10700 (1.7.0_21)
Loading lib files in /opt/enigma-dev-git/lgm16b4.jar
01_move.lgl 02_main1.lgl 03_main2.lgl 04_control.lgl 
 05_score.lgl 06_extra.lgl 07_draw.lgl 
Calling `make eTCpath=""`
> make -j -C CompilerSource 
> make[1]: Entering directory `/opt/enigma-dev-git/CompilerSource'
> make[1]: Nothing to be done for `all'.
> make[1]: Leaving directory `/opt/enigma-dev-git/CompilerSource'
0
Process terminated
Initializing Enigma: 
Linking up to IDE
Implementing JDI basics
UnimplementedUnimplemented

Choosing language: C++
Reading GCC builtins
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007effcc5143f4, pid=15362, tid=139635878045440
#
# JRE version: 7.0_21-b02
# Java VM: OpenJDK 64-Bit Server VM (23.7-b01 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C  [libc.so.6+0x693f4]  fclose+0x4
#
# Core dump written. Default location: /opt/enigma-dev-git/core or core.15362
#
# An error report file with more information is saved as:
# /tmp/hs_err_pid15362.log
#
# If you would like to submit a bug report, please include
# instructions on how to reproduce the bug and visit:
#   http://icedtea.classpath.org/bugzilla
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

I tried installing it the normal way, (the way in the wiki)
and it worked fine..
I'll keep testing it..


Ryzen 7 2700X | Vega 64 | 16GB | Arch | Bspwm

Offline

#7 2013-05-27 02:00:46

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,463

Re: First PKGBUILD, Faulty when Installed by Pacman?

So you say it works when installed with the instructions in the wiki, what is that? I assume it's just run from the build dir?

Offline

#8 2013-05-27 21:10:33

gandalf3
Member
From: ~/
Registered: 2013-05-18
Posts: 34

Re: First PKGBUILD, Faulty when Installed by Pacman?

If I understand you correctly, yes..

link to installation intructions:
http://enigma-dev.org/docs/Wiki/Install:Git


Ryzen 7 2700X | Vega 64 | 16GB | Arch | Bspwm

Offline

#9 2013-05-27 22:18:34

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,463

Re: First PKGBUILD, Faulty when Installed by Pacman?

Have you tried simply dumping the whole thing to opt and putting a script in /usr/bin to run the necessary command? Just what all are you trying to copy to /usr and /usr/bin, anyway? It could very well be as simple as

cd /opt/enigma-dev
java -jar lgm16b4.jar

Of course as Josh @ Dreamland points out, you need to make sure /opt/enigma-dev is world writable.

Last edited by Scimmia (2013-05-27 22:19:39)

Offline

#10 2013-05-28 18:58:10

gandalf3
Member
From: ~/
Registered: 2013-05-18
Posts: 34

Re: First PKGBUILD, Faulty when Installed by Pacman?

Scimmia wrote:

Have you tried simply dumping the whole thing to opt and putting a script in /usr/bin to run the necessary command? Just what all are you trying to copy to /usr and /usr/bin, anyway? It could very well be as simple as

cd /opt/enigma-dev
java -jar lgm16b4.jar

Of course as Josh @ Dreamland points out, you need to make sure /opt/enigma-dev is world writable.

That is exactly what is going into /usr/bin..
Anyway, I get the same error when trying to run the jarfile directly, so it's  not the /usr/bin script..

As for /usr, it's just all the icons and stuff that is in $srcdir/enigma-dev/packages/linux/usr/share

ah.. so do have to change the permissions of /opt/enigma-dev-git..
I thought that scince it was already compiled it wouldn't have to write anything to /opt/enigma-dev-git.. (I thought that it was lateralgm doing the writing when it compiled enigma, and I didn't have to worry because it already was compiled by then)
I guess I misunderstood, I'm trying it now with permissions.

EDIT:

Seems to work, but is it AUR worthy?

Here's where everything is now:

PKBGUILD:

pkgname=enigma-dev-git
pkgver=0.0.0
pkgrel=1
pkgdesc="ENIGMA, the Extensible Non-Interpreted Game Maker Augmentation."
url="http://enigma-dev.org"
arch=('x86_64' 'i686')
license=('GPL')
depends=('alure' 'zlib' 'openal' 'libx11' 'libgl' 'mesa' 'gtk2' 'dumb' 'java-runtime') # gcc also a dependency, but in base-devel.
optdepends=()
makedepends=('git' 'python')
conflicts=('lateralgm')
provides=('lateralgm')
replaces=()
backup=()
install='enigma-dev-git.install'
source=('lateralgm' 'lateralgm.desktop' 'git://github.com/enigma-dev/enigma-dev.git' 'http://enigma-dev.org/docs/wiki/images/4/47/Lateralgmlogo.png') # putting the git url in here causes the python configuration to fail for some reason..
md5sums=('c41602b12926d8462fb1cdb4753e4be7' 'd4894261248f2657614a177cd1a94bc3' 'SKIP' 'e6daacba04f0491b256f8a4d2cc9181a')

build() {
  cd "${srcdir}/enigma-dev"
  msg "Starting python config.."
  python install.py
  cd "${srcdir}/enigma-dev/ENIGMAsystem/SHELL/"
  msg "Starting compile.."
#   make # fix for some errors.. stopped happening, so commenting this out.
  cd "${srcdir}/enigma-dev"
  make
  }
  
pkgver () {
  cd "${srcdir}/enigma-dev"
  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
  }

package() {
  mkdir "${pkgdir}/opt/"
  install -Dm644 "${srcdir}/enigma-dev/pluginsource/COPYING" "$pkgdir/usr/share/licenses/$pkgname/COPYING"
  cp -r -a "${srcdir}/enigma-dev/packages/linux/usr/share" "${pkgdir}/usr"
  cp -r -a "${srcdir}/enigma-dev/packages/linux/usr/bin" "${pkgdir}/usr/bin"
  cp -r -a "${srcdir}/enigma-dev" "${pkgdir}/opt/${pkgname}"
  cd "${pkgdir}/usr/bin/"
  install -D "${srcdir}/lateralgm" "${pkgdir}/usr/bin/lateralgm"
  chmod +x "${pkgdir}/usr/bin/lateralgm"
  install -D "${srcdir}/lateralgm.desktop" "${pkgdir}/usr/share/applications/lateralgm.desktop"
  install -D "${srcdir}/Lateralgmlogo.png" ${pkgdir}/usr/share/icons/hicolor/128x128/apps/lateralgm.png
  install -D "${pkgdir}/usr/share/pixmaps/enigma-dev.svg" "${pkgdir}/usr/share/icons/hicolor/scalable/apps/enigma-dev.svg"
# remove some extra stuff to help reduce package size; more of this is may be possible.
  rm -rf "${pkgdir}/usr/share/${pkgname}/packages"
}

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

enigma-dev-git.install:

# arg 1:  the new package version
post_install() {
chmod -R 766 /opt/enigma-dev-git
}

# arg 1:  the old package version
pre_remove() {
  chmod -R 744 /opt/enigma-dev-git
}
     
 vim:set ts=2 sw=2 et:

/usr/bin script:

#   excute lateralgm jar file.
cd /opt/enigma-dev-git/ # fix for strange bug, where you have to be in the same directory as lgm16b4.jar.
java -jar lgm16b4.jar 

Thanks..

Last edited by gandalf3 (2013-05-28 21:28:23)


Ryzen 7 2700X | Vega 64 | 16GB | Arch | Bspwm

Offline

Board footer

Powered by FluxBB