forked from mxe/mxe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
libiconv.mk
62 lines (53 loc) · 2.15 KB
/
libiconv.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# This file is part of MXE. See LICENSE.md for licensing information.
PKG := libiconv
$(PKG)_WEBSITE := https://www.gnu.org/software/libiconv/
$(PKG)_IGNORE :=
$(PKG)_VERSION := 1.17
$(PKG)_CHECKSUM := 8f74213b56238c85a50a5329f77e06198771e70dd9a739779f4c02f65d971313
$(PKG)_SUBDIR := libiconv-$($(PKG)_VERSION)
$(PKG)_FILE := libiconv-$($(PKG)_VERSION).tar.gz
$(PKG)_URL := https://ftp.gnu.org/gnu/libiconv/$($(PKG)_FILE)
$(PKG)_DEPS := cc
$(PKG)_TARGETS := $(BUILD) $(MXE_TARGETS)
$(PKG)_DEPS_$(BUILD) :=
define $(PKG)_UPDATE
$(WGET) -q -O- 'https://www.gnu.org/software/libiconv/' | \
grep 'libiconv-' | \
$(SED) -n 's,.*libiconv-\([0-9][^>]*\)\.tar.*,\1,p' | \
head -1
endef
define $(PKG)_BUILD
$(SED) -i 's, sed , $(SED) ,g' '$(1)/windows/windres-options'
cd '$(1)' && ./configure \
$(MXE_CONFIGURE_OPTS) \
--disable-nls
$(MAKE) -C '$(1)/libcharset' -j '$(JOBS)' install
$(MAKE) -C '$(1)/lib' -j '$(JOBS)' install
$(INSTALL) -d '$(PREFIX)/$(TARGET)/include'
$(INSTALL) -m644 '$(1)/include/iconv.h.inst' '$(PREFIX)/$(TARGET)/include/iconv.h'
# charset.alias is redundant on mingw and modern glibc systems
rm -f '$(PREFIX)/$(TARGET)/lib/charset.alias'
endef
define $(PKG)_BUILD_NATIVE
# build and install the library
cd '$(BUILD_DIR)' && $(SOURCE_DIR)/configure \
$(MXE_CONFIGURE_OPTS)
$(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)' $(MXE_DISABLE_DOCS)
$(MAKE) -C '$(BUILD_DIR)' -j 1 install $(MXE_DISABLE_DOCS)
endef
define $(PKG)_BUILD_DARWIN
# required for glib but causes issues with other packages
# (e.g. gcc) so use different prefix
cd '$(BUILD_DIR)' && $(SOURCE_DIR)/configure \
$(MXE_CONFIGURE_OPTS) \
--prefix='$(PREFIX)/$(TARGET).gnu'
$(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)' $(MXE_DISABLE_DOCS)
$(MAKE) -C '$(BUILD_DIR)' -j 1 install $(MXE_DISABLE_DOCS)
endef
define $(PKG)_BUILD_$(BUILD)
$(if $(findstring darwin, $(BUILD)), \
$($(PKG)_BUILD_DARWIN), \
$($(PKG)_BUILD_NATIVE))
# charset.alias is redundant on mingw and modern glibc systems
rm -f '$(PREFIX)/$(TARGET)/lib/charset.alias'
endef