Sun Nov 5 19:37:20 2023 UTC ()
openssl: Fix building on Mac OS X Tiger.


(nia)
diff -r1.293 -r1.294 pkgsrc/security/openssl/Makefile

cvs diff -r1.293 -r1.294 pkgsrc/security/openssl/Makefile (switch to unified diff)

--- pkgsrc/security/openssl/Makefile 2023/10/27 18:30:12 1.293
+++ pkgsrc/security/openssl/Makefile 2023/11/05 19:37:19 1.294
@@ -1,145 +1,151 @@ @@ -1,145 +1,151 @@
1# $NetBSD: Makefile,v 1.293 2023/10/27 18:30:12 jperkin Exp $ 1# $NetBSD: Makefile,v 1.294 2023/11/05 19:37:19 nia Exp $
2 2
3# Remember to upload-distfiles when updating OpenSSL -- otherwise it 3# Remember to upload-distfiles when updating OpenSSL -- otherwise it
4# is not possible for users who have bootstrapped without OpenSSL 4# is not possible for users who have bootstrapped without OpenSSL
5# to install it and enable HTTPS fetching. 5# to install it and enable HTTPS fetching.
6DISTNAME= openssl-3.1.4 6DISTNAME= openssl-3.1.4
7CATEGORIES= security 7CATEGORIES= security
8MASTER_SITES= https://www.openssl.org/source/ 8MASTER_SITES= https://www.openssl.org/source/
9 9
10MAINTAINER= pkgsrc-users@NetBSD.org 10MAINTAINER= pkgsrc-users@NetBSD.org
11HOMEPAGE= https://www.openssl.org/ 11HOMEPAGE= https://www.openssl.org/
12COMMENT= Secure Socket Layer and cryptographic library 12COMMENT= Secure Socket Layer and cryptographic library
13LICENSE= openssl 13LICENSE= openssl
14 14
15USE_GCC_RUNTIME= yes 15USE_GCC_RUNTIME= yes
16 16
17USE_TOOLS+= fgrep gmake perl 17USE_TOOLS+= fgrep gmake perl
18USE_TOOLS.SunOS+= gm4 18USE_TOOLS.SunOS+= gm4
19BUILD_TARGET= depend all 19BUILD_TARGET= depend all
20TEST_TARGET= test 20TEST_TARGET= test
21 21
22HAS_CONFIGURE= yes 22HAS_CONFIGURE= yes
23CONFIGURE_SCRIPT= ./config 23CONFIGURE_SCRIPT= ./config
24CONFIGURE_ARGS+= --prefix=${PREFIX} 24CONFIGURE_ARGS+= --prefix=${PREFIX}
25CONFIGURE_ARGS+= --libdir=${PREFIX}/lib 25CONFIGURE_ARGS+= --libdir=${PREFIX}/lib
26CONFIGURE_ARGS+= --openssldir=${PKG_SYSCONFDIR} 26CONFIGURE_ARGS+= --openssldir=${PKG_SYSCONFDIR}
27CONFIGURE_ARGS+= shared 27CONFIGURE_ARGS+= shared
28MAKE_FLAGS+= MANSUFFIX= 28MAKE_FLAGS+= MANSUFFIX=
29MAKE_FLAGS+= MANDIR=${PREFIX}/${PKGMANDIR} 29MAKE_FLAGS+= MANDIR=${PREFIX}/${PKGMANDIR}
30 30
31.include "../../mk/bsd.prefs.mk" 31.include "../../mk/bsd.prefs.mk"
32 32
33.if ${MACHINE_PLATFORM:MDarwin-[0-8].*-powerpc} 33.if ${MACHINE_PLATFORM:MDarwin-[0-8].*-powerpc}
34# No {get,make,set}context support before Darwin 9 34# No {get,make,set}context support before Darwin 9
35CONFIGURE_ARGS+= no-async 35CONFIGURE_ARGS+= no-async
36.endif 36.endif
37 37
 38.if ${OPSYS} == "Darwin" && ${OPSYS_VERSION} < 101200
 39# While it does check for this, it does so using a header that is only
 40# available in OS X versions starting with Leopard.
 41CFLAGS+= -DOPENSSL_NO_APPLE_CRYPTO_RANDOM=1
 42.endif
 43
