pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/lang/rust rust: future-proof by using OPSYS_VERSION fo...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/bef1eba5c48d
branches:  trunk
changeset: 378231:bef1eba5c48d
user:      nia <nia%pkgsrc.org@localhost>
date:      Sat Apr 30 21:02:39 2022 +0000

description:
rust: future-proof by using OPSYS_VERSION for NetBSD

diffstat:

 lang/rust/Makefile    |  15 ++++++++-------
 lang/rust/platform.mk |  19 +++++++++++--------
 2 files changed, 19 insertions(+), 15 deletions(-)

diffs (97 lines):

diff -r 0ce98ee10f87 -r bef1eba5c48d lang/rust/Makefile
--- a/lang/rust/Makefile        Sat Apr 30 21:01:41 2022 +0000
+++ b/lang/rust/Makefile        Sat Apr 30 21:02:39 2022 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.254 2022/04/23 15:55:31 he Exp $
+# $NetBSD: Makefile,v 1.255 2022/04/30 21:02:39 nia Exp $
 
 DISTNAME=      rustc-1.59.0-src
 PKGNAME=       ${DISTNAME:S/rustc/rust/:S/-src//}
@@ -21,9 +21,6 @@
 USE_LIBTOOL=           yes
 USE_TOOLS+=            bash grep gmake perl:build pkg-config
 
-# The NetBSD bootstraps are built for NetBSD 8 (because rust doesn't
-# build on 7).  Mark earlier versions as broken.
-BROKEN_ON_PLATFORM+=   NetBSD-[1-7].*-*
 # Bootstrap is built for NetBSD 9.x on these platforms:
 BROKEN_ON_PLATFORM+=   NetBSD-8.*-*arm*
 BROKEN_ON_PLATFORM+=   NetBSD-8.*-aarch64
@@ -82,6 +79,10 @@
 
 .include "../../mk/bsd.prefs.mk"
 
+.if ${OPSYS} == "NetBSD" && ${OPSYS_VERSION} < 080000
+BROKEN+=               "Bootstrap unavailable for old NetBSD version"
+.endif
+
 # Allow overriding MAKE_JOBS_SAFE
 # some may chose to mostly build faster,
 # and deal with any failures due to deadlocks
@@ -292,7 +293,7 @@
 RUST_ARCH=             powerpc-unknown-netbsd
 
 # Cross-built against NetBSD 9.0
-.  if empty(OS_VERSION:M8.*) || make(distinfo) || make(makesum) || make(mdi)
+.  if ${OPSYS_VERSION} >= 090000 || make(distinfo) || make(makesum) || make(mdi)
 RUST_STAGE0:=                  rust-${RUST_STAGE0_VER}-${RUST_ARCH}90.tar.gz
 RUST_STD_STAGE0:=              rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}90.tar.gz
 DISTFILES:=                    ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
@@ -301,7 +302,7 @@
 .  endif
 
 # Cross-built against NetBSD 8.0
-.  if !empty(OS_VERSION:M8.*) || make(distinfo) || make(makesum) || make(mdi)
+.  if ${OPSYS_VERSION} < 090000 || make(distinfo) || make(makesum) || make(mdi)
 RUST_STAGE0:=                  rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
 RUST_STD_STAGE0:=              rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
 DISTFILES:=                    ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
@@ -598,7 +599,7 @@
 
 # rust i386 bootstraps are built for 8.0 and still depend on libstdc++.so.8.
 # Pull in compat80 on 9.x and newer.
-.if !empty(MACHINE_PLATFORM:MNetBSD-*-i386) && empty(OS_VERSION:M8.*)
+.if !empty(MACHINE_PLATFORM:MNetBSD-*-i386) && ${OPSYS_VERSION} >= 090000
 BUILD_DEPENDS+=        compat80>=0:../../emulators/compat80
 .endif
 
diff -r 0ce98ee10f87 -r bef1eba5c48d lang/rust/platform.mk
--- a/lang/rust/platform.mk     Sat Apr 30 21:01:41 2022 +0000
+++ b/lang/rust/platform.mk     Sat Apr 30 21:02:39 2022 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: platform.mk,v 1.13 2021/11/20 16:09:46 he Exp $
+# $NetBSD: platform.mk,v 1.14 2022/04/30 21:02:39 nia Exp $
 
 # This file encodes whether a given platform has support for rust.
 
@@ -7,20 +7,23 @@
 
 .if !defined(PLATFORM_SUPPORTS_RUST)
 
-# Rust needs NetBSD>7
+.  include "../../mk/bsd.fast.prefs.mk"
+
 .  for rust_arch in aarch64 earmv7hf i386 powerpc sparc64 x86_64
 .    for rust_os in Darwin FreeBSD Linux NetBSD SunOS
-.      if ${OPSYS} != "NetBSD" || empty(OS_VERSION:M[0-7].*)
 RUST_PLATFORMS+=       ${rust_os}-*-${rust_arch}
-.      endif
 .    endfor
 .  endfor
 
-.  for rust_platform in ${RUST_PLATFORMS}
-.    if !empty(MACHINE_PLATFORM:M${rust_platform})
+.  if ${OPSYS} == "NetBSD" && ${OPSYS_VERSION} < 080000
+PLATFORM_SUPPORTS_RUST?=       no
+.  else
+.    for rust_platform in ${RUST_PLATFORMS}
+.      if !empty(MACHINE_PLATFORM:M${rust_platform})
 PLATFORM_SUPPORTS_RUST=                yes
-.    endif
-.  endfor
+.      endif
+.    endfor
 PLATFORM_SUPPORTS_RUST?=       no
+.  endif
 
 .endif # !defined(PLATFORM_SUPPORTS_RUST)



Home | Main Index | Thread Index | Old Index