diff options
author | jperkin <jperkin@pkgsrc.org> | 2018-10-31 15:53:17 +0000 |
---|---|---|
committer | jperkin <jperkin@pkgsrc.org> | 2018-10-31 15:53:17 +0000 |
commit | c63eff9d505b3a5703179886b5591cabbf4f01c2 (patch) | |
tree | b88aa5175c35a286021febc127358f03b2cf2ade /lang/rust | |
parent | adba7e06f284b160b94b8e39e8326c52f65ff26f (diff) | |
download | pkgsrc-c63eff9d505b3a5703179886b5591cabbf4f01c2.tar.gz |
lang/rust: Various fixes.
SunOS now needs -D_POSIX_PTHREAD_SEMANTICS and a patch to the rand module
to work around getrandom() system call failures.
Add -j argument to x.py for the number of make jobs.
Diffstat (limited to 'lang/rust')
-rw-r--r-- | lang/rust/Makefile | 11 | ||||
-rw-r--r-- | lang/rust/distinfo | 3 | ||||
-rw-r--r-- | lang/rust/patches/patch-src_vendor_rand_src_rngs_os.rs | 15 |
3 files changed, 26 insertions, 3 deletions
diff --git a/lang/rust/Makefile b/lang/rust/Makefile index 25d68b95b73..6109f23b8ce 100644 --- a/lang/rust/Makefile +++ b/lang/rust/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.63 2018/10/29 22:24:11 he Exp $ +# $NetBSD: Makefile,v 1.64 2018/10/31 15:53:17 jperkin Exp $ DISTNAME= rustc-1.30.0-src PKGNAME= ${DISTNAME:S/rustc/rust/:S/-src//} @@ -90,6 +90,8 @@ CONFIGURE_ARGS+= --enable-vendor # cargo defaults to using the number of available CPUs MAKE_ENV+= CARGO_BUILD_JOBS=${MAKE_JOBS:U1} +CFLAGS.SunOS+= -D_POSIX_PTHREAD_SEMANTICS + UNLIMIT_RESOURCES+= cputime PYTHON_VERSIONS_ACCEPTED= 27 @@ -269,8 +271,13 @@ post-extract: cat ${WRKSRC}/src/vendor/libc/.cargo-checksum.json | \ ${SED} -e 's/9c6af198a2f80da827054784faf70bc404673d9568fb45664b4f73c46245fdbd/c3851969a854d6ccaa8a94369f1288025149d1ebdc74b36f224423f35b18f7a7/' > \ ${WRKSRC}/src/vendor/libc/.cargo-checksum.json.patched + cat ${WRKSRC}/src/vendor/rand/.cargo-checksum.json | \ + ${SED} -e 's/cb94a0b54e47022b2e9b58b45e0196785c61d083760333276226da435cc040d9/bcb195562cf830c9e2078757e6d0976f86ede59816ff305e21a2764a4a4cf43e/' > \ + ${WRKSRC}/src/vendor/rand/.cargo-checksum.json.patched ${CP} -f ${WRKSRC}/src/vendor/libc/.cargo-checksum.json.patched \ ${WRKSRC}/src/vendor/libc/.cargo-checksum.json + ${CP} -f ${WRKSRC}/src/vendor/rand/.cargo-checksum.json.patched \ + ${WRKSRC}/src/vendor/rand/.cargo-checksum.json .if ${OPSYS} == "NetBSD" SDIR=${WRKDIR}/scripts; \ ${MKDIR} $${SDIR}; \ @@ -302,7 +309,7 @@ pre-build: pre-build-fix do-build: cd ${WRKSRC} \ && env ${MAKE_ENV} \ - ${PYTHONBIN} ./x.py -v dist + ${PYTHONBIN} ./x.py -v dist -j ${MAKE_JOBS:U1} do-install: cd ${WRKSRC} \ diff --git a/lang/rust/distinfo b/lang/rust/distinfo index c97ce076658..67f48cea1ee 100644 --- a/lang/rust/distinfo +++ b/lang/rust/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.43 2018/10/29 22:24:11 he Exp $ +$NetBSD: distinfo,v 1.44 2018/10/31 15:53:17 jperkin Exp $ SHA1 (rust-1.29.1-i686-unknown-netbsd.tar.gz) = f4f8cbd0a2581546680328765bf5d7d351cf0643 RMD160 (rust-1.29.1-i686-unknown-netbsd.tar.gz) = a590d8dfed10220e8013796cd66c5c9eed51bf37 @@ -110,3 +110,4 @@ SHA1 (patch-src_llvm_include_llvm-c_DataTypes.h) = 432693204912e79059ee31e815ad1 SHA1 (patch-src_llvm_include_llvm_Analysis_ConstantFolding.h) = 861089ea7ec8985b9b9fce53ffadfa3e9eed4a72 SHA1 (patch-src_tools_cargo_src_cargo_core_profiles.rs) = 17e19ccaf29e5d2e6a42c5e59837169ebbc7c58e SHA1 (patch-src_tools_cargo_tests_testsuite_build.rs) = 10c0f9cc2f2c4fdc651fc123ef5d84cadf93feb5 +SHA1 (patch-src_vendor_rand_src_rngs_os.rs) = 318c9e0ed77f83bb34f5512638545ff16844e8fd diff --git a/lang/rust/patches/patch-src_vendor_rand_src_rngs_os.rs b/lang/rust/patches/patch-src_vendor_rand_src_rngs_os.rs new file mode 100644 index 00000000000..03b8790ed98 --- /dev/null +++ b/lang/rust/patches/patch-src_vendor_rand_src_rngs_os.rs @@ -0,0 +1,15 @@ +$NetBSD: patch-src_vendor_rand_src_rngs_os.rs,v 1.1 2018/10/31 15:53:18 jperkin Exp $ + +Explicitly disable getrandom support on SunOS, the test fails. +https://github.com/rust-random/rand/issues/637 + +--- src/vendor/rand/src/rngs/os.rs.orig 2018-10-24 21:38:28.000000000 +0000 ++++ src/vendor/rand/src/rngs/os.rs +@@ -675,6 +675,7 @@ mod imp { + } + + fn getrandom(buf: &mut [u8], blocking: bool) -> libc::c_long { ++ return -1; + extern "C" { + fn syscall(number: libc::c_long, ...) -> libc::c_long; + } |