You are not logged in.

#1 2014-12-25 12:54:36

jerik
Member
Registered: 2009-03-02
Posts: 197

Modify PKGBUILD script for ARM

Hi!

I have a rough PKGBUILD script that I use on my PCs to compile Gambas3 from SVN.
Is it possible to make this script spit out a package for Raspberry Pi B+ on my PC's.

Please explain like I'm 5 if it is possible smile

Merry Christmass!

Offline

#2 2014-12-25 12:55:44

jerik
Member
Registered: 2009-03-02
Posts: 197

Re: Modify PKGBUILD script for ARM

This is the script btw:

pkgname=gambas3-svn
pkgver=6558
pkgrel=1
pkgdesc="A free development environment based on a Basic interpreter - SVN version"
arch=('i686' 'x86_64')
url="http://gambas.sourceforge.net"
depends=(
  'curl'
  'gtk3'
  'librsvg'
  'qt4'
  'sqlite'
  'qtwebkit' 
  'llvm'
  'glew'
  'sdl_mixer'
  'sdl_image'
  'sdl_ttf'
  'sdl_gfx'
  'poppler'
  'gtkglext'
  ) 
makedepends=('intltool' 'xdg-utils' 'libxtst' 'subversion') 
conflicts=("${pkgname%-svn}")
#install=${pkgname}.install
license=('GPL2')
options=('ccache' '!makeflags' '!libtool')

optdepends=(
  'postgresql: postgresql server'
  'mysql: MYSQL server'
  'postgresql-libs: Postgresql database libraries'
  'libmysqlclient: MYSQL database client'
  #'libfbclient: Firebird database client'
  'sqlite2: SQLite2 database'  
  #'libgtkwebkit: WebKit Support' webkitgtk????
  
  )

provides=(
  "${pkgname%-svn}"
  'gambas3-devel=3.6.90'
  'gambas3-runtime=3.6.90'
  'gambas3-ide=3.6.90'
  'gambas3-scripter=3.6.90'
  'gambas3-examples=3.6.90'
  'gambas3-gb-args=3.6.90'
  'gambas3-gb-cairo=3.6.90'
  'gambas3-gb-chart=3.6.90'
  'gambas3-gb-clipper=3.6.90'
  'gambas3-gb-complex=3.6.90'
  'gambas3-gb-compress=3.6.90'
  'gambas3-gb-compress-zlib=3.6.90'
  'gambas3-gb-compress-bzlib2=3.6.90'
  'gambas3-gb-crypt=3.6.90'
  'gambas3-gb-data=3.6.90'
  'gambas3-gb-db=3.6.90'
  'gambas3-gb-db-form=3.6.90'
  'gambas3-gb-db-mysql=3.6.90'
  'gambas3-gb-db-odbc=3.6.90'
  'gambas3-gb-db-postgresql=3.6.90'
  'gambas3-gb-db-sqlite2=3.6.90'
  'gambas3-gb-db-sqlite3=3.6.90'
  'gambas3-gb-dbus=3.6.90'
  'gambas3-gb-desktop=3.6.90'
  'gambas3-gb-desktop-gnome=3.6.90'
  'gambas3-gb-eval-highlight=3.6.90'
  'gambas3-gb-form=3.6.90'
  'gambas3-gb-form-dialog=3.6.90'
  'gambas3-gb-form-mdi=3.6.90'
  'gambas3-gb-form-stock=3.6.90'
  'gambas3-gb-gmp=3.6.90'
  'gambas3-gb-gsl=3.6.90'
  'gambas3-gb-gtk=3.6.90'
  'gambas3-gb-gtk-opengl=3.6.90'
  'gambas3-gb-httpd=3.6.90'
  'gambas3-gb-image=3.6.90'
  'gambas3-gb-image-effect=3.6.90'
  'gambas3-gb-image-imlib=3.6.90'
  'gambas3-gb-image-io=3.6.90'
  'gambas3-gb-jit=3.6.90'
  'gambas3-gb-libxml=3.6.90'
  'gambas3-gb-logging=3.6.90'
  'gambas3-gb-map=3.6.90'
  'gambas3-gb-markdown=3.6.90'
  'gambas3-gb-media=3.6.90'
  'gambas3-gb-memcached=3.6.90'
  'gambas3-gb-mime=3.6.90'
  'gambas3-gb-mysql=3.6.90'
  'gambas3-gb-ncurses=3.6.90'
  'gambas3-gb-net=3.6.90'
  'gambas3-gb-net-curl=3.6.90'
  'gambas3-gb-net-pop3=3.6.90'
  'gambas3-gb-net-smtp=3.6.90'
  'gambas3-gb-openal=3.6.90'
  'gambas3-gb-opengl=3.6.90'
  'gambas3-gb-opengl-glu=3.6.90'
  'gambas3-gb-opengl-glsl=3.6.90'
  'gambas3-gb-opengl-sge=3.6.90'
  'gambas3-gb-openssl=3.6.90'
  'gambas3-gb-option=3.6.90'
  'gambas3-gb-pcre=3.6.90'
  'gambas3-gb-pdf=3.6.90'
  'gambas3-gb-qt4=3.6.90'
  'gambas3-gb-qt4-ext=3.6.90'
  'gambas3-gb-qt4-opengl=3.6.90'
  'gambas3-gb-qt4-webkit=3.6.90'
  'gambas3-gb-report=3.6.90'
  'gambas3-gb-sdl=3.6.90'
  'gambas3-gb-sdl-sound=3.6.90'
  'gambas3-gb-settings=3.6.90'
  'gambas3-gb-signal=3.6.90'
  'gambas3-gb-v4l=3.6.90'
  'gambas3-gb-vb=3.6.90'
  'gambas3-gb-web=3.6.90'
  'gambas3-gb-xml=3.6.90'
  'gambas3-gb-xml-html=3.6.90'
  'gambas3-gb-xml-rpc=3.6.90'
  'gambas3-gb-xml-xslt=3.6.90')

