rust_bin-1.34.2.recipe revision 05b27ed3
1SUMMARY="Modern and safe systems programming language"
2DESCRIPTION="Rust is a systems programming language that runs blazingly fast, \
3prevents almost all crashes*, and eliminates data races."
4HOMEPAGE="https://www.rust-lang.org/"
5COPYRIGHT="2018 The Rust Project Developers"
6LICENSE="MIT"
7REVISION="1"
8
9case "$effectiveTargetArchitecture" in
10	x86)
11SOURCE_URI="http://dl.rust-on-haiku.com/dist/$portVersion/rust-$portVersion-i686-unknown-haiku.tar.xz"
12CHECKSUM_SHA256="07ef97ebdc5ff062b0f1daeb5865b4b2931cf99bcc2689aa63fd2e0bb44d889c"
13SOURCE_DIR="rust-$portVersion-i686-unknown-haiku"
14		;;
15	x86_64)
16SOURCE_URI="http://dl.rust-on-haiku.com/dist/$portVersion/rust-$portVersion-x86_64-unknown-haiku.tar.xz"
17CHECKSUM_SHA256="348d9c0c22e44f878fa3073954a8f09d7b0e3a134b871ff7f80fbc6315340bca"
18SOURCE_DIR="rust-$portVersion-x86_64-unknown-haiku"
19		;;
20	*)
21SOURCE_URI="http://dl.rust-on-haiku.com/dist/$portVersion/rustc-$portVersion-src.tar.xz"
22CHECKSUM_SHA256="573abafaa8fd36cc35e94d411b0c450704d3f8df52027f15eabac1d248241613"
23SOURCE_DIR="rustc-$portVersion-src"
24		;;
25esac
26
27ARCHITECTURES="!x86_gcc2 ?x86 x86_64"
28SECONDARY_ARCHITECTURES="x86"
29DISABLE_SOURCE_PACKAGE=yes
30
31cargoVersion="0.35.0"
32rlsVersion="1.34.0"
33rustfmtVersion="1.0.3"
34clippyVersion="0.0.212"
35
36PROVIDES="
37	rust_bin$secondaryArchSuffix = $portVersion
38	cmd:rustc$secondaryArchSuffix = $portVersion
39	cmd:rustdoc$secondaryArchSuffix = $portVersion
40	cmd:rustfmt$secondaryArchSuffix = $portVersion
41	cmd:rust_gdb$secondaryArchSuffix = $portVersion
42	cmd:rust_lldb$secondaryArchSuffix = $portVersion
43	cmd:cargo$secondaryArchSuffix = $cargoVersion
44	cmd:cargo_clippy$secondaryArchSuffix = $clippyVersion
45	cmd:cargo_fmt$secondaryArchSuffix = $cargoVersion
46	cmd:clippy_driver$secondaryArchSuffix = $clippyVersion
47	cmd:rls$secondaryArchSuffix = $rlsVersion
48	cmd:rustfmt = $rustfmtVersion
49	"
50REQUIRES="
51	haiku$secondaryArchSuffix
52	lib:libcrypto$secondaryArchSuffix
53	lib:libcurl$secondaryArchSuffix
54	lib:libssl$secondaryArchSuffix
55	lib:libz$secondaryArchSuffix
56	"
57CONFLICTS="
58	rust$secondaryArchSuffix
59	"
60
61BUILD_REQUIRES="
62	haiku${secondaryArchSuffix}_devel
63	"
64
65relativeInstallDir="develop/tools$secondaryArchSubDir/rust"
66installDir="$prefix/$relativeInstallDir"
67
68INSTALL()
69{
70	./install.sh                                   \
71		--prefix=$installDir                       \
72		--docdir=$developDocDir                    \
73		--mandir=$manDir                           \
74		--sysconfdir=$dataDir                      \
75		--disable-ldconfig
76
77	# move zsh data to the datadir
78	mv $installDir/share/zsh $dataDir
79	rm -rf $installDir/share
80
81	# clean out unneccesary files created by the rust installer
82	rm $installDir/lib/rustlib/components
83	rm $installDir/lib/rustlib/install.log
84	rm $installDir/lib/rustlib/manifest-*
85	rm $installDir/lib/rustlib/rust-installer-version
86	rm $installDir/lib/rustlib/uninstall.sh
87
88	# link the binaries in $binDir
89	mkdir -p $binDir
90	for f in cargo cargo-clippy cargo-fmt clippy-driver rls rust-gdb \
91	         rust-lldb rustc rustdoc rustfmt; do
92		symlinkRelative -sfn $installDir/bin/$f $binDir
93	done
94
95	# make sure runtime_loader can find the libraries in the lib dir relative
96	# to the binaries
97	symlinkRelative -sfn $installDir/lib $installDir/bin/lib
98}
99