libgphoto2: fix dependencies, remove libusb-0.1 plugin
[openwrt/svn-archive/archive.git] / libs / libgphoto2 / Makefile
index 44badb6456b5b73a93799a6c51db36d8992b348a..cc45ece1373dd1bf7445668bd842ec9de410f797 100644 (file)
@@ -1,24 +1,26 @@
 #
-# Copyright (C) 2006-2008 OpenWrt.org
+# Copyright (C) 2006-2012 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
 #
-# $Id$
 
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libgphoto2
-PKG_VERSION:=2.4.0
+PKG_VERSION:=2.4.12
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=@SF/gphoto
-PKG_MD5SUM:=a60154772635b693ff08b4f34dea7f61
+PKG_MD5SUM:=735c50ebb15cb8be61bac400ee4afb1e
 
-PKG_FIXUP = libtool
+PKG_FIXUP:=autoreconf
+PKG_LIBTOOL_PATHS:=. libgphoto2_port
+PKG_INSTALL:=1
 
 include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
 
 define Package/libgphoto2/Default
   SECTION:=libs
@@ -28,14 +30,14 @@ endef
 
 define Package/libgphoto2
   $(call Package/libgphoto2/Default)
-  DEPENDS:=+libusb +libexif +libjpeg +libpthread +libltdl +libiconv
+  DEPENDS:=+libexif +libjpeg +libpthread +libltdl $(ICONV_DEPENDS)
   TITLE:=The basic library of the gphoto2 program.
   MENU:=1
 endef
 
 define Package/libgphoto2-drivers
   $(call Package/libgphoto2/Default)
-  DEPENDS:=libgphoto2
+  DEPENDS:=libgphoto2 +libusb-1.0 +libgd
   TITLE:=Gphoto2 drivers for various cameras
 endef
 
@@ -49,29 +51,35 @@ CONFIGURE_ARGS += \
        --without-libintl-prefix \
 
 CONFIGURE_VARS += \
-       CPPFLAGS="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/lib/libiconv/include" \
-       LDFLAGS="$$$$LDFLAGS -L$(STAGING_DIR)/usr/lib/libiconv/lib" \
+       CPPFLAGS="$$$$CPPFLAGS $(ICONV_CFLAGS)" \
+       LDFLAGS="$$$$LDFLAGS $(ICONV_LDFLAGS)" \
        LIBEXIF_CFLAGS="$$$$CPPFLAGS" \
        LIBEXIF_LIBS="$$$$LDFLAGS -lexif" \
        LIBUSB_CFLAGS="$$$$CPPFLAGS" \
        LIBUSB_LIBS="$$$$LDFLAGS -lusb" \
        LIBS="-lltdl" \
 
-define Build/Compile
-       $(MAKE) -C $(PKG_BUILD_DIR) \
-               DESTDIR="$(PKG_INSTALL_DIR)" \
-               LIBLTDL="" \
-               all install
-endef
+# If OpenWrt is using the iconv stub, we disable iconv support
+# in libgphoto2 entirely since the stub lacks some essential
+# conversions like UCS-2 to UTF-8 which will let certain drivers
+# fail with "Failed to create iconv converter" .
+ifneq ($(ICONV_FULL),1)
+  CONFIGURE_VARS += am_cv_func_iconv=no am_cv_lib_iconv=no
+endif
+
+MAKE_FLAGS += \
+       LIBLTDL="" \
+
+TARGET_CFLAGS += $(FPIC)
 
 define Build/InstallDev
-       mkdir -p $(1)/usr/bin
+       $(INSTALL_DIR) $(1)/usr/bin
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gphoto2{,-port}-config $(1)/usr/bin/
-       mkdir -p $(1)/usr/include
+       $(INSTALL_DIR) $(1)/usr/include
        $(CP) $(PKG_INSTALL_DIR)/usr/include/gphoto2 $(1)/usr/include/
-       mkdir -p $(1)/usr/lib
+       $(INSTALL_DIR) $(1)/usr/lib
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2{,_port}.{a,so*} $(1)/usr/lib/
-       mkdir -p $(1)/usr/lib/pkgconfig
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libgphoto2.pc $(1)/usr/lib/pkgconfig/
        $(SED) 's,-I$$$${prefix}/include/gphoto2,,g' $(1)/usr/bin/gphoto2{,-port}-config
        $(SED) 's,-I$$$${prefix}/include,,g' $(1)/usr/bin/gphoto2{,-port}-config
@@ -88,6 +96,7 @@ define Package/libgphoto2-drivers/install
        $(INSTALL_DIR) $(1)/usr/lib/
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2{,_port} $(1)/usr/lib/
        rm -rf $(1)/usr/lib/libgphoto2{,_port}/*/*.{,l}a
+       rm -f $(1)/usr/lib/libgphoto2_port/*/usb.so
 endef
 
 $(eval $(call BuildPackage,libgphoto2))