You are not logged in.
Here's my PKGBUILD file wanting to add a library that I've been working on to the arch linux package repository. This is technically a "pre-pre-pre-alpha" build as it is no where near finished.
**ALSO**
Not sure of the best way to include dependencies please help.
# Maintainer: Vincent Davis <vdavis2495@gmail.com>
pkgname='lucurious'
pkgver=0.0.1
pkgrel=1
license=('MIT')
pkgdesc='[Desktop Engine, Library] for building and styling 2D/3D Vulkan Wayland Compositors'
url='https://github.com/EasyIP2023/lucurious'
arch=('x86_64')
conflicts=("${pkgname}")
makedepends=('meson' 'ninja' 'git' 'wayland-protocols')
source=("${pkgname}::git+${url}")
sha512sums=('SKIP')
build () {
cd "${pkgname}"
rm -rf build
meson build
ninja -C build
}
package () {
cd "${pkgname}"
DESTDIR="${pkgdir}" ninja -C build install
install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
Last edited by EasyIP2023 (2019-11-04 19:24:54)
Offline
First, please [ code ] tags. Some issues/recommendations I can think of:
The package name should really be `lucurious-git` [1]
Add `conflicts` and `provides` arrays [1]
Add a `pkgver` function [2]
Use namcap [3] to check for common packaging mistakes (this includes missing dependencies). Note that there could be false positives.
Consider adding a `check` function [4]
I suppose your package depends at least on `wayland`. Building in a chroot [5] (combined with namcap) may clarify that.
[1] https://wiki.archlinux.org/index.php/VC … Guidelines
[2] https://wiki.archlinux.org/index.php/VC … elines#Git
[3] https://wiki.archlinux.org/index.php/Namcap
[4] https://wiki.archlinux.org/index.php/Cr … es#check()
[5] https://wiki.archlinux.org/index.php/De … ean_chroot
Offline
Add `conflicts` and `provides` arrays [1]
No, these should not be present. There are no packages that this would provide, and it should not conflict with any. Do not add empty arrays.
Last edited by Trilby (2019-11-04 12:59:41)
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
The package does not build in a clean chroot without adding:
shaderc vulkan-icd-loader vulkan-headers cglm wayland check
namcap detects:
namcap lucurious-0.0.1-1-x86_64.pkg.tar.xz
lucurious W: Referenced library 'liblucurious.so.1' is an uninstalled dependency
lucurious W: Referenced library 'libcglm.so.0' is an uninstalled dependency
lucurious E: Dependency wayland detected and not included (libraries ['usr/lib/libwayland-server.so.0', 'usr/lib/libwayland-client.so.0'] needed in files ['usr/lib/liblucurious.so.1'])
lucurious E: Dependency vulkan-icd-loader detected and not included (libraries ['usr/lib/libvulkan.so.1'] needed in files ['usr/lib/liblucurious.so.1'])
lucurious E: Dependency shaderc detected and not included (libraries ['usr/lib/libshaderc_shared.so.1'] needed in files ['usr/lib/liblucurious.so.1'])
That would suggest to me shaderc vulkan-icd-loader cglm wayland should be depends while vulkan-headers check should be added to makedepends.
Last edited by loqs (2019-11-04 17:22:34)
Offline
This PKGBUILD should be fine now. Works for me outside of chroot env in chroot I get this error
=> Checking runtime dependencies...
==> Installing missing dependencies...
error: target not found: cglm
==> ERROR: 'pacman' failed to install missing dependencies.
==> Missing dependencies:
-> shaderc
-> vulkan-icd-loader
-> cglm
-> wayland
==> Checking buildtime dependencies...
==> Installing missing dependencies...
How do I set this up to also grab clgm (https://github.com/recp/cglm) source code and install it on a machine? Or do I have to create an issue requesting a PKGBUILD for cglm as well?
# Maintainer: Vincent Davis <vdavis2495@gmail.com>
# Contributor: Vincent Davis <vdavis2495@gmail.com>
pkgname='lucurious-git'
pkgver=0.0.1
pkgrel=1
license=('MIT')
pkgdesc='[Desktop Engine, Library] for building and styling 2D/3D Vulkan Wayland Compositors'
url='https://github.com/EasyIP2023/lucurious'
arch=('x86_64')
provides=("${pkgname}=${pkgver%%.r*}")
conflicts=("${pkgname}")
depends=('shaderc' 'vulkan-icd-loader' 'cglm' 'wayland')
makedepends=('meson' 'ninja' 'git' 'wayland-protocols' 'vulkan-headers' 'check')
source=("${pkgname}::git+${url}")
sha512sums=('SKIP')
pkgver () {
cd "${pkgname}"
(
set -o pipefail
git describe --long 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
printf "${pkgver}.r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
)
}
build () {
cd "${pkgname}"
rm -rf build
meson build
ninja -C build
}
check() {
cd "${pkgname}"
meson test -C build
}
package () {
cd "${pkgname}"
DESTDIR="${pkgdir}" ninja -C build install
install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
Offline
I used https://aur.archlinux.org/packages/cglm/ then added that to the chroot:
extra-x86_64-build -- -I ../cglm/cglm-0.6.0-1-x86_64.pkg.tar.xz
Offline
Final PKGBUILD
# Maintainer: Vincent Davis <vdavis2495@gmail.com>
# Contributor: Vincent Davis <vdavis2495@gmail.com>
pkgname='lucurious-git'
pkgver=0.0.1
pkgrel=1
license=('MIT')
pkgdesc='[Desktop Engine, Library] for building and styling 2D/3D Vulkan Wayland Compositors'
url='https://github.com/EasyIP2023/lucurious'
arch=('x86_64')
depends=('shaderc' 'vulkan-icd-loader' 'cglm' 'wayland')
makedepends=('meson' 'ninja' 'git' 'wayland-protocols' 'vulkan-headers' 'check')
source=("${pkgname}::git+${url}")
sha512sums=('SKIP')
build () {
cd "${pkgname}"
rm -rf build
meson build
ninja -C build
}
check() {
cd "${pkgname}"
meson test -C build
}
package () {
cd "${pkgname}"
DESTDIR="${pkgdir}" ninja -C build install
install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
Offline
Offline
Okay below is a script I wrote to build my PKGBUILD in chroot. Along with the new PKGBUILD file. had to remove check() function as it requires a running wayland display server to not send programmed error codes. Not sure if those if statements below are okay to add. It works fine on my laptop, if it's not right just close this discussion topic.
#!/bin/bash
mkdir test_f
cp PKGBUILD test_f
cd test_f
mkdir chroot
export CHROOT=$HOME/test_f/chroot
git clone https://aur.archlinux.org/cglm.git
cd cglm
makepkg
cd ..
mkarchroot $CHROOT/root base-devel
makechrootpkg -c -r $CHROOT -I ./cglm/cglm-0.6.0-1-x86_64.pkg.tar.xz
# Maintainer: Vincent Davis <vdavis2495@gmail.com>
# Contributor: Vincent Davis <vdavis2495@gmail.com>
pkgname='lucurious-git'
pkgver=0.0.1
pkgrel=1
license=('MIT')
pkgdesc='[Desktop Engine, Library] for building and styling 2D/3D Vulkan Wayland Compositors'
url='https://github.com/EasyIP2023/lucurious'
arch=('x86_64')
depends=('shaderc' 'vulkan-icd-loader' 'cglm' 'wayland')
makedepends=('meson' 'ninja' 'git' 'wayland-protocols' 'vulkan-headers' 'check')
source=("${pkgname}::git+${url}")
sha512sums=('SKIP')
pkgver () {
cd "${pkgname}"
(
set -o pipefail
git describe --long 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
printf "${pkgver}.r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
)
}
build () {
cd "${pkgname}"
echo "What CPU do you have installed on your system?"
echo "1) Intel integrated"
echo "2) AMD integrated"
echo "3) nvidia"
read -p "Enter value: " i
if [ $i -eq 1 ]; then
sudo pacman -S vulkan-intel --noconfirm
elif [ $i -eq 2 ]; then
sudo pacman -S vulkan-radeon --noconfirm
elif [ $i -eq 3 ]; then
sudo pacman -S nvidia --noconfirm
else
echo "[x] Option was not selected please try again"
exit
fi
rm -rf build
meson build
ninja -C build
}
package () {
cd "${pkgname}"
DESTDIR="${pkgdir}" ninja -C build install
install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
Offline
PKGBUILDs cannot be interactive, get rid of that 'read' and conditional in the build function. More importantly, you definitely cannot / should not call pacman to install packages in the build function. Just list the dependencies. This depends on vulkan-driver - you don't need to care which implementation users chose to install as long as they have one of them. So just add 'vulkan-driver' to the depends/makedepends.
Last edited by Trilby (2019-11-05 02:30:35)
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
# Maintainer: Vincent Davis <vdavis2495@gmail.com>
# Contributor: Vincent Davis <vdavis2495@gmail.com>
pkgname='lucurious-git'
pkgver=0.0.1
pkgrel=1
license=('MIT')
pkgdesc='[Desktop Engine, Library] for building and styling 2D/3D Vulkan Wayland Compositors'
url='https://github.com/EasyIP2023/lucurious'
arch=('x86_64')
depends=('shaderc' 'vulkan-driver' 'vulkan-icd-loader' 'cglm' 'wayland')
makedepends=('meson' 'ninja' 'git' 'wayland-protocols' 'vulkan-headers' 'check')
source=("${pkgname}::git+${url}")
sha512sums=('SKIP')
pkgver () {
cd "${pkgname}"
(
set -o pipefail
git describe --long 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
printf "${pkgver}.r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
)
}
build () {
cd "${pkgname}"
rm -rf build
meson build
ninja -C build
}
package () {
cd "${pkgname}"
DESTDIR="${pkgdir}" ninja -C build install
install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
Last edited by EasyIP2023 (2019-11-05 03:11:35)
Offline