glibs: revert "fix compilation with Alpine Linux"
[feed/packages.git] / libs / glib2 / Makefile
1 #
2 # Copyright (C) 2007-2019 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:=glib2
11 PKG_VERSION:=2.70.4
12 PKG_RELEASE:=$(AUTORELEASE)
13
14 PKG_SOURCE:=glib-$(PKG_VERSION).tar.xz
15 PKG_SOURCE_URL:=@GNOME/glib/2.70
16 PKG_HASH:=ab3d176f3115dcc4e5d02db795984e04e4f4b48d836252e23e8c468e9d423c33
17
18 PKG_MAINTAINER:=Peter Wagner <tripolar@gmx.at>
19 PKG_LICENSE:=LGPL-2.1-or-later
20 PKG_LICENSE_FILES:=COPYING
21 PKG_CPE_ID:=cpe:/a:gnome:glib
22
23 PKG_BUILD_DIR:=$(BUILD_DIR)/glib-$(PKG_VERSION)
24 HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/glib-$(PKG_VERSION)
25 PKG_BUILD_DEPENDS:=libiconv/host
26 HOST_BUILD_DEPENDS:=libiconv/host libffi/host pcre/host
27 PKG_CONFIG_DEPENDS:=CONFIG_BUILD_NLS
28 PKG_INSTALL:=1
29
30 include $(INCLUDE_DIR)/host-build.mk
31 include $(INCLUDE_DIR)/package.mk
32 include $(INCLUDE_DIR)/nls.mk
33 include $(INCLUDE_DIR)/meson.mk
34
35 define Package/glib2
36 SECTION:=libs
37 CATEGORY:=Libraries
38 DEPENDS:=$(ICONV_DEPENDS) $(INTL_DEPENDS) +zlib +libpthread +libffi +libattr +libpcre
39 TITLE:=glib 2.0
40 URL:=http://www.gtk.org/
41 endef
42
43 define Package/glib2/description
44 The GLib library of C routines
45 endef
46
47 HOST_LDFLAGS += -Wl,-rpath,$(STAGING_DIR_HOSTPKG)/lib
48 TARGET_CFLAGS += -ffunction-sections -fdata-sections
49 TARGET_LDFLAGS += -Wl,--gc-sections $(if $(INTL_FULL),-lintl)
50
51 COMP_ARGS= \
52 -Diconv=external \
53 -Dselinux=disabled \
54 -Dlibmount=disabled \
55 -Dman=false \
56 -Ddtrace=false \
57 -Dsystemtap=false \
58 -Dsysprof=disabled \
59 -Dgtk_doc=false \
60 -Dbsymbolic_functions=true \
61 -Dforce_posix_threads=true \
62 -Dfam=false \
63 -Dtests=false \
64 -Dinstalled_tests=false \
65 -Doss_fuzz=disabled \
66 -Dglib_debug=disabled \
67 -Dglib_assert=false \
68 -Dglib_checks=false \
69 -Dlibelf=disabled
70
71 MESON_HOST_ARGS += $(COMP_ARGS) -Dxattr=false -Ddefault_library=static -Dnls=disabled
72 MESON_ARGS += $(COMP_ARGS) -Dxattr=true -Db_lto=true -Ddefault_library=both -Dnls=$(if $(CONFIG_BUILD_NLS),en,dis)abled
73
74 define Build/InstallDev
75 $(INSTALL_DIR) $(1)/usr/bin
76 $(CP) \
77 $(PKG_INSTALL_DIR)/usr/bin/* \
78 $(1)/usr/bin/
79
80 $(INSTALL_DIR) $(1)/usr/include
81 $(CP) \
82 $(PKG_INSTALL_DIR)/usr/include/glib-2.0 \
83 $(1)/usr/include/
84 $(CP) \
85 $(PKG_INSTALL_DIR)/usr/lib/glib-2.0/include/*.h \
86 $(1)/usr/include/glib-2.0/
87 $(CP) \
88 $(PKG_INSTALL_DIR)/usr/include/gio-unix-2.0 \
89 $(1)/usr/include/
90
91 $(INSTALL_DIR) $(1)/usr/lib
92 $(CP) \
93 $(PKG_INSTALL_DIR)/usr/lib/glib-2.0 \
94 $(1)/usr/lib/
95
96 $(CP) \
97 $(PKG_INSTALL_DIR)/usr/lib/*.{so*,a} \
98 $(1)/usr/lib/
99
100 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
101 ifneq ($(INTL_FULL),)
102 $(SED) '/^Libs:/s/$$$$/ -lintl/' \
103 $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/glib-2.0.pc
104 endif
105 $(INSTALL_DATA) \
106 $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc \
107 $(1)/usr/lib/pkgconfig
108
109 $(INSTALL_DIR) $(2)/share/aclocal/
110 $(INSTALL_DATA) \
111 $(PKG_INSTALL_DIR)/usr/share/aclocal/*.m4 \
112 $(2)/share/aclocal/
113
114 $(INSTALL_DIR) $(1)/usr/share/glib-2.0
115 $(CP) \
116 $(PKG_INSTALL_DIR)/usr/share/glib-2.0/codegen \
117 $(1)/usr/share/glib-2.0/
118 endef
119
120 define Package/glib2/install
121 $(INSTALL_DIR) $(1)/usr/lib
122 $(CP) \
123 $(PKG_INSTALL_DIR)/usr/lib/*.so* \
124 $(1)/usr/lib/
125 endef
126
127 $(eval $(call HostBuild))
128 $(eval $(call BuildPackage,glib2))