md5sums=('be333d42518a9ea7ea4e47e83ebd0d08')

_svntrunk=https://gambas.svn.sourceforge.net/svnroot/gambas/gambas/trunk/
_svnmod=${pkgname}
_cleanbuild=$1

build() {
  cd ${srcdir}/trunk/
  msg2 "####################################"
  msg2 "#           Updating SVN           #"
  msg2 "####################################"
  svn update
  msg2 "####################################"
  msg2 "#       Generating SVN LOG         #"
  msg2 "####################################"
  svn log > ../../svn-log.txt
  msg2 "####################################"
  msg2 "#      Running ./reconf-all        #"
  msg2 "####################################"
  ./reconf-all
  msg2 "####################################"
  msg2 "#      Running ./configure -C      #"
  msg2 "####################################"
  ./configure -C
  msg2 "####################################"
  msg2 "#           Running make           #"
  msg2 "####################################"
  make
  msg2 "####################################"
  msg2 "#       Running make install       #"
  msg2 "####################################"
  make XDG_UTILS='' DESTDIR=${pkgdir} install >> /dev/null 2>&1
}

# vim: ts=2 sw=2 et:

Last edited by jerik (2014-12-25 13:25:02)

Offline

#3 2014-12-25 13:14:49

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,444
Website

Re: Modify PKGBUILD script for ARM

Please edit your post and use [ code ] tags.

This has very little to do with the PKGBUILD - just add the architecture desired in the "arch" array and that's all that's needed there.

To build it on your computer, however, you'll need a lot of other tools.  Most notably is a cross compiler.  This looks like it: community/arm-none-eabi-gcc (see also wiki).

You'll likely also need a modified makepkg, though I'm not sure how to approach that.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#4 2014-12-25 13:27:38

jerik
Member
Registered: 2009-03-02
Posts: 197

