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.

87 lines
2.5 KiB

  1. #
  2. # Copyright (C) 2019 Lucian Cristian
  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:=nspr
  9. PKG_VERSION:=4.32
  10. PKG_RELEASE:=1
  11. PKG_MAINTAINER:=Lucian Cristian <lucian.cristian@gmail.com>
  12. PKG_LICENCE:=MPL-2.0
  13. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  14. PKG_SOURCE_URL:= \
  15. https://download.cdn.mozilla.net/pub/$(PKG_NAME)/releases/v$(PKG_VERSION)/src/ \
  16. https://archive.mozilla.org/pub/$(PKG_NAME)/releases/v$(PKG_VERSION)/src/
  17. PKG_HASH:=bb6bf4f534b9559cf123dcdc6f9cd8167de950314a90a88b2a329c16836e7f6c
  18. PKG_BUILD_PARALLEL:=1
  19. PKG_INSTALL:=1
  20. PKG_FIXUP:=autoreconf
  21. include $(INCLUDE_DIR)/package.mk
  22. CONFIGURE_PATH = ./nspr
  23. MAKE_PATH = ./nspr
  24. PKG_AUTOMAKE_PATHS = $(PKG_BUILD_DIR)/nspr
  25. LBITS = $(shell $(TARGET_CC) -dM -E - </dev/null | grep -q "__LP64__" && echo 64 || echo 32)
  26. ifeq ($(LBITS),64)
  27. conf=--enable-64bit
  28. endif
  29. export MUSL=$(if $(CONFIG_LIBC_USE_GLIBC),0,1)
  30. TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed $(FPIC)
  31. TARGET_CFLAGS += -flto
  32. CONFIGURE_ARGS += \
  33. --build=$(GNU_HOST_NAME) \
  34. --host=$(GNU_HOST_NAME) \
  35. --target=$(REAL_GNU_TARGET_NAME) \
  36. --disable-debug \
  37. --with-pthreads \
  38. $(if $(CONFIG_IPV6),--enable-ipv6,--disable-ipv6) \
  39. $(conf)
  40. define Build/Compile
  41. CROSS_COMPILE=1 CFLAGS="-DXP_UNIX $(HOST_CFLAGS)" LDFLAGS="" CC="$(HOSTCC)" \
  42. $(MAKE) -C $(PKG_BUILD_DIR)/nspr/config
  43. $(call Build/Compile/Default)
  44. endef
  45. define Package/nspr
  46. SECTION:=libs
  47. CATEGORY:=Libraries
  48. TITLE:=Netscape Portable Runtime (NSPR)
  49. URL:=https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR
  50. DEPENDS:=+libpthread
  51. endef
  52. define Package/nspr/description
  53. Netscape Portable Runtime (NSPR) provides a platform-neutral API for system
  54. level and libc-like functions. The API is used in the Mozilla clients, many
  55. of Red Hat's and Oracle's server applications, and other software offerings.
  56. endef
  57. define Build/InstallDev
  58. $(INSTALL_DIR) \
  59. $(1)/usr/include \
  60. $(1)/usr/lib/ \
  61. $(1)/usr/lib/pkgconfig/ \
  62. $(1)/usr/share/aclocal/
  63. $(CP) $(PKG_INSTALL_DIR)/usr/include/nspr $(1)/usr/include/
  64. $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/
  65. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/
  66. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/aclocal/* $(1)/usr/share/aclocal/
  67. endef
  68. define Package/nspr/install
  69. $(INSTALL_DIR) $(1)/usr/lib
  70. $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so $(1)/usr/lib/
  71. endef
  72. $(eval $(call BuildPackage,nspr))