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.

85 lines
2.0 KiB

  1. #
  2. # Copyright (C) 2014 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:=nettle
  9. PKG_VERSION:=2.7.1
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=@GNU/nettle
  13. PKG_MD5SUM:=003d5147911317931dd453520eb234a5
  14. PKG_MAINTAINER:=Nikos Mavrogiannopoulos <nmav@gnutls.org>
  15. PKG_LICENSE:=LGPLv2
  16. PKG_LICENSE_FILES:=COPYING
  17. PKG_FIXUP:=autoreconf
  18. PKG_BUILD_PARALLEL:=0
  19. include $(INCLUDE_DIR)/package.mk
  20. define Package/libnettle
  21. SECTION:=libs
  22. CATEGORY:=Libraries
  23. TITLE:=GNU crypto library
  24. URL:=http://www.lysator.liu.se/~nisse/nettle/
  25. DEPENDS+= +!LIBNETTLE_MINI:libgmp
  26. endef
  27. define Package/libnettle/config
  28. source "$(SOURCE)/Config.in"
  29. endef
  30. TARGET_CFLAGS += $(FPIC)
  31. CONFIGURE_ARGS += \
  32. --enable-shared \
  33. --disable-openssl \
  34. --disable-documentation \
  35. --enable-static
  36. ifeq ($(CONFIG_LIBNETTLE_MINI),y)
  37. CONFIGURE_ARGS += --enable-mini-gmp
  38. endif
  39. ifeq ($(CONFIG_CPU_SUBTYPE),neon)
  40. CONFIGURE_ARGS += \
  41. --enable-arm-neon
  42. endif
  43. define Build/Compile
  44. $(call Build/Compile/Default, \
  45. DESTDIR="$(PKG_INSTALL_DIR)" \
  46. CC="$(TARGET_CC)" \
  47. libnettle.so libhogweed.so
  48. +$(MAKE) -i $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
  49. DESTDIR="$(PKG_INSTALL_DIR)" \
  50. install)
  51. endef
  52. define Build/InstallDev
  53. $(INSTALL_DIR) $(1)/usr/include/nettle
  54. $(CP) $(PKG_INSTALL_DIR)/usr/include/nettle/*.h $(1)/usr/include/nettle/
  55. $(INSTALL_DIR) $(1)/usr/lib
  56. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnettle.{a,so*} $(1)/usr/lib/
  57. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libhogweed.{a,so*} $(1)/usr/lib/
  58. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  59. $(CP) \
  60. $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/nettle.pc \
  61. $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/hogweed.pc \
  62. $(1)/usr/lib/pkgconfig/
  63. endef
  64. define Package/libnettle/install
  65. $(INSTALL_DIR) $(1)/usr/lib
  66. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnettle.so.* $(1)/usr/lib/
  67. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libhogweed.so.* $(1)/usr/lib/
  68. endef
  69. $(eval $(call BuildPackage,libnettle))