summaryrefslogtreecommitdiff
path: root/lang/rust
diff options
context:
space:
mode:
authornia <nia@pkgsrc.org>2021-03-30 09:50:14 +0000
committernia <nia@pkgsrc.org>2021-03-30 09:50:14 +0000
commitc4b26864b60bdc23e50870297dc19cb549561ed7 (patch)
tree22471c6760353bbd68cdb8153b723400bec20e71 /lang/rust
parentc5007a30748244f3b9b89a65959d4db66f665972 (diff)
downloadpkgsrc-c4b26864b60bdc23e50870297dc19cb549561ed7.tar.gz
rust: normalize workarounds for cargo dependencies on NetBSD
Havard would like all rusts to be built with rust-cargo-static, because this makes it easier to produce working bootstaps. In order to do this, we need to handle the OpenSSL and curl dependencies in older bootstrap kits properly. This means, for the remaining bootstraps that do not yet have cargo with static/vendored dependencies: - depend on base 8.0 openssl (compat80) on i386. - depend on pkgsrc curl on aarch64 and earmv7. the armv7 bootstrap is built for 9.0 so does not need compat80. the aarch64 bootstrap is built for 8.99.50 so does not need compat80.
Diffstat (limited to 'lang/rust')
-rw-r--r--lang/rust/Makefile48
-rw-r--r--lang/rust/options.mk10
2 files changed, 19 insertions, 39 deletions
diff --git a/lang/rust/Makefile b/lang/rust/Makefile
index 2f877f36142..5b13a6bfe01 100644
--- a/lang/rust/Makefile
+++ b/lang/rust/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.220 2021/03/29 08:45:34 he Exp $
+# $NetBSD: Makefile,v 1.221 2021/03/30 09:50:14 nia Exp $
DISTNAME= rustc-1.49.0-src
PKGNAME= ${DISTNAME:S/rustc/rust/:S/-src//}
@@ -532,42 +532,28 @@ stage0-bootstrap: install
## Issues specific to: bootstrap AND NetBSD follow
-# (I wish this worked on powerpc, but it doesn't since
-# I can't build with the internal LLVM, ref.
-# https://github.com/rust-lang/rust/issues/65862)
-
-.if (${OPSYS} == "NetBSD") && \
- ((${MACHINE_ARCH} == "i386") || \
- (${MACHINE_ARCH} == "sparc64") || \
- (${MACHINE_ARCH} == "powerpc")) \
- && (empty(OS_VERSION:M[012345678].*) || \
- !empty(OS_VERSION:M8.99.*))
-# Bootstrap kits are built on 8.0, so that a single bootstrap can run
-# on multiple systems. Thus later versions need the compat80 package.
-# \todo Explain why this is limited to a small list of architectures,
-# and in particular why not x86_64.
+# rust-1.48.0 i386 bootstraps are built for 8.0 and still depend on
+# base OpenSSL for cargo. Pull in compat80 on 9.x and newer.
+.if !empty(MACHINE_PLATFORM:MNetBSD-*-i386) && empty(OS_VERSION:M8.*)
DEPENDS+= compat80>=0:../../emulators/compat80
.endif
-.if (${OPSYS} == "NetBSD") && \
- ((${MACHINE_ARCH} == "i386")) \
- && (empty(OS_VERSION:M[012345678].*) || \
- !empty(OS_VERSION:M8.99.*))
-# Bootstrap kits use openssl, which on NetBSD 8 comes from pkgsrc.
-# Therefore the pkgsrc openssl libs need to be present as well.
-# The 1.44.1 i686 bootstrap links with pkgsrc openssl. The others do
-# not. When the package is built,
-# cargo links against pkgsrc openssl, so it must be a run-time
-# dependency as well. Forcing USE_BUILTIN.openssl=no results in a
-# mysterious heimdal error, but straight DEPENDS seems to result in a
-# satisfactory package build.
-# While this is icky, it is for the time being better than no rust package.
-DEPENDS+= openssl>=1.1:../../security/openssl
+# As of 2021-02-25 cargo is only a static binary in x86_64,
+# powerpc, and sparc64 bootstraps.
+# he@ says this should be fixed after the bootstraps are updated
+# to 1.49.
+.if !empty(MACHINE_PLATFORM:MNetBSD-*-i386) || \
+ !empty(MACHINE_PLATFORM:MNetBSD-*-aarch64) || \
+ !empty(MACHINE_PLATFORM:MNetBSD-*-earmv7hf)
+BUILDLINK_API_DEPENDS.nghttp2+= nghttp2>=1.41.0
+BUILDLINK_API_DEPENDS.curl+= curl>=7.67.0
+. include "../../www/curl/buildlink3.mk"
+. include "../../security/openssl/buildlink3.mk"
.endif
# This is for when we build natively:
-.if ((${OPSYS} == "NetBSD") && \
- ((${MACHINE_ARCH} == "powerpc") || (${MACHINE_ARCH} == "i386")))
+.if !empty(MACHINE_PLATFORM:MNetBSD-*-powerpc) || \
+ !empty(MACHINE_PLATFORM:MNetBSD-*-i386)
# LLVM needs libatomic for 64-bit atomics on powerpc and i386
.include "../../devel/libatomic/buildlink3.mk"
# Make those libraries available via a unique directory:
diff --git a/lang/rust/options.mk b/lang/rust/options.mk
index b14a8a110a3..ebc4f9c8c02 100644
--- a/lang/rust/options.mk
+++ b/lang/rust/options.mk
@@ -1,4 +1,4 @@
-# $NetBSD: options.mk,v 1.11 2021/02/25 08:54:05 wiz Exp $
+# $NetBSD: options.mk,v 1.12 2021/03/30 09:50:14 nia Exp $
PKG_OPTIONS_VAR= PKG_OPTIONS.rust
PKG_SUPPORTED_OPTIONS+= rust-cargo-static
@@ -14,13 +14,7 @@ PKG_SUGGESTED_OPTIONS+= rust-llvm
. endif
.endif
-# As of 2021-02-25 cargo is only a static binary in x86_64 and
-# powerpc bootstraps
-.if ${OPSYS} == "NetBSD" && \
- ${MACHINE_ARCH} != "i386" && \
- ${MACHINE_ARCH} != "aarch64" && \
- ${MACHINE_ARCH} != "earmv7hf" && \
- ${MACHINE_ARCH} != "sparc64"
+.if ${OPSYS} == "NetBSD"
PKG_SUGGESTED_OPTIONS+= rust-cargo-static
.endif