You are not logged in.

#1 2013-04-11 22:27:41

fiddlinmacx
Member
Registered: 2011-03-02
Posts: 89

New PKGBUILD with git and qmake - builds but won't package. [SOLVED]

# Maintainer: Mark Coolen <mark dot coolen at gmail dot com>
pkgname=linuxstopmotion-git
_realname=linuxstopmotion
pkgver=2013-04-11
pkgrel=1
pkgdesc="software for capturing and creating stop-motion animations - development version"
arch=('i686' 'x86_64')
url="http://www.linuxstopmotion.org"
license=('GPL2')
depends=('qt4' 'sdl_image' 'libtar' 'libvorbis' 'inotify-tools')
#conflicts=('stopmotion')
source=($_realname::git+http://git.code.sf.net/p/$_realname/code
	'X11_to_libs.patch')
md5sums=('SKIP'
	'77eebd5e3dfb72c9cb2fb6b27d142283')

pkgver() {
  cd $_realname
  #uses the time of the last commit
  git describe --always | sed 's|-|.|g'
}	

build() {
	cd $_realname
	patch -p1 -i ../X11_to_libs.patch
	qmake -tp stopmotion.pro
	make PREFIX=/usr
}

package() {
	cd $_realname
	make DESTDIR="$pkgdir" install
}

the patch just changes the stopmotion.pro file, adding -lX11 to line 216 (the LIBS += section)

Last edited by fiddlinmacx (2013-04-12 23:00:32)

Offline

#2 2013-04-12 00:31:24

tdy
Member
From: Sacremende
Registered: 2008-12-14
Posts: 440

Re: New PKGBUILD with git and qmake - builds but won't package. [SOLVED]

You've given no error messages, but assuming your qt4 dependency is accurate, the first thing to do is change qmake to qmake-qt4.

Offline

#3 2013-04-12 16:24:34

fiddlinmacx
Member
Registered: 2011-03-02
Posts: 89

Re: New PKGBUILD with git and qmake - builds but won't package. [SOLVED]

Sorry. I wasn't thinking very clearly. The package builds alright, but I get errors on the 'make install' step in the package() function.
I must be missing something obvious, but I think it's trying to write to /usr/bin instead of $pkgdir/usr/bin
Does that make any sense?

Last edited by fiddlinmacx (2013-04-12 23:29:58)

Offline

#4 2013-04-12 16:41:28

fiddlinmacx
Member
Registered: 2011-03-02
Posts: 89

Re: New PKGBUILD with git and qmake - builds but won't package. [SOLVED]

This is what I get. How do I get it to install in $pkgdir/usr instead of /usr. Like I said. I must be missing something.

==> Entering fakeroot environment...
==> Starting package()...
install -m 755 -p "stopmotion" "/usr/bin/stopmotion"
mkdir: cannot create directory ‘/usr/share/stopmotion’: Permission denied
make: *** [install_translations] Error 1
make: *** Waiting for unfinished jobs....
install: cannot create regular file ‘/usr/bin/stopmotion’: Permission denied
make: [install_target] Error 1 (ignored)
: "/usr/bin/stopmotion"
==> ERROR: A failure occurred in package().
    Aborting...

Offline

#5 2013-04-12 16:43:57

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

Re: New PKGBUILD with git and qmake - builds but won't package. [SOLVED]

That depends on the Makefile, does the Makefile properly accept DESTDIR environment variables?


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

Offline

#6 2013-04-12 17:01:50

fiddlinmacx
Member
Registered: 2011-03-02
Posts: 89

Re: New PKGBUILD with git and qmake - builds but won't package. [SOLVED]

Apparently it doesn't. Is my only option then to 'install' the executable, desktop and icon files one at a time or is there a more elegant way of doing this?

Offline

#7 2013-04-12 17:34:37

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,750
Website

Re: New PKGBUILD with git and qmake - builds but won't package. [SOLVED]

I don't even get that far while building you package in a clean chroot, unless I make a few changes:

1) You should add

makedepends=('git' 'libxml2')

