You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

137 lines
3.3 KiB

  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. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=glib2
  9. PKG_VERSION:=2.65.0
  10. PKG_RELEASE:=3
  11. PKG_SOURCE:=glib-$(PKG_VERSION).tar.xz
  12. PKG_SOURCE_URL:=@GNOME/glib/2.65
  13. PKG_HASH:=b041e63cd0ac1fccb486374022ade040d907aad29b278e27d9e43e9294a6e7a3
  14. PKG_MAINTAINER:=Peter Wagner <tripolar@gmx.at>
  15. PKG_LICENSE:=LGPL-2.1-or-later
  16. PKG_LICENSE_FILES:=COPYING
  17. PKG_CPE_ID:=cpe:/a:gnome:glib
  18. PKG_BUILD_DIR:=$(BUILD_DIR)/glib-$(PKG_VERSION)
  19. HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/glib-$(PKG_VERSION)
  20. PKG_BUILD_DEPENDS:=meson/host gettext-full libiconv/host
  21. HOST_BUILD_DEPENDS:=meson/host gettext-full/host libiconv/host libffi/host
  22. PKG_INSTALL:=1
  23. include $(INCLUDE_DIR)/host-build.mk
  24. include $(INCLUDE_DIR)/package.mk
  25. include $(INCLUDE_DIR)/nls.mk
  26. include ../../devel/meson/meson.mk
  27. define Package/glib2
  28. SECTION:=libs
  29. CATEGORY:=Libraries
  30. DEPENDS:=$(ICONV_DEPENDS) $(INTL_DEPENDS) +zlib +libpthread +libffi +libattr
  31. TITLE:=glib 2.0
  32. URL:=http://www.gtk.org/
  33. endef
  34. define Package/glib2/description
  35. The GLib library of C routines
  36. endef
  37. HOST_LDFLAGS += -liconv -Wl,-rpath,$(STAGING_DIR_HOSTPKG)/lib
  38. TARGET_CFLAGS += -ffunction-sections -fdata-sections
  39. TARGET_LDFLAGS += -Wl,--gc-sections -liconv
  40. COMP_ARGS= \
  41. -Diconv=external \
  42. -Dselinux=disabled \
  43. -Dlibmount=disabled \
  44. -Dinternal_pcre=true \
  45. -Dman=false \
  46. -Ddtrace=false \
  47. -Dsystemtap=false \
  48. -Dgtk_doc=false \
  49. -Dbsymbolic_functions=true \
  50. -Dforce_posix_threads=true \
  51. -Dfam=false \
  52. -Dinstalled_tests=false \
  53. -Dnls=$(if $(CONFIG_BUILD_NLS),en,dis)abled \
  54. -Doss_fuzz=disabled \
  55. -Dglib_assert=false \
  56. -Dglib_checks=false
  57. MESON_HOST_ARGS += $(COMP_ARGS) -Dxattr=false
  58. MESON_ARGS += $(COMP_ARGS) -Dxattr=true -Db_lto=true
  59. # hack to compile static libraries
  60. define Build/Compile
  61. $(call Build/Compile/Meson)
  62. $(call Ninja,-C $(MESON_BUILD_DIR) install,DESTDIR="$(PKG_INSTALL_DIR)")
  63. $(call Meson, \
  64. --reconfigure \
  65. --buildtype plain \
  66. --native-file $(PKG_BUILD_DIR)/openwrt-native.txt \
  67. --cross-file $(PKG_BUILD_DIR)/openwrt-cross.txt \
  68. -Ddefault_library=static \
  69. $(MESON_ARGS) \
  70. $(MESON_BUILD_DIR) \
  71. $(PKG_BUILD_DIR), \
  72. $(MESON_VARS))
  73. endef
  74. define Build/InstallDev
  75. $(INSTALL_DIR) $(1)/usr/bin
  76. $(CP) \
  77. $(PKG_INSTALL_DIR)/usr/bin/* \
  78. $(1)/usr/bin/
  79. $(INSTALL_DIR) $(1)/usr/include
  80. $(CP) \
  81. $(PKG_INSTALL_DIR)/usr/include/glib-2.0 \
  82. $(1)/usr/include/
  83. $(CP) \
  84. $(PKG_INSTALL_DIR)/usr/lib/glib-2.0/include/*.h \
  85. $(1)/usr/include/glib-2.0/
  86. $(CP) \
  87. $(PKG_INSTALL_DIR)/usr/include/gio-unix-2.0 \
  88. $(1)/usr/include/
  89. $(INSTALL_DIR) $(1)/usr/lib
  90. $(CP) \
  91. $(PKG_INSTALL_DIR)/usr/lib/glib-2.0 \
  92. $(1)/usr/lib/
  93. $(CP) \
  94. $(PKG_INSTALL_DIR)/usr/lib/*.{so*,a} \
  95. $(1)/usr/lib/
  96. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  97. $(INSTALL_DATA) \
  98. $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc \
  99. $(1)/usr/lib/pkgconfig
  100. $(INSTALL_DIR) $(2)/share/aclocal/
  101. $(INSTALL_DATA) \
  102. $(PKG_INSTALL_DIR)/usr/share/aclocal/*.m4 \
  103. $(2)/share/aclocal/
  104. $(INSTALL_DIR) $(1)/usr/share/glib-2.0
  105. $(CP) \
  106. $(PKG_INSTALL_DIR)/usr/share/glib-2.0/codegen \
  107. $(1)/usr/share/glib-2.0/
  108. endef
  109. define Package/glib2/install
  110. $(INSTALL_DIR) $(1)/usr/lib
  111. $(CP) \
  112. $(PKG_INSTALL_DIR)/usr/lib/*.so* \
  113. $(1)/usr/lib/
  114. endef
  115. $(eval $(call HostBuild))
  116. $(eval $(call BuildPackage,glib2))