Re: Modify PKGBUILD script for ARM

Thank you!
I believe compiling it on the PI will take an incredible amount of hours smile
The cross compiling looks a bit terrifying though :s

Offline

#5 2014-12-25 15:49:18

chaonaut
Member
From: Kyiv, Ukraine
Registered: 2014-02-05
Posts: 382

Re: Modify PKGBUILD script for ARM

Trilby wrote:

To build it on your computer, however, you'll need a lot of other tools.  Most notably is a cross compiler.  This looks like it: community/arm-none-eabi-gcc (see also wiki).
You'll likely also need a modified makepkg, though I'm not sure how to approach that.

another option is a virtual ARM machine.
i often build packages for my ARM box this way, since it's faster than native compiling.


— love is the law, love under wheel, — said aleister crowley and typed in his terminal:
usermod -a -G wheel love

Offline

#6 2014-12-25 15:56:15

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,444
Website

Re: Modify PKGBUILD script for ARM

I almost added to my other post that I also suspect getting cross compiling set up would likely be a real PITA.  Getting a cross compiler running might not be terribly hard, but getting a streamlined method of producing arch packages might be.  I hesitated putting this as it's possible that I just may be ignorant of a good way of doing it - but if it were me, I'd just compile it on the PI.  Just set it up one night, then go to bed ... by morning it should be done.

But chaonaut's suggestion of a virtual arm sounds great.  I was wondering if that'd be possible.  In principle it should be, but I've never 'virtualized' very different hardware.  But if that works, that should be pretty strait forward.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#7 2014-12-25 15:59:04

jerik
Member
Registered: 2009-03-02
Posts: 197

Re: Modify PKGBUILD script for ARM

chaonaut wrote:
Trilby wrote:

To build it on your computer, however, you'll need a lot of other tools.  Most notably is a cross compiler.  This looks like it: community/arm-none-eabi-gcc (see also wiki).
You'll likely also need a modified makepkg, though I'm not sure how to approach that.

another option is a virtual ARM machine.
i often build packages for my ARM box this way, since it's faster than native compiling.

That's a very good idea!

Offline

#8 2014-12-25 16:00:20

jerik
Member
Registered: 2009-03-02
Posts: 197

Re: Modify PKGBUILD script for ARM

I'm trying at the moment to compile on the PI and it is SIRUP big_smile

Offline

#9 2014-12-25 16:21:18

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,444
Website

Re: Modify PKGBUILD script for ARM

While strategies to cross compile for ARM one an archlinux machine certainly fit here, if you do opt for building for ARM on ARM and run into trouble you should direct those issues to the ARM forums as they will be much more equipped to help.  You may want to check over there anyways - I suspect this is a relatively common issue they've faced (not gambas in particular, but building big packages).


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#10 2014-12-25 16:33:03

chaonaut
Member
From: Kyiv, Ukraine
Registered: 2014-02-05
Posts: 382

Re: Modify PKGBUILD script for ARM

Trilby wrote:

I was wondering if that'd be possible.  In principle it should be, but I've never 'virtualized' very different hardware.  But if that works, that should be pretty strait forward.

arm support is available in qemu for quite a long time, and it really works.
a lot of arm machines are weak & slow, so running compilation in a virtual machine on modern mainstream CPUs is way faster.


— love is the law, love under wheel, — said aleister crowley and typed in his terminal:
usermod -a -G wheel love

Offline

#11 2014-12-25 23:56:22

jerik
Member
Registered: 2009-03-02
Posts: 197

Re: Modify PKGBUILD script for ARM

I managed to compile it on the PI smile

Offline

#12 2014-12-26 00:06:03

jerik
Member
Registered: 2009-03-02
Posts: 197

Re: Modify PKGBUILD script for ARM

It was just as easy to make it work on the PI as on the PC. I would not have thought that when I started smile

Offline

Board footer

Powered by FluxBB