This commit is contained in:
Mario Fetka
2024-06-18 10:44:56 +02:00
parent 6a37474503
commit 20ef8b5c88
95 changed files with 4227 additions and 99 deletions

View File

@@ -0,0 +1,130 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI=5
PYTHON_COMPAT=( python2_7 python3_{4,5} pypy )
DISTUTILS_OPTIONAL=1
inherit distutils-r1 eutils flag-o-matic multilib toolchain-funcs versionator
MY_PV="${PV//.}"
DESCRIPTION="Powerful security toolkit for adding encryption to software"
HOMEPAGE="http://www.cs.auckland.ac.nz/~pgut001/cryptlib/"
DOC_PREFIX="${PN}-$(get_version_component_range 1-2 ${PV}).0"
SRC_URI="ftp://ftp.franken.de/pub/crypt/cryptlib/cl${MY_PV}.zip
doc? ( mirror://gentoo/${DOC_PREFIX}-manual.pdf.bz2 )"
LICENSE="Sleepycat"
KEYWORDS="~amd64 ~x86"
SLOT="0"
IUSE="doc ldap odbc python"
S="${WORKDIR}"
RDEPEND="sys-libs/zlib
ldap? ( net-nds/openldap )
odbc? ( dev-db/unixODBC )
python? ( ${PYTHON_DEPS} )"
DEPEND="${RDEPEND}
app-arch/unzip"
src_unpack() {
# we need the -a option, so we can not use 'unpack'
unzip -qoa "${DISTDIR}/cl${MY_PV}.zip" || die
use doc && unpack "${DOC_PREFIX}-manual.pdf.bz2"
}
wrap_python() {
if use python; then
cd bindings || die
distutils-r1_${1}
fi
}
src_prepare() {
rm -fr zlib || die
# we want our own CFLAGS ;-)
sed -i -e "s:-m.*=pentium::g" -e "s:-fomit-frame-pointer::g" -e "s:-O2::g" \
-e "s:-O3::g" -e "s:-O4::g" makefile || die "sed makefile failed"
sed -i -e "s/-march=[[:alnum:]\.=-]*//g" -e "s/-mcpu=[[:alnum:]\.=-]*//g" \
-e "s:-O2::g" -e "s:-O3::g" tools/ccopts.sh || die "sed tools/ccopts.sh failed"
# change 'make' to '$(MAKE)'
sed -i -e "s:@\?make:\$(MAKE):g" makefile || die "sed makefile failed"
# NOTICE:
# Because of stack execution
# assembly parts are disabled.
sed -i -e 's:i\[3,4,5,6\]86:___:g' makefile || die "sed makefile failed"
# Fix version number of shared library.
sed -i -e 's/PLV="2"/PLV="3"/' tools/buildall.sh || die "sed tools/buildall.sh failed"
# Respect LDFLAGS and fix soname and strip issues.
epatch "${FILESDIR}/${P}-build.patch"
# Use external zlib.
epatch "${FILESDIR}/${P}-zlib.patch"
wrap_python ${FUNCNAME}
}
src_compile() {
local libname="libcl.so.${PV}"
# At least -O2 is needed.
replace-flags -O -O2
replace-flags -O0 -O2
replace-flags -O1 -O2
replace-flags -Os -O2
is-flagq -O* || append-flags -O2
append-flags "-fPIC -D__UNIX__ -DOSVERSION=2 -DNDEBUG -I."
if [ -f /usr/include/pthread.h -a \
`grep -c PTHREAD_MUTEX_RECURSIVE /usr/include/pthread.h` -ge 0 ] ; then
append-flags "-DHAS_RECURSIVE_MUTEX"
fi
if [ -f /usr/include/pthread.h -a \
`grep -c PTHREAD_MUTEX_ROBUST /usr/include/pthread.h` -ge 0 ] ; then
append-flags "-DHAS_ROBUST_MUTEX"
fi
use ldap && append-flags -DHAS_LDAP
use odbc && append-flags -DHAS_ODBC
emake directories
emake toolscripts
emake CC="$(tc-getCC)" CFLAGS="${CFLAGS} -c" STRIP=true Linux
emake TARGET=${libname} OBJPATH="./shared-obj/" CC="$(tc-getCC)" \
CFLAGS="${CFLAGS} -c" STRIP=true Linux
if use python; then
#ln -s libcl.so.${PV} libcl.so || die
# Python bindings don't work with -O2 and higher.
replace-flags -O* -O1
wrap_python ${FUNCNAME}
fi
}
src_install() {
dolib.so "libcl.so.${PV}"
dosym "libcl.so.${PV}" "/usr/$(get_libdir)/libcl.so"
dolib.a "libcl.a"
doheader cryptlib.h
dodoc README
if use doc; then
newdoc "${DOC_PREFIX}-manual.pdf" "manual.pdf"
fi
wrap_python ${FUNCNAME}
}

View File

@@ -0,0 +1,54 @@
From 58d3e56f59e0e8d48d913c217929b35e9366e829 Mon Sep 17 00:00:00 2001
From: Alon Bar-Lev <alon.barlev@gmail.com>
Date: Sat, 11 Jun 2016 15:07:12 +0300
Subject: [PATCH] build: so: support LDFLAGS and SONAME
Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
---
tools/buildsharedlib.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/buildsharedlib.sh b/tools/buildsharedlib.sh
index f1277a7..59c4713 100644
--- a/tools/buildsharedlib.sh
+++ b/tools/buildsharedlib.sh
@@ -131,9 +131,9 @@ case $OSNAME in
*)
if [ `$LD -v 2>&1 | grep -c gcc` -gt 0 -a \
`gcc -Wl,-Bsymbolic 2>&1 | grep -c unrecognized` = 0 ] ; then
- $LD -shared -Wl,-Bsymbolic -o $LIBNAME `cat $LINKFILE` `./tools/getlibs.sh autodetect` ;
+ $LD -shared $LDFLAGS -Wl,-soname,$LIBNAME -Wl,-Bsymbolic -o $LIBNAME `cat $LINKFILE` `./tools/getlibs.sh autodetect` ;
else
- $LD -shared -o $LIBNAME `cat $LINKFILE` `./tools/getlibs.sh autodetect` ;
+ $LD -shared -shared $LDFLAGS -Wl,-soname,$LIBNAME -o $LIBNAME `cat $LINKFILE` `./tools/getlibs.sh autodetect` ;
fi
if [ `which objdump` -a `objdump -p $LIBNAME | grep -c TEXTREL` -gt '0' ] ; then
echo "Warning: Shared library still contains TEXTREL records." ;
--
2.7.3
From b11541f4beaf8395dd90de53b57933661e120b0a Mon Sep 17 00:00:00 2001
From: Dennis Schridde <devurandom@gmx.net>
Date: Sat, 11 Jun 2016 15:34:57 +0300
Subject: [PATCH] build: ignore DL_EXPORT on non windows
Signed-off-by: Dennis Schridde <devurandom@gmx.net>
---
cryptlib.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/cryptlib.h b/cryptlib.h
index 61cf338..4738852 100644
--- a/cryptlib.h
+++ b/cryptlib.h
@@ -122,6 +122,7 @@
#define C_CHR char
#define C_STR C_CHR *
#define C_RET int
+ #define DL_EXPORT(type) type
#endif /* Windows vs.everything else function types */
/* Symbolic defines to make it clearer how the function parameters behave */
--
2.7.3

