pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

nettle: add package for v4 for testing



Module Name:	pkgsrc-wip
Committed By:	Thomas Klausner <wiz%NetBSD.org@localhost>
Pushed By:	wiz
Date:		Fri Feb 6 15:47:31 2026 +0100
Changeset:	f45e0c0797eff84318f585f3cdfb7d818bead485

Modified Files:
	Makefile
Added Files:
	nettle/DESCR
	nettle/Makefile
	nettle/PLIST
	nettle/buildlink3.mk
	nettle/distinfo
	nettle/patches/patch-Makefile.in
	nettle/patches/patch-config.make.in
	nettle/patches/patch-configure
	nettle/patches/patch-testsuite_Makefile.in
	nettle/patches/patch-tools_Makefile.in

Log Message:
nettle: add package for v4 for testing

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=f45e0c0797eff84318f585f3cdfb7d818bead485

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 Makefile                                   |  1 +
 nettle/DESCR                               | 23 +++++++++
 nettle/Makefile                            | 35 +++++++++++++
 nettle/PLIST                               | 81 ++++++++++++++++++++++++++++++
 nettle/buildlink3.mk                       | 16 ++++++
 nettle/distinfo                            | 10 ++++
 nettle/patches/patch-Makefile.in           | 59 ++++++++++++++++++++++
 nettle/patches/patch-config.make.in        | 17 +++++++
 nettle/patches/patch-configure             | 24 +++++++++
 nettle/patches/patch-testsuite_Makefile.in | 17 +++++++
 nettle/patches/patch-tools_Makefile.in     | 15 ++++++
 11 files changed, 298 insertions(+)

diffs:
diff --git a/Makefile b/Makefile
index 9a43527923..bf0362a70a 100644
--- a/Makefile
+++ b/Makefile
@@ -2615,6 +2615,7 @@ SUBDIR+=	netlogo
 SUBDIR+=	netmask
 SUBDIR+=	netquery-git
 SUBDIR+=	netrik
+SUBDIR+=	nettle
 SUBDIR+=	netwib
 SUBDIR+=	netwmpager
 SUBDIR+=	netwox
