-
Notifications
You must be signed in to change notification settings - Fork 50
/
Copy pathbuild.sh
executable file
·66 lines (58 loc) · 2.06 KB
/
build.sh
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
65
66
#!/usr/bin/env bash
pyinstaller src/rocprofiler-compute.py \
--name "rocprofiler-compute" \
--add-data "src/perfmon_pub/*:perfmon_pub" \
--add-data "src/utils/*:utils" \
--add-data "src/soc_params/*.csv:soc_params" \
--add-data "src/rocprof_compute_analyze/*:rocprof_compute_analyze" \
--hidden-import matplotlib.backends.backend_pdf \
${@}
while [ $# -gt 0 ]; do
case "$1" in
-y*)
if [[ "$1" != *=* ]]; then shift; fi
y="${1#*=}"
;;
--workpath*)
if [[ "$1" != *=* ]]; then shift; fi
workpath="${1#*=}"
;;
--distpath*)
if [[ "$1" != *=* ]]; then shift; fi
distpath="${1#*=}"
;;
*)
echo "Invalid argument"
exit 1
;;
esac
shift
done
echo "distpath=$distpath"
echo "(build.sh) Checking for submodules"
# Check to se if submodules are available
if [ -d "src/waveparser/" ] && [ -d "src/multevent/" ]
then
echo "Found submodules"
if [ "$(ls -A src/waveparser/)" ] && [ "$(ls -A src/multevent/)" ]; then
echo "waveparser and multevents submodules loaded. Packaging..."
cp -r src/waveparser/ "$distpath"/waveparser/
cp -r src/multevent/ "$distpath"/multevent/
else
echo "One of your submodules isn't loaded. Skipping submodule packaging"
fi
else
echo "ERROR: Couldn't find directory for submodules"
fi
echo "(build.sh) Loading dash_svg"
# Take care of dash-svg module that isn't detected by PyInstaller
dash_info=$(pip3 show dash_svg)
dash_loc=$(sed -n '8p' <<<"$dash_info")
cp -r ${dash_loc:10}/dash_svg "$distpath"/rocprofiler-compute/
echo "(build.sh) Fixing flattened directories"
#TODO: Copy orig file structure from over to flattened packaged version
rm -rf "$distpath"/rocprofiler-compute/rocprof_compute_analyze/
cp -r src/rocprof_compute_analyze/ "$distpath"/rocprofiler-compute/
rm -rf "$distpath"/rocprofiler-compute/perfmon_pub/
cp -r src/perfmon_pub/ "$distpath"/rocprofiler-compute/
rm -rf "$distpath"/rocprofiler-compute/perfmon/