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