-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·64 lines (52 loc) · 2.65 KB
/
build.sh
File metadata and controls
executable file
·64 lines (52 loc) · 2.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
#
# Script to build the project and generate .deb and .rpm packages for multiple architectures
# Author: matheus-git <mathiew0@gmail.com>
#
YELLOW_BOLD="\033[1;33m"
RESET="\033[0m"
PGO_DIR="/tmp/pgo-data"
MERGED_PROFILE="$(pwd)/merged.profdata"
#echo -e "${YELLOW_BOLD}\nCleaning old builds${RESET}"
#cargo clean
#rm -rf "$PGO_DIR" "$MERGED_PROFILE"
echo -e "${YELLOW_BOLD}\ncargo build --release${RESET}"
cargo build --release
#RUSTFLAGS="-Cprofile-generate=/tmp/pgo-data" cargo build --release
#
#echo -e "${YELLOW_BOLD}\nRunning binary to collect profiles${RESET}"
#./target/release/systemd-manager-tui
#
#echo -e "${YELLOW_BOLD}\nMerging profiles${RESET}"
#llvm-profdata merge -o "$MERGED_PROFILE" "$PGO_DIR"/*.profraw
#
#echo -e "${YELLOW_BOLD}\nFinal release build using PGO${RESET}"
#RUSTFLAGS="-Cprofile-use=$MERGED_PROFILE -Cllvm-args=-pgo-warn-missing-function" cargo build --release
echo -e "${YELLOW_BOLD}\ncross build --release --target x86_64-unknown-linux-musl${RESET}"
cargo zigbuild --release --target x86_64-unknown-linux-musl
echo -e "${YELLOW_BOLD}\ncross build --release --target aarch64-unknown-linux-musl${RESET}"
cargo zigbuild --release --target aarch64-unknown-linux-musl
if ! command -v cargo-deb &> /dev/null; then
echo -e "${YELLOW_BOLD}\nInstalling cargo-deb${RESET}"
cargo install cargo-deb
fi
echo -e "${YELLOW_BOLD}\ncargo deb${RESET}"
cargo deb --target x86_64-unknown-linux-musl --no-build
echo -e "${YELLOW_BOLD}\ncargo deb --target aarch64-unknown-linux-musl${RESET}"
cargo deb --target aarch64-unknown-linux-musl --no-build
if ! command -v cargo-generate-rpm &> /dev/null && ! command -v cargo generate-rpm &> /dev/null; then
echo -e "${YELLOW_BOLD}\nInstalling cargo-rpm${RESET}"
cargo install cargo-generate-rpm
fi
echo -e "${YELLOW_BOLD}\ncargo generate-rpm --target x86_64-unknown-linux-musl${RESET}"
cargo generate-rpm --target x86_64-unknown-linux-musl
echo -e "${YELLOW_BOLD}\ncargo generate-rpm --target aarch64-unknown-linux-musl${RESET}"
cargo generate-rpm --target aarch64-unknown-linux-musl
echo -e "${YELLOW_BOLD}\nBuilds and packages generated in the following directories:${RESET}"
echo -e "${YELLOW_BOLD} - target/release/${RESET}"
echo -e "${YELLOW_BOLD} - target/x86_64-unknown-linux-musl/release/${RESET}"
echo -e "${YELLOW_BOLD} - target/aarch64-unknown-linux-musl/release/${RESET}"
echo -e "${YELLOW_BOLD} - target/x86_64-unknown-linux-musl/debian/${RESET}"
echo -e "${YELLOW_BOLD} - target/aarch64-unknown-linux-musl/debian/${RESET}"
echo -e "${YELLOW_BOLD} - target/x86_64-unknown-linux-musl/generate-rpm/${RESET}"
echo -e "${YELLOW_BOLD} - target/aarch64-unknown-linux-musl/generate-rpm/${RESET}"