[gvfs] FreeBSD support for gphoto2 backend



commit 0285e9ede48ff83aead882401e36e9d7ae25746f
Author: Alexander Larsson <alexl redhat com>
Date:   Wed Sep 23 13:07:46 2009 +0200

    FreeBSD support for gphoto2 backend
    
    Here is a patch from Aurélien Jarno to enable the gphoto2 backend on FreeBSD
    and GNU/kFreeBSD.

 configure.ac                            |    2 +-
 monitor/gphoto2/ggphoto2volumemonitor.c |    6 ++++++
 2 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 5d21eb4..2db4dcf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -372,7 +372,7 @@ if test "x$enable_gphoto2" != "xno" -a \( "x$msg_hal" = "xyes" -o "x$msg_gudev"
 
   # Need OS tweaks in hal volume monitor backend
   case "$host" in
-    *-linux*)
+    *-linux* | *-freebsd* | *-kfreebsd*-gnu)
       use_gphoto2=yes
       ;;
     *)
diff --git a/monitor/gphoto2/ggphoto2volumemonitor.c b/monitor/gphoto2/ggphoto2volumemonitor.c
index a9f9122..8b87074 100644
--- a/monitor/gphoto2/ggphoto2volumemonitor.c
+++ b/monitor/gphoto2/ggphoto2volumemonitor.c
@@ -763,7 +763,13 @@ update_cameras (GGPhoto2VolumeMonitor *monitor,
         continue;
 
       usb_bus_num = hal_device_get_property_int (d, "usb.bus_number");
+#if defined(__linux__)
       usb_device_num = hal_device_get_property_int (d, "usb.linux.device_number");
+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+      usb_device_num = hal_device_get_property_int (d, "freebsd.unit");
+#else
+# error "Need OS specific tweaks"
+#endif
 
       store_heads = get_stores_for_camera (usb_bus_num, usb_device_num);
       num_store_heads = g_list_length (store_heads);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]