38PLIST_VARS+= devcrypto afalg 44PLIST_VARS+= devcrypto afalg
39# the AF_ALG engine is supported only on Linux, where it 45# the AF_ALG engine is supported only on Linux, where it
40# is used instead of the BSD /dev/crypto engine. 46# is used instead of the BSD /dev/crypto engine.
41.if ${OPSYS} == "Linux" 47.if ${OPSYS} == "Linux"
42PLIST.afalg= yes 48PLIST.afalg= yes
43.endif 49.endif
44.if exists(/dev/crypto) && ${OPSYS} != "SunOS" 50.if exists(/dev/crypto) && ${OPSYS} != "SunOS"
45PLIST.devcrypto= yes 51PLIST.devcrypto= yes
46.else 52.else
47CONFIGURE_ARGS+= no-devcryptoeng 53CONFIGURE_ARGS+= no-devcryptoeng
48.endif 54.endif
49 55
50# Fix 64-bit build on at least Mac OS X Snow Leopard 56# Fix 64-bit build on at least Mac OS X Snow Leopard
51.if ${OPSYS} == "Darwin" && ${MACHINE_ARCH} == "x86_64" 57.if ${OPSYS} == "Darwin" && ${MACHINE_ARCH} == "x86_64"
52CONFIGURE_ENV+= KERNEL_BITS=${ABI} 58CONFIGURE_ENV+= KERNEL_BITS=${ABI}
53.endif 59.endif
54 60
55.if ${USE_CROSS_COMPILE:tl} == "yes" 61.if ${USE_CROSS_COMPILE:tl} == "yes"
56 62
57OPENSSL_ARCH.aarch64= arm64 63OPENSSL_ARCH.aarch64= arm64
58OPENSSL_ARCH.x86_64= amd64 64OPENSSL_ARCH.x86_64= amd64
59CONFIGURE_ENV+= MACHINE=${OPENSSL_ARCH.${MACHINE_ARCH}:U${MACHINE_GNU_ARCH}:Q} 65CONFIGURE_ENV+= MACHINE=${OPENSSL_ARCH.${MACHINE_ARCH}:U${MACHINE_GNU_ARCH}:Q}
60CONFIGURE_ENV+= RELEASE=${OS_VERSION:Q} 66CONFIGURE_ENV+= RELEASE=${OS_VERSION:Q}
61CONFIGURE_ENV+= SYSTEM=${OPSYS:Q} 67CONFIGURE_ENV+= SYSTEM=${OPSYS:Q}
62CONFIGURE_ENV+= BUILD=${OPSYS:Q}\ ${OS_VERSION:Q} 68CONFIGURE_ENV+= BUILD=${OPSYS:Q}\ ${OS_VERSION:Q}
63 69
64# We don't carry a runtime dependency on Perl, but OpenSSL does provide 70# We don't carry a runtime dependency on Perl, but OpenSSL does provide
65# a Perl script that you can use if you do install Perl. 71# a Perl script that you can use if you do install Perl.
66SUBST_CLASSES+= perlcross 72SUBST_CLASSES+= perlcross
67SUBST_MESSAGE.perlcross= Fixing Perl interpreter path for cross-build 73SUBST_MESSAGE.perlcross= Fixing Perl interpreter path for cross-build
68SUBST_STAGE.perlcross= pre-install 74SUBST_STAGE.perlcross= pre-install
69SUBST_FILES.perlcross+= tools/c_rehash 75SUBST_FILES.perlcross+= tools/c_rehash
70SUBST_FILES.perlcross+= apps/CA.pl 76SUBST_FILES.perlcross+= apps/CA.pl
71SUBST_FILES.perlcross+= apps/tsget.pl 77SUBST_FILES.perlcross+= apps/tsget.pl
72SUBST_SED.perlcross= -e s,${PERL5:Q},${LOCALBASE:Q}/bin/perl5,g 78SUBST_SED.perlcross= -e s,${PERL5:Q},${LOCALBASE:Q}/bin/perl5,g
73CHECK_INTERPRETER_SKIP+= bin/c_rehash 79CHECK_INTERPRETER_SKIP+= bin/c_rehash
74 80
75.endif # USE_CROSS_COMPILE 81.endif # USE_CROSS_COMPILE
76 82
77.include "options.mk" 83.include "options.mk"
78 84
79CONFIGURE_ENV+= PERL=${PERL5:Q} 85CONFIGURE_ENV+= PERL=${PERL5:Q}
80 86
81# If the config script cannot guess the host system correctly then we need to 87# If the config script cannot guess the host system correctly then we need to
82# specify it manually and call the Configure script directly. 88# specify it manually and call the Configure script directly.
83OPENSSL_HOST.SunOS-i386= solaris-x86-gcc 89OPENSSL_HOST.SunOS-i386= solaris-x86-gcc
84.if ${PKGSRC_COMPILER:Msunpro} 90.if ${PKGSRC_COMPILER:Msunpro}
85OPENSSL_HOST.SunOS-x86_64= solaris64-x86_64-cc 91OPENSSL_HOST.SunOS-x86_64= solaris64-x86_64-cc
86.else 92.else
87OPENSSL_HOST.SunOS-x86_64= solaris64-x86_64-gcc 93OPENSSL_HOST.SunOS-x86_64= solaris64-x86_64-gcc
88.endif 94.endif
89OPENSSL_HOST.Darwin-aarch64= darwin64-arm64-cc 95OPENSSL_HOST.Darwin-aarch64= darwin64-arm64-cc
90 96
91LDFLAGS.SunOS+= -lrt 97LDFLAGS.SunOS+= -lrt
92CPPFLAGS.OpenBSD+= -D__STDC_NO_ATOMICS__ 98CPPFLAGS.OpenBSD+= -D__STDC_NO_ATOMICS__
93 99
94.if defined(OPENSSL_HOST.${OPSYS}-${MACHINE_ARCH}) 100.if defined(OPENSSL_HOST.${OPSYS}-${MACHINE_ARCH})
95CONFIG_SHELL= ${PERL5} 101CONFIG_SHELL= ${PERL5}
96CONFIGURE_SCRIPT= ./Configure 102CONFIGURE_SCRIPT= ./Configure
97CONFIGURE_ARGS+= ${OPENSSL_HOST.${OPSYS}-${MACHINE_ARCH}} 103CONFIGURE_ARGS+= ${OPENSSL_HOST.${OPSYS}-${MACHINE_ARCH}}
98.endif 104.endif
99 105
100PKGCONFIG_OVERRIDE+= libcrypto.pc libssl.pc openssl.pc 106PKGCONFIG_OVERRIDE+= libcrypto.pc libssl.pc openssl.pc
101PKGCONFIG_OVERRIDE_STAGE= post-build 107PKGCONFIG_OVERRIDE_STAGE= post-build
102 108
103PKG_SYSCONFSUBDIR= openssl 109PKG_SYSCONFSUBDIR= openssl
104CONF_FILES= ${PREFIX}/share/examples/openssl/openssl.cnf \ 110CONF_FILES= ${PREFIX}/share/examples/openssl/openssl.cnf \
105 ${PKG_SYSCONFDIR}/openssl.cnf 111 ${PKG_SYSCONFDIR}/openssl.cnf
106OWN_DIRS= ${PKG_SYSCONFDIR}/certs ${PKG_SYSCONFDIR}/private 112OWN_DIRS= ${PKG_SYSCONFDIR}/certs ${PKG_SYSCONFDIR}/private
107 113
108INSTALLATION_DIRS+= share/examples/openssl 114INSTALLATION_DIRS+= share/examples/openssl
109 115
110# 116#
111# Note that this package cannot be updated solely from Darwin, it relies on 117# Note that this package cannot be updated solely from Darwin, it relies on
112# shlib-dylib.awk to convert the normal .so entries to dylib, which doesn't 118# shlib-dylib.awk to convert the normal .so entries to dylib, which doesn't
113# work the other way around. The lib/engines-1.1 plugins also need special 119# work the other way around. The lib/engines-1.1 plugins also need special
114# handling. 120# handling.
115# 121#
116OPSYSVARS+= SOEXT 122OPSYSVARS+= SOEXT
117SOEXT.Darwin= dylib 123SOEXT.Darwin= dylib
118SOEXT.*= so 124SOEXT.*= so
119PLIST_SUBST+= SOEXT=${SOEXT} 125PLIST_SUBST+= SOEXT=${SOEXT}
120 126
121PRINT_PLIST_AWK+= /^lib\/engines/ { gsub(/\.${SOEXT}$$/, ".$${SOEXT}"); } 127PRINT_PLIST_AWK+= /^lib\/engines/ { gsub(/\.${SOEXT}$$/, ".$${SOEXT}"); }
122 128
123# Remove CC from the environment, to fix GCC version handling on HP-UX, 129# Remove CC from the environment, to fix GCC version handling on HP-UX,
124# SunOS and Linux/sparc. 130# SunOS and Linux/sparc.
125# 131#
126# See https://github.com/openssl/openssl/issues/11060. 132# See https://github.com/openssl/openssl/issues/11060.
127do-configure: 133do-configure:
128 ${RUN} cd ${WRKSRC} && ${SETENV} ${_CONFIGURE_SCRIPT_ENV:NCC=*} \ 134 ${RUN} cd ${WRKSRC} && ${SETENV} ${_CONFIGURE_SCRIPT_ENV:NCC=*} \
129 ${CONFIG_SHELL} ${CONFIGURE_SCRIPT} ${CONFIGURE_ARGS} 135 ${CONFIG_SHELL} ${CONFIGURE_SCRIPT} ${CONFIGURE_ARGS}
130 136
131# 137#
132# Get rid of ridiculous namespace collisions like passwd.1 and just leave the 138# Get rid of ridiculous namespace collisions like passwd.1 and just leave the
133# openssl-*.1 style variants. On a more practical note this avoids creating 139# openssl-*.1 style variants. On a more practical note this avoids creating
134# a conflict with moreutils (ts.1). 140# a conflict with moreutils (ts.1).
135# 141#
136post-install: 142post-install:
137 cd ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1; \ 143 cd ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1; \
138 for f in openssl-*; do \ 144 for f in openssl-*; do \
139 ${RM} -f `${ECHO} $${f} | ${SED} -e 's/openssl-//'`; \ 145 ${RM} -f `${ECHO} $${f} | ${SED} -e 's/openssl-//'`; \
140 done 146 done
141 ${MV} ${DESTDIR}${PKG_SYSCONFDIR}/* \ 147 ${MV} ${DESTDIR}${PKG_SYSCONFDIR}/* \
142 ${DESTDIR}${PREFIX}/share/examples/openssl 148 ${DESTDIR}${PREFIX}/share/examples/openssl
143 149
144.include "../../mk/dlopen.buildlink3.mk" 150.include "../../mk/dlopen.buildlink3.mk"
145.include "../../mk/bsd.pkg.mk" 151.include "../../mk/bsd.pkg.mk"