Source-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc Rename rust-bin's PKGNAME to rust-bin. Add rust.mk for...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/4513dd5a075d
branches:  trunk
changeset: 434333:4513dd5a075d
user:      nia <nia%pkgsrc.org@localhost>
date:      Sun Jun 14 15:33:27 2020 +0000

description:
Rename rust-bin's PKGNAME to rust-bin. Add rust.mk for rust packages.

This allows rust-bin and rust to coexist in bulk builds (for testing, etc),
but the packages still may not be installed at the same time.

rust.mk as a solution for picking the correct rust variant was suggested
by gdt@. It is intended to be included directly by packages that do not
use cargo.mk, and indirectly by packages that do use cargo.mk.

rust.mk provides one user-settable variable:

RUST_TYPE
        as before, whether to bootstrap rust from source or use
        official binaries. may be "src" or "bin"

And two package-settable variables:

RUST_REQ
        the minimum version of Rust required by the package.
        defaults to "1.20.0"

RUST_RUNTIME
        whether Rust is a runtime dependency, may be "yes" or "no"

diffstat:

 devel/cbindgen/Makefile         |   4 +-
 graphics/librsvg/Makefile       |   6 +--
 lang/mozjs68/Makefile           |   7 ++--
 lang/rust-bin/Makefile          |   9 ++----
 lang/rust-bin/buildlink3.mk     |  13 +++++++++
 lang/rust/Makefile              |  10 ++-----
 lang/rust/cargo.mk              |  10 +-----
 lang/rust/rust.mk               |  57 +++++++++++++++++++++++++++++++++++++++++
 lang/rust/type.mk               |  28 --------------------
 net/tor/options.mk              |   6 +--
 sysutils/tealdeer/Makefile      |   3 +-
 www/cliqz/Makefile              |   7 ++--
 www/firefox/mozilla-common.mk   |   7 ++--
 www/firefox68/mozilla-common.mk |   7 ++--
 www/geckodriver/Makefile        |   3 +-
 www/seamonkey/mozilla-common.mk |   7 ++--
 www/zola/Makefile               |   3 +-
 17 files changed, 102 insertions(+), 85 deletions(-)

diffs (truncated from 399 to 300 lines):

diff -r 88e3fba55a35 -r 4513dd5a075d devel/cbindgen/Makefile
--- a/devel/cbindgen/Makefile   Sun Jun 14 14:57:34 2020 +0000
+++ b/devel/cbindgen/Makefile   Sun Jun 14 15:33:27 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.15 2020/06/03 08:53:04 ryoon Exp $
+# $NetBSD: Makefile,v 1.16 2020/06/14 15:33:28 nia Exp $
 
 DISTNAME=      cbindgen-0.14.2
 CATEGORIES=    devel
@@ -55,6 +55,6 @@
 do-install:
        ${INSTALL_PROGRAM} ${WRKSRC}/target/release/cbindgen ${DESTDIR}${PREFIX}/bin
 
+RUST_RUNTIME=  yes
 .include "../../lang/rust/cargo.mk"
-.include "../../lang/rust/buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"
diff -r 88e3fba55a35 -r 4513dd5a075d graphics/librsvg/Makefile
--- a/graphics/librsvg/Makefile Sun Jun 14 14:57:34 2020 +0000
+++ b/graphics/librsvg/Makefile Sun Jun 14 15:33:27 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.122 2020/06/02 08:22:44 adam Exp $
+# $NetBSD: Makefile,v 1.123 2020/06/14 15:33:27 nia Exp $
 
 DISTNAME=      librsvg-2.48.3
 PKGREVISION=   1
@@ -206,8 +206,6 @@
 BUILDLINK_API_DEPENDS.libxml2+=        libxml2>=2.9
 .include "../../textproc/libxml2/buildlink3.mk"
 .include "../../graphics/gdk-pixbuf2/buildlink3.mk"
-BUILDLINK_API_DEPENDS.rust+=   rust>=1.39.0
-BUILDLINK_DEPMETHOD.rust?=     build
-.include "../../lang/rust/buildlink3.mk"
+RUST_REQ=      1.39.0
 .include "../../lang/rust/cargo.mk"
 .include "../../mk/bsd.pkg.mk"
