pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
signify: allow building on Solaris.
Module Name: pkgsrc-wip
Committed By: Paolo Vincenzo Olivo <vms%retrobsd.ddns.net@localhost>
Pushed By: vms
Date: Sun Jul 3 17:40:36 2022 +0200
Changeset: c138ee70e19b9936ecaa7db3ecf29c7e458daa34
Modified Files:
signify/Makefile
signify/distinfo
signify/patches/patch-Makefile
Added Files:
signify/files/minmax.h
signify/patches/patch-src_liboutils_sha2.c
Log Message:
signify: allow building on Solaris.
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=c138ee70e19b9936ecaa7db3ecf29c7e458daa34
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
signify/Makefile | 27 ++++++++++++++++++------
signify/distinfo | 3 ++-
signify/files/minmax.h | 10 +++++++++
signify/patches/patch-Makefile | 19 ++++++++++++++---
signify/patches/patch-src_liboutils_sha2.c | 34 ++++++++++++++++++++++++++++++
5 files changed, 82 insertions(+), 11 deletions(-)
diffs:
diff --git a/signify/Makefile b/signify/Makefile
index 66f1815c81..d31d00e501 100644
--- a/signify/Makefile
+++ b/signify/Makefile
@@ -15,24 +15,37 @@ LICENSE= original-bsd AND modified-bsd AND isc AND public-domain
USE_TOOLS+= gmake
MAKEFLAGS+= ALL=src/usr.bin/signify/signify
+INSTALLATION_DIRS= bin ${PKGMANDIR}/man1
+MAKE_DIRS+= ${PKG_SYSCONFDIR}/signify
+
+WRKSRC= ${WRKDIR}/${DISTNAME}
+OUTDIR= ${WRKSRC}/src/usr.bin/signify
+LIBSRCDIR= ${WRKSRC}/src/liboutils
+
+.include "../../mk/bsd.prefs.mk"
+
SUBST_CLASSES+= paths
SUBST_STAGE.paths= pre-configure
SUBST_FILES.paths+= ${OUTDIR}/signify.c
SUBST_FILES.paths+= ${OUTDIR}/signify.1
SUBST_SED.paths= -e 's|/etc/signify|${PKG_SYSCONFDIR}/signify|g'
-WRKSRC= ${WRKDIR}/${DISTNAME}
-OUTDIR= ${WRKSRC}/src/usr.bin/signify
-
-INSTALLATION_DIRS= bin ${PKGMANDIR}/man1
-MAKE_DIRS+= ${PKG_SYSCONFDIR}/signify
-
-.include "../../mk/bsd.prefs.mk"
+.if ${OPSYS} == "SunOS"
+SUBST_CLASSES+= ints
+SUBST_STAGE.ints= pre-configure
+SUBST_FILES.ints+= ${LIBSRCDIR}/*.c
+SUBST_FILES.ints+= ${LIBSRCDIR}/include/*.h
+SUBST_SED.ints= -e 's|u_int|uint|g'
+.endif
post-patch:
.if ${OPSYS} == "NetBSD"
# The sys/* overrides are not needed on NetSD
${RM} ${WRKSRC}/src/liboutils/include/sys/*
+
+.elif ${OPSYS} == "SunOS"
+# Solaris lacks MIN/MAX macros in sys/params.h
+ ${CP} ${FILESDIR}/minmax.h ${LIBSRCDIR}
.endif
do-install:
diff --git a/signify/distinfo b/signify/distinfo
index c74ef42b13..a92abe4c95 100644
--- a/signify/distinfo
+++ b/signify/distinfo
@@ -3,4 +3,5 @@ $NetBSD$
BLAKE2s (outils-0.10.tar.gz) = dd72f25dae8d5f6a742371ffcc7c8275f690a0e25eff5f85010067797823ecc8
SHA512 (outils-0.10.tar.gz) = 58ba7854e7c96ba73ba984d6a33c1972640f6657d1fc138bc78a7eb29e5d7e7321386837183455631dbddda87ae2f40438e6891a5560685faf7530bed1e73031
Size (outils-0.10.tar.gz) = 280502 bytes
-SHA1 (patch-Makefile) = f4d399a31884f65590c90e508f1ebd32f3e885fd
+SHA1 (patch-Makefile) = 03764a51ba29f703cda88a74b81bd600762124f4
+SHA1 (patch-src_liboutils_sha2.c) = 03182d6019efd9d60ff05eee9cef8de53632caa8
diff --git a/signify/files/minmax.h b/signify/files/minmax.h
new file mode 100644
index 0000000000..cd9d2e7d07
--- /dev/null
+++ b/signify/files/minmax.h
@@ -0,0 +1,10 @@
+/* MAX(a,b) returns the maximum of A and B. */
+#ifndef MAX
+# define MAX(a,b) ((a) > (b) ? (a) : (b))
+#endif
+
+/* MIN(a,b) returns the minimum of A and B. */
+#ifndef MIN
+# define MIN(a,b) ((a) < (b) ? (a) : (b))
+#endif
+
diff --git a/signify/patches/patch-Makefile b/signify/patches/patch-Makefile
index a1e128333a..f142f7c010 100644
--- a/signify/patches/patch-Makefile
+++ b/signify/patches/patch-Makefile
@@ -1,7 +1,7 @@
$NetBSD$
Do not build compatibility for functions
-already supported by NetBSD.
+already supported on GNU/Linux systems.
--- Makefile.orig 2021-10-14 15:34:52.000000000 +0000
+++ Makefile
@@ -13,15 +13,28 @@ already supported by NetBSD.
ALL=src/usr.bin/apply/apply src/usr.bin/jot/jot src/usr.bin/lam/lam src/usr.bin/lndir/lndir src/bin/md5/md5 src/usr.bin/rs/rs src/usr.bin/signify/signify src/usr.bin/calendar/calendar src/usr.bin/vis/vis src/usr.bin/unvis/unvis src/usr.bin/what/what src/usr.sbin/rdate/rdate
all: $(ALL)
-@@ -21,7 +22,11 @@ src/bin/md5/md5: src/bin/md5/md5.o src/b
+@@ -21,8 +22,24 @@ src/bin/md5/md5: src/bin/md5/md5.o src/b
src/usr.bin/rs/rs: src/usr.bin/rs/rs.o src/usr.bin/rs/utf8.o src/liboutils/pledge.o src/liboutils/strtonum.o src/liboutils/reallocarray.o
+ifeq ($(UNAME_S),NetBSD)
++
+src/usr.bin/signify/signify: src/usr.bin/signify/signify.o src/usr.bin/signify/crypto_api.o src/usr.bin/signify/fe25519.o src/usr.bin/signify/mod_ed25519.o src/usr.bin/signify/mod_ge25519.o src/usr.bin/signify/sc25519.o src/usr.bin/signify/zsig.o src/liboutils/pledge.o src/liboutils/explicit_bzero.o src/liboutils/ohash.o src/liboutils/readpassphrase.o src/liboutils/sha2.o src/liboutils/sha256hl.o src/liboutils/sha512_256hl.o src/liboutils/sha512hl.o src/liboutils/timingsafe_bcmp.o src/liboutils/bcrypt_pbkdf.o src/liboutils/blowfish.o src/liboutils/freezero.o
++
++else ifeq ($(UNAME_S),SunOS)
++
++CPPFLAGS+=-include src/liboutils/minmax.h
++
++LIBS=-lrt -lresolv -lm
++
++src/usr.bin/signify/signify: src/usr.bin/signify/signify.o src/usr.bin/signify/crypto_api.o src/usr.bin/signify/fe25519.o src/usr.bin/signify/mod_ed25519.o src/usr.bin/signify/mod_ge25519.o src/usr.bin/signify/sc25519.o src/usr.bin/signify/zsig.o src/liboutils/pledge.o src/liboutils/ohash.o src/liboutils/readpassphrase.o src/liboutils/sha2.o src/liboutils/sha256hl.o src/liboutils/sha512_256hl.o src/liboutils/sha512hl.o src/liboutils/timingsafe_bcmp.o src/liboutils/bcrypt_pbkdf.o src/liboutils/blowfish.o
++
+else
++
src/usr.bin/signify/signify: src/usr.bin/signify/signify.o src/usr.bin/signify/crypto_api.o src/usr.bin/signify/fe25519.o src/usr.bin/signify/mod_ed25519.o src/usr.bin/signify/mod_ge25519.o src/usr.bin/signify/sc25519.o src/usr.bin/signify/zsig.o src/liboutils/pledge.o src/liboutils/strlcpy.o src/liboutils/base64.o src/liboutils/explicit_bzero.o src/liboutils/ohash.o src/liboutils/arc4random.o src/liboutils/getentropy_linux.o src/liboutils/readpassphrase.o src/liboutils/sha2.o src/liboutils/sha256hl.o src/liboutils/sha512_256hl.o src/liboutils/sha512hl.o src/liboutils/timingsafe_bcmp.o src/liboutils/bcrypt_pbkdf.o src/liboutils/blowfish.o src/liboutils/freezero.o
-+endif
++endif
++
src/usr.bin/calendar/calendar: src/usr.bin/calendar/calendar.o src/usr.bin/calendar/day.o src/usr.bin/calendar/io.o src/usr.bin/calendar/ostern.o src/usr.bin/calendar/paskha.o src/usr.bin/calendar/pesach.o src/liboutils/arc4random_uniform.o src/liboutils/arc4random.o src/liboutils/getentropy_linux.o src/liboutils/explicit_bzero.o src/liboutils/pledge.o src/liboutils/sha2.o src/liboutils/strtonum.o
+ src/usr.bin/vis/vis: src/usr.bin/vis/vis.o src/usr.bin/vis/foldit.o src/liboutils/pledge.o src/liboutils/strtonum.o src/liboutils/vis.o
diff --git a/signify/patches/patch-src_liboutils_sha2.c b/signify/patches/patch-src_liboutils_sha2.c
new file mode 100644
index 0000000000..b8067401ac
--- /dev/null
+++ b/signify/patches/patch-src_liboutils_sha2.c
@@ -0,0 +1,34 @@
+$NetBSD$
+
+Portability fix for SunOS.
+
+--- src/liboutils/sha2.c.orig 2021-10-14 15:34:52.000000000 +0000
++++ src/liboutils/sha2.c
+@@ -58,6 +58,27 @@
+ #endif
+ #endif
+
++/*
++ * Must define BYTE_ORDER on SunOS
++ * since it lacks endian.h
++ *
++ */
++
++#if defined(__sun)
++#include <sys/byteorder.h>
++#define bswap_16(x) BSWAP_16(x)
++#define bswap_32(x) BSWAP_32(x)
++#define bswap_64(x) BSWAP_64(x)
++#define LITTLE_ENDIAN 1234
++#define BIG_ENDIAN 4321
++#ifdef LITTLE_ENDIAN
++#define BYTE_ORDER LITTLE_ENDIAN
++#else
++#define BYTE_ORDER BIG_ENDIAN
++#endif
++#endif
++
++
+ /*** SHA-224/256/384/512 Machine Architecture Definitions *****************/
+ /*
+ * BYTE_ORDER NOTE:
Home |
Main Index |
Thread Index |
Old Index