aboutsummaryrefslogtreecommitdiff
path: root/lang/rust
diff options
context:
space:
mode:
Diffstat (limited to 'lang/rust')
-rw-r--r--lang/rust/Makefile73
-rw-r--r--lang/rust/distinfo6
-rw-r--r--lang/rust/files/patch-vendor_backtrace-sys_build.rs17
-rw-r--r--lang/rust/files/patch-vendor_backtrace-sys_src_libbacktrace_fileline.c129
4 files changed, 142 insertions, 83 deletions
diff --git a/lang/rust/Makefile b/lang/rust/Makefile
index 60451760056f..9e2c07e7fa5b 100644
--- a/lang/rust/Makefile
+++ b/lang/rust/Makefile
@@ -2,7 +2,7 @@
# $FreeBSD$
PORTNAME= rust
-PORTVERSION?= 1.41.0
+PORTVERSION?= 1.41.1
PORTREVISION?= 0
CATEGORIES= lang
MASTER_SITES= https://static.rust-lang.org/dist/:src \
@@ -44,10 +44,9 @@ TEST_ENV= ${MAKE_ENV} \
CONFLICTS_INSTALL?= rust-nightly
-PLIST_FILES= lib/rustlib/components \
- lib/rustlib/rust-installer-version
+OPTIONS_DEFINE= DOCS GDB SOURCES WASM
+OPTIONS_DEFAULT= SOURCES WASM
-OPTIONS_DEFINE= DOCS GDB SOURCES WASM
GDB_DESC= Install ports gdb (necessary for debugging rust programs)
SOURCES_DESC= Install source files
WASM_DESC= Build the WebAssembly target (wasm32-unknown-unknown)
@@ -187,58 +186,29 @@ do-configure:
do-build:
@cd ${WRKSRC} && \
- ${SETENV} ${MAKE_ENV} ${PYTHON_CMD} x.py build --config=config.toml \
- --jobs=${MAKE_JOBS_NUMBER}
+ ${SETENV} ${MAKE_ENV} ${PYTHON_CMD} x.py build --jobs=${MAKE_JOBS_NUMBER}
do-install:
# DESTDIR not in MAKE_ENV as it would cause the bundled LLVM to be
# staged into it during do-build.
@cd ${WRKSRC} && \
${SETENV} ${MAKE_ENV} DESTDIR=${STAGEDIR} ${PYTHON_CMD} \
- x.py install --config=config.toml --jobs=${MAKE_JOBS_NUMBER}
-
-# In post-install, we use the manifests generated during Rust install
-# to in turn generate the PLIST. We do that, instead of the regular
-# `pkg-plist`, because several libraries have a computed filename based
-# on the absolute path of the source files. As it is user-specific, we
-# can't know their filename in advance.
-#
-# Both rustc and Cargo components install the same README.md and LICENSE
-# files. The install process backs up the first copy to install the
-# second. Thus here, we need to remove those backups. We also need to
-# dedup the entries in the generated PLIST, because both components'
-# manifests list them.
-#
-# We fix manpage entries in the generated manifests because Rust
-# installs them uncompressed but the Ports framework compresses them.
-post-install:
- for f in ${STAGEDIR}${PREFIX}/lib/rustlib/manifest-*; do \
- ${REINPLACE_CMD} -i '' -E \
- -e 's,:${STAGEDIR},:,' \
- -e 's,(share/man/man[1-9]/.*\.[0-9]),\1.gz,' \
- "$$f"; \
- ${ECHO_CMD} "$${f#${STAGEDIR}}" >> ${TMPPLIST}; \
- ${AWK} '\
- /^file:/ { \
- file=$$0; \
- sub(/^file:/, "", file); \
- print file; \
- } \
- /^dir:/ { \
- dir=$$0; \
- sub(/^dir:/, "", dir); \
- system("find ${STAGEDIR}" dir " -type f | ${SED} -E -e \"s,${STAGEDIR},,\""); \
- }' \
- "$$f" >> ${TMPPLIST}; \
- done
- ${RM} -r ${STAGEDIR}${PREFIX}/share/doc/rust/*.old
- ${SORT} -u < ${TMPPLIST} > ${TMPPLIST}.uniq
- ${MV} ${TMPPLIST}.uniq ${TMPPLIST}
- @${RM} \
- ${STAGEDIR}${PREFIX}/lib/rustlib/install.log \
- ${STAGEDIR}${PREFIX}/lib/rustlib/uninstall.sh
- @${FIND} ${STAGEDIR}${PREFIX}/bin -exec ${FILE} -i {} + | ${AWK} -F: \
- '/executable|sharedlib/ { print $$1 }' | ${XARGS} ${STRIP_CMD}
+ x.py install --jobs=${MAKE_JOBS_NUMBER}
+# We autogenerate the plist file. We do that, instead of the
+# regular pkg-plist, because several libraries have a computed
+# filename based on the absolute path of the source files. As it
+# is user-specific, we cannot know their filename in advance.
+ @${RM} -r ${STAGEDIR}${DOCSDIR}/*.old \
+ ${STAGEDIR}${DOCSDIR}/html/.lock \
+ ${STAGEDIR}${DOCSDIR}/html/.stamp \
+ ${STAGEDIR}${PREFIX}/lib/rustlib/install.log \
+ ${STAGEDIR}${PREFIX}/lib/rustlib/manifest-* \
+ ${STAGEDIR}${PREFIX}/lib/rustlib/uninstall.sh
+ @${FIND} ${STAGEDIR}${PREFIX}/bin ${STAGEDIR}${PREFIX}/lib -exec ${FILE} -i {} + | \
+ ${AWK} -F: '/executable|sharedlib/ { print $$1 }' | ${XARGS} ${STRIP_CMD}
+ @${FIND} ${STAGEDIR}${PREFIX} -not -type d | \
+ ${SED} -E -e 's,^${STAGEDIR}${PREFIX}/,,' \
+ -e 's,(share/man/man[1-9]/.*\.[0-9]),\1.gz,' >> ${TMPPLIST}
post-install-SOURCES-on:
# Silence stage-qa warnings by sanitizing permissions on sources
@@ -248,8 +218,7 @@ post-install-SOURCES-on:
# Note that make test does not work when rust is already installed.
do-test:
@cd ${WRKSRC} && \
- ${SETENV} ${TEST_ENV} ${PYTHON_CMD} x.py test --config=config.toml \
- --jobs=${MAKE_JOBS_NUMBER}
+ ${SETENV} ${TEST_ENV} ${PYTHON_CMD} x.py test --jobs=${MAKE_JOBS_NUMBER}
.if !defined(_RUST_MAKESUM_GUARD)
makesum:
diff --git a/lang/rust/distinfo b/lang/rust/distinfo
index 18fa867b836c..b019d351affa 100644
--- a/lang/rust/distinfo
+++ b/lang/rust/distinfo
@@ -1,6 +1,6 @@
-TIMESTAMP = 1580240609
-SHA256 (rust/rustc-1.41.0-src.tar.xz) = 38d6742e5c4c98a835de5d6e12a209e442fb3078a03b2c01bab6ea7afb25be6f
-SIZE (rust/rustc-1.41.0-src.tar.xz) = 93763052
+TIMESTAMP = 1582642993
+SHA256 (rust/rustc-1.41.1-src.tar.xz) = ebac9861b43c7207af36e24402dfdc5463a4df4bdb015ccb2b165251c0fdcf7c
+SIZE (rust/rustc-1.41.1-src.tar.xz) = 93754192
SHA256 (rust/2020-01-11/rustc-1.40.0-aarch64-unknown-freebsd.tar.xz) = b73372fb30198cd9c26927f89cc96c339253038491fcb5629d88285f156f1347
SIZE (rust/2020-01-11/rustc-1.40.0-aarch64-unknown-freebsd.tar.xz) = 26371388
SHA256 (rust/2020-01-11/rust-std-1.40.0-aarch64-unknown-freebsd.tar.xz) = 88abe2b1e267309bc87bb0bf9ace0c7d72be21c47a0fec9858364f1ed6cd64f9
diff --git a/lang/rust/files/patch-vendor_backtrace-sys_build.rs b/lang/rust/files/patch-vendor_backtrace-sys_build.rs
new file mode 100644
index 000000000000..32a363623ac4
--- /dev/null
+++ b/lang/rust/files/patch-vendor_backtrace-sys_build.rs
@@ -0,0 +1,17 @@
+https://github.com/rust-lang/backtrace-rs/pull/294
+
+--- vendor/backtrace-sys/build.rs.orig 2020-02-19 21:11:31 UTC
++++ vendor/backtrace-sys/build.rs
+@@ -60,6 +60,12 @@ fn main() {
+ File::create(out_dir.join("config.h")).unwrap();
+ if target.contains("android") {
+ maybe_enable_dl_iterate_phdr_android(&mut build);
++ } else if target.contains("freebsd") {
++ build.define("HAVE_DL_ITERATE_PHDR", "1");
++ build.define("HAVE_KERN_PROC", "1");
++ } else if target.contains("netbsd") {
++ build.define("HAVE_DL_ITERATE_PHDR", "1");
++ build.define("HAVE_KERN_PROC_ARGS", "1");
+ } else if !target.contains("apple-ios")
+ && !target.contains("solaris")
+ && !target.contains("redox")
diff --git a/lang/rust/files/patch-vendor_backtrace-sys_src_libbacktrace_fileline.c b/lang/rust/files/patch-vendor_backtrace-sys_src_libbacktrace_fileline.c
index 3ab27099b284..07713763576e 100644
--- a/lang/rust/files/patch-vendor_backtrace-sys_src_libbacktrace_fileline.c
+++ b/lang/rust/files/patch-vendor_backtrace-sys_src_libbacktrace_fileline.c
@@ -1,44 +1,117 @@
-This file is in the public domain.
+https://github.com/ianlancetaylor/libbacktrace/commit/0f06cda953cc4e26f38751c5b9f15ae8dfa5ff2d
+https://github.com/rust-lang-nursery/libbacktrace/pull/1
---- vendor/backtrace-sys/src/libbacktrace/fileline.c.orig 2019-01-16 09:30:44 UTC
+--- vendor/backtrace-sys/src/libbacktrace/fileline.c.orig 2020-02-19 21:11:31 UTC
+++ vendor/backtrace-sys/src/libbacktrace/fileline.c
-@@ -39,8 +39,39 @@ POSSIBILITY OF SUCH DAMAGE. */
+@@ -39,6 +39,10 @@ POSSIBILITY OF SUCH DAMAGE. */
#include <stdlib.h>
#include <unistd.h>
-+#if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__)
++#if defined (HAVE_KERN_PROC_ARGS) || defined (HAVE_KERN_PROC)
+#include <sys/sysctl.h>
-+#include <limits.h>
+#endif
+
#include "backtrace.h"
#include "internal.h"
+
+@@ -46,6 +50,78 @@ POSSIBILITY OF SUCH DAMAGE. */
+ #define getexecname() NULL
+ #endif
+
++#if !defined (HAVE_KERN_PROC_ARGS) && !defined (HAVE_KERN_PROC)
++
++#define sysctl_exec_name1(state, error_callback, data) NULL
++#define sysctl_exec_name2(state, error_callback, data) NULL
++
++#else /* defined (HAVE_KERN_PROC_ARGS) || |defined (HAVE_KERN_PROC) */
++
++static char *
++sysctl_exec_name (struct backtrace_state *state,
++ int mib0, int mib1, int mib2, int mib3,
++ backtrace_error_callback error_callback, void *data)
++{
++ int mib[4];
++ size_t len;
++ char *name;
++ size_t rlen;
+
-+#if !defined(HAVE_GETEXECNAME) && defined(KERN_PROC_PATHNAME)
-+/* Return pathname of executable or 0 on failure. */
-+#define HAVE_GETEXECNAME
-+static char execname[PATH_MAX + 1];
-+static const char *
-+getexecname(void)
++ mib[0] = mib0;
++ mib[1] = mib1;
++ mib[2] = mib2;
++ mib[3] = mib3;
++
++ if (sysctl (mib, 4, NULL, &len, NULL, 0) < 0)
++ return NULL;
++ name = (char *) backtrace_alloc (state, len, error_callback, data);
++ if (name == NULL)
++ return NULL;
++ rlen = len;
++ if (sysctl (mib, 4, name, &rlen, NULL, 0) < 0)
++ {
++ backtrace_free (state, name, len, error_callback, data);
++ return NULL;
++ }
++ return name;
++}
++
++#ifdef HAVE_KERN_PROC_ARGS
++
++static char *
++sysctl_exec_name1 (struct backtrace_state *state,
++ backtrace_error_callback error_callback, void *data)
+{
-+ size_t path_len = sizeof(execname);
-+ int mib[] = {
-+ CTL_KERN,
-+#if defined(__NetBSD__)
-+ KERN_PROC_ARGS,
-+ -1,
-+ KERN_PROC_PATHNAME,
++ /* This variant is used on NetBSD. */
++ return sysctl_exec_name (state, CTL_KERN, KERN_PROC_ARGS, -1,
++ KERN_PROC_PATHNAME, error_callback, data);
++}
++
+#else
-+ KERN_PROC,
-+ KERN_PROC_PATHNAME,
-+ -1,
++
++#define sysctl_exec_name1(state, error_callback, data) NULL
++
+#endif
-+ };
-+ u_int miblen = sizeof(mib) / sizeof(mib[0]);
-+ int rc = sysctl(mib, miblen, execname, &path_len, NULL, 0);
-+ return rc ? NULL : execname;
++
++#ifdef HAVE_KERN_PROC
++
++static char *
++sysctl_exec_name2 (struct backtrace_state *state,
++ backtrace_error_callback error_callback, void *data)
++{
++ /* This variant is used on FreeBSD. */
++ return sysctl_exec_name (state, CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1,
++ error_callback, data);
+}
-+#endif /* !HAVE_GETEXECNAME && KERN_PROC_PATHNAME */
++
++#else
++
++#define sysctl_exec_name2(state, error_callback, data) NULL
++
++#endif
++
++#endif /* defined (HAVE_KERN_PROC_ARGS) || |defined (HAVE_KERN_PROC) */
++
+ /* Initialize the fileline information from the executable. Returns 1
+ on success, 0 on failure. */
- #ifndef HAVE_GETEXECNAME
- #define getexecname() NULL
+@@ -83,7 +159,7 @@ fileline_initialize (struct backtrace_state *state,
+
+ descriptor = -1;
+ called_error_callback = 0;
+- for (pass = 0; pass < 5; ++pass)
++ for (pass = 0; pass < 7; ++pass)
+ {
+ int does_not_exist;
+
+@@ -105,6 +181,12 @@ fileline_initialize (struct backtrace_state *state,
+ snprintf (buf, sizeof (buf), "/proc/%ld/object/a.out",
+ (long) getpid ());
+ filename = buf;
++ break;
++ case 5:
++ filename = sysctl_exec_name1 (state, error_callback, data);
++ break;
++ case 6:
++ filename = sysctl_exec_name2 (state, error_callback, data);
+ break;
+ default:
+ abort ();