aboutsummaryrefslogtreecommitdiffstats
path: root/community/libcamera/APKBUILD
blob: 443b423c565baccb7c49db0f2d85ceb295b52ac1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# Contributor: Luca Weiss <luca@z3ntu.xyz>
# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=libcamera
pkgver=0.2.0
pkgrel=0
pkgdesc="Linux camera framework"
url="https://libcamera.org/"
arch="all"
license="LGPL-2.1-or-later AND GPL-2.0-or-later"
depends_dev="
	eudev-dev
	glib-dev
	gnutls-dev
	gst-plugins-bad-dev
	qt5-qtbase-dev
	"
# upstream calls 'date' with a non-POSIX option so we pull in coreutils
makedepends="$depends_dev
	coreutils
	doxygen
	graphviz
	gtest-dev
	libevent-dev
	libunwind-dev
	linux-headers
	meson
	py3-jinja2
	py3-ply
	py3-sphinx
	py3-yaml
	qt5-qttools-dev
	yaml-dev
	"
subpackages="
	$pkgname-dbg
	$pkgname-dev
	$pkgname-doc
	qcam
	$pkgname-gstreamer
	$pkgname-v4l2
	$pkgname-tools
	"
source="$pkgname-$pkgver.tar.gz::https://github.com/libcamera-org/libcamera/archive/refs/tags/v$pkgver.tar.gz
	0001-qcam-Decrease-minimum-width-of-selector-dialog.patch
	qcam.desktop
	"
# gstreamer tests fail
# manual strip because ipa .sign files depend on the file contents- have to re-sign after strip
options="!strip !check"

case "$CARCH" in
arm*|aarch64)
	subpackages="$subpackages $pkgname-raspberrypi"
	;;
esac

case "$CARCH" in
ppc64le|s390x|riscv64)
	# doesn't install any ipa
	;;
*)
	depends="$pkgname-ipa=$pkgver-r$pkgrel"
	subpackages="$subpackages $pkgname-ipa"
	;;
esac

build() {
	abuild-meson \
		-Dv4l2=true \
		-Dwerror=false \
		. output
	meson compile -C output
}

check() {
	meson test --no-rebuild -C output --print-errorlogs
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
	install -Dm644 -t "$pkgdir"/usr/share/applications "$srcdir"/qcam.desktop

	# manual strip first..
	scanelf --recursive \
		--nobanner \
		--etype "ET_DYN,ET_EXEC" \
		--format "%F" \
		"$pkgdir" \
		| while read -r file; do
			strip "$file"
	done
}

ipa() {
	depends=""
	amove usr/lib/libcamera
	# then sign ipa's
	local ipa
	for ipa in "$subpkgdir"/usr/lib/libcamera/ipa*.so; do
		msg "signing $ipa"
		"$builddir"/src/ipa/ipa-sign.sh \
			"$(find "$builddir"/output -type f -iname "*ipa-priv-key.pem")" \
			"$ipa" \
			"$ipa".sign
	done
}

qcam() {
	depends=""
	amove usr/bin/qcam

	amove usr/share/applications/qcam.desktop
}

gstreamer() {
	depends=""
	amove usr/lib/gstreamer-1.0
}

v4l2() {
	depends=""
	amove usr/libexec/libcamera/v4l2-compat.so
}

raspberrypi() {
	depends=""
	amove usr/share/libcamera/ipa/rpi
	amove usr/libexec/libcamera/raspberrypi_ipa_proxy
	amove usr/share/libcamera/pipeline/rpi/vc4
}

tools() {
	depends=""
	amove usr/bin/cam
	amove usr/bin/lc-compliance
}

sha512sums="
f01afcbf615d6c1a7f6c3f2b89043094a737376a3f3cb3f4e4f72f8366acf0bbf099b1f1b1b306c489a43f92eaf723779f0e49bb047c233367a0d69555b74def  libcamera-0.2.0.tar.gz
69d6e29d764f752feed453b9c0f61c81cdb506eb14893d0d99d0d6834f369f1e816c2381dfab5ad1a744a3d11211af02d75dc041ecc87c7e4f73e2bd34c666c2  0001-qcam-Decrease-minimum-width-of-selector-dialog.patch
22167a4eceb6d1b40b0b7c45fdf116c71684f5340de7f767535cb8e160ad9d2ae0f00cb3d461f73a344520a48a4641cf46226841d78bee06bfbfd2a91337f754  qcam.desktop
"