Makefile 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. #
  2. # Copyright (C) 2017 Shane Peelar
  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:=pcre2
  9. PKG_VERSION:=10.42
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
  12. PKG_SOURCE_URL:=https://github.com/PCRE2Project/pcre2/releases/download/$(PKG_NAME)-$(PKG_VERSION)
  13. PKG_HASH:=8d36cd8cb6ea2a4c2bb358ff6411b0c788633a2a45dabbf1aeb4b701d1b5e840
  14. PKG_MAINTAINER:=Shane Peelar <lookatyouhacker@gmail.com>
  15. PKG_LICENSE:=BSD-3-Clause
  16. PKG_LICENSE_FILES:=LICENCE
  17. PKG_CPE_ID:=cpe:/a:pcre:pcre
  18. PKG_CONFIG_DEPENDS:=\
  19. CONFIG_PACKAGE_libpcre2-16 \
  20. CONFIG_PACKAGE_libpcre2-32 \
  21. CONFIG_PCRE2_JIT_ENABLED
  22. PKG_BUILD_DEPENDS:=zlib
  23. include $(INCLUDE_DIR)/package.mk
  24. include $(INCLUDE_DIR)/host-build.mk
  25. include $(INCLUDE_DIR)/cmake.mk
  26. define Package/libpcre2/default
  27. SECTION:=libs
  28. CATEGORY:=Libraries
  29. URL:=https://www.pcre.org/
  30. endef
  31. define Package/libpcre2/config
  32. source "$(SOURCE)/Config.in"
  33. endef
  34. define Package/libpcre2
  35. $(call Package/libpcre2/default)
  36. TITLE:=A Perl Compatible Regular Expression library
  37. endef
  38. define Package/libpcre2-16
  39. $(call Package/libpcre2/default)
  40. TITLE:=A Perl Compatible Regular Expression library (16bit support)
  41. endef
  42. define Package/libpcre2-32
  43. $(call Package/libpcre2/default)
  44. TITLE:=A Perl Compatible Regular Expression library (32bit support)
  45. endef
  46. CMAKE_HOST_OPTIONS += \
  47. -DBUILD_SHARED_LIBS=OFF \
  48. -DPCRE2_BUILD_PCRE2_8=ON \
  49. -DPCRE2_BUILD_PCRE2_16=ON \
  50. -DPCRE2_BUILD_PCRE2_32=ON \
  51. -DPCRE2_DEBUG=OFF \
  52. -DPCRE2_DISABLE_PERCENT_ZT=ON \
  53. -DPCRE2_SUPPORT_JIT=OFF \
  54. -DPCRE2_SHOW_REPORT=OFF \
  55. -DPCRE2_BUILD_PCRE2GREP=OFF \
  56. -DPCRE2_BUILD_TESTS=OFF \
  57. -DPCRE2_STATIC_PIC=ON
  58. CMAKE_OPTIONS += \
  59. -DBUILD_SHARED_LIBS=ON \
  60. -DPCRE2_BUILD_PCRE2_8=ON \
  61. -DPCRE2_BUILD_PCRE2_16=O$(if $(CONFIG_PACKAGE_libpcre2-16),N,FF) \
  62. -DPCRE2_BUILD_PCRE2_32=O$(if $(CONFIG_PACKAGE_libpcre2-32),N,FF) \
  63. -DPCRE2_DEBUG=OFF \
  64. -DPCRE2_DISABLE_PERCENT_ZT=ON \
  65. -DPCRE2_SUPPORT_JIT=O$(if $(CONFIG_PCRE2_JIT_ENABLED),N,FF) \
  66. -DPCRE2_SHOW_REPORT=OFF \
  67. -DPCRE2_BUILD_PCRE2GREP=OFF \
  68. -DPCRE2_BUILD_TESTS=OFF
  69. define Build/InstallDev
  70. $(call Build/InstallDev/cmake,$(1))
  71. $(SED) 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' $(1)/usr/bin/pcre2-config
  72. $(INSTALL_DIR) $(2)/bin
  73. $(LN) ../../usr/bin/pcre2-config $(2)/bin/pcre2-config
  74. endef
  75. define Package/libpcre2/install
  76. $(INSTALL_DIR) $(1)/usr/lib
  77. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcre2-{8,posix}.so* $(1)/usr/lib/
  78. endef
  79. define Package/libpcre2-16/install
  80. $(INSTALL_DIR) $(1)/usr/lib
  81. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcre2-16.so* $(1)/usr/lib/
  82. endef
  83. define Package/libpcre2-32/install
  84. $(INSTALL_DIR) $(1)/usr/lib
  85. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcre2-32.so* $(1)/usr/lib/
  86. endef
  87. $(eval $(call BuildPackage,libpcre2))
  88. $(eval $(call BuildPackage,libpcre2-16))
  89. $(eval $(call BuildPackage,libpcre2-32))
  90. $(eval $(call HostBuild))