source: packages/libs/libgphoto2/Makefile @ 27714

Last change on this file since 27714 was 27714, checked in by jow, 5 years ago

[packages] libgphoto2: disable iconv support if built against the stub, this allows drivers with optional conversion to work which would otherwise fail

  • Property copyright set to Copyright (C) 2006-2008 OpenWrt.org
  • Property licence set to GPLv2
  • Property svn:eol-style set to native
File size: 2.8 KB
Line 
1#
2# Copyright (C) 2006-2010 OpenWrt.org
3#
4# This is free software, licensed under the GNU General Public License v2.
5# See /LICENSE for more information.
6#
7
8include $(TOPDIR)/rules.mk
9
10PKG_NAME:=libgphoto2
11PKG_VERSION:=2.4.9
12PKG_RELEASE:=1
13
14PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15PKG_SOURCE_URL:=@SF/gphoto
16PKG_MD5SUM:=32b233189e3df7e5e67d2a81163682b8
17
18PKG_FIXUP:=libtool
19PKG_LIBTOOL_PATHS:=. libgphoto2_port
20PKG_INSTALL:=1
21
22include $(INCLUDE_DIR)/package.mk
23include $(INCLUDE_DIR)/nls.mk
24
25define Package/libgphoto2/Default
26  SECTION:=libs
27  CATEGORY:=Libraries
28  URL:=http://www.gphoto.org/
29endef
30
31define Package/libgphoto2
32  $(call Package/libgphoto2/Default)
33  DEPENDS:=+libusb +libexif +libjpeg +libpthread +libltdl $(ICONV_DEPENDS)
34  TITLE:=The basic library of the gphoto2 program.
35  MENU:=1
36endef
37
38define Package/libgphoto2-drivers
39  $(call Package/libgphoto2/Default)
40  DEPENDS:=libgphoto2
41  TITLE:=Gphoto2 drivers for various cameras
42endef
43
44CONFIGURE_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
53CONFIGURE_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" .
66ifneq ($(ICONV_FULL),1)
67  CONFIGURE_VARS += am_cv_func_iconv=no am_cv_lib_iconv=no
68endif
69
70MAKE_FLAGS += \
71        LIBLTDL="" \
72
73TARGET_CFLAGS += $(FPIC)
74
75define 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
88endef
89
90define Package/libgphoto2/install
91        $(INSTALL_DIR) $(1)/usr/lib
92        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2{,_port}.so.* $(1)/usr/lib/
93endef
94
95define 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
99endef
100
101$(eval $(call BuildPackage,libgphoto2))
102$(eval $(call BuildPackage,libgphoto2-drivers))
Note: See TracBrowser for help on using the repository browser.