pkgsrc-WIP-changes archive

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

rust182-bin: Add a package with binaries corresponding to bind182.



Module Name:	pkgsrc-wip
Committed By:	Havard Eidnes <he%NetBSD.org@localhost>
Pushed By:	he
Date:		Sun Nov 3 22:37:25 2024 +0000
Changeset:	d55e1c4b9a8a566cedf47d0b330378c6ec3f3e37

Added Files:
	rust182-bin/DESCR
	rust182-bin/Makefile
	rust182-bin/buildlink3.mk
	rust182-bin/distinfo
	rust182-bin/files/install.sh

Log Message:
rust182-bin: Add a package with binaries corresponding to bind182.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=d55e1c4b9a8a566cedf47d0b330378c6ec3f3e37

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

diffstat:
 rust182-bin/DESCR            |  17 +
 rust182-bin/Makefile         | 296 +++++++++++++
 rust182-bin/buildlink3.mk    |  13 +
 rust182-bin/distinfo         |  56 +++
 rust182-bin/files/install.sh | 971 +++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 1353 insertions(+)

diffs:
diff --git a/rust182-bin/DESCR b/rust182-bin/DESCR
new file mode 100644
index 0000000000..5c709044ce
--- /dev/null
+++ b/rust182-bin/DESCR
@@ -0,0 +1,17 @@
+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.
+
+This package installs a released binary, on architectures supported by
+upstream, or a TNF-built binary, on NetBSD versions not supported by
+upstream.
diff --git a/rust182-bin/Makefile b/rust182-bin/Makefile
new file mode 100644
index 0000000000..65a20a734c
--- /dev/null
+++ b/rust182-bin/Makefile
@@ -0,0 +1,296 @@
+# $NetBSD: Makefile,v 1.69 2024/10/14 20:52:26 wiz Exp $
+
+DISTNAME=	rust-1.82.0
+PKGNAME=	${DISTNAME:S/rust/rust-bin/1}
+CATEGORIES=	lang
+MASTER_SITES=	https://static.rust-lang.org/dist/
+DIST_SUBDIR=	${PKGNAME_NOREV}
+
+MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=	https://rust-lang.org/
+COMMENT=	Safe, concurrent, practical language (pre-built distribution)
+LICENSE=	mit OR apache-2.0
+
+CONFLICTS+=	rust-[0-9]*
+
+# Rust upstream provided binaries
+ONLY_FOR_PLATFORM+=	Darwin-*-aarch64
+ONLY_FOR_PLATFORM+=	Darwin-*-x86_64
+ONLY_FOR_PLATFORM+=	FreeBSD-*-x86_64
+ONLY_FOR_PLATFORM+=	Linux-*-aarch64
+ONLY_FOR_PLATFORM+=	Linux-*-i386
+ONLY_FOR_PLATFORM+=	Linux-*-x86_64
+ONLY_FOR_PLATFORM+=	NetBSD-*-x86_64
+
+# he%NetBSD.org@localhost provided binaries
+ONLY_FOR_PLATFORM+=	NetBSD-*-aarch64
+ONLY_FOR_PLATFORM+=	NetBSD-*-aarch64eb
+ONLY_FOR_PLATFORM+=	NetBSD-*-earmv7hf
+ONLY_FOR_PLATFORM+=	NetBSD-*-earmv6hf
+ONLY_FOR_PLATFORM+=	NetBSD-*-i386
+ONLY_FOR_PLATFORM+=	NetBSD-*-powerpc
+ONLY_FOR_PLATFORM+=	NetBSD-*-sparc64
+ONLY_FOR_PLATFORM+=	NetBSD-*-mipsel
+ONLY_FOR_PLATFORM+=	NetBSD-*-riscv64
+
+# Illumos, jperkin@ provided binaries
+ONLY_FOR_PLATFORM+=	SunOS-*-x86_64
+
+NETBSD_REPO=	https://cdn.NetBSD.org/pub/pkgsrc/distfiles/LOCAL_PORTS/rust/
+
+CHECK_RELRO_SKIP+=	lib/rustlib/*/bin/*
+
+CHECK_SHLIBS_SKIP+=	bin/cargo-clippy
+CHECK_SHLIBS_SKIP+=	bin/rustfmt
+
+# Bootstraps built for 9.0 or newer, -8 gcc is too old...
+BROKEN_ON_PLATFORM+=	NetBSD-8.*
+
+# Binary distributions aren't built as PIE.
+MKPIE_SUPPORTED=	no
+
+NO_BUILD=	yes
+USE_TOOLS+=	bash pax
+WRKSRC=		${WRKDIR}/${DISTFILES:C/.tar.[gx]z//}
+
+GENERATE_PLIST+=	find ${DESTDIR}${PREFIX} \( -type f -o -type l \) -print | \
+			sed 's,${DESTDIR}${PREFIX}/,,' | ${SORT} ;
+
+INSTALLATION_DIRS=	bin ${PKGMANDIR} share/doc/cargo/bash_completion.d
+
+.include "../../mk/bsd.prefs.mk"
+
+.if ${OPSYS} == "NetBSD" && ${OPSYS_VERSION} < 080000
+BROKEN+=		"Bootstrap unavailable for old NetBSD version"
+.endif
+
+DISTFILES:=	# empty
+
+# Rust upstream provided binaries
+
+.if ${MACHINE_PLATFORM:MDarwin-*-aarch64} || make(distinfo) || make(makesum) || make(mdi)
+RUST_ARCH:=	aarch64-apple-darwin
+DISTFILES:=	${DISTFILES} ${DISTNAME}-${RUST_ARCH}.tar.gz
+.endif
+.if ${MACHINE_PLATFORM:MDarwin-*-x86_64} || make(distinfo) || make(makesum) || make(mdi)
+RUST_ARCH:=	x86_64-apple-darwin
+DISTFILES:=	${DISTFILES} ${DISTNAME}-${RUST_ARCH}.tar.gz
+.endif
+.if ${MACHINE_PLATFORM:MFreeBSD-*-x86_64} || make(distinfo) || make(makesum) || make(mdi)
+RUST_ARCH:=	x86_64-unknown-freebsd
+DISTFILES:=	${DISTFILES} ${DISTNAME}-${RUST_ARCH}.tar.gz
+.endif
+.if ${MACHINE_PLATFORM:MLinux-*-i386} || make(distinfo) || make(makesum) || make(mdi)
+RUST_ARCH:=	i686-unknown-linux-gnu
+DISTFILES:=	${DISTFILES} ${DISTNAME}-${RUST_ARCH}.tar.gz
+.endif
+.if (${MACHINE_PLATFORM:MLinux-*-aarch64} && !empty(GLIBC_VERSION)) || make(distinfo) || make(makesum) || make(mdi)
+RUST_ARCH:=	aarch64-unknown-linux-gnu
+DISTFILES:=	${DISTFILES} ${DISTNAME}-${RUST_ARCH}.tar.gz
+.endif
+.if (${MACHINE_PLATFORM:MLinux-*-aarch64} && empty(GLIBC_VERSION)) || make(distinfo) || make(makesum) || make(mdi)
+RUST_ARCH:=	aarch64-unknown-linux-musl
+DISTFILES:=	${DISTFILES} ${DISTNAME}-${RUST_ARCH}.tar.gz
+.endif
+.if (${MACHINE_PLATFORM:MLinux-*-x86_64} && !empty(GLIBC_VERSION)) || make(distinfo) || make(makesum) || make(mdi)
+RUST_ARCH:=	x86_64-unknown-linux-gnu
+DISTFILES:=	${DISTFILES} ${DISTNAME}-${RUST_ARCH}.tar.gz
+.endif
+.if (${MACHINE_PLATFORM:MLinux-*-x86_64} && empty(GLIBC_VERSION)) || make(distinfo) || make(makesum) || make(mdi)
+RUST_ARCH:=	x86_64-unknown-linux-musl
+DISTFILES:=	${DISTFILES} ${DISTNAME}-${RUST_ARCH}.tar.gz
+.endif
+.if ${MACHINE_PLATFORM:MNetBSD-*-x86_64} || make(distinfo) || make(makesum) || make(mdi)
+RUST_ARCH:=	x86_64-unknown-netbsd
+DISTFILES:=	${DISTFILES} ${DISTNAME}-${RUST_ARCH}.tar.gz
+.endif
+
+# NetBSD provided binaries:
+
+NBSUF=
+
+.if ${MACHINE_PLATFORM:MNetBSD-*-aarch64} || make(distinfo) || make(makesum) || make(mdi)
+RUST_ARCH:=	aarch64-unknown-netbsd
+DN:=		${DISTNAME}${NBSUF}
+EXTRACT_SUFX=	.tar.xz
+DF:=		${DN}-${RUST_ARCH}${EXTRACT_SUFX}
+DISTFILES:=	${DISTFILES} ${DF}
+SITES.${DF}=	${NETBSD_REPO}
+.endif
+.if ${MACHINE_PLATFORM:MNetBSD-*-aarch64eb} || make(distinfo) || make(makesum) || make(mdi)
+RUST_ARCH:=	aarch64_be-unknown-netbsd
+DN:=		${DISTNAME}${NBSUF}
+EXTRACT_SUFX=	.tar.xz
+DF:=		${DN}-${RUST_ARCH}${EXTRACT_SUFX}
+DISTFILES:=	${DISTFILES} ${DF}
+SITES.${DF}=	${NETBSD_REPO}
+.endif
+.if ${MACHINE_PLATFORM:MNetBSD-*-earmv6hf} || make(distinfo) || make(makesum) || make(mdi)
+RUST_ARCH:=	armv6-unknown-netbsd-eabihf
+DN:=		${DISTNAME}${NBSUF}
+EXTRACT_SUFX=	.tar.xz
+DF:=		${DN}-${RUST_ARCH}${EXTRACT_SUFX}
+DISTFILES:=	${DISTFILES} ${DF}
+SITES.${DF}=	${NETBSD_REPO}
+.endif
+.if ${MACHINE_PLATFORM:MNetBSD-*-earmv7hf} || make(distinfo) || make(makesum) || make(mdi)
+RUST_ARCH:=	armv7-unknown-netbsd-eabihf
+DN:=		${DISTNAME}${NBSUF}
+EXTRACT_SUFX=	.tar.xz
+DF:=		${DN}-${RUST_ARCH}${EXTRACT_SUFX}
+DISTFILES:=	${DISTFILES} ${DF}
+SITES.${DF}=	${NETBSD_REPO}
+.endif
+.if ${MACHINE_PLATFORM:MNetBSD-*-i386} || make(distinfo) || make(makesum) || make(mdi)
+RUST_ARCH:=	i586-unknown-netbsd
+DN:=		${DISTNAME}${NBSUF}
+EXTRACT_SUFX=	.tar.xz
+DF:=		${DN}-${RUST_ARCH}${EXTRACT_SUFX}
+DISTFILES:=	${DISTFILES} ${DF}
+SITES.${DF}=	${NETBSD_REPO}
+.endif
+.if ${MACHINE_PLATFORM:MNetBSD-*-powerpc} || make(distinfo) || make(makesum) || make(mdi)
+RUST_ARCH:=	powerpc-unknown-netbsd
+DN:=		${DISTNAME}${NBSUF}
+EXTRACT_SUFX=	.tar.xz
+DF:=		${DN}-${RUST_ARCH}${EXTRACT_SUFX}
+DISTFILES:=	${DISTFILES} ${DF}
+SITES.${DF}=	${NETBSD_REPO}
+.endif
+.if ${MACHINE_PLATFORM:MNetBSD-*-sparc64} || make(distinfo) || make(makesum) || make(mdi)
+RUST_ARCH:=	sparc64-unknown-netbsd
+DN:=		${DISTNAME}${NBSUF}
+EXTRACT_SUFX=	.tar.xz
+DF:=		${DN}-${RUST_ARCH}${EXTRACT_SUFX}
+DISTFILES:=	${DISTFILES} ${DF}
+SITES.${DF}=	${NETBSD_REPO}
+.endif
+.if ${MACHINE_PLATFORM:MNetBSD-*-mipsel} || make(distinfo) || make(makesum) || make(mdi)
+RUST_ARCH:=	mipsel-unknown-netbsd
+DN:=		${DISTNAME}${NBSUF}
+EXTRACT_SUFX=	.tar.xz
+DF:=		${DN}-${RUST_ARCH}${EXTRACT_SUFX}
+DISTFILES:=	${DISTFILES} ${DF}
+SITES.${DF}=	${NETBSD_REPO}
+.endif
+.if ${MACHINE_PLATFORM:MNetBSD-*-riscv64} || make(distinfo) || make(makesum) || make(mdi)
+RUST_ARCH:=	riscv64gc-unknown-netbsd
+DN:=		${DISTNAME}${NBSUF}
+EXTRACT_SUFX=	.tar.xz
+DF:=		${DN}-${RUST_ARCH}${EXTRACT_SUFX}
+DISTFILES:=	${DISTFILES} ${DF}
+SITES.${DF}=	${NETBSD_REPO}
+.endif
+
+# Illumos:
+#.if !empty(MACHINE_PLATFORM:MSunOS-*-x86_64) || make(distinfo) || make(makesum) || make(mdi)
+#RUST_ARCH:=	x86_64-unknown-illumos
+#DN:=		${DISTNAME}
+#EXTRACT_SUFX=	.tar.gz
+#DF:=		${DN}-${RUST_ARCH}${EXTRACT_SUFX}
+#DISTFILES:=	${DISTFILES} ${DF}
+#SITES.${DF}=	https://us-central.manta.mnx.io/pkgsrc/public/pkg-bootstraps/
+#.endif
+
+
+# Binary still extracts to plain non-nb'ed directory
+WRKSRC:=	${WRKSRC:C/nb[0-9]*//}
+WRKSRC:=	${WRKSRC:C/-$//}
+
+do-install:
+	cd ${.CURDIR}/files; pax -rw install.sh ${WRKSRC}
+	cd ${WRKSRC} && env PKGMANDIR=${PKGMANDIR} bash ./install.sh \
+	--destdir=${DESTDIR} --prefix=${PREFIX}
+	${RM} -f ${DESTDIR}${PREFIX}/lib/rustlib/${RUST_ARCH}/bin/rust-llvm-dwp
+	${RM} -f ${DESTDIR}${PREFIX}/lib/rustlib/install.log
+	${RM} -f ${DESTDIR}${PREFIX}/lib/rustlib/manifest-*
+	${RM} -f ${DESTDIR}${PREFIX}/lib/rustlib/uninstall.sh
+
+.if ${OPSYS} == "Darwin"
+.PHONY: fix-darwin-install-name
+post-install: fix-darwin-install-name
+fix-darwin-install-name:
+.  for bin in clippy-driver miri rls rust-analyzer 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 bin in lldb lldb-mi llvm-nm llvm-objcopy llvm-objdump 	\
+		llvm-profdata llvm-readobj llvm-size llvm-strip
+	otool -XL ${DESTDIR}${PREFIX}/lib/rustlib/${RUST_ARCH}/bin/${bin} \
+	    | ${GREP} '@rpath' | while read rpath rest; do		\
+		install_name_tool -change $$rpath			\
+		    `${ECHO} $$rpath | ${SED} -e 's,@rpath,${PREFIX}/lib/rustlib/${RUST_ARCH}/lib,g'` \
+		    ${DESTDIR}${PREFIX}/lib/rustlib/${RUST_ARCH}/bin/${bin}; \
+	done
+.  endfor
+.  for lib in lib lib/rustlib/${RUST_ARCH}/lib lib/rustlib/${RUST_ARCH}/codegen-backends
+	for f in ${DESTDIR}${PREFIX}/${lib}/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}/lib,g'` \
+			    $$f;					\
+		done;							\
+	done
+.  endfor
+.else
+# Not Darwin:
+
+TOOL_DEPENDS+=		patchelf-[0-9]*:../../devel/patchelf
+
+RUST_LLVM_RPATH=	${PREFIX}/lib
+FORCE_RPATH=		--force-rpath
+
+# 32-bit NetBSD ports need libatomic
+.  if ${MACHINE_PLATFORM:MNetBSD-*-powerpc} || \
+      ${MACHINE_PLATFORM:MNetBSD-*-earmv[67]hf} || \
+      ${MACHINE_PLATFORM:MNetBSD-*-mipsel} || \
+      ${MACHINE_PLATFORM:MNetBSD-*-i386}
+.    include "../../devel/libatomic/buildlink3.mk"
+.  endif
+
+.PHONY: fix-relative-rpath
+post-install: fix-relative-rpath
+fix-relative-rpath:
+.  for bin in \
+	bin/cargo \
+	bin/cargo-clippy \
+	bin/cargo-fmt \
+	bin/clippy-driver \
+	bin/miri  \
+	bin/rls \
+	bin/rust-analyzer \
+	bin/rust-demangler \
+	bin/rustc \
+	bin/rustdoc \
+	bin/rustfmt \
+	libexec/rust-analyzer-proc-macro-srv
+	if [ -f ${DESTDIR}${PREFIX}/${bin} ]; then \
+		${PREFIX}/bin/patchelf ${FORCE_RPATH} --set-rpath \
+		    ${PREFIX}/lib ${DESTDIR}${PREFIX}/${bin} ; \
+	fi
+.  endfor
+# Only Linux builds link these binaries against an LLVM library
+.  if ${OPSYS} == "Linux"
+.    for bin in llc llvm-ar llvm-as llvm-cov llvm-dis llvm-link llvm-nm llvm-objcopy \
+	   llvm-objdump llvm-profdata llvm-readobj llvm-size llvm-strip opt \
+	   rust-lld gcc-ld/ld64.lld gcc-ld/ld.lld gcc-ld/lld-link gcc-ld/wasm-ld
+	 ${PREFIX}/bin/patchelf ${FORCE_RPATH} --set-rpath ${RUST_LLVM_RPATH} \
+	   ${DESTDIR}${PREFIX}/lib/rustlib/${RUST_ARCH}/bin/${bin}
+.    endfor
+.  endif
+.  for lib in lib lib/rustlib/${RUST_ARCH}/lib \
+		lib/rustlib/${RUST_ARCH}/codegen-backends
+	for f in ${DESTDIR}${PREFIX}/${lib}/lib*.so; do			\
+		[ ! -f $$f ] && continue;				\
+		${PREFIX}/bin/patchelf ${FORCE_RPATH} --set-rpath ${PREFIX}/lib $$f;	\
+	done
+.  endfor
+.endif
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/rust182-bin/buildlink3.mk b/rust182-bin/buildlink3.mk
new file mode 100644
index 0000000000..1d6874ec86
--- /dev/null
+++ b/rust182-bin/buildlink3.mk
@@ -0,0 +1,13 @@
+# $NetBSD: buildlink3.mk,v 1.2 2022/07/01 07:00:28 pin Exp $
+
+BUILDLINK_TREE+=	rust-bin
+
+.if !defined(RUST_BIN_BUILDLINK3_MK)
+RUST_BIN_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.rust-bin+=	rust-bin>=1.56.1
+BUILDLINK_PKGSRCDIR.rust-bin?=		../../lang/rust-bin
+BUILDLINK_PASSTHRU_DIRS+=		${PREFIX}/lib/rustlib
+.endif
+
+BUILDLINK_TREE+=	-rust-bin
diff --git a/rust182-bin/distinfo b/rust182-bin/distinfo
new file mode 100644
index 0000000000..db0e573eb1
--- /dev/null
+++ b/rust182-bin/distinfo
@@ -0,0 +1,56 @@
+$NetBSD: distinfo,v 1.40 2024/10/14 20:52:26 wiz Exp $
+
+BLAKE2s (rust-bin-1.82.0/rust-1.82.0-aarch64-apple-darwin.tar.gz) = 664d14f01ccd28193d595f28351d5421e3e28987c6703a7685129386c11b151c
+SHA512 (rust-bin-1.82.0/rust-1.82.0-aarch64-apple-darwin.tar.gz) = 4b25e91e30764c39fcf9efafa96b7a89fe14d64c7364cdc10dd7c9027779f6de73c6f98024df16dc1020b50c404f1201fa3f4c473098f820afada473fa33478e
+Size (rust-bin-1.82.0/rust-1.82.0-aarch64-apple-darwin.tar.gz) = 353239700 bytes
+BLAKE2s (rust-bin-1.82.0/rust-1.82.0-aarch64-unknown-linux-gnu.tar.gz) = 024259d2a3dde28d310fd7ebdda40c324922e1860509c9295df4485b68d40d4e
+SHA512 (rust-bin-1.82.0/rust-1.82.0-aarch64-unknown-linux-gnu.tar.gz) = 5012ed757908ed0db73e0e079a46d4bfce575ea3ebe17a47b127001971944f0d7b885ca28bc7ee8e9da91170106ed434529536e7069c78e3706aacf59d892c15
+Size (rust-bin-1.82.0/rust-1.82.0-aarch64-unknown-linux-gnu.tar.gz) = 501568008 bytes
+BLAKE2s (rust-bin-1.82.0/rust-1.82.0-aarch64-unknown-linux-musl.tar.gz) = f7a7c78f7ba00bf3135a7bb07e0e543af34b4d3e567e350e2d81eb6dc2541de7
+SHA512 (rust-bin-1.82.0/rust-1.82.0-aarch64-unknown-linux-musl.tar.gz) = 260a13bc4b66fc9427eaeeecd8c3da272d42fd6d457369f13ca139e101071900dc21a2b3077c5dea8d4db2eb3008d39a363ec5cf495780549e148d46250311a1
+Size (rust-bin-1.82.0/rust-1.82.0-aarch64-unknown-linux-musl.tar.gz) = 403598068 bytes
+BLAKE2s (rust-bin-1.82.0/rust-1.82.0-aarch64-unknown-netbsd.tar.xz) = 3e64188087780dbd2d1816d13542233b0643470a1c8ec0760e333c461810999c
+SHA512 (rust-bin-1.82.0/rust-1.82.0-aarch64-unknown-netbsd.tar.xz) = db70efdbd55f3ed9df5bc197674bbb84dc1193c18bca25cd3326bd0a435dacba9065e8d2f6bc0f733d2f8683cea3e00881231b0af06fbacb43df8b19a1e74160
+Size (rust-bin-1.82.0/rust-1.82.0-aarch64-unknown-netbsd.tar.xz) = 205636040 bytes
+BLAKE2s (rust-bin-1.82.0/rust-1.82.0-aarch64_be-unknown-netbsd.tar.xz) = c97147db08a5c44815bf1c32447c15dff9b22c592dbe7f8474ae7b188309a05a
+SHA512 (rust-bin-1.82.0/rust-1.82.0-aarch64_be-unknown-netbsd.tar.xz) = 5ad6da49ff80a1860dedc0bdb8ac8ff8c975367118db75d0528ee83c10ea7598ac881448a5641d5010b35b34d0aeeb4dfc19ad581ba304fc844947ead09f0d05
+Size (rust-bin-1.82.0/rust-1.82.0-aarch64_be-unknown-netbsd.tar.xz) = 203750380 bytes
+BLAKE2s (rust-bin-1.82.0/rust-1.82.0-armv6-unknown-netbsd-eabihf.tar.xz) = 83784b40300458573a8cea5e37cf700c5c72746b831363ded55aef9b2031ff4f
+SHA512 (rust-bin-1.82.0/rust-1.82.0-armv6-unknown-netbsd-eabihf.tar.xz) = ed77b4948265483362ab1548b98fdd837fffa49e5144d0647c657555f965462f5729b53f2e9fa0655e37c32ba42a7b4398642a76a199e89ae2f8749c0acb88c7
+Size (rust-bin-1.82.0/rust-1.82.0-armv6-unknown-netbsd-eabihf.tar.xz) = 175096484 bytes
+BLAKE2s (rust-bin-1.82.0/rust-1.82.0-armv7-unknown-netbsd-eabihf.tar.xz) = a20536546db9e91726dfb3ceeb58d9ae4d54e04c0ba52ccbfeb5f82ef549e857
+SHA512 (rust-bin-1.82.0/rust-1.82.0-armv7-unknown-netbsd-eabihf.tar.xz) = 985c92c2f366162d6960ddb96ac6be15f7d770f9964d96026ac0c55a1939a0be69ee206697db9fb2da0546417aef19bddaddf26d2484db486160517a9d205d0f
+Size (rust-bin-1.82.0/rust-1.82.0-armv7-unknown-netbsd-eabihf.tar.xz) = 175788804 bytes
+BLAKE2s (rust-bin-1.82.0/rust-1.82.0-i586-unknown-netbsd.tar.xz) = dfe4e0008619c899cbfee987db9e15f02346520e710d886806bc74383da95d4b
+SHA512 (rust-bin-1.82.0/rust-1.82.0-i586-unknown-netbsd.tar.xz) = 7024ab15af2f74e91f1d919f51887b6f78c9dbf7c7194b4899df4d459cc0ec42f752864fa27ad2a8920855a5bb5852b71109962795c1ce3327cb8129a55baf20
+Size (rust-bin-1.82.0/rust-1.82.0-i586-unknown-netbsd.tar.xz) = 226751484 bytes
+BLAKE2s (rust-bin-1.82.0/rust-1.82.0-i686-unknown-linux-gnu.tar.gz) = 8e96b3a839e940f069b9f1220792e0d3777e3f77823d840b723b586a5e2039e6
+SHA512 (rust-bin-1.82.0/rust-1.82.0-i686-unknown-linux-gnu.tar.gz) = e8197c5a41c5028bf6ed34891671d8b891a82a1e54815eb1f3833e5d21bc4c12f6c49041d1246336a1417224499daef819a0705dad215aa25b360a5b935c6052
+Size (rust-bin-1.82.0/rust-1.82.0-i686-unknown-linux-gnu.tar.gz) = 453859154 bytes
+BLAKE2s (rust-bin-1.82.0/rust-1.82.0-mipsel-unknown-netbsd.tar.xz) = d6c6fd621edb195b3d445bc3abefb03af7ddedfae58090b81c8742e3ee102deb
+SHA512 (rust-bin-1.82.0/rust-1.82.0-mipsel-unknown-netbsd.tar.xz) = 8c21a939454c41f110420443a752d20ad7937645d58a2f5ddfba2ad5853eec48c83b5a5f61a8cef12ae98a37554ba2de65a64f7479675827016de9abe7770ed3
+Size (rust-bin-1.82.0/rust-1.82.0-mipsel-unknown-netbsd.tar.xz) = 181473484 bytes
+BLAKE2s (rust-bin-1.82.0/rust-1.82.0-powerpc-unknown-netbsd.tar.xz) = ab56bfec95efeeb8b95d6c195899bffa7ff0a1569f40e1163170876d087fd6e8
+SHA512 (rust-bin-1.82.0/rust-1.82.0-powerpc-unknown-netbsd.tar.xz) = 0a00ce1d1324b2deb7ae77e9a16e57f178e9f18b0caffc18350f89d1573a4ea44f27641929f6af5dd70daabb1deea58571375b1468fc4651b086b20d772f4de2
+Size (rust-bin-1.82.0/rust-1.82.0-powerpc-unknown-netbsd.tar.xz) = 237715156 bytes
+BLAKE2s (rust-bin-1.82.0/rust-1.82.0-riscv64gc-unknown-netbsd.tar.xz) = acb6312c2022c4d2016fed300ba2f861bd98cca4650a66851048aa07c6c999ac
+SHA512 (rust-bin-1.82.0/rust-1.82.0-riscv64gc-unknown-netbsd.tar.xz) = 7831912b24f96e6429433f7da223aa7b6232e0329e85770932ce676335945480b691725f40ab472acb4bfbcfe191aff949bf2fe0dcbc58ee9a13feadb470406f
+Size (rust-bin-1.82.0/rust-1.82.0-riscv64gc-unknown-netbsd.tar.xz) = 223052688 bytes
+BLAKE2s (rust-bin-1.82.0/rust-1.82.0-sparc64-unknown-netbsd.tar.xz) = 5a1523dbf4b02eb8a51950e821a3c0975569b0a454c5c063ec59e8e019a282a8
+SHA512 (rust-bin-1.82.0/rust-1.82.0-sparc64-unknown-netbsd.tar.xz) = d8a2c349ade804b9fb06f8f98231ca49649289da0142e7a39f6c2893bd140191e65a683b82bfead5cd3a521550ab6893956d179520c006a3c56df4bd865941b0
+Size (rust-bin-1.82.0/rust-1.82.0-sparc64-unknown-netbsd.tar.xz) = 202245792 bytes
+BLAKE2s (rust-bin-1.82.0/rust-1.82.0-x86_64-apple-darwin.tar.gz) = 9bc4f814e48e1f663d586da87bae1f001d4b0ce71c5879c4b206162082d344a5
+SHA512 (rust-bin-1.82.0/rust-1.82.0-x86_64-apple-darwin.tar.gz) = 0ca5079f938c78d199dee1527d0d9d8c5f481daff4db4e31323a5128108b18934bb377be8087cc2b6213b5100fb14e3fc1dfed1a8a6a0a26fca1b57927e39fea
+Size (rust-bin-1.82.0/rust-1.82.0-x86_64-apple-darwin.tar.gz) = 359733549 bytes
+BLAKE2s (rust-bin-1.82.0/rust-1.82.0-x86_64-unknown-freebsd.tar.gz) = 2a5ccc8fb5aa1d5ff1bbfd60a169dbba28ab2e7933aac37484534215ed0d5f53
+SHA512 (rust-bin-1.82.0/rust-1.82.0-x86_64-unknown-freebsd.tar.gz) = 2e97de2e1d0c9d69662cc151becd478d2b0acaaff42443562f518a4191dadabdf0e165f0b9ae1fe90a8c37114377563d9471da2e631ead6a9b1b8583d57da2d0
+Size (rust-bin-1.82.0/rust-1.82.0-x86_64-unknown-freebsd.tar.gz) = 342962316 bytes
+BLAKE2s (rust-bin-1.82.0/rust-1.82.0-x86_64-unknown-linux-gnu.tar.gz) = 6e7ce2e72a8bc69e9458ea802d18b1de5f0e697be2720eef8bc465051f13bc18
+SHA512 (rust-bin-1.82.0/rust-1.82.0-x86_64-unknown-linux-gnu.tar.gz) = 0fb69cea8b4ebed5a7859f56b308c743ab094bc04d7266651f8a250bcb262f1c45b2ad2b0e2ee5c854ed35208eafd1f7253a495e55860787ba63396ad6a07133
+Size (rust-bin-1.82.0/rust-1.82.0-x86_64-unknown-linux-gnu.tar.gz) = 353103417 bytes
+BLAKE2s (rust-bin-1.82.0/rust-1.82.0-x86_64-unknown-linux-musl.tar.gz) = 91e06ae7ae9e9d807fd4ba71594654da932e6ffc0bd01fab4847d3714145503a
+SHA512 (rust-bin-1.82.0/rust-1.82.0-x86_64-unknown-linux-musl.tar.gz) = 7b56379b0ed71592144a32fb9af624d4e6af2a1ee7eb84176c6f1556b9edb13a07e6e381b7424b536ba1082705084eb74a7f5e0c010af5319f8cd4c2c9f9ce9c
+Size (rust-bin-1.82.0/rust-1.82.0-x86_64-unknown-linux-musl.tar.gz) = 494869296 bytes
+BLAKE2s (rust-bin-1.82.0/rust-1.82.0-x86_64-unknown-netbsd.tar.gz) = f63e6aa6212458cdca976ad57d77c43839e8a3c5768366064f164e68cdc1e870
+SHA512 (rust-bin-1.82.0/rust-1.82.0-x86_64-unknown-netbsd.tar.gz) = f9e70b617b87130735c7f6b018dff85191288cf23eee4ad6d89cf63d79f06fce581b64bc27c32f7d0ee8fb9d2a86595b1c534f6ff12c55bffd3c9bc40546643f
+Size (rust-bin-1.82.0/rust-1.82.0-x86_64-unknown-netbsd.tar.gz) = 357458451 bytes
diff --git a/rust182-bin/files/install.sh b/rust182-bin/files/install.sh
new file mode 100644
index 0000000000..1cc270c333
--- /dev/null
+++ b/rust182-bin/files/install.sh
@@ -0,0 +1,971 @@
+#!/bin/bash
+# Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+# file at the top-level directory of this distribution and at
+# http://rust-lang.org/COPYRIGHT.
+#
+# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+# option. This file may not be copied, modified, or distributed
+# except according to those terms.
+
+# No undefined variables
+set -u
+
+init_logging() {
+    local _abs_libdir="$1"
+    local _logfile="$_abs_libdir/$TEMPLATE_REL_MANIFEST_DIR/install.log"
+    LOGFILE="$_logfile"
+}
+
+log_line() {
+    local _line="$1"
+
+}
+
+msg() {
+    local _line="install: ${1-}"
+    echo "$_line"
+    log_line "$_line"
+}
+
+verbose_msg() {
+    if [ -n "${CFG_VERBOSE-}" ]; then
+	msg "${1-}"
+    else
+	log_line "install: ${1-}"
+    fi
+}
+
+step_msg() {
+    msg
+    msg "$1"
+    msg
+}
+
+verbose_step_msg() {
+    if [ -n "${CFG_VERBOSE-}" ]; then
+	msg
+	msg "$1"
+	msg
+    else
+	log_line ""
+	log_line "install: $1"
+	log_line ""
+    fi
+}
+
+warn() {
+    local _line="install: WARNING: $1"
+    echo "$_line" >&2
+    log_line "$_line"
+}
+
+err() {
+    local _line="install: error: $1"
+    echo "$_line" >&2
+    log_line "$_line"
+    exit 1
+}
+
+# A non-user error that is likely to result in a corrupted install
+critical_err() {
+    local _line="install: error: $1. see logs at '${LOGFILE-}'"
+    echo "$_line" >&2
+    log_line "$_line"
+    exit 1
+}
+
+need_ok() {
+    if [ $? -ne 0 ]
+    then
+        err "$1"
+    fi
+}
+
+critical_need_ok() {
+    if [ $? -ne 0 ]
+    then
+        critical_err "$1"
+    fi
+}
+
+want_ok() {
+    if [ $? -ne 0 ]; then
+	warn "$1"
+    fi
+}
+
+assert_nz() {
+    if [ -z "$1" ]; then err "assert_nz $2"; fi
+}
+
+need_cmd() {
+    if command -v $1 >/dev/null 2>&1
+    then verbose_msg "found $1"
+    else err "need $1"
+    fi
+}
+
+run() {
+    local _line="\$ $*"
+    "$@"
+    local _retval=$?
+    log_line "$_line"
+    return $_retval
+}
+
+write_to_file() {
+    local _msg="$1"
+    local _file="$2"
+    local _line="$ echo \"$_msg\" > \"$_file\""
+    echo "$_msg" > "$_file"
+    local _retval=$?
+    log_line "$_line"
+    return $_retval
+}
+
+append_to_file() {
+    local _msg="$1"
+    local _file="$2"
+    local _line="$ echo \"$_msg\" >> \"$_file\""
+    echo "$_msg" >> "$_file"
+    local _retval=$?
+    log_line "$_line"
+    return $_retval
+}
+
+make_dir_recursive() {
+    local _dir="$1"
+    local _line="$ umask 022 && mkdir -p \"$_dir\""
+    umask 022 && mkdir -p "$_dir"
+    local _retval=$?
+    log_line "$_line"
+    return $_retval
+}
+
+putvar() {
+    local t
+    local tlen
+    eval t=\$$1
+    eval tlen=\${#$1}
+}
+
+valopt() {
+    VAL_OPTIONS="$VAL_OPTIONS $1"
+
+    local op=$1
+    local default=$2
+    shift
+    shift
+    local doc="$*"
+    if [ $HELP -eq 0 ]
+    then
+        local uop=$(echo $op | tr 'a-z-' 'A-Z_')
+        local v="CFG_${uop}"
+        eval $v="$default"
+        for arg in $CFG_ARGS
+        do
+            if echo "$arg" | grep -q -- "--$op="
+            then
+                local val=$(echo "$arg" | cut -f2 -d=)
+                eval $v=$val
+            fi
+        done
+        putvar $v
+    else
+        if [ -z "$default" ]
+        then
+            default="<none>"
+        fi
+        op="${op}=[${default}]"
+        printf "    --%-30s %s\n" "$op" "$doc"
+    fi
+}
+
+opt() {
+    BOOL_OPTIONS="$BOOL_OPTIONS $1"
+
+    local op=$1
+    local default=$2
+    shift
+    shift
+    local doc="$*"
+    local flag=""
+
+    if [ $default -eq 0 ]
+    then
+        flag="enable"
+    else
+        flag="disable"
+        doc="don't $doc"
+    fi
+
+    if [ $HELP -eq 0 ]
+    then
+        for arg in $CFG_ARGS
+        do
+            if [ "$arg" = "--${flag}-${op}" ]
+            then
+                op=$(echo $op | tr 'a-z-' 'A-Z_')
+                flag=$(echo $flag | tr 'a-z' 'A-Z')
+                local v="CFG_${flag}_${op}"
+                eval $v=1
+                putvar $v
+            fi
+        done
+    else
+        if [ ! -z "${META-}" ]
+        then
+            op="$op=<$META>"
+        fi
+        printf "    --%-30s %s\n" "$flag-$op" "$doc"
+     fi
+}
+
+flag() {
+    BOOL_OPTIONS="$BOOL_OPTIONS $1"
+
+    local op=$1
+    shift
+    local doc="$*"
+
+    if [ $HELP -eq 0 ]
+    then
+        for arg in $CFG_ARGS
+        do
+            if [ "$arg" = "--${op}" ]
+            then
+                op=$(echo $op | tr 'a-z-' 'A-Z_')
+                local v="CFG_${op}"
+                eval $v=1
+                putvar $v
+            fi
+        done
+    else
+        if [ ! -z "${META-}" ]
+        then
+            op="$op=<$META>"
+        fi
+        printf "    --%-30s %s\n" "$op" "$doc"
+     fi
+}
+
+validate_opt () {
+    for arg in $CFG_ARGS
+    do
+        local is_arg_valid=0
+        for option in $BOOL_OPTIONS
+        do
+            if test --disable-$option = $arg
+            then
+                is_arg_valid=1
+            fi
+            if test --enable-$option = $arg
+            then
+                is_arg_valid=1
+            fi
+            if test --$option = $arg
+            then
+                is_arg_valid=1
+            fi
+        done
+        for option in $VAL_OPTIONS
+        do
+            if echo "$arg" | grep -q -- "--$option="
+            then
+                is_arg_valid=1
+            fi
+        done
+        if [ "$arg" = "--help" ]
+        then
+            echo
+            echo "No more help available for Configure options,"
+            echo "check the Wiki or join our IRC channel"
+            break
+        else
+            if test $is_arg_valid -eq 0
+            then
+                err "Option '$arg' is not recognized"
+            fi
+        fi
+    done
+}
+
+absolutify() {
+    local file_path="$1"
+    local file_path_dirname="$(dirname "$file_path")"
+    local file_path_basename="$(basename "$file_path")"
+    local file_abs_path="$(abs_path "$file_path_dirname")"
+    local file_path="$file_abs_path/$file_path_basename"
+    # This is the return value
+    RETVAL="$file_path"
+}
+
+# Prints the absolute path of a directory to stdout
+abs_path() {
+    local path="$1"
+    # Unset CDPATH because it causes havok: it makes the destination unpredictable
+    # and triggers 'cd' to print the path to stdout. Route `cd`'s output to /dev/null
+    # for good measure.
+    (unset CDPATH && cd "$path" > /dev/null && pwd)
+}
+
+uninstall_legacy() {
+    local _abs_libdir="$1"
+
+    local _uninstalled_something=false
+
+    # Replace commas in legacy manifest list with spaces
+    _legacy_manifest_dirs=`echo "$TEMPLATE_LEGACY_MANIFEST_DIRS" | sed "s/,/ /g"`
+
+    # Uninstall from legacy manifests
+    local _md
+    for _md in $_legacy_manifest_dirs; do
+	# First, uninstall from the installation prefix.
+	# Errors are warnings - try to rm everything in the manifest even if some fail.
+	if [ -f "$_abs_libdir/$_md/manifest" ]
+	then
+
+	    # iterate through installed manifest and remove files
+	    local _p;
+	    while read _p; do
+		# the installed manifest contains absolute paths
+		msg "removing legacy file $_p"
+		if [ -f "$_p" ]
+		then
+		    run rm -f "$_p"
+		    want_ok "failed to remove $_p"
+		else
+		    warn "supposedly installed file $_p does not exist!"
+		fi
+	    done < "$_abs_libdir/$_md/manifest"
+
+	    # If we fail to remove $md below, then the
+	    # installed manifest will still be full; the installed manifest
+	    # needs to be empty before install.
+	    msg "removing legacy manifest $_abs_libdir/$_md/manifest"
+	    run rm -f "$_abs_libdir/$_md/manifest"
+	    # For the above reason, this is a hard error
+	    need_ok "failed to remove installed manifest"
+
+	    # Remove $template_rel_manifest_dir directory
+	    msg "removing legacy manifest dir $_abs_libdir/$_md"
+	    run rm -R "$_abs_libdir/$_md"
+	    want_ok "failed to remove $_md"
+
+	    _uninstalled_something=true
+	fi
+    done
+
+    RETVAL="$_uninstalled_something"
+}
+
+uninstall_components() {
+    local _abs_libdir="$1"
+    local _dest_prefix="$2"
+    local _components="$3"
+
+    # We're going to start by uninstalling existing components. This
+    local _uninstalled_something=false
+
+    # First, try removing any 'legacy' manifests from before
+    # rust-installer
+    uninstall_legacy "$_abs_libdir"
+    assert_nz "$RETVAL", "RETVAL"
+    if [ "$RETVAL" = true ]; then
+	_uninstalled_something=true;
+    fi
+
+    # Load the version of the installed installer
+    local _installed_version=
+    if [ -f "$abs_libdir/$TEMPLATE_REL_MANIFEST_DIR/rust-installer-version" ]; then
+	_installed_version=`cat "$_abs_libdir/$TEMPLATE_REL_MANIFEST_DIR/rust-installer-version"`
+
+	# Sanity check
+	if [ ! -n "$_installed_version" ]; then critical_err "rust installer version is empty"; fi
+    fi
+
+    # If there's something installed, then uninstall
+    if [ -n "$_installed_version" ]; then
+	# Check the version of the installed installer
+	case "$_installed_version" in
+
+	    # If this is a previous version, then upgrade in place to the
+	    # current version before uninstalling.
+	    2 )
+		# The only change between version 2 -> 3 is that components are placed
+		# in subdirectories of the installer tarball. There are no changes
+		# to the installed data format, so nothing to do.
+		;;
+
+	    # This is the current version. Nothing need to be done except uninstall.
+	    "$TEMPLATE_RUST_INSTALLER_VERSION")
+		;;
+
+	    # If this is an unknown (future) version then bail.
+	    * )
+		echo "The copy of $TEMPLATE_PRODUCT_NAME at $_dest_prefix was installed using an"
+		echo "unknown version ($_installed_version) of rust-installer."
+		echo "Uninstall it first with the installer used for the original installation"
+		echo "before continuing."
+		exit 1
+		;;
+	esac
+
+	local _md="$_abs_libdir/$TEMPLATE_REL_MANIFEST_DIR"
+	local _installed_components="$(cat "$_md/components")"
+
+	# Uninstall (our components only) before reinstalling
+	local _available_component
+	for _available_component in $_components; do
+	    local _installed_component
+	    for _installed_component in $_installed_components; do
+		if [ "$_available_component" = "$_installed_component" ]; then
+		    msg "uninstalling component '$_available_component'"
+		    local _component_manifest="$_md/manifest-$_installed_component"
+
+		    # Sanity check: there should be a component manifest
+		    if [ ! -f "$_component_manifest" ]; then
+			critical_err "installed component '$_installed_component' has no manifest"
+		    fi
+
+		    # Iterate through installed component manifest and remove files
+		    local _directive
+		    while read _directive; do
+
+			local _command=${_directive%%:*}
+			local _file=${_directive#*:}
+
+			# Sanity checks
+			if [ ! -n "$_command" ]; then critical_err "malformed installation directive"; fi
+			if [ ! -n "$_file" ]; then critical_err "malformed installation directive"; fi
+
+			case "$_command" in
+			    file)
+				verbose_msg "removing file $_file"
+				if [ -f "$_file" ]; then
+				    run rm -f "$_file"
+				    want_ok "failed to remove $_file"
+				else
+				    warn "supposedly installed file $_file does not exist!"
+				fi
+				;;
+
+			    dir)
+				verbose_msg "removing directory $_file"
+				run rm -r "$_file"
+				want_ok "unable to remove directory $_file"
+				;;
+
+			    *)
+				critical_err "unknown installation directive"
+				;;
+			esac
+
+		    done < "$_component_manifest"
+
+		    # Remove the installed component manifest
+		    verbose_msg "removing component manifest $_component_manifest"
+		    run rm "$_component_manifest"
+		    # This is a hard error because the installation is unrecoverable
+		    critical_need_ok "failed to remove installed manifest for component '$_installed_component'"
+
+		    # Update the installed component list
+		    local _modified_components="$(sed "/^$_installed_component\$/d" "$_md/components")"
+		    write_to_file "$_modified_components" "$_md/components"
+		    critical_need_ok "failed to update installed component list"
+		fi
+	    done
+	done
+
+	# If there are no remaining components delete the manifest directory,
+	# but only if we're doing an uninstall - if we're doing an install,
+	# then leave the manifest directory around to hang onto the logs,
+	# and any files not managed by the installer.
+	if [ -n "${CFG_UNINSTALL-}" ]; then
+	    local _remaining_components="$(cat "$_md/components")"
+	    if [ ! -n "$_remaining_components" ]; then
+		verbose_msg "removing manifest directory $_md"
+		run rm -r "$_md"
+		want_ok "failed to remove $_md"
+
+		maybe_unconfigure_ld
+	    fi
+	fi
+
+	_uninstalled_something=true
+    fi
+
+    # There's no installed version. If we were asked to uninstall, then that's a problem.
+    if [ -n "${CFG_UNINSTALL-}" -a "$_uninstalled_something" = false ]
+    then
+	err "unable to find installation manifest at $CFG_LIBDIR/$TEMPLATE_REL_MANIFEST_DIR"
+    fi
+}
+
+install_components() {
+    local _src_dir="$1"
+    local _abs_libdir="$2"
+    local _dest_prefix="$3"
+    local _components="$4"
+
+    local _component
+    for _component in $_components; do
+
+	msg "installing component '$_component'"
+
+	# The file name of the manifest we're installing from
+	local _input_manifest="$_src_dir/$_component/manifest.in"
+
+	# Sanity check: do we have our input manifests?
+	if [ ! -f "$_input_manifest" ]; then
+	    critical_err "manifest for $_component does not exist at $_input_manifest"
+	fi
+
+	# The installed manifest directory
+	local _md="$_abs_libdir/$TEMPLATE_REL_MANIFEST_DIR"
+
+	# The file name of the manifest we're going to create during install
+	local _installed_manifest="$_md/manifest-$_component"
+
+	# Create the installed manifest, which we will fill in with absolute file paths
+	touch "$_installed_manifest"
+	critical_need_ok "failed to create installed manifest"
+
+	# Add this component to the installed component list
+	append_to_file "$_component" "$_md/components"
+	critical_need_ok "failed to update components list for $_component"
+
+	# Now install, iterate through the new manifest and copy files
+	local _directive
+	while read _directive; do
+
+	    local _command=${_directive%%:*}
+	    local _file=${_directive#*:}
+
+	    # Sanity checks
+	    if [ ! -n "$_command" ]; then critical_err "malformed installation directive"; fi
+	    if [ ! -n "$_file" ]; then critical_err "malformed installation directive"; fi
+
+	    # Decide the destination of the file
+	    local _file_install_path="$_dest_prefix/$_file"
+
+	    case "$_file" in
+		etc/*)
+		    local _f=${_file#"etc/"}
+		    _file_install_path="$CFG_DESTDIR_PREFIX/share/doc/cargo/$_f"
+		    ;;
+		bin/*)
+		    local _f=${_file#"bin/"}
+		    _file_install_path="$CFG_BINDIR/$_f"
+		    ;;
+		lib/*)
+		    local _f=${_file#"lib/"}
+		    _file_install_path="$CFG_LIBDIR/$_f"
+		    ;;
+		share/man/*)
+		    local _f=${_file#"share/man/"}
+		    _file_install_path="$CFG_DESTDIR_PREFIX/$PKGMANDIR/$_f"
+		    ;;
+		share/doc/*)
+            # HACK: Try to support overriding --docdir.  Paths with the form
+            # "share/doc/$product/" can be redirected to a single --docdir
+            # path. If the following detects that --docdir has been specified
+            # then it will replace everything preceeding the "$product" path
+            # component. The problem here is that the combined rust installer
+            # contains two "products": rust and cargo; so the contents of those
+            # directories will both be dumped into the same directory; and the
+            # contents of those directories are _not_ disjoint. Since this feature
+            # is almost entirely to support 'make install' anyway I don't expect
+            # this problem to be a big deal in practice.
+		    if [ "$CFG_DOCDIR" != "<default>" ]; then
+			local _f=${_file#"share/doc/"*/}
+			_file_install_path="$CFG_DOCDIR/$_f"
+		    fi
+		    ;;
+		share/*)
+		    local _f=${_file#"share/"}
+		    _file_install_path="$CFG_DATADIR/$_f"
+		    ;;
+	    esac
+
+
+	    # Make sure there's a directory for it
+	    make_dir_recursive "$(dirname "$_file_install_path")"
+	    critical_need_ok "directory creation failed"
+
+	    # Make the path absolute so we can uninstall it later without
+	    # starting from the installation cwd
+	    absolutify "$_file_install_path"
+	    _file_install_path="$RETVAL"
+	    assert_nz "$_file_install_path" "file_install_path"
+
+	    case "$_command" in
+		file )
+
+		    verbose_msg "copying file $_file_install_path"
+
+		    maybe_backup_path "$_file_install_path"
+
+		    local mode=644
+		    if test -x "$_src_dir/$_component/$_file"; then
+			mode=755
+		    fi
+		    case "$_file" in
+			bin/*) mode=755
+			       ;;
+		    esac
+		    run cp "$_src_dir/$_component/$_file" "$_file_install_path"
+		    run chmod $mode "$_file_install_path"
+		    critical_need_ok "file creation failed"
+
+		    # Update the manifest
+		    append_to_file "file:$_file_install_path" "$_installed_manifest"
+		    critical_need_ok "failed to update manifest"
+
+		    ;;
+
+		dir )
+
+		    verbose_msg "copying directory $_file_install_path"
+
+		    maybe_backup_path "$_file_install_path"
+
+		    run cp -R "$_src_dir/$_component/$_file" "$_file_install_path"
+		    critical_need_ok "failed to copy directory"
+
+                    # Set permissions. 0755 for dirs, 644 for files
+                    run chmod -R u+rwX,go+rX,go-w "$_file_install_path"
+                    critical_need_ok "failed to set permissions on directory"
+
+		    # Update the manifest
+		    append_to_file "dir:$_file_install_path" "$_installed_manifest"
+		    critical_need_ok "failed to update manifest"
+		    ;;
+
+		*)
+		    critical_err "unknown installation directive"
+		    ;;
+	    esac
+	done < "$_input_manifest"
+
+    done
+}
+
+maybe_configure_ld() {
+    local _abs_libdir="$1"
+
+    local _ostype="$(uname -s)"
+    assert_nz "$_ostype"  "ostype"
+
+    if [ "$_ostype" = "Linux" -a ! -n "${CFG_DISABLE_LDCONFIG-}" ]; then
+
+	# Fedora-based systems do not configure the dynamic linker to look
+	# /usr/local/lib, which is our default installation directory. To
+	# make things just work, try to put that directory in
+	# /etc/ld.so.conf.d/rust-installer-v1 so ldconfig picks it up.
+	# Issue #30.
+	#
+	# This will get rm'd when the last component is uninstalled in
+	# maybe_unconfigure_ld.
+	if [ "$_abs_libdir" = "/usr/local/lib" -a -d "/etc/ld.so.conf.d" ]; then
+	    echo "$_abs_libdir" > "/etc/ld.so.conf.d/rust-installer-v1-$TEMPLATE_REL_MANIFEST_DIR.conf"
+	    if [ $? -ne 0 ]; then
+		# This shouldn't happen if we've gotten this far
+		# installing to /usr/local
+		warn "failed to update /etc/ld.so.conf.d. this is unexpected"
+	    fi
+	fi
+
+	verbose_msg "running ldconfig"
+	if [ -n "${CFG_VERBOSE-}" ]; then
+	    ldconfig
+	else
+	    ldconfig 2> /dev/null
+	fi
+	if [ $? -ne 0 ]
+	then
+            warn "failed to run ldconfig. this may happen when not installing as root. run with --verbose to see the error"
+	fi
+    fi
+}
+
+maybe_unconfigure_ld() {
+    local _ostype="$(uname -s)"
+    assert_nz "$_ostype"  "ostype"
+
+    if [ "$_ostype" != "Linux" ]; then
+	return 0
+    fi
+
+    rm "/etc/ld.so.conf.d/rust-installer-v1-$TEMPLATE_REL_MANIFEST_DIR.conf" 2> /dev/null
+    # Above may fail since that file may not have been created on install
+}
+
+# Doing our own 'install'-like backup that is consistent across platforms
+maybe_backup_path() {
+    local _file_install_path="$1"
+
+    if [ -e "$_file_install_path" ]; then
+	msg "backing up existing file at $_file_install_path"
+	run mv -f "$_file_install_path" "$_file_install_path.old"
+	critical_need_ok "failed to back up $_file_install_path"
+    fi
+}
+
+install_uninstaller() {
+    local _src_dir="$1"
+    local _src_basename="$2"
+    local _abs_libdir="$3"
+
+    local _uninstaller="$_abs_libdir/$TEMPLATE_REL_MANIFEST_DIR/uninstall.sh"
+    msg "creating uninstall script at $_uninstaller"
+    run cp "$_src_dir/$_src_basename" "$_uninstaller"
+    critical_need_ok "unable to install uninstaller"
+}
+
+do_preflight_sanity_checks() {
+    local _src_dir="$1"
+    local _dest_prefix="$2"
+
+    # Sanity check: can we can write to the destination?
+    verbose_msg "verifying destination is writable"
+    make_dir_recursive "$CFG_LIBDIR"
+    need_ok "can't write to destination. consider \`sudo\`."
+    touch "$CFG_LIBDIR/rust-install-probe" > /dev/null
+    if [ $? -ne 0 ]
+    then
+	err "can't write to destination. consider \`sudo\`."
+    fi
+    rm "$CFG_LIBDIR/rust-install-probe"
+    need_ok "failed to remove install probe"
+
+    # Sanity check: don't install to the directory containing the installer.
+    # That would surely cause chaos.
+    verbose_msg "verifying destination is not the same as source"
+    local _prefix_dir="$(abs_path "$dest_prefix")"
+    if [ "$_src_dir" = "$_dest_prefix" -a "${CFG_UNINSTALL-}" != 1 ]; then
+	err "cannot install to same directory as installer"
+    fi
+}
+
+verbose_msg "looking for install programs"
+verbose_msg
+
+need_cmd mkdir
+need_cmd printf
+need_cmd cut
+need_cmd grep
+need_cmd uname
+need_cmd tr
+need_cmd sed
+need_cmd chmod
+need_cmd env
+need_cmd pwd
+
+CFG_ARGS="${@:-}"
+
+HELP=0
+if [ "${1-}" = "--help" ]
+then
+    HELP=1
+    shift
+    echo
+    echo "Usage: $0 [options]"
+    echo
+    echo "Options:"
+    echo
+else
+    verbose_step_msg "processing arguments"
+fi
+
+OPTIONS=""
+BOOL_OPTIONS=""
+VAL_OPTIONS=""
+
+flag uninstall "only uninstall from the installation prefix"
+valopt destdir "" "set installation root"
+valopt prefix "/usr/local" "set installation prefix"
+
+# Avoid prepending an extra / to the prefix path if there's no destdir
+# NB: CFG vars here are undefined when passing --help
+if [ -z "${CFG_DESTDIR-}" ]; then
+    CFG_DESTDIR_PREFIX="${CFG_PREFIX-}"
+else
+    CFG_DESTDIR_PREFIX="$CFG_DESTDIR/$CFG_PREFIX"
+fi
+
+# NB This isn't quite the same definition as in `configure`.
+# just using 'lib' instead of configure's CFG_LIBDIR_RELATIVE
+valopt without "" "comma-separated list of components to not install"
+valopt components "" "comma-separated list of components to install"
+flag list-components "list available components"
+valopt sysconfdir "$CFG_DESTDIR_PREFIX/etc" "install system configuration files"
+valopt bindir "$CFG_DESTDIR_PREFIX/bin" "install binaries"
+valopt libdir "$CFG_DESTDIR_PREFIX/lib" "install libraries"
+valopt datadir "$CFG_DESTDIR_PREFIX/share" "install data"
+# NB We repeat datadir default value because we don't set CFG_DATADIR in --help
+valopt mandir "${CFG_DATADIR-"$CFG_DESTDIR_PREFIX/share"}/man" "install man pages in PATH"
+# NB See the docdir handling in install_components for an explanation of this
+# weird <default> string
+valopt docdir "\<default\>" "install documentation in PATH"
+opt ldconfig 1 "run ldconfig after installation (Linux only)"
+opt verify 1 "obsolete"
+flag verbose "run with verbose output"
+
+if [ $HELP -eq 1 ]
+then
+    echo
+    exit 0
+fi
+
+verbose_step_msg "validating arguments"
+validate_opt
+
+# Template configuration.
+# These names surrounded by '%%` are replaced by sed when generating install.sh
+# FIXME: Might want to consider loading this from a file and not generating install.sh
+
+# Rust or Cargo
+TEMPLATE_PRODUCT_NAME='Rust'
+# rustlib or cargo
+TEMPLATE_REL_MANIFEST_DIR=rustlib
+# 'Rust is ready to roll.' or 'Cargo is cool to cruise.'
+TEMPLATE_SUCCESS_MESSAGE='rust installed.'
+# Locations to look for directories containing legacy, pre-versioned manifests
+TEMPLATE_LEGACY_MANIFEST_DIRS='rustlib,cargo'
+# The installer version
+TEMPLATE_RUST_INSTALLER_VERSION='3'
+
+# OK, let's get installing ...
+
+# This is where we are installing from
+src_dir="$(abs_path $(dirname "$0"))"
+
+# The name of the script
+src_basename="$(basename "$0")"
+
+# If we've been run as 'uninstall.sh' (from the existing installation)
+# then we're doing a full uninstall, as opposed to the --uninstall flag
+# which just means 'uninstall my components'.
+if [ "$src_basename" = "uninstall.sh" ]; then
+    if [ "${*:-}" != "" ]; then
+	# Currently don't know what to do with arguments in this mode
+	err "uninstall.sh does not take any arguments"
+    fi
+    CFG_UNINSTALL=1
+    CFG_DESTDIR_PREFIX="$(abs_path "$src_dir/../../")"
+    CFG_LIBDIR="$(abs_path "$src_dir/../")"
+fi
+
+# This is where we are installing to
+dest_prefix="$CFG_DESTDIR_PREFIX"
+
+# Open the components file to get the list of components to install.
+# NB: During install this components file is read from the installer's
+# source dir, during a full uninstall it's read from the manifest dir,
+# and thus contains all installed components.
+components=`cat "$src_dir/components"`
+
+# Sanity check: do we have components?
+if [ ! -n "$components" ]; then
+    err "unable to find installation components"
+fi
+
+# If the user asked for a component list, do that and exit
+if [ -n "${CFG_LIST_COMPONENTS-}" ]; then
+    echo
+    echo "# Available components"
+    echo
+    for component in $components; do
+	echo "* $component"
+    done
+    echo
+    exit 0
+fi
+
+# If the user specified which components to install/uninstall,
+# then validate that they exist and select them for installation
+if [ -n "$CFG_COMPONENTS" ]; then
+    # Remove commas
+    user_components="$(echo "$CFG_COMPONENTS" | sed "s/,/ /g")"
+    for user_component in $user_components; do
+	found=false
+	for my_component in $components; do
+	    if [ "$user_component" = "$my_component" ]; then
+		found=true
+	    fi
+	done
+	if [ "$found" = false ]; then
+	    err "unknown component: $user_component"
+	fi
+    done
+    components="$user_components"
+fi
+
+if [ -n "$CFG_WITHOUT" ]; then
+    without_components="$(echo "$CFG_WITHOUT" | sed "s/,/ /g")"
+    for without_component in $without_components; do
+	components="$(echo "$components" | sed "s/$without_component//" | sed "s/$without_component//")"
+    done
+fi
+
+if [ -z "$components" ]; then
+    if [ -z "${CFG_UNINSTALL-}" ]; then
+	err "no components selected for installation"
+    else
+	err "no components selected for uninstallation"
+    fi
+fi
+
+do_preflight_sanity_checks "$src_dir" "$dest_prefix"
+
+# Using an absolute path to libdir in a few places so that the status
+# messages are consistently using absolute paths.
+absolutify "$CFG_LIBDIR"
+abs_libdir="$RETVAL"
+assert_nz "$abs_libdir" "abs_libdir"
+
+# Create the manifest directory, where we will put our logs
+make_dir_recursive "$abs_libdir/$TEMPLATE_REL_MANIFEST_DIR"
+need_ok "failed to create $TEMPLATE_REL_MANIFEST_DIR"
+
+# Log messages and commands
+init_logging "$abs_libdir"
+
+# First do any uninstallation, including from legacy manifests. This
+# will also upgrade the metadata of existing installs.
+uninstall_components "$abs_libdir" "$dest_prefix" "$components"
+
+# If we're only uninstalling then exit
+if [ -n "${CFG_UNINSTALL-}" ]
+then
+    echo
+    echo "    $TEMPLATE_PRODUCT_NAME is uninstalled."
+    echo
+    exit 0
+fi
+
+# Create the manifest directory again! uninstall_legacy
+# may have deleted it.
+make_dir_recursive "$abs_libdir/$TEMPLATE_REL_MANIFEST_DIR"
+need_ok "failed to create $TEMPLATE_REL_MANIFEST_DIR"
+
+# Drop the version number into the manifest dir
+write_to_file "$TEMPLATE_RUST_INSTALLER_VERSION" "$abs_libdir/$TEMPLATE_REL_MANIFEST_DIR/rust-installer-version"
+critical_need_ok "failed to write installer version"
+
+# Install the uninstaller
+
+# Install each component
+install_components "$src_dir" "$abs_libdir" "$dest_prefix" "$components"
+
+# Make dynamic libraries available to the linker
+maybe_configure_ld "$abs_libdir"
+
+echo
+echo "    $TEMPLATE_SUCCESS_MESSAGE"
+echo
+
+


Home | Main Index | Thread Index | Old Index