poco: moved to github
[packages.git] / libs / libgphoto2 / Makefile
1 #
2 # Copyright (C) 2006-2012 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=libgphoto2
11 PKG_VERSION:=2.4.12
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=@SF/gphoto
16 PKG_MD5SUM:=735c50ebb15cb8be61bac400ee4afb1e
17
18 PKG_FIXUP:=autoreconf
19 PKG_LIBTOOL_PATHS:=. libgphoto2_port
20 PKG_INSTALL:=1
21
22 include $(INCLUDE_DIR)/package.mk
23 include $(INCLUDE_DIR)/nls.mk
24
25 define Package/libgphoto2/Default
26   SECTION:=libs
27   CATEGORY:=Libraries
28   URL:=http://www.gphoto.org/
29 endef
30
31 define Package/libgphoto2
32   $(call Package/libgphoto2/Default)
33   DEPENDS:=+libexif +libjpeg +libpthread +libltdl $(ICONV_DEPENDS)
34   TITLE:=The basic library of the gphoto2 program.
35   MENU:=1
36 endef
37
38 define Package/libgphoto2-drivers
39   $(call Package/libgphoto2/Default)
40   DEPENDS:=libgphoto2 +libusb-compat +libgd
41   TITLE:=Gphoto2 drivers for various cameras
42 endef
43
44 CONFIGURE_ARGS += \
45         --enable-shared \
46         --enable-static \
47         --disable-rpath \
48         --with-drivers=all \
49         --without-included-ltdl \
50         --without-libiconv-prefix \
51         --without-libintl-prefix \
52
53 CONFIGURE_VARS += \
54         CPPFLAGS="$$$$CPPFLAGS $(ICONV_CFLAGS)" \
55         LDFLAGS="$$$$LDFLAGS $(ICONV_LDFLAGS)" \
56         LIBEXIF_CFLAGS="$$$$CPPFLAGS" \
57         LIBEXIF_LIBS="$$$$LDFLAGS -lexif" \
58         LIBUSB_CFLAGS="$$$$CPPFLAGS" \
59         LIBUSB_LIBS="$$$$LDFLAGS -lusb" \
60         LIBS="-lltdl" \
61
62 # If OpenWrt is using the iconv stub, we disable iconv support
63 # in libgphoto2 entirely since the stub lacks some essential
64 # conversions like UCS-2 to UTF-8 which will let certain drivers
65 # fail with "Failed to create iconv converter" .
66 ifneq ($(ICONV_FULL),1)
67   CONFIGURE_VARS += am_cv_func_iconv=no am_cv_lib_iconv=no
68 endif
69
70 MAKE_FLAGS += \
71         LIBLTDL="" \
72
73 TARGET_CFLAGS += $(FPIC)
74
75 define Build/InstallDev
76         $(INSTALL_DIR) $(1)/usr/bin
77         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gphoto2{,-port}-config $(1)/usr/bin/
78         $(INSTALL_DIR) $(1)/usr/include
79         $(CP) $(PKG_INSTALL_DIR)/usr/include/gphoto2 $(1)/usr/include/
80         $(INSTALL_DIR) $(1)/usr/lib
81         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2{,_port}.{a,so*} $(1)/usr/lib/
82         $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
83         $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libgphoto2.pc $(1)/usr/lib/pkgconfig/
84         $(SED) 's,-I$$$${prefix}/include/gphoto2,,g' $(1)/usr/bin/gphoto2{,-port}-config
85         $(SED) 's,-I$$$${prefix}/include,,g' $(1)/usr/bin/gphoto2{,-port}-config
86         # remove annoying recursive symlink
87         rm -f $(1)/usr/include/gphoto2/gphoto2
88 endef
89
90 define Package/libgphoto2/install
91         $(INSTALL_DIR) $(1)/usr/lib
92         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2{,_port}.so.* $(1)/usr/lib/
93 endef
94
95 define Package/libgphoto2-drivers/install
96         $(INSTALL_DIR) $(1)/usr/lib/
97         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2{,_port} $(1)/usr/lib/
98         rm -rf $(1)/usr/lib/libgphoto2{,_port}/*/*.{,l}a
99         rm -f $(1)/usr/lib/libgphoto2_port/*/usb.so
100 endef
101
102 $(eval $(call BuildPackage,libgphoto2))
103 $(eval $(call BuildPackage,libgphoto2-drivers))