diff --git a/nettle/DESCR b/nettle/DESCR
new file mode 100644
index 0000000000..4e96fca776
--- /dev/null
+++ b/nettle/DESCR
@@ -0,0 +1,23 @@
+Nettle is a cryptographic library that is designed to fit easily in more
+or less any context: In crypto toolkits for object-oriented languages
+(C++, Python, Pike, ...), in applications like LSH or GNUPG, or even in
+kernel space. In most contexts, you need more than the basic
+cryptographic algorithms, you also need some way to keep track of available
+algorithms, their properties and variants. You often have some algorithm
+selection process, often dictated by a protocol you want to implement.
+
+And as the requirements of applications differ in subtle and not so
+subtle ways, an API that fits one application well can be a pain to use
+in a different context. And that is why there are so many different
+cryptographic libraries around.
+
+Nettle tries to avoid this problem by doing one thing, the low-level
+crypto stuff, and providing a simple but general interface to it.
+In particular, Nettle doesn't do algorithm selection. It doesn't do
+memory allocation. It doesn't do any I/O.
+
+The idea is that one can build several application and context specific
+interfaces on top of Nettle, and share the code, test cases, benchmarks,
+documentation, etc. Examples are the Nettle module for the Pike
+language, and LSH, which both use an object-oriented abstraction on top
+of the library.
diff --git a/nettle/Makefile b/nettle/Makefile
new file mode 100644
index 0000000000..8549102ae0
--- /dev/null
+++ b/nettle/Makefile
@@ -0,0 +1,35 @@
+# $NetBSD: Makefile,v 1.35 2026/02/06 10:02:02 wiz Exp $
+
+DISTNAME=	nettle-4.0
+CATEGORIES=	security
+MASTER_SITES=	http://www.lysator.liu.se/~nisse/archive/
+MASTER_SITES+=	ftp://ftp.lysator.liu.se/pub/security/lsh/
+
+MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=	https://www.lysator.liu.se/~nisse/nettle/
+COMMENT=	Cryptographic library
+LICENSE=	gnu-lgpl-v2.1
+
+USE_CC_FEATURES=	c99 # and alignas/alignof from C11
+USE_LANGUAGES=		c
+USE_LIBTOOL=		yes
+USE_TOOLS+=		gm4 gmake
+GNU_CONFIGURE=		yes
+SET_LIBDIR=		yes
+CONFIGURE_ARGS+=	--disable-openssl
+CONFIGURE_ARGS+=	--disable-shared
+
+.include "../../mk/bsd.prefs.mk"
+
+.if ${USE_CROSS_COMPILE:U:tl} == yes
+CONFIGURE_ENV+=		CC_FOR_BUILD=${NATIVE_CC:Q}
+.endif
+
+INFO_FILES=		yes
+TEST_TARGET=		check
+PKGCONFIG_OVERRIDE=	hogweed.pc.in
+PKGCONFIG_OVERRIDE+=	nettle.pc.in
+
+BUILDLINK_API_DEPENDS.gmp+=	gmp>=6.0
+.include "../../devel/gmp/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/nettle/PLIST b/nettle/PLIST
new file mode 100644
index 0000000000..c9af94e56d
--- /dev/null
+++ b/nettle/PLIST
@@ -0,0 +1,81 @@
+@comment $NetBSD: PLIST,v 1.15 2026/02/06 10:02:02 wiz Exp $
+bin/nettle-hash
+bin/nettle-lfib-stream
+bin/nettle-pbkdf2
+bin/pkcs1-conv
+bin/sexp-conv
+include/nettle/aes.h
+include/nettle/arcfour.h
+include/nettle/arctwo.h
+include/nettle/asn1.h
+include/nettle/balloon.h
+include/nettle/base16.h
+include/nettle/base64.h
+include/nettle/bignum.h
+include/nettle/blowfish.h
+include/nettle/buffer.h
+include/nettle/camellia.h
+include/nettle/cast128.h
+include/nettle/cbc.h
+include/nettle/ccm.h
+include/nettle/cfb.h
+include/nettle/chacha-poly1305.h
+include/nettle/chacha.h
+include/nettle/cmac.h
+include/nettle/ctr.h
+include/nettle/curve25519.h
+include/nettle/curve448.h
+include/nettle/des.h
+include/nettle/drbg-ctr.h
+include/nettle/dsa.h
+include/nettle/eax.h
+include/nettle/ecc-curve.h
+include/nettle/ecc.h
+include/nettle/ecdsa.h
+include/nettle/eddsa.h
+include/nettle/gcm.h
+include/nettle/gostdsa.h
+include/nettle/gosthash94.h
+include/nettle/hkdf.h
+include/nettle/hmac.h
+include/nettle/knuth-lfib.h
+include/nettle/macros.h
+include/nettle/md2.h
+include/nettle/md4.h
+include/nettle/md5.h
+include/nettle/memops.h
+include/nettle/memxor.h
+include/nettle/nettle-meta.h
+include/nettle/nettle-types.h
+include/nettle/nist-keywrap.h
+include/nettle/ocb.h
+include/nettle/pbkdf2.h
+include/nettle/pkcs1.h
+include/nettle/poly1305.h
+include/nettle/pss-mgf1.h
+include/nettle/pss.h
+include/nettle/realloc.h
+include/nettle/ripemd160.h
+include/nettle/rsa.h
+include/nettle/salsa20.h
+include/nettle/serpent.h
+include/nettle/sexp.h
+include/nettle/sha1.h
+include/nettle/sha2.h
+include/nettle/sha3.h
+include/nettle/siv-cmac.h
+include/nettle/siv-gcm.h
+include/nettle/slh-dsa.h
+include/nettle/sm3.h
+include/nettle/sm4.h
+include/nettle/streebog.h
+include/nettle/twofish.h
+include/nettle/umac.h
+include/nettle/version.h
+include/nettle/xts.h
+include/nettle/yarrow.h
+info/nettle.info
+lib/libhogweed.la
+lib/libnettle.la
+lib/pkgconfig/hogweed.pc
+lib/pkgconfig/nettle.pc
diff --git a/nettle/buildlink3.mk b/nettle/buildlink3.mk
new file mode 100644
index 0000000000..fb7e709a96
--- /dev/null
+++ b/nettle/buildlink3.mk
@@ -0,0 +1,16 @@
+# $NetBSD: buildlink3.mk,v 1.10 2026/02/06 10:04:11 wiz Exp $
+
+BUILDLINK_TREE+=	nettle
+
+.if !defined(NETTLE_BUILDLINK3_MK)
+NETTLE_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.nettle+=	nettle>=2.4
+BUILDLINK_ABI_DEPENDS.nettle+=	nettle>=4.0
+BUILDLINK_PKGSRCDIR.nettle?=	../../security/nettle
+
+BUILDLINK_API_DEPENDS.gmp+=	gmp>=6.0
+.include "../../devel/gmp/buildlink3.mk"
+.endif # NETTLE_BUILDLINK3_MK
+
+BUILDLINK_TREE+=	-nettle
diff --git a/nettle/distinfo b/nettle/distinfo
new file mode 100644
index 0000000000..b25c35d473
--- /dev/null
+++ b/nettle/distinfo
@@ -0,0 +1,10 @@
+$NetBSD: distinfo,v 1.32 2026/02/06 10:02:02 wiz Exp $
+
+BLAKE2s (nettle-4.0.tar.gz) = ffef23783302e27718f7d9a279f936cfa826a8d8a06bca8c16a3cd56ed2fb8e3
+SHA512 (nettle-4.0.tar.gz) = 833303d94f5a67094011ad4dd931fffdb9adf679b4df241a544a08194a66e6e449398b704ba5b29d52c1c3b5ada6f6dc18b24d1adb3382a68470a11645bf13cd
+Size (nettle-4.0.tar.gz) = 2630735 bytes
+SHA1 (patch-Makefile.in) = 50b24e265e35b58228c897e8ea8381ea8ff6efc4
+SHA1 (patch-config.make.in) = 708fb3cac9c44825e0d231541cbecade2239c850
+SHA1 (patch-configure) = c05cec552acae0340fa017e433a2cc436a4e86a2
+SHA1 (patch-testsuite_Makefile.in) = 23cc958d5b4bc5c3822848ce0e4be5e7f13d2ffc
+SHA1 (patch-tools_Makefile.in) = 743d09935526cb783fe93ffc417c4153e13dcfac
diff --git a/nettle/patches/patch-Makefile.in b/nettle/patches/patch-Makefile.in
new file mode 100644
index 0000000000..1a6c03b205
--- /dev/null
+++ b/nettle/patches/patch-Makefile.in
@@ -0,0 +1,59 @@
+$NetBSD: patch-Makefile.in,v 1.12 2026/02/06 10:02:02 wiz Exp $
+
+Use LIBTOOL.
+
+--- Makefile.in.orig	2026-02-05 19:18:44.000000000 +0000
++++ Makefile.in
+@@ -27,7 +27,7 @@ EXTRA_CFLAGS = $(CCPIC)
+ PRE_CPPFLAGS = -I. -I$(srcdir)
+ EXTRA_CFLAGS = $(CCPIC)
+ 
+-LIBTARGETS = @IF_STATIC@ libnettle.a @IF_HOGWEED@ libhogweed.a
++LIBTARGETS = @IF_STATIC@ libnettle.la @IF_HOGWEED@ libhogweed.la
+ SHLIBTARGETS = @IF_SHARED@ $(LIBNETTLE_FORLINK) @IF_HOGWEED@ $(LIBHOGWEED_FORLINK)
+ 
+ gnulib_FILES = lib/getopt-core.h lib/getopt-ext.h \
+@@ -302,24 +302,24 @@ hogweed_OBJS = $(hogweed_SOURCES:.c=.$(OBJEXT)) \
+ hogweed_OBJS = $(hogweed_SOURCES:.c=.$(OBJEXT)) \
+ 	       $(OPT_HOGWEED_OBJS) @IF_MINI_GMP@ mini-gmp.$(OBJEXT)
+ 
+-libnettle.a: $(nettle_OBJS)
+-	-rm -f $@
+-	$(AR) $(ARFLAGS) $@ $(nettle_OBJS)
+-	$(RANLIB) $@
++libnettle.la: $(nettle_OBJS)
++	${LIBTOOL} --mode=link ${CC} ${LDFLAGS} -o libnettle.la \
++		${nettle_OBJS:.o=.lo} -rpath ${PREFIX}/lib \
++		-version-info ${LIBNETTLE_MAJOR}:${LIBNETTLE_MINOR}
+ 	echo nettle > libnettle.stamp
+ 
+-libhogweed.a: $(hogweed_OBJS)
+-	-rm -f $@
+-	$(AR) $(ARFLAGS) $@ $(hogweed_OBJS)
+-	$(RANLIB) $@
++libhogweed.la: $(hogweed_OBJS)
++	${LIBTOOL} --mode=link ${CC} ${LDFLAGS} -o libhogweed.la \
++		${hogweed_OBJS:.o=.lo} -rpath ${PREFIX}/lib \
++		-version-info ${LIBHOGWEED_MAJOR}:${LIBHOGWEED_MINOR}
+ 	echo hogweed > libhogweed.stamp
+ 
+ %.$(OBJEXT): %.asm $(srcdir)/m4-utils.m4 $(srcdir)/asm.m4 config.m4 machine.m4
+ 	$(M4) $(srcdir)/m4-utils.m4 $(srcdir)/asm.m4 config.m4 machine.m4 $< >$*.s
+-	$(COMPILE) $(ASM_FLAGS) -c $*.s
++	${LIBTOOL} --mode=compile $(COMPILE) -c $*.s
+ 
+ %.$(OBJEXT): %.c
+-	$(COMPILE) -c $< \
++	${LIBTOOL} --mode=compile $(COMPILE) -c $< \
+ 	&& $(DEP_PROCESS)
+ 
+ # Rules building shared libraries.
+@@ -510,7 +510,7 @@ install-static: $(LIBTARGETS)
+ install-static: $(LIBTARGETS)
+ 	$(MKDIR_P) $(DESTDIR)$(libdir)
+ 	for f in $(LIBTARGETS); do \
+-	  $(INSTALL_DATA) $$f $(DESTDIR)$(libdir) ; \
++	  ${LIBTOOL} --mode=install ${BSD_INSTALL_LIB} $$f $(DESTDIR)$(libdir) ; \
+ 	done
+ 
+ install-dll-nettle:
diff --git a/nettle/patches/patch-config.make.in b/nettle/patches/patch-config.make.in
new file mode 100644
index 0000000000..a42fae6a83
--- /dev/null
+++ b/nettle/patches/patch-config.make.in
@@ -0,0 +1,17 @@
+$NetBSD: patch-config.make.in,v 1.3 2015/08/23 14:22:10 wiz Exp $
+
+Use LIBTOOL.
+
+--- config.make.in.orig	2015-04-24 17:22:03.000000000 +0000
++++ config.make.in
+@@ -70,8 +70,8 @@ infodir =	@infodir@
+ 
+ COMPILE = $(CC) $(PRE_CPPFLAGS) $(CPPFLAGS) $(DEFS) $(CFLAGS) $(EXTRA_CFLAGS) $(DEP_FLAGS)
+ COMPILE_CXX = $(CXX) $(PRE_CPPFLAGS) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) $(DEP_FLAGS)
+-LINK = $(CC) $(CFLAGS) $(PRE_LDFLAGS) $(LDFLAGS)
+-LINK_CXX = $(CXX) $(CXXFLAGS) $(PRE_LDFLAGS) $(LDFLAGS)
++LINK = ${LIBTOOL} --mode=link $(CC) $(CFLAGS) $(PRE_LDFLAGS) $(LDFLAGS)
++LINK_CXX = ${LIBTOOL} --mode=link $(CXX) $(CXXFLAGS) $(PRE_LDFLAGS) $(LDFLAGS)
+ 
+ # Default rule. Must be here, since config.make is included before the
+ # usual targets.
diff --git a/nettle/patches/patch-configure b/nettle/patches/patch-configure
new file mode 100644
index 0000000000..def165f932
--- /dev/null
+++ b/nettle/patches/patch-configure
@@ -0,0 +1,24 @@
+$NetBSD: patch-configure,v 1.2 2024/12/31 17:42:57 adam Exp $
+
+Support NetBSD.
+Portability fix.
+
+--- configure.orig	2013-05-28 16:21:53.000000000 +0200
++++ configure	2013-11-26 10:12:32.000000000 +0100
+@@ -4903,6 +4903,7 @@
+ 	solaris*)	CCPIC="-fPIC" ;;
+ 	cygwin*)	CCPIC="" ;;
+ 	mingw32*)	CCPIC="" ;;
++	*netbsd*)	CCPIC="-fPIC" ;;
+ 	*)		CCPIC="-fpic" ;;
+       esac
+     else
+@@ -7187,7 +7188,7 @@
+     enable_documentation=yes
+ 
+   else
+-    if test "x$enable_documentation" == "xauto" ; then
++    if test "x$enable_documentation" = "xauto" ; then
+       enable_documentation=no
+     else
+       as_fn_error $? "Cannot find 'makeinfo', required for documentation." "$LINENO" 5
diff --git a/nettle/patches/patch-testsuite_Makefile.in b/nettle/patches/patch-testsuite_Makefile.in
new file mode 100644
index 0000000000..989bfc34f4
--- /dev/null
+++ b/nettle/patches/patch-testsuite_Makefile.in
@@ -0,0 +1,17 @@
+$NetBSD: patch-testsuite_Makefile.in,v 1.7 2024/06/18 10:45:53 adam Exp $
+
+Use LIBTOOL.
+
+--- testsuite/Makefile.in.orig	2024-06-16 15:27:54.000000000 +0000
++++ testsuite/Makefile.in
+@@ -108,8 +108,8 @@ all: $(EXTRA_TARGETS)
+ # explicit rule for each and every executable.
+ 
+ TEST_OBJS = testutils.$(OBJEXT) ../non-nettle.$(OBJEXT)
+-LIB_HOGWEED = @IF_HOGWEED@ -lhogweed
+-TEST_LIBS = $(LIB_HOGWEED) -lnettle $(LIBS)
++LIB_HOGWEED = @IF_HOGWEED@ ../libhogweed.la
++TEST_LIBS = $(LIB_HOGWEED) ../libnettle.la $(LIBS)
+ 
+ ../non-nettle.$(OBJEXT):
+ 	( cd .. && $(MAKE) non-nettle.$(OBJEXT) )
diff --git a/nettle/patches/patch-tools_Makefile.in b/nettle/patches/patch-tools_Makefile.in
new file mode 100644
index 0000000000..ee3561c5a3
--- /dev/null
+++ b/nettle/patches/patch-tools_Makefile.in
@@ -0,0 +1,15 @@
+$NetBSD: patch-tools_Makefile.in,v 1.4 2015/08/23 14:22:10 wiz Exp $
+
+Use LIBTOOL.
+
+--- tools/Makefile.in.orig	2014-06-07 06:15:01.000000000 +0000
++++ tools/Makefile.in
+@@ -75,7 +75,7 @@ check:
+ install: $(TARGETS)
+ 	$(MKDIR_P) $(DESTDIR)$(bindir)
+ 	for f in $(TARGETS) ; do \
+-	  $(INSTALL_PROGRAM) $$f $(DESTDIR)$(bindir) ; \
++	  ${LIBTOOL} --mode=install $(INSTALL_PROGRAM) $$f $(DESTDIR)$(bindir) ; \
+ 	done
+ 
+ uninstall:


Home | Main Index | Thread Index | Old Index