as they're needed to clone the repository and generate the Makefile respectively.

2) You should call qmake with /usr/lib/qt4/bin/qmake, as /usr/bin/qmake is qt5's qmake by default (and I'm assuming it's not backwards compatible, you haven't listed qt5 as a depend or makedepend in any case)

3) The -tp switches to qmake don't work and cause the build to fail for me:

WARNING: Unable to generate output for: /build/src/linuxstopmotion/Makefile [TEMPLATE stopmotion.proapp]

I'm not sure what they're supposed to do or why you have them there, but the instructions on sourceforge don't say to use them.  Incidentally, '/usr/lib/qt4/bin/qmake stopmotion.pro' works fine for me.

4) Instead of a patch, consider using sed to add the library to the LIBS variable:

sed -i '/^LIBS/s|$| -lX11|' Makefile

5) $DESTDIR is unused in the Makefile. You should be using $INSTALL_DIR

Last edited by WorMzy (2013-04-12 17:35:39)


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#8 2013-04-12 22:59:49

fiddlinmacx
Member
Registered: 2011-03-02
Posts: 89

Re: New PKGBUILD with git and qmake - builds but won't package. [SOLVED]

Awesome WorMzy. I had it working finally, but your suggestions are great. INSTALL_ROOT is the variable I need, apparently, from the Makefile. That works.
qmake -tp was a mistake. I was trying something and forgot to take that out. I put in the 'sed' line too.
As for libxml2, namcap tells me that the executable needs it, so I put it in 'depends'

Thanks a lot. I've got is sorted now.

Offline

#9 2013-04-12 23:04:33

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: New PKGBUILD with git and qmake - builds but won't package. [SOLVED]

The source files in "$_realname" are the ones cloned directly from the server. That directory should not be used for building nor should files in that directory be modified.

Use this instead, along with whatever other changes you have made since your first post:

prepare() {
  cd "$srcdir/$_realname"
  patch -p1 -i "$srcdir"/X11_to_libs.patch
}

build() {
  cd "$srcdir/$_realname"
  qmake -tp stopmotion.pro
  make PREFIX=/usr
}

package() {
  cd "$srcdir/$_realname"
  make DESTDIR="$pkgdir" install
}

Aside from preserving the sources for subsequent updates, it is necessary because the cloned directory is only present in the same directory as the PKGBUILD if SRCDEST is not set in makepkg. Notice that I have also replaced the relative path of the path ("../X11_to_libs.patch") with the path to the copied version in $srcdir for the same reason.

Always quote path variables as well.

Last edited by Xyne (2013-04-12 23:09:20)


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#10 2013-04-12 23:16:32

fiddlinmacx
Member
Registered: 2011-03-02
Posts: 89

Re: New PKGBUILD with git and qmake - builds but won't package. [SOLVED]

Thanks Xyne. I don't know why I was doing that. I fixed the PKGBUILD. It worked before, but you're right that $srcdir/$_realname is better  there. I'm putting a 'sed' line before 'make' to avoid the use of a patch file too although I can sure see the use of the prepare() function.

Offline

#11 2013-04-12 23:36:20

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,750
Website

Re: New PKGBUILD with git and qmake - builds but won't package. [SOLVED]

fiddlinmacx wrote:

INSTALL_ROOT is the variable I need

Oops, glad you caught that, my fingers must've rebelled; I'm glad I put you on the right track at least. Good catch on the libxml2 dependency too, I didn't notice that.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#12 2013-04-13 11:39:50

fiddlinmacx
Member
Registered: 2011-03-02
Posts: 89

Re: New PKGBUILD with git and qmake - builds but won't package. [SOLVED]

It's all good. I'm still a bit of a noob at PKGBUILDs. Every one is different in some way and I'm still learning. Between you and Xyne and a poster on the AUR I got this one sorted.
This time my sons were taking low-res stop-motion pics of their Hobbit Lego, so I wanted something they could use to make video. That's the way it goes ;-)
Thanks.

Offline

Board footer

Powered by FluxBB