|
| 1 | +# |
| 2 | +# Copyright (C) 2008 OpenWrt.org |
| 3 | +# |
| 4 | +# This is free software, licensed under the GNU General Public License v2. |
| 5 | +# See /LICENSE for more information. |
| 6 | +# |
| 7 | +# Taken from github.com/tobiaswaldvogel/openwrt-addpack/blob/master/libicu/Makefile |
| 8 | + |
| 9 | +include $(TOPDIR)/rules.mk |
| 10 | + |
| 11 | +PKG_NAME:=icu |
| 12 | +PKG_VERSION:=57.1 |
| 13 | +PKG_RELEASE:=1 |
| 14 | + |
| 15 | +PKG_SOURCE:=icu4c-57_1-src.tgz |
| 16 | +PKG_SOURCE_URL:=http://download.icu-project.org/files/icu4c/$(PKG_VERSION)/ |
| 17 | +PKG_BUILD_DIR:=$(BUILD_DIR)/icu |
| 18 | +PKG_FIXUP:=libtool,no-autoreconf |
| 19 | +PKG_INSTALL=1 |
| 20 | + |
| 21 | +include $(INCLUDE_DIR)/package.mk |
| 22 | +include $(INCLUDE_DIR)/host-build.mk |
| 23 | + |
| 24 | +define Package/libicu |
| 25 | + SECTION:=libs |
| 26 | + CATEGORY:=Libraries |
| 27 | + TITLE:=ICU library for software internationalization |
| 28 | + URL:=http://icu-project.org |
| 29 | + DEPENDS:=+glib2 |
| 30 | +endef |
| 31 | + |
| 32 | +define Package/libicu/description |
| 33 | + ICU is a mature, widely used set of C/C++ and Java libraries providing Unicode |
| 34 | + and Globalization support for software applications. |
| 35 | +endef |
| 36 | + |
| 37 | +MAKE_PATH:=source |
| 38 | + |
| 39 | +HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/icu |
| 40 | + |
| 41 | +#define Host/Prepare |
| 42 | +# mkdir -p $(HOST_BUILD_DIR) |
| 43 | +#endef |
| 44 | + |
| 45 | + |
| 46 | +define Host/Compile |
| 47 | + $(MAKE) -C $(HOST_BUILD_DIR)/source all install |
| 48 | +endef |
| 49 | + |
| 50 | + |
| 51 | + |
| 52 | +# Specify what needs to be done to prepare for building the package. |
| 53 | +# In our case, we need to copy the source files to the build directory. |
| 54 | +# This is NOT the default. The default uses the PKG_SOURCE_URL and the |
| 55 | +# PKG_SOURCE which is not defined here to download the source from the web. |
| 56 | +# In order to just build a simple program that we have just written, it is |
| 57 | +# much easier to do it this way. |
| 58 | +#define Build/Prepare |
| 59 | +# $(call Build/Prepare/Default) |
| 60 | +# $(CP) -a $(PKG_BUILD_DIR)/source/* $(PKG_BUILD_DIR)/ |
| 61 | +#endef |
| 62 | + |
| 63 | +define Build/Prepare |
| 64 | + mkdir -p $(HOST_BUILD_DIR) |
| 65 | + $(call Host/Prepare/Default) |
| 66 | + $(call Host/Configure/Default,,,source) |
| 67 | + $(call Host/Compile) |
| 68 | + $(call Build/Prepare/Default) |
| 69 | +endef |
| 70 | + |
| 71 | +define Build/Configure |
| 72 | +# mkdir -p $(HOST_BUILD_DIR) |
| 73 | +# $(call Host/Prepare/Default) |
| 74 | +# $(call Host/Configure/Default,,,source) |
| 75 | +# $(call Host/Compile) |
| 76 | + $(call Build/Configure/Default, \ |
| 77 | + --with-cross-build=$(HOST_BUILD_DIR)/source,, \ |
| 78 | + source \ |
| 79 | + ) |
| 80 | +endef |
| 81 | + |
| 82 | +#define Build/InstallDev |
| 83 | +# $(INSTALL_DIR) $(1)/usr/lib |
| 84 | +# $(CP) \ |
| 85 | +# $(PKG_INSTALL_DIR)/usr/lib/*.so* \ |
| 86 | +# $(1)/usr/lib/ |
| 87 | +# |
| 88 | +# $(INSTALL_DIR) $(1)/usr/bin |
| 89 | +# $(INSTALL_DATA) \ |
| 90 | +# $(PKG_INSTALL_DIR)/usr/bin/* \ |
| 91 | +# $(1)/usr/bin/ |
| 92 | +# |
| 93 | +# $(INSTALL_DIR) $(1)/usr/include |
| 94 | +# $(CP) \ |
| 95 | +# $(PKG_INSTALL_DIR)/usr/include/* \ |
| 96 | +# $(1)/usr/include/ |
| 97 | +#endef |
| 98 | + |
| 99 | +define Package/libicu/install |
| 100 | + $(INSTALL_DIR) $(1)/usr/lib |
| 101 | +# $(CP) \ |
| 102 | +# $(PKG_INSTALL_DIR)/usr/lib/*.so* \ |
| 103 | +# $(1)/usr/lib/ |
| 104 | +endef |
| 105 | + |
| 106 | +$(eval $(call HostBuild)) |
| 107 | +$(eval $(call BuildPackage,libicu)) |
0 commit comments