You are not logged in.

#1 2019-03-28 18:44:28

zpg443
Member
Registered: 2016-12-03
Posts: 271

[SOLVED] PKGBUILD Review Request by zpg443

This C++ app was built with Qt5 and QMake. I would appreciate any feedback on this PKGBUILD.

# Maintainer: Louis Cornell <lpcornel@gmail.com>
pkgname=archsimian-git
pkgver=VERSION
pkgrel=1
pkgdesc="Advanced playlist creator that uses your MediaMonkey library data"
arch=('x86_64')
url="https://github.com/Harpo3/archsimian"
license=('GPL-3.0')
depends=('sqlite3' 'python')
makedepends=('git')
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
source=('git+https://github.com/Harpo3/archsimian#branch=archsimian-git')
md5sums=('SKIP')
options=()

pkgver() {
    cd "${srcdir}/${pkgname%-git}"
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

build() {
    cd "${srcdir}/${pkgname%-git}"
    autoreconf -i
    ./configure
    qmake -o Makefile ArchSimian.pro
    make
}

package() {
    cd "$srcdir/${pkgname%-git}"
    make INSTALL_ROOT="$pkgdir" install
    make DESTDIR="$pkgdir/" install
}

The build installs and runs correctly to /usr/bin without hard coding but the install generated these error messages:

==> Entering fakeroot environment...
==> Starting package()...
/usr/bin/qmake -install qinstall -exe archsimian /home/lpc123/abs/archsimian/pkg/archsimian-git/usr/bin/archsimian
strip /home/lpc123/abs/archsimian/pkg/archsimian-git/usr/bin/archsimian
/usr/bin/qmake -install qinstall -exe archsimian /usr/bin/archsimian
Error copying archsimian to /usr/bin/archsimian: Cannot create /usr/bin/archsimian for output
make: [Makefile:1064: install_target] Error 3 (ignored)
strip /usr/bin/archsimian
strip: '/usr/bin/archsimian': No such file
make: [Makefile:1065: install_target] Error 1 (ignored)

The Makefile (generated by QMake) lines (1062-1065) are:

install_target: first FORCE
	@test -d $(INSTALL_ROOT)/usr/bin || mkdir -p $(INSTALL_ROOT)/usr/bin
	-$(QINSTALL_PROGRAM) $(QMAKE_TARGET) $(INSTALL_ROOT)/usr/bin/$(QMAKE_TARGET)
	-$(STRIP) $(INSTALL_ROOT)/usr/bin/$(QMAKE_TARGET)

When using a prefix in the PKGBUILD, as in

./configure --prefix=/usr/bin

it generates the same error message.

Qmake -query is:

[lpc123@archmain archsimian]$ qmake -query
QT_SYSROOT:
QT_INSTALL_PREFIX:/usr
QT_INSTALL_ARCHDATA:/usr/lib/qt
QT_INSTALL_DATA:/usr/share/qt
QT_INSTALL_DOCS:/usr/share/doc/qt
QT_INSTALL_HEADERS:/usr/include/qt
QT_INSTALL_LIBS:/usr/lib
QT_INSTALL_LIBEXECS:/usr/lib/qt/libexec
QT_INSTALL_BINS:/usr/bin
QT_INSTALL_TESTS:/usr/tests
QT_INSTALL_PLUGINS:/usr/lib/qt/plugins
QT_INSTALL_IMPORTS:/usr/lib/qt/imports
QT_INSTALL_QML:/usr/lib/qt/qml
QT_INSTALL_TRANSLATIONS:/usr/share/qt/translations
QT_INSTALL_CONFIGURATION:/etc/xdg
QT_INSTALL_EXAMPLES:/usr/share/doc/qt/examples
QT_INSTALL_DEMOS:/usr/share/doc/qt/examples
QT_HOST_PREFIX:/usr
QT_HOST_DATA:/usr/lib/qt
QT_HOST_BINS:/usr/bin
QT_HOST_LIBS:/usr/lib
QMAKE_SPEC:linux-g++
QMAKE_XSPEC:linux-g++
QMAKE_VERSION:3.1
QT_VERSION:5.12.2

In the Qt5 .pro file, I set the path using:

target.path = $$[QT_INSTALL_BINS]
INSTALLS += target

Any tips on this and the rest of the PKGBUILD are appreciated.

Last edited by zpg443 (2019-03-28 22:35:39)

Offline

#2 2019-03-28 21:55:29

hpmachining
Member
From: Michigan
Registered: 2016-11-23
Posts: 40
Website

Re: [SOLVED] PKGBUILD Review Request by zpg443

Here are my notes:
1) The license= should just be GPL3, not GPL-3.0
2) You are missing qt5-base as a dependancy.
3) Are sqlite3 and python actually needed? This is a namcap warning, but they are not always correct. But if they are not needed to build or run the program, optdepends would probably be the place to put them.
4) Remove empty options variable.
5) Next, why are you using using autotools & qmake both in the build function? You are mixing 2 different build systems and the Makefile created with autoreconf / configure just gets overwritten by qmake. Same with the package function and the 2 make install lines. Only one is needed. The second one using DESTDIR is causing the errors you reported. From what I can tell the following build & package functions work (only build tested):

build() {
    cd "${srcdir}/${pkgname%-git}"
    qmake ArchSimian.pro
    make
}

package() {
    cd "$srcdir/${pkgname%-git}"
    make INSTALL_ROOT="$pkgdir" install
}

6) FYI, you don't need to have "${srcdir}" in the cd lines of build() and package(), but it doesn't hurt anything.

Also, I recommend learning to build in a clean chroot to help detect dependancy issues.

Offline

#3 2019-03-28 22:34:51

zpg443
Member
Registered: 2016-12-03
Posts: 271

Re: [SOLVED] PKGBUILD Review Request by zpg443

This is my first AUR package, so I am not surprised at your findings.  I was confused about using qmake and make together, so thank you for straightening me out. Sqlite3 and python are needed to run the program, but not for installation, so I moved them to optdepends as suggested.

I plan next to test in chroot.

Offline

#4 2019-03-29 00:21:19

hpmachining
Member
From: Michigan
Registered: 2016-11-23
Posts: 40
Website

Re: [SOLVED] PKGBUILD Review Request by zpg443

zpg443 wrote:

Sqlite3 and python are needed to run the program, but not for installation, so I moved them to optdepends as suggested.

If they are needed to run the program, then keep them in depends. See here for what to put in optdepends.

Offline

Board footer

Powered by FluxBB