From 179a863d87f4251aa4ea4a73eb422d3340b426f4 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Thu, 20 Nov 2014 16:46:32 +0100 Subject: [PATCH] libgphoto2: fixed cross build if -udev-rules subpkg is not available. --- srcpkgs/libgphoto2/template | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/srcpkgs/libgphoto2/template b/srcpkgs/libgphoto2/template index 40b0c431047..18ea8fa4129 100644 --- a/srcpkgs/libgphoto2/template +++ b/srcpkgs/libgphoto2/template @@ -14,6 +14,10 @@ homepage="http://www.gphoto.org" distfiles="${SOURCEFORGE_SITE}/gphoto/$pkgname-$version.tar.bz2" checksum=59b32d45252f67d066cc3bda7a59f8078e0cf4e7f23590a4b621633e81060292 +if [ "$CROSS_BUILD" ]; then + hostmakedepends+=" libgphoto2" +fi + pre_configure() { autoreconf -fi } @@ -25,28 +29,25 @@ post_install() { # Remove recursive symlink rm -f ${DESTDIR}/usr/include/gphoto2/gphoto2 - if [ "$CROSS_BUILD" ]; then - return 0 - fi - vmkdir usr/lib/udev/rules.d - LD_LIBRARY_PATH="${DESTDIR}/usr/lib${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH" \ - CAMLIBS="${DESTDIR}/usr/lib/libgphoto2/${version}" \ - "${DESTDIR}/usr/lib/libgphoto2/print-camera-list" udev-rules version 136 > \ - "${DESTDIR}/usr/lib/udev/rules.d/40-gphoto.rules" + if [ -z "$CROSS_BUILD" ]; then + LD_LIBRARY_PATH="${DESTDIR}/usr/lib${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH" \ + CAMLIBS="${DESTDIR}/usr/lib/libgphoto2/${version}" \ + ${DESTDIR}/usr/lib/libgphoto2/print-camera-list udev-rules version 136 > \ + ${DESTDIR}/usr/lib/udev/rules.d/40-gphoto.rules + else + /usr/lib/libgphoto2/print-camera-list udev-rules version 136 > \ + ${DESTDIR}/usr/lib/udev/rules.d/40-gphoto.rules + fi } -if [ -z "$CROSS_BUILD" ]; then - libgphoto2-udev-rules_package() { - replaces="libgphoto2<2.4.14_8" - short_desc+=" - udev rules" - noarch=yes - pkg_install() { - vmove usr/lib/udev/rules.d - } +libgphoto2-udev-rules_package() { + short_desc+=" - udev rules" + noarch=yes + pkg_install() { + vmove usr/lib/udev/rules.d } -fi # CROSS_BUILD - +} libgphoto2-devel_package() { depends="libexif-devel libusb-compat-devel libgphoto2>=${version}_${revision}" short_desc+=" - development files"