You are not logged in.
Pages: 1
Hello, this is the first time I try to make a package and submitting it. I’ve tested it on several machines running Arch (kernels 5.0.13, 5.0.10-zen and 5.0.7), the latter had literally no development tools, not even gcc. Here is the PKGBUILD:
# Maintainer: Lucien Cartier-Tilet <phundrak@phundrak.fr>
pkgname=gl4dummies-git
pkgver=r289.714a7c3
pkgrel=1
pkgdesc="C wrapper around OpenGL 3.3+."
arch=('x86_64')
url="http://gl4d.api8.fr/"
license=('GPL3')
depends=('sdl2')
makedepends=('git' 'meson' 'ninja' 'gcc' 'pkg-config')
optdepends=('sdl2_gfx: low level support'
'sdl2_image: texture support'
'sdl2_mixer: audio support'
'sdl2_net: networking support'
'sdl2_ttf: TrueType fonts support')
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
source=('gl4dummies::git+https://github.com/noalien/GL4Dummies.git')
md5sums=('SKIP')
pkgver() {
cd "$srcdir/${pkgname%-git}"
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
build() {
cd "$srcdir/${pkgname%-git}"
meson build --prefix=/usr
ninja -C build
}
package() {
cd "$srcdir/${pkgname%-git}"
DESTDIR="$pkgdir" ninja -C build install
install -Dm644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md ChangeLog NEWS
install -Dm644 -t "$pkgdir/usr/share/licences/$pkgname/" AUTHORS COPYING
}
I tested if the library was correctly installed by compiling this simple project.
The test project itself also requires the packages `sdl2_image`, `glfw` and for some reason `cmake` due to glfw3, if you want to compile it yourself.
Any review is welcome!
Offline
Looks good to me. You could drop ninja from makedepends as meson depends on that, but it makes no difference. Note you swapped from tab indents to spaces in build() and package().
Offline
Alright, thank you! So something like this should do then?
# Maintainer: Lucien Cartier-Tilet <phundrak@phundrak.fr>
pkgname=gl4dummies-git
pkgver=r289.714a7c3
pkgrel=1
pkgdesc="C wrapper around OpenGL 3.3+."
arch=('x86_64')
url="http://gl4d.api8.fr/"
license=('GPL3')
depends=('sdl2')
makedepends=('git' 'meson' 'gcc' 'pkg-config')
optdepends=('sdl2_gfx: low level support'
'sdl2_image: texture support'
'sdl2_mixer: audio support'
'sdl2_net: networking support'
'sdl2_ttf: TrueType fonts support')
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
source=('gl4dummies::git+https://github.com/noalien/GL4Dummies.git')
md5sums=('SKIP')
pkgver() {
cd "$srcdir/${pkgname%-git}"
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
build() {
cd "$srcdir/${pkgname%-git}"
meson build --prefix=/usr
ninja -C build
}
package() {
cd "$srcdir/${pkgname%-git}"
DESTDIR="$pkgdir" ninja -C build install
install -Dm644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md ChangeLog NEWS
install -Dm644 -t "$pkgdir/usr/share/licences/$pkgname/" AUTHORS COPYING
}
Note you swapped from tab indents to spaces in build() and package().
My bad, vim didn’t swap the tabs to spaces automatically and I forgot to check that.
Offline
meson build --prefix=/usr
Projects using meson often have all kinds of special options that are autoeselected and change behaviour.
I suggest you add meson configure build to verify what options meson has set.
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
(A works at time B) && (time C > time B ) ≠ (A works at time C)
Offline
Alright, so with
build() {
cd "$srcdir/${pkgname%-git}"
meson build --prefix=/usr
meson configure build
ninja -C build
}
instead, we should be good?
Offline
Not entirely.
You have lots of ${pkgname%-git} expressions, but pkgname is set to gl4dummies-git .
This suggests you wanted to use something like
_pkgname=gl4dummies
pkgname=$_pkgname-git
in the PKGBUILD.
NOTE : If the % does strip the "-git" part this will work, but in my personal opinion stripping a part and immediately re-adding it reduces the readability.
Other pointers :
all functions in a PKGBUILD start at $srcdir, you can use relative paths .
check the provides/conflicts arrays, I doubt it does what you want
Edit : I misunderstood what % does with strings in Bash.
Last edited by Lone_Wolf (2019-05-13 10:25:14)
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
(A works at time B) && (time C > time B ) ≠ (A works at time C)
Offline
$ pkgname=gl4dummies-git
$ provides=("${pkgname%-git}")
$ echo ${provides[@]}
gl4dummies
Looks like it does exactly what is needed.
Offline
Confirmed, after some searching I found http://tldp.org/LDP/abs/html/refcards.html#AEN22828 that shows what % does with strings in bash.
editing post #6 now.
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
(A works at time B) && (time C > time B ) ≠ (A works at time C)
Offline
Pages: 1