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.

74 lines
2.7 KiB

  1. #
  2. # Copyright (C) 2009-2016 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:=libsodium
  9. PKG_VERSION:=1.0.18
  10. PKG_RELEASE:=3
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=https://download.libsodium.org/libsodium/releases \
  13. https://github.com/jedisct1/libsodium/releases/download/$(PKG_VERSION)
  14. PKG_HASH:=6f504490b342a4f8a4c4a02fc9b866cbef8622d5df4e5452b46be121e46636c1
  15. PKG_MAINTAINER:=Damiano Renfer <damiano.renfer@gmail.com>
  16. PKG_LICENSE:=ISC
  17. PKG_LICENSE_FILES:=LICENSE
  18. PKG_USE_MIPS16:=0
  19. PKG_FIXUP:=autoreconf
  20. PKG_INSTALL:=1
  21. PKG_BUILD_PARALLEL:=1
  22. include $(INCLUDE_DIR)/package.mk
  23. define Package/libsodium
  24. SECTION:=libs
  25. CATEGORY:=Libraries
  26. TITLE:=P(ortable|ackageable) NaCl-based crypto library
  27. URL:=https://github.com/jedisct1/libsodium
  28. endef
  29. define Package/libsodium/description
  30. NaCl (pronounced "salt") is a new easy-to-use high-speed software library for network communication, encryption, decryption, signatures, etc.
  31. NaCl's goal is to provide all of the core operations needed to build higher-level cryptographic tools.
  32. Sodium is a portable, cross-compilable, installable, packageable fork of NaCl (based on the latest released upstream version nacl-20110221), with a compatible API.
  33. The design choices, particularly in regard to the Curve25519 Diffie-Hellman function, emphasize security (whereas NIST curves emphasize "performance" at the cost of security), and "magic constants" in NaCl/Sodium have clear rationales.
  34. The same cannot be said of NIST curves, where the specific origins of certain constants are not described by the standards.
  35. And despite the emphasis on higher security, primitives are faster across-the-board than most implementations of the NIST standards.
  36. endef
  37. define Package/libsodium/config
  38. menu "Configuration"
  39. depends on PACKAGE_libsodium
  40. config LIBSODIUM_MINIMAL
  41. bool "Compile only what is required for the high-level API (no aes128ctr), should be fine in most cases."
  42. default y
  43. endmenu
  44. endef
  45. CONFIGURE_ARGS+= \
  46. --disable-ssp \
  47. $(if $(CONFIG_LIBSODIUM_MINIMAL),--enable,--disable)-minimal
  48. define Build/InstallDev
  49. $(INSTALL_DIR) $(1)/usr/include/sodium
  50. $(CP) $(PKG_INSTALL_DIR)/usr/include/sodium.h $(1)/usr/include
  51. $(CP) $(PKG_INSTALL_DIR)/usr/include/sodium/*.h $(1)/usr/include/sodium
  52. $(INSTALL_DIR) $(1)/usr/lib
  53. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsodium.{a,so*} $(1)/usr/lib
  54. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  55. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libsodium.pc $(1)/usr/lib/pkgconfig/
  56. endef
  57. define Package/libsodium/install
  58. $(INSTALL_DIR) $(1)/usr/lib
  59. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsodium.so.* $(1)/usr/lib/
  60. endef
  61. $(eval $(call BuildPackage,libsodium))