forked from filipnavara/dotnet-riscv
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path07_pack_bflat_libs_linux.sh
More file actions
executable file
·51 lines (39 loc) · 1.21 KB
/
07_pack_bflat_libs_linux.sh
File metadata and controls
executable file
·51 lines (39 loc) · 1.21 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
#!/bin/bash
export TOP_DIR="$(cd "$(dirname "$(which "$0")")" ; pwd -P)"
libs_dir="${TOP_DIR}/libs"
output_dir="${TOP_DIR}/output/bflat-libs-linux"
file="bflat-libs-linux-musl-riscv64.zip"
apt-get update -y
apt-get install -y gcc-riscv64-linux-gnu
cd "${TOP_DIR}"
mkdir -p "${output_dir}"
function pack_bflat_libs_linux()
{
local file="$1"
local output_dir="$2"
local artifactpath="$3"
local pkgpath=".packages/microsoft.netcore.app.runtime.nativeaot.linux-musl-riscv64"
if [ ! -d "${artifactpath}/$pkgpath" ] ; then
return 1
fi
pushd "${artifactpath}/$pkgpath"
cp 10.0.*/runtimes/linux-*riscv64/lib/net10.0/*.dll \
10.0.*/runtimes/linux-*riscv64/native/*.a \
10.0.*/runtimes/linux-*riscv64/native/*.o \
10.0.*/runtimes/linux-*riscv64/native/*.so \
10.0.*/runtimes/linux-*riscv64/native/*.dll \
"${output_dir}/"
popd
ret="$?"
pushd "${output_dir}"
if [ -f "$file" ] ; then
rm "$file"
fi
riscv64-linux-gnu-strip --strip-debug *.a *.o
zip -r "$file" *
ret="$?"
popd
return $ret
}
pack_bflat_libs_linux "$file" "${output_dir}" "${TOP_DIR}/dotnet"
exit $?