pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/lang/rust Import rust 1.11.0 as lang/rust into pkgsrc.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/b06909a2122d
branches:  trunk
changeset: 352077:b06909a2122d
user:      jperkin <jperkin%pkgsrc.org@localhost>
date:      Tue Sep 06 10:36:49 2016 +0000

description:
Import rust 1.11.0 as lang/rust into pkgsrc.

pkgsrc notes:

  * The build requires binary bootstraps built by the Rust team.  Due
    to the requirement that only the previous version is supported as
    a bootstrap compiler, and new versions of Rust are released every
    6 weeks, it is unlikely to be practical to build TNF bootstraps.
    Users should evaluate whether they trust binaries from upstream.

  * There is currently no SunOS bootstrap provided by the Rust team,
    so for now a version built by myself is provided by Joyent.

  * Only Darwin/Linux/SunOS are currently supported.  The Rust team do
    provide NetBSD bootstraps so support should be easy enough to add.

Information about Rust from the DESCR:

Rust is a systems programming language focused on three goals: safety,
speed, and concurrency.  It maintains these goals without having a
garbage collector, making it a useful language for a number of use cases
other languages aren't good at: embedding in other languages, programs
with specific space and time requirements, and writing low-level code,
like device drivers and operating systems.

It improves on current languages targeting this space by having a number
of compile-time safety checks that produce no runtime overhead, while
eliminating all data races.  Rust also aims to achieve "zero-cost
abstractions" even though some of these abstractions feel like those of
a high-level language.  Even then, Rust still allows precise control
like a low-level language would.

diffstat:

 lang/rust/DESCR                                                           |   13 +
 lang/rust/Makefile                                                        |  163 ++++++++++
 lang/rust/PLIST                                                           |  104 ++++++
 lang/rust/PLIST.gdb                                                       |    4 +
 lang/rust/PLIST.lldb                                                      |    3 +
 lang/rust/buildlink3.mk                                                   |   14 +
 lang/rust/distinfo                                                        |   37 ++
 lang/rust/patches/patch-mk_cfg_x86__64-apple-darwin.mk                    |   15 +
 lang/rust/patches/patch-mk_rt.mk                                          |   18 +
 lang/rust/patches/patch-mk_rustllvm.mk                                    |   18 +
 lang/rust/patches/patch-src_etc_local__stage0.sh                          |   25 +
 lang/rust/patches/patch-src_liblibc_src_unix_solaris_mod.rs               |   31 +
 lang/rust/patches/patch-src_librustc__trans_back_linker.rs                |   15 +
 lang/rust/patches/patch-src_libstd_rtdeps.rs                              |   19 +
 lang/rust/patches/patch-src_libstd_sys_unix_thread.rs                     |   14 +
 lang/rust/patches/patch-src_llvm_Makefile.rules                           |   14 +
 lang/rust/patches/patch-src_llvm_cmake_modules_AddLLVM.cmake              |   15 +
 lang/rust/patches/patch-src_llvm_lib_CodeGen_MachineDominanceFrontier.cpp |   14 +
 lang/rust/patches/patch-src_llvm_utils_buildit_build__llvm                |   15 +
 lang/rust/patches/patch-src_rust-installer_gen-install-script.sh          |   21 +
 lang/rust/patches/patch-src_rust-installer_gen-installer.sh               |   40 ++
 lang/rust/patches/patch-src_rust-installer_install-template.sh            |   27 +
 22 files changed, 639 insertions(+), 0 deletions(-)

diffs (truncated from 727 to 300 lines):

