Compile with rust and clang from Freedesktop SDK

parent eb8b8544
kind: manual
depends:
- filename: rust/rust.bst
- filename: extensions/rust/rust.bst
junction: freedesktop-sdk.bst
type: build
- filename: rust/cargo.bst
- filename: extensions/rust/cargo.bst
junction: freedesktop-sdk.bst
type: build
- filename: base/libffi.bst
junction: freedesktop-sdk.bst
......@@ -31,6 +33,7 @@ config:
environment:
CARGO_HOME: '%{build-root}/home'
PATH: '/usr/lib/sdk/rust/bin:/app/bin:/usr/bin'
sources:
- kind: tar
......
......@@ -20,11 +20,20 @@ depends:
- filename: base/unzip.bst
junction: freedesktop-sdk.bst
type: build
- filename: llvm7.bst
- filename: desktop/llvm7.bst
junction: freedesktop-sdk.bst
type: build
- filename: rust/cargo.bst
- filename: base/pkg-config.bst
junction: freedesktop-sdk.bst
type: build
- filename: rust/rust.bst
- filename: base/perl.bst
junction: freedesktop-sdk.bst
type: build
- filename: extensions/rust/cargo.bst
junction: freedesktop-sdk.bst
type: build
- filename: extensions/rust/rust.bst
junction: freedesktop-sdk.bst
type: build
- filename: base/nss.bst
......@@ -99,8 +108,9 @@ environment:
CPPFLAGS: "-I/app/include"
LDFLAGS: "-L/app/lib"
#MOZBUILD_STATE_PATH: "%{build-root}/mozbuild"
RUST_BACKTRACE: "1"
CARGO_RUSTCFLAGS: '--verbose'
#RUST_BACKTRACE: "1"
#CARGO_RUSTCFLAGS: '--verbose'
PATH: '/usr/lib/sdk/rust/bin:/app/bin:/usr/bin'
config:
configure-commands:
......@@ -186,6 +196,9 @@ sources:
base-dir: firefox-65.0.2
- kind: patch
path: patches/firefox-enable-system-extensions.patch
- kind: patch
path: patches/firefox-rustc-1-33-0.patch
- kind: tar
url: "https://hg.mozilla.org/l10n-central/ach/archive/1d134c2eb450.tar.bz2"
directory: "locales/ach"
......
......@@ -14,4 +14,4 @@ sources:
- kind: git
url: https://gitlab.com/freedesktop-sdk/freedesktop-sdk
track: 'valentindavid/snap'
ref: 19c832f12672ed602823413f2b7094ee3e1289af
ref: 08d6edc4684e95afa8836252d513ee6035a57ff2
kind: manual
depends:
- filename: bootstrap-import.bst
junction: freedesktop-sdk.bst
type: build
config:
install-commands:
- |
bash install.sh \
--prefix="%{prefix}" \
--destdir="%{install-root}" \
--disable-ldconfig
- |
rm "%{install-root}%{libdir}/rustlib/components"
rm "%{install-root}%{libdir}/rustlib/install.log"
rm "%{install-root}%{libdir}/rustlib/rust-installer-version"
rm "%{install-root}%{libdir}/rustlib/uninstall.sh"
sources:
- kind: tar
(?):
- target_arch == "x86_64":
url: https://static.rust-lang.org/dist/cargo-0.31.0-x86_64-unknown-linux-gnu.tar.gz
ref: bfbabba9a2c1717fe1ce68469ce2de7b4b94e44e6a165d50b77de7bf7515bdb6
- target_arch == "i686":
url: https://static.rust-lang.org/dist/cargo-0.31.0-i686-unknown-linux-gnu.tar.gz
ref: 681caeb35516535896f555110923b5dbfd9d79b668a808d01c4cee88534c1ba4
- target_arch == "aarch64":
url: https://static.rust-lang.org/dist/cargo-0.31.0-aarch64-unknown-linux-gnu.tar.gz
ref: fc7b102942e6fdb32b9cb077513bb50186834bef4c947ff0b011c552cd639f8e
- target_arch == "arm":
url: https://static.rust-lang.org/dist/cargo-0.31.0-armv7-unknown-linux-gnueabihf.tar.gz
ref: 55dd38a6ca4528e18f6e546d4c4cdd12d3af6d3413ac68233cb64272fe93724e
This diff is collapsed.
kind: manual
depends:
- filename: bootstrap-import.bst
junction: freedesktop-sdk.bst
type: build
config:
install-commands:
- |
bash install.sh \
--prefix="%{prefix}" \
--destdir="%{install-root}" \
--disable-ldconfig
- |
rm "%{install-root}%{libdir}/rustlib/components"
rm "%{install-root}%{libdir}/rustlib/install.log"
rm "%{install-root}%{libdir}/rustlib/rust-installer-version"
rm "%{install-root}%{libdir}/rustlib/uninstall.sh"
# Use the previous version of the compiler to bootstrap the new one.
# That's how upstream recommends doing it.
sources:
- kind: tar
(?):
- target_arch == "x86_64":
url: https://static.rust-lang.org/dist/rust-1.31.1-x86_64-unknown-linux-gnu.tar.gz
ref: a64685535d0c457f49a8712a096a5c21564cd66fd2f7da739487f028192ebe3c
- target_arch == "i686":
url: https://static.rust-lang.org/dist/rust-1.31.1-i686-unknown-linux-gnu.tar.gz
ref: 1e77e5e8c745320faad9ce6f319a77b4a2e75d972eb68a195acd081ad910ab6d
- target_arch == "aarch64":
url: https://static.rust-lang.org/dist/rust-1.31.1-aarch64-unknown-linux-gnu.tar.gz
ref: 29a7c6eb536fefd0ca459e48dfaea006aa8bff8a87aa82a9b7d483487033632a
- target_arch == "arm":
url: https://static.rust-lang.org/dist/rust-1.31.1-armv7-unknown-linux-gnueabihf.tar.gz
ref: 11c717b781a7af5bdc829894139f8f45d4c12a061f7f9e39481f21426a04eb21
kind: manual
depends:
- filename: bootstrap-import.bst
junction: freedesktop-sdk.bst
type: build
- filename: rust/rust-stage1.bst
type: build
- filename: base/buildsystem-cmake.bst
junction: freedesktop-sdk.bst
type: build
- filename: base/python3.bst
junction: freedesktop-sdk.bst
type: build
- filename: llvm7.bst
- filename: base/libxml2.bst
junction: freedesktop-sdk.bst
variables:
debuginfo-only-std: 'false'
rust-target: '%{host-triplet}'
(?):
- target_arch == "i686":
# i686 also exhausts memory on stage0
debuginfo-only-std: 'true'
- target_arch == "arm":
rust-target: armv7-unknown-linux-gnueabihf
# armv7 exhausts memory on stage0 librustc w/ debuginfo
# github:rust-lang/rust/issues/45854
debuginfo-only-std: 'true'
environment-nocache:
- MAXJOBS
environment:
MAXJOBS: '%{max-jobs}'
config:
configure-commands:
- |
cat <<EOF >config.toml
[llvm]
link-shared = true
[build]
build = "%{rust-target}"
host = ["%{rust-target}"]
target = ["%{rust-target}"]
cargo = "%{bindir}/cargo"
rustc = "%{bindir}/rustc"
submodules = false
python = "/usr/bin/python3"
locked-deps = true
vendor = true
verbose = 2
[install]
prefix = "%{prefix}"
sysconfdir = "%{sysconfdir}"
bindir = "%{bindir}"
libdir = "%{libdir}"
datadir = "%{datadir}"
infodir = "%{infodir}"
localstatedir = "%{localstatedir}"
mandir = "%{mandir}"
docdir = "%{datadir}/doc/rust"
[rust]
channel = "stable"
debuginfo = true
debuginfo-only-std = %{debuginfo-only-std}
rpath = false
default-linker = "/usr/bin/gcc"
[target.%{rust-target}]
cc = "/usr/bin/%{host-triplet}-gcc"
cxx = "/usr/bin/%{host-triplet}-g++"
linker = "/usr/bin/%{host-triplet}-gcc"
ar = "/usr/bin/%{host-triplet}-gcc-ar"
llvm-config = "/app/bin/llvm-config"
EOF
build-commands:
- |
python3 x.py build -j${MAXJOBS}
install-commands:
- |
DESTDIR="%{install-root}" python3 x.py install
- |
rustlibdir="%{install-root}%{libdir}/rustlib/%{host-triplet}/lib"
for lib in "${rustlibdir}/"lib*.so; do
libname=$(basename "${lib}")
runtimelib="%{install-root}%{libdir}/${lib}"
if [ -f "${runtimelib}" ]; then
rm "${lib}"
ln -s "$(realpath "${runtimelib}" --relative-to="${rustlibdir}")" "${lib}"
fi
done
- |
rm "%{install-root}%{libdir}/rustlib/components"
rm "%{install-root}%{libdir}/rustlib/install.log"
rm "%{install-root}%{libdir}/rustlib/rust-installer-version"
rm "%{install-root}%{libdir}/rustlib/uninstall.sh"
public:
bst:
split-rules:
devel:
(>):
- '%{bindir}/*'
- '%{libdir}/rustlib'
- '%{libdir}/rustlib/**'
sources:
- kind: tar
url: https://static.rust-lang.org/dist/rustc-1.32.0-src.tar.gz
ref: 4c594c7712a0e7e8eae6526c464bf6ea1d82f77b4f61717c3fc28fb27ba2224a
- kind: patch
path: patches/rust-codegen-libdir.patch
- kind: patch
path: patches/rust-cannonicalize-install.patch
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment