pkgsrc-Changes archive

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

CVS commit: pkgsrc/lang/rust



Module Name:    pkgsrc
Committed By:   jperkin
Date:           Wed Jul  8 14:46:14 UTC 2020

Modified Files:
        pkgsrc/lang/rust: Makefile buildlink3.mk cross.mk distinfo rust.mk
        pkgsrc/lang/rust/patches: patch-src_libstd_build.rs
Added Files:
        pkgsrc/lang/rust/patches: patch-vendor_mio_src_sys_unix_mod.rs
            patch-vendor_mio_src_sys_unix_ready.rs patch-vendor_net2_src_ext.rs
            patch-vendor_net2_src_lib.rs patch-vendor_net2_src_sys_unix_mod.rs
            patch-vendor_time_src_sys.rs

Log Message:
rust: Add support for cross-compiling illumos.

It's not really cross-compiled, it's just a different target name, but is
treated the same way.  Once stabilised and crate support catches up we'll
switch over to it by default from x86_64-sun-solaris.  Until then I'll
build bootstrap kits for both natively.

While here fix up a bunch of obvious pkglint warnings.


To generate a diff of this commit:
cvs rdiff -u -r1.186 -r1.187 pkgsrc/lang/rust/Makefile
cvs rdiff -u -r1.5 -r1.6 pkgsrc/lang/rust/buildlink3.mk
cvs rdiff -u -r1.1 -r1.2 pkgsrc/lang/rust/cross.mk
cvs rdiff -u -r1.116 -r1.117 pkgsrc/lang/rust/distinfo
cvs rdiff -u -r1.4 -r1.5 pkgsrc/lang/rust/rust.mk
cvs rdiff -u -r1.8 -r1.9 pkgsrc/lang/rust/patches/patch-src_libstd_build.rs
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/lang/rust/patches/patch-vendor_mio_src_sys_unix_mod.rs \
    pkgsrc/lang/rust/patches/patch-vendor_mio_src_sys_unix_ready.rs \
    pkgsrc/lang/rust/patches/patch-vendor_net2_src_ext.rs \
    pkgsrc/lang/rust/patches/patch-vendor_net2_src_lib.rs \
    pkgsrc/lang/rust/patches/patch-vendor_net2_src_sys_unix_mod.rs \
    pkgsrc/lang/rust/patches/patch-vendor_time_src_sys.rs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/lang/rust/Makefile
diff -u pkgsrc/lang/rust/Makefile:1.186 pkgsrc/lang/rust/Makefile:1.187
--- pkgsrc/lang/rust/Makefile:1.186     Tue Jul  7 10:44:02 2020
+++ pkgsrc/lang/rust/Makefile   Wed Jul  8 14:46:14 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.186 2020/07/07 10:44:02 he Exp $
+# $NetBSD: Makefile,v 1.187 2020/07/08 14:46:14 jperkin Exp $
 
 DISTNAME=      rustc-1.44.1-src
 PKGNAME=       ${DISTNAME:S/rustc/rust/:S/-src//}
@@ -125,7 +125,7 @@ MAKE_JOBS_SAFE=     no
 .  endif
 
 # Open PRs
-# 
+#
 # Broken package with PREFIX not /usr/pkg:
 #   http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=54453
 #
@@ -136,7 +136,7 @@ MAKE_JOBS_SAFE=     no
 #   http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=55368
 
 # Stale PRs (a reason to believe they no longer apply)
-# 
+#
 # NetBSD 8.1 sparc64: bootstrap fails with libssl.so.14 missing
 #   http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=54622
 
@@ -322,11 +322,28 @@ CKSUM_CRATES+=    vendor/lzma-sys
 CKSUMS+=       51a9ca7a4576822dc4fa01b31bc4bbed21817777abb304f605ef5951f68c3ed2
 CKSUMS+=       807c3aa4b5a62a70ba790df151e9ecf19f4bb562f2858575d690908751262db3
 
-# Contain identical checksums
 CKSUM_CRATES+= vendor/rand-0.6.1
 CKSUMS+=       1e732c2e3b4bd1561f11e0979bf9d20669a96eae7afe0deff9dfbb980ee47bf1
 CKSUMS+=       bc03f2345d7cfa7000f9da817120b6afa073359789c21a9a790ebd8676c50cca
 
+CKSUM_CRATES+= vendor/mio
+CKSUMS+=       62331824b1f5022e372b875faad41a970abb13e63c15e3fae9af948a2b06e4e1
+CKSUMS+=       6fc27e48d0c7275588da244c372994ef442bc4ecd78264cc5337a55b79798f62
+CKSUMS+=       bf76f97c0dc9dfe870b8e865ea03ebbdfa939494a6fea809ac530d8055a56ec0
+CKSUMS+=       f4d143c57f3b87e4af6381ea33cb81c3c3577aa717bf7690e0a5c1eea73d2baa
+
+CKSUM_CRATES+= vendor/net2
+CKSUMS+=       b9300ae246e9ac451889f146ece8bb6ed4a95482edf806373de5af759cd09360
+CKSUMS+=       762a881d936363f4140bc6befc516f9b3f321ef0a6eb9f3f812aa15ab32b56c0
+CKSUMS+=       bb28a7275eac021132b01206d134802902d616c0be3e82100b45a3ff1eba4c02
+CKSUMS+=       baa97a46744047bef086334ed9a63b340e4aba85e6471493780fc99d8e6445ed
+CKSUMS+=       8d8a171090b75e86e7505921460fba072db0077942edd11c4a3c8a70e9164eef
+CKSUMS+=       7ad3b486020bd652ad7c5af752f039c30ee0099c86ff6b6f336587db7a2bc523
+
+CKSUM_CRATES+= vendor/time
+CKSUMS+=       4f6bc5c6300c2d49da7d21615152872e16d53c0f02540824f48c45edd4d3140f
+CKSUMS+=       6d460b1899de033f625ccb13b1e3ba28cd338980a8c88c518a18749a079bafc3
+
 SUBST_CLASSES+=                cksum
 SUBST_STAGE.cksum=     pre-configure
 .for crate in ${CKSUM_CRATES}
@@ -461,7 +478,7 @@ stage0-bootstrap: install
                   libssh2.so.1 libunistring.so.2; do \
                ${CP} ${PREFIX}/lib/$${lib} ${BOOTSTRAP_TMPDIR}/lib/pkgsrc/; \
        done
-       for f in ${BOOTSTRAP_TMPDIR}/bin/{cargo*,clippy*,miri,rls,rustc,rustdoc,rustfmt}; do \
+       for f in ${BOOTSTRAP_TMPDIR}/bin/{cargo*,clippy*,rls,rustc,rustdoc,rustfmt}; do \
                ${ELFEDIT} -e 'dyn:runpath $$ORIGIN/../lib:$$ORIGIN/../lib/pkgsrc' $$f; \
        done
        for f in ${BOOTSTRAP_TMPDIR}/lib/pkgsrc/*.so*; do \
@@ -470,7 +487,7 @@ stage0-bootstrap: install
        for f in ${BOOTSTRAP_TMPDIR}/lib/*.so*; do \
                ${ELFEDIT} -e 'dyn:runpath $$ORIGIN:$$ORIGIN/pkgsrc' $$f; \
        done
-       for f in ${BOOTSTRAP_TMPDIR}/lib/rustlib/${RUST_ARCH}/*/*.so*; do \
+       for f in ${BOOTSTRAP_TMPDIR}/lib/rustlib/*/*/*.so*; do \
                ${ELFEDIT} -e 'dyn:runpath $$ORIGIN:$$ORIGIN/../../..:$$ORIGIN/../../../pkgsrc' $$f; \
        done
        (cd ${WRKDIR}; \

Index: pkgsrc/lang/rust/buildlink3.mk
diff -u pkgsrc/lang/rust/buildlink3.mk:1.5 pkgsrc/lang/rust/buildlink3.mk:1.6
--- pkgsrc/lang/rust/buildlink3.mk:1.5  Sun Jun 14 15:38:18 2020
+++ pkgsrc/lang/rust/buildlink3.mk      Wed Jul  8 14:46:14 2020
@@ -1,9 +1,8 @@
-# $NetBSD: buildlink3.mk,v 1.5 2020/06/14 15:38:18 nia Exp $
+# $NetBSD: buildlink3.mk,v 1.6 2020/07/08 14:46:14 jperkin Exp $
 
 #
 # DO NOT include this directly! Use rust.mk instead.
 #
-
 BUILDLINK_TREE+=       rust
 
 .if !defined(RUST_BUILDLINK3_MK)

Index: pkgsrc/lang/rust/cross.mk
diff -u pkgsrc/lang/rust/cross.mk:1.1 pkgsrc/lang/rust/cross.mk:1.2
--- pkgsrc/lang/rust/cross.mk:1.1       Mon Jul  6 19:09:29 2020
+++ pkgsrc/lang/rust/cross.mk   Wed Jul  8 14:46:14 2020
@@ -1,4 +1,4 @@
-# $Id: cross.mk,v 1.1 2020/07/06 19:09:29 he Exp $
+# $NetBSD: cross.mk,v 1.2 2020/07/08 14:46:14 jperkin Exp $
 
 # These settings may be used to cross-build rust.
 #
@@ -32,11 +32,11 @@
 # the ultimate target to built for, as well as the
 # host the compiler is supposed to run on.
 # Rust's target designation
-#TARGET=               armv7-unknown-netbsd-eabihf
-#TARGET=               sparc64-unknown-netbsd
-#TARGET=               powerpc-unknown-netbsd
-#TARGET=               aarch64-unknown-netbsd
-#TARGET=               i686-unknown-netbsd
+#TARGET=               armv7-unknown-netbsd-eabihf
+#TARGET=               sparc64-unknown-netbsd
+#TARGET=               powerpc-unknown-netbsd
+#TARGET=               aarch64-unknown-netbsd
+#TARGET=               i686-unknown-netbsd
 #
 #SCRIPTS=              ${WRKDIR}/scripts
 #CONFIGURE_ARGS+=      --host=${TARGET}
@@ -48,3 +48,11 @@
 
 # May be required when cross-building on NetBSD
 #MAKE_ENV+=            OPENSSL_DIR=/usr
+
+#
+# Cross-compile illumos target.  The host is identical, it's just the target that
+# has been renamed.
+#
+#CONFIGURE_ARGS+=      --set=target.x86_64-unknown-illumos.llvm-config=${BUILDLINK_PREFIX.llvm}/bin/llvm-config
+#CONFIGURE_ARGS+=      --host=x86_64-unknown-illumos
+#CONFIGURE_ARGS+=      --target=x86_64-unknown-illumos

Index: pkgsrc/lang/rust/distinfo
diff -u pkgsrc/lang/rust/distinfo:1.116 pkgsrc/lang/rust/distinfo:1.117
--- pkgsrc/lang/rust/distinfo:1.116     Tue Jul  7 10:44:02 2020
+++ pkgsrc/lang/rust/distinfo   Wed Jul  8 14:46:14 2020
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.116 2020/07/07 10:44:02 he Exp $
+$NetBSD: distinfo,v 1.117 2020/07/08 14:46:14 jperkin Exp $
 
 SHA1 (rust-1.41.1-i686-apple-darwin.tar.gz) = 5a778b77fc88b19f1c668316e3bf677c60f8ead1
 RMD160 (rust-1.41.1-i686-apple-darwin.tar.gz) = ae61f32a4d27a760e6f2b79f4042ed0cf385f784
@@ -112,7 +112,7 @@ SHA1 (patch-src_librustc__codegen__ssa_b
 SHA1 (patch-src_librustc__llvm_build.rs) = 7cc2aa0568aa2cbf4eb1fdbb00922b10df0b3ff6
 SHA1 (patch-src_librustc__target_spec_solaris__base.rs) = 63bf74e64f01e918db0860c43eefe50185c9a0c2
 SHA1 (patch-src_librustc__target_spec_x86__64__sun__solaris.rs) = f6ad33b41906bbf83a1cbd0e2fe13a4da37266fa
-SHA1 (patch-src_libstd_build.rs) = 8d9508a3c8931f280e5b8031413672a485094872
+SHA1 (patch-src_libstd_build.rs) = eb8faae53e997c14a40c0d35615f4ca5e316e7cc
 SHA1 (patch-src_libstd_sys_unix_thread.rs) = 2554f1a42afaa0ddce5053860f4dabecdf6c527a
 SHA1 (patch-src_libunwind_build.rs) = 723ded63580812f74d04c447f90925725ae9bfc9
 SHA1 (patch-src_llvm-project_llvm_CMakeLists.txt) = d49503d19c30a64d571eb7fa79e7aad7038cd427
@@ -130,4 +130,10 @@ SHA1 (patch-vendor_backtrace-sys_src_lib
 SHA1 (patch-vendor_libc_src_unix_solarish_mod.rs) = 804ea03be546fef0d2bd37d7f8abb26d38a7892b
 SHA1 (patch-vendor_libssh2-sys_libssh2_Makefile.am) = 5343adcf044eeed1f325cd29d28964e209a50058
 SHA1 (patch-vendor_lzma-sys_config.h) = ab963fc8d7a847715e0e0dc2928333efe38e923f
+SHA1 (patch-vendor_mio_src_sys_unix_mod.rs) = ebc40c32ee5a709cce986304c493cb852aee642e
+SHA1 (patch-vendor_mio_src_sys_unix_ready.rs) = 2479285f60290c3669df84b6a6ce9f5fd0c5edc7
+SHA1 (patch-vendor_net2_src_ext.rs) = d390377f3ba98b9a38c9460c2b320af5b26901b6
+SHA1 (patch-vendor_net2_src_lib.rs) = dc3595a88f1322f39049de23755ef54f340eb054
+SHA1 (patch-vendor_net2_src_sys_unix_mod.rs) = 368b05d524edbaf3bb4f72b7066086aa876e2b9a
 SHA1 (patch-vendor_rand__os_src_netbsd.rs) = 049df63c904abd81cb92f33fa0882f5c81cae51a
+SHA1 (patch-vendor_time_src_sys.rs) = 9684a60cb9c6fb6a0f3eed3d6101a76986a38d8d

Index: pkgsrc/lang/rust/rust.mk
diff -u pkgsrc/lang/rust/rust.mk:1.4 pkgsrc/lang/rust/rust.mk:1.5
--- pkgsrc/lang/rust/rust.mk:1.4        Sun Jun 14 19:40:52 2020
+++ pkgsrc/lang/rust/rust.mk    Wed Jul  8 14:46:14 2020
@@ -1,5 +1,5 @@
-# $NetBSD: rust.mk,v 1.4 2020/06/14 19:40:52 nia Exp $
-# 
+# $NetBSD: rust.mk,v 1.5 2020/07/08 14:46:14 jperkin Exp $
+#
 # This file determines the type of rust package to use.
 #
 # It should be included by rust-dependent packages that don't use

Index: pkgsrc/lang/rust/patches/patch-src_libstd_build.rs
diff -u pkgsrc/lang/rust/patches/patch-src_libstd_build.rs:1.8 pkgsrc/lang/rust/patches/patch-src_libstd_build.rs:1.9
--- pkgsrc/lang/rust/patches/patch-src_libstd_build.rs:1.8      Mon Jul  6 13:56:32 2020
+++ pkgsrc/lang/rust/patches/patch-src_libstd_build.rs  Wed Jul  8 14:46:14 2020
@@ -1,10 +1,9 @@
-$NetBSD: patch-src_libstd_build.rs,v 1.8 2020/07/06 13:56:32 he Exp $
+$NetBSD: patch-src_libstd_build.rs,v 1.9 2020/07/08 14:46:14 jperkin Exp $
 
-SunOS support:
- - Support PKGSRC_USE_SSP (ugly for now).
- - Add libexecinfo for backtrace().
+- Support PKGSRC_USE_SSP (ugly for now).
+- Add libexecinfo for backtrace().
 
---- src/libstd/build.rs.orig   2019-08-13 06:27:22.000000000 +0000
+--- src/libstd/build.rs.orig   2020-06-01 15:44:16.000000000 +0000
 +++ src/libstd/build.rs
 @@ -16,6 +16,7 @@ fn main() {
          println!("cargo:rustc-link-lib=execinfo");
@@ -14,12 +13,20 @@ SunOS support:
          println!("cargo:rustc-link-lib=pthread");
          println!("cargo:rustc-link-lib=rt");
      } else if target.contains("dragonfly") || target.contains("openbsd") {
-@@ -31,6 +32,8 @@ fn main() {
+@@ -25,12 +26,16 @@ fn main() {
+         println!("cargo:rustc-link-lib=posix4");
+         println!("cargo:rustc-link-lib=pthread");
+         println!("cargo:rustc-link-lib=resolv");
++        println!("cargo:rustc-link-lib=nsl");
++        println!("cargo:rustc-link-lib=ssp");
++        println!("cargo:rustc-link-lib=umem");
+     } else if target.contains("illumos") {
+         println!("cargo:rustc-link-lib=socket");
+         println!("cargo:rustc-link-lib=posix4");
          println!("cargo:rustc-link-lib=pthread");
          println!("cargo:rustc-link-lib=resolv");
          println!("cargo:rustc-link-lib=nsl");
-+      // pkgsrc hack until I can figure out how to pass it through properly
-+      println!("cargo:rustc-link-lib=ssp");
++        println!("cargo:rustc-link-lib=ssp");
          // Use libumem for the (malloc-compatible) allocator
          println!("cargo:rustc-link-lib=umem");
      } else if target.contains("apple-darwin") {

Added files:

Index: pkgsrc/lang/rust/patches/patch-vendor_mio_src_sys_unix_mod.rs
diff -u /dev/null pkgsrc/lang/rust/patches/patch-vendor_mio_src_sys_unix_mod.rs:1.1
--- /dev/null   Wed Jul  8 14:46:14 2020
+++ pkgsrc/lang/rust/patches/patch-vendor_mio_src_sys_unix_mod.rs       Wed Jul  8 14:46:14 2020
@@ -0,0 +1,19 @@
+$NetBSD: patch-vendor_mio_src_sys_unix_mod.rs,v 1.1 2020/07/08 14:46:14 jperkin Exp $
+
+Support illumos.
+
+--- vendor/mio/src/sys/unix/mod.rs.orig        2020-06-01 17:45:25.000000000 +0000
++++ vendor/mio/src/sys/unix/mod.rs
+@@ -3,10 +3,10 @@ use libc::{self, c_int};
+ #[macro_use]
+ pub mod dlsym;
+ 
+-#[cfg(any(target_os = "linux", target_os = "android", target_os = "solaris"))]
++#[cfg(any(target_os = "linux", target_os = "android", target_os = "solaris", target_os = "illumos"))]
+ mod epoll;
+ 
+-#[cfg(any(target_os = "linux", target_os = "android", target_os = "solaris"))]
++#[cfg(any(target_os = "linux", target_os = "android", target_os = "solaris", target_os = "illumos"))]
+ pub use self::epoll::{Events, Selector};
+ 
+ #[cfg(any(target_os = "bitrig", target_os = "dragonfly",
Index: pkgsrc/lang/rust/patches/patch-vendor_mio_src_sys_unix_ready.rs
diff -u /dev/null pkgsrc/lang/rust/patches/patch-vendor_mio_src_sys_unix_ready.rs:1.1
--- /dev/null   Wed Jul  8 14:46:14 2020
+++ pkgsrc/lang/rust/patches/patch-vendor_mio_src_sys_unix_ready.rs     Wed Jul  8 14:46:14 2020
@@ -0,0 +1,42 @@
+$NetBSD: patch-vendor_mio_src_sys_unix_ready.rs,v 1.1 2020/07/08 14:46:14 jperkin Exp $
+
+Support illumos.
+
+--- vendor/mio/src/sys/unix/ready.rs.orig      2020-06-01 17:45:25.000000000 +0000
++++ vendor/mio/src/sys/unix/ready.rs
+@@ -110,7 +110,7 @@ const LIO: usize   = 0b100000;
+ const LIO: usize   = 0b000000;
+ 
+ 
+-#[cfg(any(target_os = "linux", target_os = "android", target_os = "solaris"))]
++#[cfg(any(target_os = "linux", target_os = "android", target_os = "solaris", target_os = "illumos"))]
+ const PRI: usize = ::libc::EPOLLPRI as usize;
+ 
+ 
+@@ -241,7 +241,7 @@ impl UnixReady {
+     /// [`Poll`]: struct.Poll.html
+     #[inline]
+     #[cfg(any(target_os = "linux",
+-        target_os = "android", target_os = "solaris"))]
++        target_os = "android", target_os = "solaris", target_os = "illumos"))]
+     pub fn priority() -> UnixReady {
+         UnixReady(ready_from_usize(PRI))
+     }
+@@ -368,7 +368,7 @@ impl UnixReady {
+     /// [`Poll`]: struct.Poll.html
+     #[inline]
+     #[cfg(any(target_os = "linux",
+-        target_os = "android", target_os = "solaris"))]
++        target_os = "android", target_os = "solaris", target_os = "illumos"))]
+     pub fn is_priority(&self) -> bool {
+         self.contains(ready_from_usize(PRI))
+     }
+@@ -459,7 +459,7 @@ impl fmt::Debug for UnixReady {
+             #[allow(deprecated)]
+             (UnixReady::aio(), "Aio"),
+             #[cfg(any(target_os = "linux",
+-                target_os = "android", target_os = "solaris"))]
++                target_os = "android", target_os = "solaris", target_os = "illumos"))]
+             (UnixReady::priority(), "Priority"),
+         ];
+ 
Index: pkgsrc/lang/rust/patches/patch-vendor_net2_src_ext.rs
diff -u /dev/null pkgsrc/lang/rust/patches/patch-vendor_net2_src_ext.rs:1.1
--- /dev/null   Wed Jul  8 14:46:14 2020
+++ pkgsrc/lang/rust/patches/patch-vendor_net2_src_ext.rs       Wed Jul  8 14:46:14 2020
@@ -0,0 +1,14 @@
+$NetBSD: patch-vendor_net2_src_ext.rs,v 1.1 2020/07/08 14:46:14 jperkin Exp $
+
+Support illumos.
+
+--- vendor/net2/src/ext.rs.orig        2020-06-01 17:45:25.000000000 +0000
++++ vendor/net2/src/ext.rs
+@@ -28,6 +28,7 @@ cfg_if! {
+                  target_os = "netbsd",
+                  target_os = "openbsd",
+                  target_os = "solaris",
++                 target_os = "illumos",
+                  target_env = "uclibc"))] {
+         use libc::IPV6_JOIN_GROUP as IPV6_ADD_MEMBERSHIP;
+         use libc::IPV6_LEAVE_GROUP as IPV6_DROP_MEMBERSHIP;
Index: pkgsrc/lang/rust/patches/patch-vendor_net2_src_lib.rs
diff -u /dev/null pkgsrc/lang/rust/patches/patch-vendor_net2_src_lib.rs:1.1
--- /dev/null   Wed Jul  8 14:46:14 2020
+++ pkgsrc/lang/rust/patches/patch-vendor_net2_src_lib.rs       Wed Jul  8 14:46:14 2020
@@ -0,0 +1,15 @@
+$NetBSD: patch-vendor_net2_src_lib.rs,v 1.1 2020/07/08 14:46:14 jperkin Exp $
+
+Support illumos.
+
+--- vendor/net2/src/lib.rs.orig        2020-06-01 17:45:25.000000000 +0000
++++ vendor/net2/src/lib.rs
+@@ -63,7 +63,7 @@ mod utils;
+ #[cfg(target_os="redox")] #[path = "sys/redox/mod.rs"] mod sys;
+ #[cfg(unix)] #[path = "sys/unix/mod.rs"] mod sys;
+ #[cfg(windows)] #[path = "sys/windows/mod.rs"] mod sys;
+-#[cfg(all(unix, not(any(target_os = "solaris"))))] pub mod unix;
++#[cfg(all(unix, not(any(target_os = "solaris", target_os = "illumos"))))] pub mod unix;
+ 
+ pub use tcp::TcpBuilder;
+ pub use udp::UdpBuilder;
Index: pkgsrc/lang/rust/patches/patch-vendor_net2_src_sys_unix_mod.rs
diff -u /dev/null pkgsrc/lang/rust/patches/patch-vendor_net2_src_sys_unix_mod.rs:1.1
--- /dev/null   Wed Jul  8 14:46:14 2020
+++ pkgsrc/lang/rust/patches/patch-vendor_net2_src_sys_unix_mod.rs      Wed Jul  8 14:46:14 2020
@@ -0,0 +1,33 @@
+$NetBSD: patch-vendor_net2_src_sys_unix_mod.rs,v 1.1 2020/07/08 14:46:14 jperkin Exp $
+
+Support illumos.
+
+--- vendor/net2/src/sys/unix/mod.rs.orig       2020-06-01 17:45:25.000000000 +0000
++++ vendor/net2/src/sys/unix/mod.rs
+@@ -14,7 +14,7 @@ use std::mem;
+ use std::net::{TcpListener, TcpStream, UdpSocket};
+ use std::os::unix::io::FromRawFd;
+ use libc::{self, c_int};
+-#[cfg(not(any(target_os = "solaris", target_os = "emscripten")))]
++#[cfg(not(any(target_os = "solaris", target_os = "emscripten", target_os = "illumos")))]
+ use libc::{ioctl, FIOCLEX};
+ 
+ mod impls;
+@@ -36,7 +36,7 @@ pub struct Socket {
+ }
+ 
+ impl Socket {
+-    #[cfg(not(any(target_os = "solaris", target_os = "emscripten")))]
++    #[cfg(not(any(target_os = "solaris", target_os = "emscripten", target_os = "illumos")))]
+     pub fn new(family: c_int, ty: c_int) -> io::Result<Socket> {
+         unsafe {
+             // Linux >2.6.26 overloads the type argument to accept SOCK_CLOEXEC,
+@@ -58,7 +58,7 @@ impl Socket {
+ 
+     // ioctl(FIOCLEX) is not supported by Solaris/Illumos or emscripten,
+     // use fcntl(FD_CLOEXEC) instead
+-    #[cfg(any(target_os = "solaris", target_os = "emscripten"))]
++    #[cfg(any(target_os = "solaris", target_os = "emscripten", target_os = "illumos"))]
+     pub fn new(family: c_int, ty: c_int) -> io::Result<Socket> {
+         unsafe {
+             let fd = try!(::cvt(libc::socket(family, ty, 0)));
Index: pkgsrc/lang/rust/patches/patch-vendor_time_src_sys.rs
diff -u /dev/null pkgsrc/lang/rust/patches/patch-vendor_time_src_sys.rs:1.1
--- /dev/null   Wed Jul  8 14:46:14 2020
+++ pkgsrc/lang/rust/patches/patch-vendor_time_src_sys.rs       Wed Jul  8 14:46:14 2020
@@ -0,0 +1,51 @@
+$NetBSD: patch-vendor_time_src_sys.rs,v 1.1 2020/07/08 14:46:14 jperkin Exp $
+
+Support illumos.
+
+--- vendor/time/src/sys.rs.orig        2020-06-01 17:45:25.000000000 +0000
++++ vendor/time/src/sys.rs
+@@ -359,7 +359,7 @@ mod inner {
+     #[cfg(all(not(target_os = "macos"), not(target_os = "ios")))]
+     pub use self::unix::*;
+ 
+-    #[cfg(target_os = "solaris")]
++    #[cfg(any(target_os = "solaris", target_os = "illumos"))]
+     extern {
+         static timezone: time_t;
+         static altzone: time_t;
+@@ -390,7 +390,7 @@ mod inner {
+         rust_tm.tm_utcoff = utcoff;
+     }
+ 
+-    #[cfg(any(target_os = "nacl", target_os = "solaris"))]
++    #[cfg(any(target_os = "nacl", target_os = "solaris", target_os = "illumos"))]
+     unsafe fn timegm(tm: *mut libc::tm) -> time_t {
+         use std::env::{set_var, var_os, remove_var};
+         extern {
+@@ -433,7 +433,7 @@ mod inner {
+             if libc::localtime_r(&sec, &mut out).is_null() {
+                 panic!("localtime_r failed: {}", io::Error::last_os_error());
+             }
+-            #[cfg(target_os = "solaris")]
++            #[cfg(any(target_os = "solaris", target_os = "illumos"))]
+             let gmtoff = {
+                 ::tzset();
+                 // < 0 means we don't know; assume we're not in DST.
+@@ -446,7 +446,7 @@ mod inner {
+                     -timezone
+                 }
+             };
+-            #[cfg(not(target_os = "solaris"))]
++            #[cfg(not(any(target_os = "solaris", target_os = "illumos")))]
+             let gmtoff = out.tm_gmtoff;
+             tm_to_rust_tm(&out, gmtoff as i32, tm);
+         }
+@@ -455,7 +455,7 @@ mod inner {
+     pub fn utc_tm_to_time(rust_tm: &Tm) -> i64 {
+         #[cfg(all(target_os = "android", target_pointer_width = "32"))]
+         use libc::timegm64 as timegm;
+-        #[cfg(not(any(all(target_os = "android", target_pointer_width = "32"), target_os = "nacl", target_os = "solaris")))]
++        #[cfg(not(any(all(target_os = "android", target_pointer_width = "32"), target_os = "nacl", target_os = "solaris", target_os = "illumos")))]
+         use libc::timegm;
+ 
+         let mut tm = unsafe { mem::zeroed() };



Home | Main Index | Thread Index | Old Index