diff -r 0ae61a94cb19 -r b06909a2122d lang/rust/DESCR
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/rust/DESCR   Tue Sep 06 10:36:49 2016 +0000
@@ -0,0 +1,13 @@
+Rust is a systems programming language focused on three goals: safety,
+speed, and concurrency.  It maintains these goals without having a
+garbage collector, making it a useful language for a number of use cases
+other languages aren't good at: embedding in other languages, programs
+with specific space and time requirements, and writing low-level code,
+like device drivers and operating systems.
+
+It improves on current languages targeting this space by having a number
+of compile-time safety checks that produce no runtime overhead, while
+eliminating all data races.  Rust also aims to achieve "zero-cost
+abstractions" even though some of these abstractions feel like those of
+a high-level language.  Even then, Rust still allows precise control
+like a low-level language would.
diff -r 0ae61a94cb19 -r b06909a2122d lang/rust/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/rust/Makefile        Tue Sep 06 10:36:49 2016 +0000
@@ -0,0 +1,163 @@
+# $NetBSD: Makefile,v 1.1 2016/09/06 10:36:49 jperkin Exp $
+
+DISTNAME=      rustc-1.11.0-src
+PKGNAME=       ${DISTNAME:S/rustc/rust/:S/-src//}
+CATEGORIES=    lang
+MASTER_SITES=  http://static.rust-lang.org/dist/
+
+MAINTAINER=    pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=      http://www.rust-lang.org/
+COMMENT=       Safe, concurrent, practical language
+LICENSE=       mit OR apache-2.0
+
+WRKSRC=                ${WRKDIR}/${DISTNAME:S/-src//}
+
+USE_GCC_RUNTIME=       yes
+USE_LANGUAGES=         c c++
+USE_TOOLS+=            bash gmake
+
+HAS_CONFIGURE=         yes
+CONFIGURE_ARGS+=       --prefix=${PREFIX}
+CONFIGURE_ARGS+=       --build=${RUST_ARCH}
+CONFIGURE_ARGS+=       --mandir=${PREFIX}/${PKGMANDIR}
+CONFIGURE_ARGS+=       --release-channel=stable
+CONFIGURE_ENV+=                CFG_DISABLE_CODEGEN_TESTS=1
+
+UNLIMIT_RESOURCES+=    cputime
+
+REPLACE_BASH+= src/rust-installer/gen-install-script.sh
+REPLACE_BASH+= src/rust-installer/gen-installer.sh
+
+#
+# Lots of per-platform specific documentation, e.g. for each system call,
+# making it difficult to PLIST.  If it ends up being important we'll just have
+# to go with lots of PLIST.${OPSYS}
+#
+CONFIGURE_ARGS+=       --disable-docs
+
+TEST_TARGET=   check
+
+# Required for LLVM (-std=c++11)
+GCC_REQD+=     4.8
+
+.include "../../mk/bsd.prefs.mk"
+
+#
+# Use jemalloc on systems where rust does by default too.
+#
+PLIST_VARS+=           jemalloc
+.if ${OPSYS} == "Linux" || ${OPSYS} == "Darwin"
+.  include "../../devel/jemalloc/buildlink3.mk"
+CONFIGURE_ARGS+=       --jemalloc-root=${BUILDLINK_PREFIX.jemalloc}/lib
+PLIST.jemalloc=                yes
+.else
+CONFIGURE_ARGS+=       --disable-jemalloc
+.endif
+
+#
+# Can't use pkgsrc llvm on SunOS at the moment due to a relocation error.
+#
+.if ${OPSYS} != "SunOS"
+.  include "../../lang/llvm/buildlink3.mk"
+CONFIGURE_ARGS+=       --llvm-root=${BUILDLINK_PREFIX.llvm}
+.endif
+
+#
+# Rust unfortunately requires itself to build.  On platforms which aren't
+# supported by upstream (where they offer binary bootstraps), or where we
+# do not trust random binaries from the Internet, we need to build and
+# provide our own bootstrap.
+#
+# pkgsrc can be used to do this, but the resulting bootstrap must be
+# relocatable (i.e. $ORIGIN) and not depend on anything from pkgsrc (so it
+# is common to use rust's internal llvm).
+#
+# The following variables need to be modified/commented out when producing
+# a stage2 bootstrap.
+#
+CONFIGURE_ARGS+=       --enable-local-rust
+CONFIGURE_ARGS+=       --local-rust-root=${WRKDIR}/rust-${RUST_STAGE2_VER}-${RUST_ARCH}/rustc
+#
+.if !empty(MACHINE_PLATFORM:MDarwin-*-i386)
+RUST_ARCH=             i686-apple-darwin
+.elif !empty(MACHINE_PLATFORM:MDarwin-*-x86_64)
+RUST_ARCH=             x86_64-apple-darwin
+.elif !empty(MACHINE_PLATFORM:MLinux-*-i386)
+RUST_ARCH=             i686-unknown-linux-gnu
+.elif !empty(MACHINE_PLATFORM:MLinux-*-x86_64)
+RUST_ARCH=             x86_64-unknown-linux-gnu
+.elif !empty(MACHINE_PLATFORM:MSunOS-*-x86_64)
+RUST_ARCH=             x86_64-sun-solaris
+SITES.${RUST_STAGE2}=  https://us-east.manta.joyent.com/pkgsrc/public/tmp/
+.else
+NOT_FOR_PLATFORM+=     ${MACHINE_PLATFORM}
+.endif
+
+RUST_STAGE2_VER=       1.10.0
+RUST_STAGE2?=          rust-${RUST_STAGE2_VER}-${RUST_ARCH}.tar.gz
+SITES.${RUST_STAGE2}?= https://static.rust-lang.org/dist/
+DISTFILES=             ${DEFAULT_DISTFILES} ${RUST_STAGE2}
+
+PLIST_SRC=             PLIST
+.if ${OPSYS} == "Darwin"
+PLIST_SRC+=            PLIST.lldb
+.else
+PLIST_SRC+=            PLIST.gdb
+.endif
+
+OPSYSVARS+=            SOEXT
+SOEXT.Darwin=          dylib
+SOEXT.*=               so
+
+RUST_VERHASH=          39b92f95
+PLIST_SUBST+=          RUST_ARCH=${RUST_ARCH:Q}
+PLIST_SUBST+=          RUST_VERHASH=${RUST_VERHASH:Q}
+PLIST_SUBST+=          SOEXT=${SOEXT:Q}
+PRINT_PLIST_AWK+=      { gsub(/${RUST_ARCH}/, "$${RUST_ARCH}") }
+PRINT_PLIST_AWK+=      { gsub(/${RUST_VERHASH}/, "$${RUST_VERHASH}") }
+PRINT_PLIST_AWK+=      { gsub(/\.${SOEXT}/, ".$${SOEXT}") }
+
+.if ${OPSYS} == "SunOS"
+BUILD_DEPENDS+=                grep>=0:../../textproc/grep
+BUILD_DEPENDS+=                coreutils>=0:../../sysutils/coreutils
+TOOLS_PATH.grep=       ${PREFIX}/bin/ggrep
+TOOLS_CREATE+=         md5sum
+TOOLS_PATH.md5sum=     ${PREFIX}/bin/gmd5sum
+
+SUBST_CLASSES+=                ranlib
+SUBST_STAGE.ranlib=    pre-configure
+SUBST_FILES.ranlib=    mk/rt.mk
+SUBST_SED.ranlib=      -e 's,RANLIB=.* \\,RANLIB="true" \\,g'
+.endif
+
+post-install:
+       ${RM} -f ${DESTDIR}${PREFIX}/lib/rustlib/install.log
+
+.if ${OPSYS} == "Darwin"
+.PHONY: fix-darwin-install-name
+post-install: fix-darwin-install-name
+fix-darwin-install-name:
+.  for bin in rustc rustdoc
+       otool -XL ${DESTDIR}${PREFIX}/bin/${bin}                        \
+           | ${GREP} '@rpath' | while read rpath rest; do              \
+               install_name_tool -change $$rpath                       \
+                   `${ECHO} $$rpath | ${SED} -e 's,@rpath,${PREFIX}/lib,g'` \
+                   ${DESTDIR}${PREFIX}/bin/${bin};                     \
+       done
+.  endfor
+.  for libdir in lib lib/rustlib/${RUST_ARCH}/lib
+       for f in ${DESTDIR}${PREFIX}/${libdir}/lib*.dylib; do           \
+               [ ! -f $$f ] && continue;                               \
+               install_name_tool -id `${ECHO} $$f | ${SED} -e 's,${DESTDIR},,g'` $$f; \
+               otool -XL $$f | grep '@rpath' | while read rpath rest; do \
+                       install_name_tool -change $$rpath \
+                           `${ECHO} $$rpath | ${SED} -e 's,@rpath,${PREFIX}/${libdir},g'` \
+                           $$f;                                        \
+               done;                                                   \
+       done
+.  endfor
+.endif
+
+.include "../../devel/cmake/buildlink3.mk"
+.include "../../lang/python/tool.mk"
+.include "../../mk/bsd.pkg.mk"
diff -r 0ae61a94cb19 -r b06909a2122d lang/rust/PLIST
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/rust/PLIST   Tue Sep 06 10:36:49 2016 +0000
@@ -0,0 +1,104 @@
+@comment $NetBSD: PLIST,v 1.1 2016/09/06 10:36:49 jperkin Exp $
+bin/rustc
+bin/rustdoc
+lib/libarena-${RUST_VERHASH}.${SOEXT}
+lib/libflate-${RUST_VERHASH}.${SOEXT}
+lib/libfmt_macros-${RUST_VERHASH}.${SOEXT}
+lib/libgetopts-${RUST_VERHASH}.${SOEXT}
+lib/libgraphviz-${RUST_VERHASH}.${SOEXT}
+lib/liblog-${RUST_VERHASH}.${SOEXT}
+lib/librbml-${RUST_VERHASH}.${SOEXT}
+lib/librustc-${RUST_VERHASH}.${SOEXT}
+lib/librustc_back-${RUST_VERHASH}.${SOEXT}
+lib/librustc_borrowck-${RUST_VERHASH}.${SOEXT}
+lib/librustc_const_eval-${RUST_VERHASH}.${SOEXT}
+lib/librustc_const_math-${RUST_VERHASH}.${SOEXT}
+lib/librustc_data_structures-${RUST_VERHASH}.${SOEXT}
+lib/librustc_driver-${RUST_VERHASH}.${SOEXT}
+lib/librustc_errors-${RUST_VERHASH}.${SOEXT}
+lib/librustc_incremental-${RUST_VERHASH}.${SOEXT}
+lib/librustc_lint-${RUST_VERHASH}.${SOEXT}
+lib/librustc_llvm-${RUST_VERHASH}.${SOEXT}
+lib/librustc_metadata-${RUST_VERHASH}.${SOEXT}
+lib/librustc_mir-${RUST_VERHASH}.${SOEXT}
+lib/librustc_passes-${RUST_VERHASH}.${SOEXT}
+lib/librustc_platform_intrinsics-${RUST_VERHASH}.${SOEXT}
+lib/librustc_plugin-${RUST_VERHASH}.${SOEXT}
+lib/librustc_privacy-${RUST_VERHASH}.${SOEXT}
+lib/librustc_resolve-${RUST_VERHASH}.${SOEXT}
+lib/librustc_save_analysis-${RUST_VERHASH}.${SOEXT}
+lib/librustc_trans-${RUST_VERHASH}.${SOEXT}
+lib/librustc_typeck-${RUST_VERHASH}.${SOEXT}
+lib/librustdoc-${RUST_VERHASH}.${SOEXT}
+lib/libserialize-${RUST_VERHASH}.${SOEXT}
+lib/libstd-${RUST_VERHASH}.${SOEXT}
+lib/libsyntax-${RUST_VERHASH}.${SOEXT}
+lib/libsyntax_ext-${RUST_VERHASH}.${SOEXT}
+lib/libsyntax_pos-${RUST_VERHASH}.${SOEXT}
+lib/libterm-${RUST_VERHASH}.${SOEXT}
+lib/libtest-${RUST_VERHASH}.${SOEXT}
+lib/rustlib/components
+lib/rustlib/etc/debugger_pretty_printers_common.py
+lib/rustlib/manifest-rust-std-${RUST_ARCH}
+lib/rustlib/manifest-rustc
+lib/rustlib/rust-installer-version
+lib/rustlib/uninstall.sh
+lib/rustlib/${RUST_ARCH}/lib/liballoc-${RUST_VERHASH}.rlib
+${PLIST.jemalloc}lib/rustlib/${RUST_ARCH}/lib/liballoc_jemalloc-${RUST_VERHASH}.rlib
+lib/rustlib/${RUST_ARCH}/lib/liballoc_system-${RUST_VERHASH}.rlib
+lib/rustlib/${RUST_ARCH}/lib/libarena-${RUST_VERHASH}.${SOEXT}
+lib/rustlib/${RUST_ARCH}/lib/libcollections-${RUST_VERHASH}.rlib
+lib/rustlib/${RUST_ARCH}/lib/libcompiler-rt.a
+lib/rustlib/${RUST_ARCH}/lib/libcore-${RUST_VERHASH}.rlib
+lib/rustlib/${RUST_ARCH}/lib/libflate-${RUST_VERHASH}.${SOEXT}
+lib/rustlib/${RUST_ARCH}/lib/libfmt_macros-${RUST_VERHASH}.${SOEXT}
+lib/rustlib/${RUST_ARCH}/lib/libgetopts-${RUST_VERHASH}.rlib
+lib/rustlib/${RUST_ARCH}/lib/libgetopts-${RUST_VERHASH}.${SOEXT}
+lib/rustlib/${RUST_ARCH}/lib/libgraphviz-${RUST_VERHASH}.${SOEXT}
+lib/rustlib/${RUST_ARCH}/lib/liblibc-${RUST_VERHASH}.rlib
+lib/rustlib/${RUST_ARCH}/lib/liblog-${RUST_VERHASH}.${SOEXT}
+lib/rustlib/${RUST_ARCH}/lib/libpanic_abort-${RUST_VERHASH}.rlib
+lib/rustlib/${RUST_ARCH}/lib/libpanic_unwind-${RUST_VERHASH}.rlib
+lib/rustlib/${RUST_ARCH}/lib/librand-${RUST_VERHASH}.rlib
+lib/rustlib/${RUST_ARCH}/lib/librbml-${RUST_VERHASH}.${SOEXT}
+lib/rustlib/${RUST_ARCH}/lib/librustc-${RUST_VERHASH}.${SOEXT}
+lib/rustlib/${RUST_ARCH}/lib/librustc_back-${RUST_VERHASH}.${SOEXT}
+lib/rustlib/${RUST_ARCH}/lib/librustc_bitflags-${RUST_VERHASH}.rlib
+lib/rustlib/${RUST_ARCH}/lib/librustc_borrowck-${RUST_VERHASH}.${SOEXT}
+lib/rustlib/${RUST_ARCH}/lib/librustc_const_eval-${RUST_VERHASH}.${SOEXT}
+lib/rustlib/${RUST_ARCH}/lib/librustc_const_math-${RUST_VERHASH}.${SOEXT}
+lib/rustlib/${RUST_ARCH}/lib/librustc_data_structures-${RUST_VERHASH}.${SOEXT}
+lib/rustlib/${RUST_ARCH}/lib/librustc_driver-${RUST_VERHASH}.${SOEXT}
+lib/rustlib/${RUST_ARCH}/lib/librustc_errors-${RUST_VERHASH}.${SOEXT}
+lib/rustlib/${RUST_ARCH}/lib/librustc_incremental-${RUST_VERHASH}.${SOEXT}
+lib/rustlib/${RUST_ARCH}/lib/librustc_lint-${RUST_VERHASH}.${SOEXT}
+lib/rustlib/${RUST_ARCH}/lib/librustc_llvm-${RUST_VERHASH}.${SOEXT}
+lib/rustlib/${RUST_ARCH}/lib/librustc_metadata-${RUST_VERHASH}.${SOEXT}
+lib/rustlib/${RUST_ARCH}/lib/librustc_mir-${RUST_VERHASH}.${SOEXT}
+lib/rustlib/${RUST_ARCH}/lib/librustc_passes-${RUST_VERHASH}.${SOEXT}
+lib/rustlib/${RUST_ARCH}/lib/librustc_platform_intrinsics-${RUST_VERHASH}.${SOEXT}
+lib/rustlib/${RUST_ARCH}/lib/librustc_plugin-${RUST_VERHASH}.${SOEXT}
+lib/rustlib/${RUST_ARCH}/lib/librustc_privacy-${RUST_VERHASH}.${SOEXT}
+lib/rustlib/${RUST_ARCH}/lib/librustc_resolve-${RUST_VERHASH}.${SOEXT}
+lib/rustlib/${RUST_ARCH}/lib/librustc_save_analysis-${RUST_VERHASH}.${SOEXT}
+lib/rustlib/${RUST_ARCH}/lib/librustc_trans-${RUST_VERHASH}.${SOEXT}
+lib/rustlib/${RUST_ARCH}/lib/librustc_typeck-${RUST_VERHASH}.${SOEXT}
+lib/rustlib/${RUST_ARCH}/lib/librustc_unicode-${RUST_VERHASH}.rlib
+lib/rustlib/${RUST_ARCH}/lib/librustdoc-${RUST_VERHASH}.${SOEXT}
+lib/rustlib/${RUST_ARCH}/lib/libserialize-${RUST_VERHASH}.${SOEXT}
+lib/rustlib/${RUST_ARCH}/lib/libstd-${RUST_VERHASH}.rlib
+lib/rustlib/${RUST_ARCH}/lib/libstd-${RUST_VERHASH}.${SOEXT}
+lib/rustlib/${RUST_ARCH}/lib/libsyntax-${RUST_VERHASH}.${SOEXT}
+lib/rustlib/${RUST_ARCH}/lib/libsyntax_ext-${RUST_VERHASH}.${SOEXT}
+lib/rustlib/${RUST_ARCH}/lib/libsyntax_pos-${RUST_VERHASH}.${SOEXT}
+lib/rustlib/${RUST_ARCH}/lib/libterm-${RUST_VERHASH}.rlib
+lib/rustlib/${RUST_ARCH}/lib/libterm-${RUST_VERHASH}.${SOEXT}
+lib/rustlib/${RUST_ARCH}/lib/libtest-${RUST_VERHASH}.rlib
+lib/rustlib/${RUST_ARCH}/lib/libtest-${RUST_VERHASH}.${SOEXT}
+lib/rustlib/${RUST_ARCH}/lib/libunwind-${RUST_VERHASH}.rlib
+man/man1/rustc.1
+man/man1/rustdoc.1
+share/doc/rust/COPYRIGHT
+share/doc/rust/LICENSE-APACHE
+share/doc/rust/LICENSE-MIT
+share/doc/rust/README.md
diff -r 0ae61a94cb19 -r b06909a2122d lang/rust/PLIST.gdb
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/rust/PLIST.gdb       Tue Sep 06 10:36:49 2016 +0000
@@ -0,0 +1,4 @@
+@comment $NetBSD: PLIST.gdb,v 1.1 2016/09/06 10:36:49 jperkin Exp $
+bin/rust-gdb
+lib/rustlib/etc/gdb_load_rust_pretty_printers.py
+lib/rustlib/etc/gdb_rust_pretty_printing.py



Home | Main Index | Thread Index | Old Index