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.

129 lines
3.0 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:=1
  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 libiconv/host
  21. HOST_BUILD_DEPENDS:=meson/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) +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. -Dselinux=disabled \
  42. -Dlibmount=disabled \
  43. -Dinternal_pcre=true \
  44. -Dman=false \
  45. -Ddtrace=false \
  46. -Dsystemtap=false \
  47. -Dgtk_doc=false \
  48. -Dbsymbolic_functions=true \
  49. -Dforce_posix_threads=true \
  50. -Dfam=false \
  51. -Dinstalled_tests=false \
  52. -Dnls=disabled \
  53. -Doss_fuzz=disabled
  54. MESON_HOST_ARGS += $(COMP_ARGS) -Dxattr=false
  55. MESON_ARGS += $(COMP_ARGS) -Dxattr=true -Db_lto=true
  56. # hack to compile static libraries
  57. define Build/Compile
  58. $(call Build/Compile/Meson)
  59. $(call Ninja,-C $(MESON_BUILD_DIR) install,DESTDIR="$(PKG_INSTALL_DIR)")
  60. $(call Meson, \
  61. --reconfigure \
  62. --buildtype plain \
  63. --native-file $(PKG_BUILD_DIR)/openwrt-native.txt \
  64. --cross-file $(PKG_BUILD_DIR)/openwrt-cross.txt \
  65. -Ddefault_library=static \
  66. $(MESON_ARGS) \
  67. $(MESON_BUILD_DIR) \
  68. $(PKG_BUILD_DIR), \
  69. $(MESON_VARS))
  70. endef
  71. define Build/InstallDev
  72. $(INSTALL_DIR) $(1)/usr/bin
  73. $(CP) \
  74. $(PKG_INSTALL_DIR)/usr/bin/* \
  75. $(1)/usr/bin/
  76. $(INSTALL_DIR) $(1)/usr/include
  77. $(CP) \
  78. $(PKG_INSTALL_DIR)/usr/include/glib-2.0 \
  79. $(1)/usr/include/
  80. $(CP) \
  81. $(PKG_INSTALL_DIR)/usr/lib/glib-2.0/include/*.h \
  82. $(1)/usr/include/glib-2.0/
  83. $(CP) \
  84. $(PKG_INSTALL_DIR)/usr/include/gio-unix-2.0 \
  85. $(1)/usr/include/
  86. $(INSTALL_DIR) $(1)/usr/lib
  87. $(CP) \
  88. $(PKG_INSTALL_DIR)/usr/lib/glib-2.0 \
  89. $(1)/usr/lib/
  90. $(CP) \
  91. $(PKG_INSTALL_DIR)/usr/lib/*.{so*,a} \
  92. $(1)/usr/lib/
  93. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  94. $(INSTALL_DATA) \
  95. $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc \
  96. $(1)/usr/lib/pkgconfig
  97. $(INSTALL_DIR) $(2)/share/aclocal/
  98. $(INSTALL_DATA) \
  99. $(PKG_INSTALL_DIR)/usr/share/aclocal/*.m4 \
  100. $(2)/share/aclocal/
  101. endef
  102. define Package/glib2/install
  103. $(INSTALL_DIR) $(1)/usr/lib
  104. $(CP) \
  105. $(PKG_INSTALL_DIR)/usr/lib/*.so* \
  106. $(1)/usr/lib/
  107. endef
  108. $(eval $(call HostBuild))
  109. $(eval $(call BuildPackage,glib2))