summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorMateusz Gozdek2020-06-06 23:22:57 +0200
committerMateusz Gozdek2020-06-06 23:55:39 +0200
commitef4cb7d793f1affdb0de884deda8b4ca45006d05 (patch)
tree05cd1aaa04d5b0f1842e2ae4375678024591d4f9 /PKGBUILD
parent660a90cf900a3741fe381d10c21a3bd2e785f3dc (diff)
downloadaur-ef4cb7d793f1affdb0de884deda8b4ca45006d05.tar.gz
Use split package to also manage v4l2loopback-dc-dkms package
As they are both build from the same source. Signed-off-by: Mateusz Gozdek <mgozdekof@gmail.com>
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD76
1 files changed, 56 insertions, 20 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 1772d82a1b6..fc9a094f19b 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,43 +3,79 @@
# Contributor: Rein Fernhout <public@reinfernhout.xyz>
# Past Contributor: James An <james@jamesan.ca>
-pkgname=droidcam
+pkgbase=droidcam
+pkgname=('droidcam' 'v4l2loopback-dc-dkms')
pkgver=1.3
-pkgrel=1
+pkgrel=2
epoch=1
pkgdesc='A tool for using your android device as a wireless/usb webcam'
arch=('x86_64')
-url="https://github.com/aramg/${pkgname}"
+url="https://github.com/aramg/${pkgbase}"
license=('GPL')
-depends=('v4l2loopback-dc-dkms' 'alsa-lib' 'libjpeg-turbo' 'ffmpeg')
-makedepends=('gtk3')
-optdepends=('gtk3: use GUI version in addition to CLI interface' )
+backup=("etc/modprobe.d/${pkgbase}.conf")
+makedepends=('gtk3' 'ffmpeg')
-source=("${pkgname}.desktop"
- "${pkgname}-${pkgver}.zip::${url}/archive/v${pkgver}.zip"
- "${pkgname}.conf"
+source=("${pkgbase}.desktop"
+ "dkms.conf"
+ "${pkgbase}.conf"
+ "${pkgbase}-${pkgver}.zip::${url}/archive/v${pkgver}.zip"
)
sha512sums=('72d21aa2d7eecc9bb070aaf7059a671246feb22f9c39b934a5463a4839f9347050de00754e5031dbc44f78eb2731f58f0cd2fcf781bc241f6fbd1abb4308b7ee'
- 'c783b62c530c521aa7f047073efe74b57f28fbadbd097dca595fb582820566aedd03c6e92d2f24d9ff84dceed8ab51955ad77e80481ebfb6e30423425f8f2953'
- 'ea457b46a2fc9f1a3ea8e99f2cd0771a587cff89f42335fdaf55988dda0376a1fea73b660174c9f1906a304bace68bffec30b70b20dafc05ebae8854d9aadb13')
+ '27848dc6825c965c0aaac8e86220c3916ba20df6d941f5f05caecbf9c329ee744ee883bd2638ba58fe0dc3f40a8ae804dafbfbbe2efc23237e2b5450606cb78d'
+ 'ea457b46a2fc9f1a3ea8e99f2cd0771a587cff89f42335fdaf55988dda0376a1fea73b660174c9f1906a304bace68bffec30b70b20dafc05ebae8854d9aadb13'
+ 'c783b62c530c521aa7f047073efe74b57f28fbadbd097dca595fb582820566aedd03c6e92d2f24d9ff84dceed8ab51955ad77e80481ebfb6e30423425f8f2953')
+
+prepare() {
+ # Generate the module loading configuration files
+ echo "options v4l2loopback_dc width=640 height=480" >| "${pkgbase}.modprobe.conf"
+}
build() {
- cd ${pkgname}-${pkgver}/linux
+ cd ${pkgbase}-${pkgver}/linux
# All JPEG* parameters are needed to use shared version of libturbojpeg instead of
# static one.
make JPEG_DIR="" JPEG_INCLUDE="" JPEG_LIB="" JPEG=$(pkg-config --libs --cflags libturbojpeg)
}
-package() {
- pushd ${pkgname}-${pkgver}/linux
+package_droidcam() {
+ depends=('alsa-lib' 'libjpeg-turbo' 'ffmpeg' 'v4l2loopback-dc-dkms')
+ optdepends=('gtk3: use GUI version in addition to CLI interface' )
+
+ pushd ${pkgbase}-${pkgver}/linux
# Install droidcam program files
- install -Dm755 "${pkgname}" "${pkgdir}/usr/bin/${pkgname}"
- install -Dm755 "${pkgname}-cli" "${pkgdir}/usr/bin/${pkgname}-cli"
- install -Dm644 icon2.png "${pkgdir}/usr/share/pixmaps/${pkgname}.png"
- install -Dm644 "../../${pkgname}.desktop" "${pkgdir}/usr/share/applications/${pkgname}.desktop"
- install -Dm644 "../../${pkgname}.conf" "${pkgdir}/etc/modules-load.d/droidcam.conf"
- install -Dm644 README.md "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+ install -Dm755 "${pkgbase}" "$pkgdir/usr/bin/${pkgbase}"
+ install -Dm755 "${pkgbase}-cli" "$pkgdir/usr/bin/${pkgbase}-cli"
+ install -Dm644 icon2.png "$pkgdir/usr/share/pixmaps/${pkgbase}.png"
+ install -Dm644 "../../${pkgbase}.desktop" "$pkgdir/usr/share/applications/${pkgbase}.desktop"
+ install -Dm644 "../../${pkgbase}.conf" "${pkgdir}/etc/modules-load.d/${pkgbase}.conf"
+ install -Dm644 README.md "$pkgdir/usr/share/licenses/${pkgbase}/LICENSE"
+}
+
+package_v4l2loopback-dc-dkms() {
+ depends=('dkms')
+ _pkgname=v4l2loopback-dc
+ local install_dir="${pkgdir}/usr/src/${_pkgname}-${pkgver}"
+
+ # Copy dkms.conf
+ install -Dm644 dkms.conf "${install_dir}/dkms.conf"
+
+ # Set name and version
+ sed -e "s/@_PKGNAME@/${_pkgname}/" -e "s/@PKGVER@/${pkgver}/" -i "${install_dir}/dkms.conf"
+
+ # Install module loading configuration
+ install -Dm644 "${pkgbase}.modprobe.conf" "$pkgdir/etc/modprobe.d/${pkgbase}.conf"
+
+ # Install module source
+ cd ${pkgbase}-${pkgver}/linux/v4l2loopback
+
+ for d in $(find . -type d); do
+ install -dm755 "${install_dir}/$d"
+ done
+
+ for f in $(find . -type f ! -name '.gitignore'); do
+ install -m644 "$f" "${install_dir}/$f"
+ done
}