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.

142 lines
3.5 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.2
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=glib-$(PKG_VERSION).tar.xz
  12. PKG_SOURCE_URL:=@GNOME/glib/2.65
  13. PKG_HASH:=445b1951eaa82d7a8af46bdff5dcc8030406db1ceeb0f0c3a88983f70152c555
  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_CONFIG_DEPENDS:=CONFIG_BUILD_NLS
  23. PKG_INSTALL:=1
  24. include $(INCLUDE_DIR)/host-build.mk
  25. include $(INCLUDE_DIR)/package.mk
  26. include $(INCLUDE_DIR)/nls.mk
  27. include ../../devel/meson/meson.mk
  28. define Package/glib2
  29. SECTION:=libs
  30. CATEGORY:=Libraries
  31. DEPENDS:=$(ICONV_DEPENDS) $(INTL_DEPENDS) +zlib +libpthread +libffi +libattr
  32. TITLE:=glib 2.0
  33. URL:=http://www.gtk.org/
  34. endef
  35. define Package/glib2/description
  36. The GLib library of C routines
  37. endef
  38. HOST_LDFLAGS += -liconv -Wl,-rpath,$(STAGING_DIR_HOSTPKG)/lib
  39. TARGET_CFLAGS += -ffunction-sections -fdata-sections
  40. TARGET_LDFLAGS += -Wl,--gc-sections -liconv $(if $(INTL_FULL),-lintl)
  41. COMP_ARGS= \
  42. -Diconv=external \
  43. -Dselinux=disabled \
  44. -Dlibmount=disabled \
  45. -Dinternal_pcre=true \
  46. -Dman=false \
  47. -Ddtrace=false \
  48. -Dsystemtap=false \
  49. -Dgtk_doc=false \
  50. -Dbsymbolic_functions=true \
  51. -Dforce_posix_threads=true \
  52. -Dfam=false \
  53. -Dinstalled_tests=false \
  54. -Dnls=$(if $(CONFIG_BUILD_NLS),en,dis)abled \
  55. -Doss_fuzz=disabled \
  56. -Dglib_assert=false \
  57. -Dglib_checks=false
  58. MESON_HOST_ARGS += $(COMP_ARGS) -Dxattr=false
  59. MESON_ARGS += $(COMP_ARGS) -Dxattr=true -Db_lto=true
  60. # hack to compile static libraries
  61. define Build/Compile
  62. $(call Build/Compile/Meson)
  63. $(call Ninja,-C $(MESON_BUILD_DIR) install,DESTDIR="$(PKG_INSTALL_DIR)")
  64. $(call Meson, \
  65. --reconfigure \
  66. --buildtype plain \
  67. --native-file $(PKG_BUILD_DIR)/openwrt-native.txt \
  68. --cross-file $(PKG_BUILD_DIR)/openwrt-cross.txt \
  69. -Ddefault_library=static \
  70. $(MESON_ARGS) \
  71. $(MESON_BUILD_DIR) \
  72. $(PKG_BUILD_DIR), \
  73. $(MESON_VARS))
  74. endef
  75. define Build/InstallDev
  76. $(INSTALL_DIR) $(1)/usr/bin
  77. $(CP) \
  78. $(PKG_INSTALL_DIR)/usr/bin/* \
  79. $(1)/usr/bin/
  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. $(INSTALL_DIR) $(1)/usr/lib
  91. $(CP) \
  92. $(PKG_INSTALL_DIR)/usr/lib/glib-2.0 \
  93. $(1)/usr/lib/
  94. $(CP) \
  95. $(PKG_INSTALL_DIR)/usr/lib/*.{so*,a} \
  96. $(1)/usr/lib/
  97. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  98. ifneq ($(INTL_FULL),)
  99. $(SED) '/^Libs:/s/$$$$/ -lintl/' \
  100. $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/glib-2.0.pc
  101. endif
  102. $(INSTALL_DATA) \
  103. $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc \
  104. $(1)/usr/lib/pkgconfig
  105. $(INSTALL_DIR) $(2)/share/aclocal/
  106. $(INSTALL_DATA) \
  107. $(PKG_INSTALL_DIR)/usr/share/aclocal/*.m4 \
  108. $(2)/share/aclocal/
  109. $(INSTALL_DIR) $(1)/usr/share/glib-2.0
  110. $(CP) \
  111. $(PKG_INSTALL_DIR)/usr/share/glib-2.0/codegen \
  112. $(1)/usr/share/glib-2.0/
  113. endef
  114. define Package/glib2/install
  115. $(INSTALL_DIR) $(1)/usr/lib
  116. $(CP) \
  117. $(PKG_INSTALL_DIR)/usr/lib/*.so* \
  118. $(1)/usr/lib/
  119. endef
  120. $(eval $(call HostBuild))
  121. $(eval $(call BuildPackage,glib2))