diff -r 88e3fba55a35 -r 4513dd5a075d lang/mozjs68/Makefile
--- a/lang/mozjs68/Makefile     Sun Jun 14 14:57:34 2020 +0000
+++ b/lang/mozjs68/Makefile     Sun Jun 14 15:33:27 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.4 2020/06/02 08:22:45 adam Exp $
+# $NetBSD: Makefile,v 1.5 2020/06/14 15:33:28 nia Exp $
 
 DISTNAME=      mozjs68_68.6.0.orig
 PKGNAME=       ${DISTNAME:S/_/-/:S/.orig//}
@@ -66,9 +66,8 @@
 
 BUILDLINK_DEPMETHOD.clang=     build
 .include "../../lang/clang/buildlink3.mk"
-BUILDLINK_DEPMETHOD.rust=      build
-BUILDLINK_API_DEPENDS.rust+=   rust>=1.34.0
-.include "../../lang/rust/buildlink3.mk"
+RUST_TYPE=     1.34.0
+.include "../../lang/rust/rust.mk"
 .include "../../devel/zlib/buildlink3.mk"
 .include "../../lang/python/tool.mk"
 .include "../../textproc/icu/buildlink3.mk"
diff -r 88e3fba55a35 -r 4513dd5a075d lang/rust-bin/Makefile
--- a/lang/rust-bin/Makefile    Sun Jun 14 14:57:34 2020 +0000
+++ b/lang/rust-bin/Makefile    Sun Jun 14 15:33:27 2020 +0000
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.8 2020/06/09 15:58:05 nia Exp $
+# $NetBSD: Makefile,v 1.9 2020/06/14 15:33:28 nia Exp $
 
 DISTNAME=      rust-1.44.0
+PKGNAME=       ${DISTNAME:S/rust/rust-bin/1}
 CATEGORIES=    lang
 MASTER_SITES=  https://static.rust-lang.org/dist/
 
@@ -9,11 +10,7 @@
 COMMENT=       Safe, concurrent, practical language (official binaries)
 LICENSE=       mit OR apache-2.0
 
-.include "../../lang/rust/type.mk"
-
-.if ${RUST_TYPE} != "bin"
-PKG_SKIP_REASON+=      "Rust binary package, RUST_TYPE is src"
-.endif
+CONFLICTS+=    rust-[0-9]*
 
 ONLY_FOR_PLATFORM+=    Darwin-*-x86_64
 ONLY_FOR_PLATFORM+=    FreeBSD-*-i386
diff -r 88e3fba55a35 -r 4513dd5a075d lang/rust-bin/buildlink3.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/rust-bin/buildlink3.mk       Sun Jun 14 15:33:27 2020 +0000
@@ -0,0 +1,13 @@
+# $NetBSD: buildlink3.mk,v 1.1 2020/06/14 15:33:28 nia Exp $
+
+BUILDLINK_TREE+=       rust-bin
+
+.if !defined(RUST_BIN_BUILDLINK3_MK)
+RUST_BIN_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.rust-bin+=       rust-bin>=1.20.0
+BUILDLINK_PKGSRCDIR.rust-bin?=         ../../lang/rust-bin
+BUILDLINK_PASSTHRU_DIRS+=              ${PREFIX}/lib/rustlib
+.endif
+
+BUILDLINK_TREE+=       -rust-bin
diff -r 88e3fba55a35 -r 4513dd5a075d lang/rust/Makefile
--- a/lang/rust/Makefile        Sun Jun 14 14:57:34 2020 +0000
+++ b/lang/rust/Makefile        Sun Jun 14 15:33:27 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.179 2020/06/14 14:29:25 gdt Exp $
+# $NetBSD: Makefile,v 1.180 2020/06/14 15:33:27 nia Exp $
 
 DISTNAME=      rustc-1.43.1-src
 PKGNAME=       ${DISTNAME:S/rustc/rust/:S/-src//}
@@ -11,6 +11,8 @@
 COMMENT=       Safe, concurrent, practical language
 LICENSE=       mit OR apache-2.0
 
+CONFLICTS+=    rust-bin-[0-9]*
+
 USE_GCC_RUNTIME=       yes
 USE_LANGUAGES=         c c++11
 USE_LIBTOOL=           yes
@@ -20,12 +22,6 @@
 # build on 7).  Mark earlier versions as broken.
 BROKEN_ON_PLATFORM+=   NetBSD-[1-7].*-*
 
-.include "type.mk"
-
-.if ${RUST_TYPE} != "src"
-PKG_SKIP_REASON+=      "Rust source package, RUST_TYPE is bin"
-.endif
-
 HAS_CONFIGURE=                 yes
 PYTHON_FOR_BUILD_ONLY=         yes
 CONFIG_SHELL=                  ${PYTHONBIN}
diff -r 88e3fba55a35 -r 4513dd5a075d lang/rust/cargo.mk
--- a/lang/rust/cargo.mk        Sun Jun 14 14:57:34 2020 +0000
+++ b/lang/rust/cargo.mk        Sun Jun 14 15:33:27 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: cargo.mk,v 1.16 2020/06/14 11:19:34 rillig Exp $
+# $NetBSD: cargo.mk,v 1.17 2020/06/14 15:33:27 nia Exp $
 #
 # Common logic that can be used by packages that depend on cargo crates
 # from crates.io. This lets existing pkgsrc infrastructure fetch and verify
@@ -22,13 +22,7 @@
 
 MASTER_SITES?= -${MASTER_SITE_CRATESIO}${PKGBASE}/${PKGVERSION_NOREV}/download
 
-.include "type.mk"
-
-.if ${RUST_TYPE} != "bin"
-BUILD_DEPENDS+=        rust-[0-9]*:../../lang/rust
-.else
-BUILD_DEPENDS+=        rust-[0-9]*:../../lang/rust-bin
-.endif
+.include "../../lang/rust/rust.mk"
 
 USE_TOOLS+=            bsdtar digest
 CARGO_VENDOR_DIR=      ${WRKDIR}/vendor
diff -r 88e3fba55a35 -r 4513dd5a075d lang/rust/rust.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/rust/rust.mk Sun Jun 14 15:33:27 2020 +0000
@@ -0,0 +1,57 @@
+# $NetBSD: rust.mk,v 1.1 2020/06/14 15:33:27 nia Exp $
+# 
+# This file determines the type of rust package to use.
+#
+# === User-settable variables ===
+#
+# RUST_TYPE
+#      The preferred type of Rust release to use -
+#      either bootstrap-from-source or an official binary.
+#
+#      Official Rust binaries are only published for certain platforms,
+#      including Darwin, Linux, and NetBSD x86_64.
+#
+#      Possible values: src bin
+#      Default: src
+#
+# === Package-settable variables ===
+#
+# RUST_REQ
+#      The minimum version of Rust required by the package.
+#      Binary Rust is only published for certain platforms.
+#
+#      Default: 1.20.0
+#
+# RUST_RUNTIME
+#      Whether rust is a runtime dependency.
+#      Usually it is only needed to build.
+#
+#      Possible values: yes no
+#      Default: no
+
+.include "../../mk/bsd.fast.prefs.mk"
+
+RUST_REQ?=     1.20.0
+RUST_RUNTIME?= no
+
+.if !empty(MACHINE_PLATFORM:MNetBSD-*-x86_64)
+RUST_TYPE?=    bin
+.else
+RUST_TYPE?=    src
+.endif
+
+.if ${RUST_TYPE} == "bin"
+.  if ${RUST_RUNTIME} != "no"
+BUILDLINK_DEPMETHOD.rust-bin?=         build
+.  endif
+BUILDLINK_API_DEPENDS.rust-bin+=       rust-bin>=${RUST_REQ}
+.  include "../../lang/rust-bin/buildlink3.mk"
+.endif
+
+.if ${RUST_TYPE} == "src"
+.  if ${RUST_RUNTIME} != "no"
+BUILDLINK_DEPMETHOD.rust?=             build
+.  endif
+BUILDLINK_API_DEPENDS.rust+=           rust>=${RUST_REQ}
+.  include "../../lang/rust/buildlink3.mk"
+.endif
diff -r 88e3fba55a35 -r 4513dd5a075d lang/rust/type.mk
--- a/lang/rust/type.mk Sun Jun 14 14:57:34 2020 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-# $NetBSD: type.mk,v 1.2 2020/05/18 16:33:44 wiz Exp $
-# 
-# This file determines the type of rust package to use -
-# binary (as via rustup) or a source bootstrap.
-#
-# Rust only publishes binaries for specific platforms in specific
-# tiers.
-#
-# === User-settable variables ===
-#
-# RUST_TYPE
-#      The preferred Rust type to use.
-#
-#      Possible values: src bin
-#      Default: src
-
-.if !defined(RUST_TYPE)
-.  include "../../mk/bsd.fast.prefs.mk"
-
-# The Rust bootstrapping process is often particularly slow
-# and unreliable on NetBSD due to ld.so bugs
-.  if !empty(MACHINE_PLATFORM:MNetBSD-*-x86_64)
-RUST_TYPE?=    bin
-.  else
-RUST_TYPE?=    src
-.  endif
-
-.endif # !defined(RUST_TYPE)
diff -r 88e3fba55a35 -r 4513dd5a075d net/tor/options.mk
--- a/net/tor/options.mk        Sun Jun 14 14:57:34 2020 +0000
+++ b/net/tor/options.mk        Sun Jun 14 15:33:27 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: options.mk,v 1.11 2020/05/15 16:39:34 wiz Exp $
+# $NetBSD: options.mk,v 1.12 2020/06/14 15:33:28 nia Exp $
 
 PKG_OPTIONS_VAR=       PKG_OPTIONS.tor
 PKG_SUPPORTED_OPTIONS= doc rust
@@ -33,10 +33,8 @@
 CARGO_CRATE_DEPENDS+=  rand_core-0.2.0-pre.0
 CARGO_CRATE_DEPENDS+=  typenum-1.9.0
 
+RUST_REQ=      1.34.0
 .include "../../lang/rust/cargo.mk"
-BUILDLINK_DEPMETHOD.rust=      build
-BUILDLINK_API_DEPENDS.rust+=   rust>=1.34.0
-.include "../../lang/rust/buildlink3.mk"
 
 pre-configure:
        cd ${WRKSRC} && ${MKDIR} -p src/rust/target/release
diff -r 88e3fba55a35 -r 4513dd5a075d sysutils/tealdeer/Makefile
--- a/sysutils/tealdeer/Makefile        Sun Jun 14 14:57:34 2020 +0000
+++ b/sysutils/tealdeer/Makefile        Sun Jun 14 15:33:27 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1 2020/03/19 19:43:52 bsiegert Exp $
+# $NetBSD: Makefile,v 1.2 2020/06/14 15:33:28 nia Exp $
 
 DISTNAME=      tealdeer-1.3.0
 GITHUB_TAG=    v${PKGVERSION_NOREV}
@@ -190,6 +190,5 @@
        ${INSTALL_DATA} ${WRKSRC}/bash_tealdeer ${DESTDIR}${PREFIX}/share/bash-completion/completions/tldr
 
 .include "../../lang/rust/cargo.mk"
-.include "../../lang/rust/buildlink3.mk"
 .include "../../security/openssl/buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"
diff -r 88e3fba55a35 -r 4513dd5a075d www/cliqz/Makefile
--- a/www/cliqz/Makefile        Sun Jun 14 14:57:34 2020 +0000
+++ b/www/cliqz/Makefile        Sun Jun 14 15:33:27 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.42 2020/06/02 08:24:56 adam Exp $
+# $NetBSD: Makefile,v 1.43 2020/06/14 15:33:28 nia Exp $
 
 DISTNAME=      cliqz-1.36.0
 PKGREVISION=   1
@@ -175,8 +175,7 @@
 PKG_CXX=       ${PREFIX}/bin/clang++
 BUILDLINK_DEPMETHOD.clang=     build
 .include "../../lang/clang/buildlink3.mk"
-BUILDLINK_DEPMETHOD.rust=      build
-BUILDLINK_API_DEPENDS.rust+=   rust>=1.41.0
-.include "../../lang/rust/buildlink3.mk"



Home | Main Index | Thread Index | Old Index