pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/lang/rust rust: normalize workarounds for cargo depend...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/b9c55b4a10cd
branches:  trunk
changeset: 449421:b9c55b4a10cd
user:      nia <nia%pkgsrc.org@localhost>
date:      Tue Mar 30 09:50:14 2021 +0000

description:
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:

 lang/rust/Makefile   |  48 +++++++++++++++++-------------------------------
 lang/rust/options.mk |  10 ++--------
 2 files changed, 19 insertions(+), 39 deletions(-)

diffs (92 lines):

diff -r c0107e11d4d9 -r b9c55b4a10cd lang/rust/Makefile
--- a/lang/rust/Makefile        Tue Mar 30 09:45:55 2021 +0000
+++ b/lang/rust/Makefile        Tue Mar 30 09:50:14 2021 +0000
@@ -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 @@
 
 ## 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 -r c0107e11d4d9 -r b9c55b4a10cd lang/rust/options.mk
--- a/lang/rust/options.mk      Tue Mar 30 09:45:55 2021 +0000
+++ b/lang/rust/options.mk      Tue Mar 30 09:50:14 2021 +0000
@@ -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 @@
 .  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
 



Home | Main Index | Thread Index | Old Index