summaryrefslogtreecommitdiff
path: root/app-crypt/libscrypt
diff options
context:
space:
mode:
Diffstat (limited to 'app-crypt/libscrypt')
-rw-r--r--app-crypt/libscrypt/Manifest4
-rw-r--r--app-crypt/libscrypt/files/libscrypt-1.21-build.patch76
-rw-r--r--app-crypt/libscrypt/libscrypt-1.21.ebuild36
-rw-r--r--app-crypt/libscrypt/metadata.xml11
4 files changed, 127 insertions, 0 deletions
diff --git a/app-crypt/libscrypt/Manifest b/app-crypt/libscrypt/Manifest
new file mode 100644
index 000000000000..8e17ba85fc70
--- /dev/null
+++ b/app-crypt/libscrypt/Manifest
@@ -0,0 +1,4 @@
+AUX libscrypt-1.21-build.patch 2460 BLAKE2B 139168dc59ea0001b5106a62731379c8a54e713d0bb5a30ab736eab36b2e8918d2ce47c8b3dc264b50172868c9c5108d0cd093c68e4fe4d3668301d84b15269c SHA512 74891b020e6115aa938368f43d727b3653160406f887f9958e66c688eb1191f7ba2ce6d753541af9369cf7724ecffff9b6633bef26062ebc0f74a092ed8cdd0d
+DIST libscrypt-1.21.tar.gz 19425 BLAKE2B 4f9f21c6ba36bad005d95203d1d2c206f50200973233670c4819fe2cc32de6941cc100360ba1683453fc7abcb0e0e024e32417beec06d5b43cbda56bfa89be5a SHA512 0f894bc2f47016cdd043ea692a4e4b08891b1a961443265230d5ccb76820d40e50b0d4d63588c44c985cd24e214f07b126d30989d3ce4cd79366f3b8f16c4d34
+EBUILD libscrypt-1.21.ebuild 709 BLAKE2B 1c2bfa6f478996809d468000838d310208a1e79fbc5db4a4b0a2cf5b631c48b5b2fe8bf5c7bd2708a6ffba0b6e63d858aadcfcbf3f382308cfdf520b25d5d1c5 SHA512 6999f0a1a937c7b7fae9e3af4c60a4385e7c3662e9625760d2c3392eaad2cd11e5a0e1b2f863f35368fc66c16f765539275eeafdc20afaa5d44826e59018f30e
+MISC metadata.xml 345 BLAKE2B affc5819c29d3b72ccc6a15e4d0b01bbff5bd3fdbe617c1b90dbd3af812127731d9981bab6a5ddd4a66cb1dcbb6bfa91b692cae1e5daf8247b84f25aa9bc01c1 SHA512 d123a54ae5536171b145454494d00e340797239bc5614a36451b9b975ad7bb2f38c5330069e78dd99f1d23cdb6f252736885af78d8cef63eb57dc93d68033383
diff --git a/app-crypt/libscrypt/files/libscrypt-1.21-build.patch b/app-crypt/libscrypt/files/libscrypt-1.21-build.patch
new file mode 100644
index 000000000000..236e80730d57
--- /dev/null
+++ b/app-crypt/libscrypt/files/libscrypt-1.21-build.patch
@@ -0,0 +1,76 @@
+From bdfec26744122e8f52a58bc086c89b27faaf5888 Mon Sep 17 00:00:00 2001
+From: Alon Bar-Lev <alon.barlev@gmail.com>
+Date: Sat, 1 Jul 2017 23:06:41 +0300
+Subject: [PATCH 1/2] build: move non-essential flags to *_EXTRA
+
+This enables downstream to selectively add/replace the optimization and
+other non-essential flags.
+
+Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
+---
+ Makefile | 11 ++++++-----
+ 1 file changed, 6 insertions(+), 5 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 7022a4a..c9313cb 100644
+--- a/Makefile
++++ b/Makefile
+@@ -5,21 +5,22 @@ MAKE_DIR ?= install -d
+ INSTALL_DATA ?= install
+
+ CC?=gcc
+-CFLAGS?=-O2 -Wall -g -D_FORTIFY_SOURCE=2 -fstack-protector -fPIC
+-LDFLAGS?=-Wl,-z,now -Wl,-z,relro -Wl,-soname,libscrypt.so.0 -Wl,--version-script=libscrypt.version
+-CFLAGS_EXTRA?=-Wl,-rpath=.
++CFLAGS?=$(CFLAGS_EXTRA) -D_FORTIFY_SOURCE=2 -fPIC
++LDFLAGS?=$(LDFLAGS_EXTRA) -Wl,-soname,libscrypt.so.0 -Wl,--version-script=libscrypt.version
++CFLAGS_EXTRA?=-Wl,-rpath=. -O2 -Wall -g -fstack-protector
++LDFLAGS_EXTRA?=-Wl,-z,relro
+
+ all: reference
+
+ OBJS= crypto_scrypt-nosse.o sha256.o crypto-mcf.o b64.o crypto-scrypt-saltgen.o crypto_scrypt-check.o crypto_scrypt-hash.o slowequals.o
+
+ libscrypt.so.0: $(OBJS)
+- $(CC) $(LDFLAGS) -shared -o libscrypt.so.0 $(OBJS) -lm -lc
++ $(CC) $(LDFLAGS) -shared -o libscrypt.so.0 $(OBJS) -lm -lc
+ ar rcs libscrypt.a $(OBJS)
+
+ reference: libscrypt.so.0 main.o crypto_scrypt-hexconvert.o
+ ln -s -f libscrypt.so.0 libscrypt.so
+- $(CC) -Wall -o reference main.o b64.o crypto_scrypt-hexconvert.o $(CFLAGS_EXTRA) -L. -lscrypt
++ $(CC) -o reference main.o b64.o crypto_scrypt-hexconvert.o $(CFLAGS) $(LDFLAGS_EXTRA) -L. -lscrypt
+
+ clean:
+ rm -f *.o reference libscrypt.so* libscrypt.a endian.h
+--
+2.13.0
+
+From 7899df0447e0fcad32a6cce7439eef1f1295aaeb Mon Sep 17 00:00:00 2001
+From: Alon Bar-Lev <alon.barlev@gmail.com>
+Date: Sat, 1 Jul 2017 23:14:29 +0300
+Subject: [PATCH 2/2] build: run tests with local library
+
+Ensure tests can run and when run are run with current library.
+
+Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index c9313cb..783c537 100644
+--- a/Makefile
++++ b/Makefile
+@@ -26,7 +26,7 @@ clean:
+ rm -f *.o reference libscrypt.so* libscrypt.a endian.h
+
+ check: all
+- ./reference
++ LD_LIBRARY_PATH=. ./reference
+
+ devtest:
+ splint crypto_scrypt-hexconvert.c
+--
+2.13.0
+
diff --git a/app-crypt/libscrypt/libscrypt-1.21.ebuild b/app-crypt/libscrypt/libscrypt-1.21.ebuild
new file mode 100644
index 000000000000..62491faa8ab2
--- /dev/null
+++ b/app-crypt/libscrypt/libscrypt-1.21.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit toolchain-funcs
+
+DESCRIPTION="Shared library to impliment the scrypt algorithm"
+HOMEPAGE="https://github.com/technion/libscrypt"
+SRC_URI="https://github.com/technion/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="BSD-2"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ppc ppc64 sparc x86"
+IUSE=""
+
+DEPEND=""
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+ "${FILESDIR}/${P}-build.patch"
+)
+
+pkg_setup() {
+ export LIBDIR=${PREFIX}/$(get_libdir)
+ export CFLAGS_EXTRA="${CFLAGS}"
+ export LDFLAGS_EXTRA="${LDFLAGS}"
+ export PREFIX=/usr
+ unset CFLAGS
+ unset LDFLAGS
+}
+
+src_compile() {
+ emake \
+ CC=$(tc-getCC)
+}
diff --git a/app-crypt/libscrypt/metadata.xml b/app-crypt/libscrypt/metadata.xml
new file mode 100644
index 000000000000..576146f2c144
--- /dev/null
+++ b/app-crypt/libscrypt/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>blueness@gentoo.org</email>
+ <name>Anthony G. Basile</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">technion/libscrypt</remote-id>
+ </upstream>
+</pkgmetadata>