View File

@@ -0,0 +1,55 @@
From 70b00d882e9ff1e17bb82b3e722def0b71f2374a Mon Sep 17 00:00:00 2001
From: Alon Bar-Lev <alon.barlev@gmail.com>
Date: Sat, 11 Jun 2016 15:15:25 +0300
Subject: [PATCH 2/2] build: use system zlib
this should be a toggle of build system not hard coded.
Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
---
envelope/envelope.h | 6 +-----
makefile | 4 ++--
2 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/envelope/envelope.h b/envelope/envelope.h
index 028f4b2..4ef6b20 100644
--- a/envelope/envelope.h
+++ b/envelope/envelope.h
@@ -17,11 +17,7 @@
#endif /* Compiler-specific includes */
#endif /* _STREAM_DEFINED */
#ifdef USE_COMPRESSION
- #if defined( INC_ALL )
- #include "zlib.h"
- #else
- #include "zlib/zlib.h"
- #endif /* Compiler-specific includes */
+ #include <zlib.h>
#endif /* USE_COMPRESSION */
/****************************************************************************
diff --git a/makefile b/makefile
index c762d02..24c180a 100644
--- a/makefile
+++ b/makefile
@@ -283,7 +283,7 @@ ZLIBOBJS = $(OBJPATH)adler32.o $(OBJPATH)deflate.o $(OBJPATH)inffast.o \
OBJS = $(BNOBJS) $(CERTOBJS) $(CRYPTOBJS) $(CTXOBJS) $(DEVOBJS) \
$(ENCDECOBJS) $(ENVOBJS) $(HASHOBJS) $(IOOBJS) $(KEYSETOBJS) \
$(KRNLOBJS) $(LIBOBJS) $(MECHOBJS) $(MISCOBJS) $(SESSOBJS) \
- $(ZLIBOBJS) $(OSOBJS)
+ $(OSOBJS)
# Object files for the self-test code
@@ -1483,7 +1483,7 @@ $(LIBNAME): $(OBJS) $(EXTRAOBJS) $(TESTOBJS)
$(SLIBNAME): $(OBJS) $(EXTRAOBJS) $(TESTOBJS)
@./tools/buildsharedlib.sh $(OSNAME) $(SLIBNAME) $(LD) \
- $(STRIP) $(OBJS) $(EXTRAOBJS)
+ $(STRIP) $(OBJS) $(EXTRAOBJS) -lz
$(DYLIBNAME): $(OBJS) $(EXTRAOBJS) $(TESTOBJS)
@$(LD) -dynamiclib -compatibility_version $(MAJ).$(MIN) \
--
2.7.3

2
dev-libs/plog/Manifest Normal file
View File

@@ -0,0 +1,2 @@
DIST plog-1.1.9.tar.gz 47444 BLAKE2B 2358f0186379f323d7d5ff56e684865af3b65012f2c34752be42f205298c82229f4d10870b60312de9b8dd47852d80a72a2e5ccb7b214a899401eb8048f72c2f SHA512 d979fdf0011ef9bb94a2271da5d17058dbab5bc47438a13769d084fdebe5e169e7c05a043d69acceb752896df7cdae4433f32bfbcc81e055dffd9c701be88003
EBUILD plog-1.1.9.ebuild 514 BLAKE2B a9712e1f69a58a1ff197d6cb3b74238018216ca5f629097ee308335ca29265a512702680359c469f940feda432b7207c649e887f7c1d053f1537b28ab7204823 SHA512 51641f5607f63b29495093910e938573a01c4d11119f59ebf9b7a6b2d839cefff274b766a13628dc65ebf71e0091d67d91e08c4dceb4989ebfceb04d62ff1f6e

View File

@@ -0,0 +1,25 @@
# Copyright 2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit cmake
DESCRIPTION="Portable, simple and extensible C++ logging library"
HOMEPAGE="https://github.com/SergiusTheBest/plog"
SRC_URI="https://github.com/SergiusTheBest/plog/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="MIT"
SLOT="0"
KEYWORDS="amd64 x86"
DEPEND=""
RDEPEND="${DEPEND}"
BDEPEND=""
src_configure() {
local mycmakeargs=(
-DPLOG_BUILD_SAMPLES=OFF
)
cmake_src_configure
}