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.

86 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.25
  10. PKG_RELEASE:=2
  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:=0bc309be21f91da4474c56df90415101c7f0c7c7cab2943cd943cd7896985256
  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
  31. CONFIGURE_ARGS += \
  32. --build=$(GNU_HOST_NAME) \
  33. --host=$(GNU_HOST_NAME) \
  34. --target=$(REAL_GNU_TARGET_NAME) \
  35. --disable-debug \
  36. --with-pthreads \
  37. $(if $(CONFIG_IPV6),--enable-ipv6,--disable-ipv6) \
  38. $(conf)
  39. define Build/Compile
  40. CROSS_COMPILE=1 CFLAGS="-DXP_UNIX $(HOST_CFLAGS)" LDFLAGS="" CC="$(HOSTCC)" \
  41. $(MAKE) -C $(PKG_BUILD_DIR)/nspr/config
  42. $(call Build/Compile/Default)
  43. endef
  44. define Package/nspr
  45. SECTION:=libs
  46. CATEGORY:=Libraries
  47. TITLE:=Netscape Portable Runtime (NSPR)
  48. URL:=https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR
  49. DEPENDS:=+libpthread
  50. endef
  51. define Package/nspr/description
  52. Netscape Portable Runtime (NSPR) provides a platform-neutral API for system
  53. level and libc-like functions. The API is used in the Mozilla clients, many
  54. of Red Hat's and Oracle's server applications, and other software offerings.
  55. endef
  56. define Build/InstallDev
  57. $(INSTALL_DIR) \
  58. $(1)/usr/include \
  59. $(1)/usr/lib/ \
  60. $(1)/usr/lib/pkgconfig/ \
  61. $(1)/usr/share/aclocal/
  62. $(CP) $(PKG_INSTALL_DIR)/usr/include/nspr $(1)/usr/include/
  63. $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/
  64. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/
  65. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/aclocal/* $(1)/usr/share/aclocal/
  66. endef
  67. define Package/nspr/install
  68. $(INSTALL_DIR) $(1)/usr/lib
  69. $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so $(1)/usr/lib/
  70. endef
  71. $(eval $(call BuildPackage,nspr))