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.

128 lines
2.9 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.64.2
  10. PKG_RELEASE:=2
  11. PKG_SOURCE:=glib-$(PKG_VERSION).tar.xz
  12. PKG_SOURCE_URL:=@GNOME/glib/2.64
  13. PKG_HASH:=9a2f21ed8f13b9303399de13a0252b7cbcede593d26971378ec6cb90e87f2277
  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
  21. HOST_BUILD_DEPENDS:=meson/host libffi/host libiconv/host
  22. PKG_INSTALL:=1
  23. include $(INCLUDE_DIR)/host-build.mk
  24. include $(INCLUDE_DIR)/package.mk
  25. include ../../devel/meson/meson.mk
  26. define Package/glib2
  27. SECTION:=libs
  28. CATEGORY:=Libraries
  29. DEPENDS:=+zlib +libpthread +libffi +libattr @!USE_UCLIBC
  30. TITLE:=glib 2.0
  31. URL:=http://www.gtk.org/
  32. endef
  33. define Package/glib2/description
  34. The GLib library of C routines
  35. endef
  36. HOST_LDFLAGS += -liconv
  37. TARGET_CFLAGS += -ffunction-sections -fdata-sections -flto
  38. TARGET_LDFLAGS += -Wl,--gc-sections
  39. COMP_ARGS= \
  40. -Dselinux=disabled \
  41. -Dlibmount=disabled \
  42. -Dinternal_pcre=true \
  43. -Dman=false \
  44. -Ddtrace=false \
  45. -Dsystemtap=false \
  46. -Dgtk_doc=false \
  47. -Dbsymbolic_functions=true \
  48. -Dforce_posix_threads=true \
  49. -Dfam=false \
  50. -Dinstalled_tests=false \
  51. -Dnls=disabled \
  52. -Doss_fuzz=disabled
  53. MESON_HOST_ARGS += $(COMP_ARGS) -Dxattr=false
  54. MESON_ARGS += $(COMP_ARGS) -Dxattr=true
  55. # hack to compile static libraries
  56. define Build/Compile
  57. $(call Build/Compile/Meson)
  58. $(call Ninja,-C $(MESON_BUILD_DIR) install,DESTDIR="$(PKG_INSTALL_DIR)")
  59. $(call Meson, \
  60. --reconfigure \
  61. --buildtype plain \
  62. --native-file $(PKG_BUILD_DIR)/openwrt-native.txt \
  63. --cross-file $(PKG_BUILD_DIR)/openwrt-cross.txt \
  64. -Ddefault_library=static \
  65. $(MESON_ARGS) \
  66. $(MESON_BUILD_DIR) \
  67. $(PKG_BUILD_DIR), \
  68. $(MESON_VARS))
  69. endef
  70. define Build/InstallDev
  71. $(INSTALL_DIR) $(1)/usr/bin
  72. $(CP) \
  73. $(PKG_INSTALL_DIR)/usr/bin/* \
  74. $(1)/usr/bin/
  75. $(INSTALL_DIR) $(1)/usr/include
  76. $(CP) \
  77. $(PKG_INSTALL_DIR)/usr/include/glib-2.0 \
  78. $(1)/usr/include/
  79. $(CP) \
  80. $(PKG_INSTALL_DIR)/usr/lib/glib-2.0/include/*.h \
  81. $(1)/usr/include/glib-2.0/
  82. $(CP) \
  83. $(PKG_INSTALL_DIR)/usr/include/gio-unix-2.0 \
  84. $(1)/usr/include/
  85. $(INSTALL_DIR) $(1)/usr/lib
  86. $(CP) \
  87. $(PKG_INSTALL_DIR)/usr/lib/glib-2.0 \
  88. $(1)/usr/lib/
  89. $(CP) \
  90. $(PKG_INSTALL_DIR)/usr/lib/*.{so*,a} \
  91. $(1)/usr/lib/
  92. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  93. $(INSTALL_DATA) \
  94. $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc \
  95. $(1)/usr/lib/pkgconfig
  96. $(INSTALL_DIR) $(2)/share/aclocal/
  97. $(INSTALL_DATA) \
  98. $(PKG_INSTALL_DIR)/usr/share/aclocal/*.m4 \
  99. $(2)/share/aclocal/
  100. endef
  101. define Package/glib2/install
  102. $(INSTALL_DIR) $(1)/usr/lib
  103. $(CP) \
  104. $(PKG_INSTALL_DIR)/usr/lib/*.so* \
  105. $(1)/usr/lib/
  106. endef
  107. $(eval $(call HostBuild))
  108. $(eval $(call BuildPackage,glib2))