1- #! /usr/bin/env sh
2- cd repo
3- # C code (EOCFI)
4- cd lime_tbx/business/eocfi_adapter/eocfi_c
5- cp MakefileLinux.mak Makefile
6- make
7- cd ../../../..
8- # python code
9- rm -rf lime_tbx.egg-info dist build
10- python3.9 -m build
11- rm -rf .venv
12- python3.9 -m venv .venv
13- .venv/bin/pip install wheel
14- .venv/bin/pip install -r requirements.txt
15- .venv/bin/pip install PySide2~=5.15
16- pyinstaller lime_tbx.spec
17- rm -rf deployment/installer/linux/installer_files && rm deployment/installer/linux/lime_installer.zip && rm -rf deployment/installer/debian/lime_*
18- cd deployment/installer && ./build_linux_installer.sh
19- cd debian && ./build_deb.sh
1+ #! /usr/bin/env bash
2+ set -euo pipefail
3+
4+ MODE=" pkg"
5+
6+ usage () {
7+ cat << EOF
8+ Usage: $0 [--c | --pkg | --all]
9+
10+ --c Only compile EO-CFI C code
11+ --pkg Only package Python app (without compiling EO-CFI C code) [default]
12+ --all Compile EO-CFI C code and package Python app
13+ EOF
14+ }
15+
16+ parse_args () {
17+ while [[ $# -gt 0 ]]; do
18+ case " $1 " in
19+ --c) MODE=" c" ; shift ;;
20+ --pkg) MODE=" pkg" ; shift ;;
21+ --all) MODE=" all" ; shift ;;
22+ -h|--help) usage; exit 0 ;;
23+ * ) echo " Unknown option: $1 " ; usage; exit 1 ;;
24+ esac
25+ done
26+ }
27+
28+ compile_c () {
29+ echo " [build] Compiling C code (EO-CFI)..."
30+ cd repo/lime_tbx/business/eocfi_adapter/eocfi_c
31+ cp MakefileLinux.mak Makefile
32+ make
33+ cd ../../../../..
34+ }
35+
36+ package_python () {
37+ echo " [build] Packaging Python app..."
38+ cd repo
39+ rm -rf lime_tbx.egg-info dist build
40+ python3.9 -m build
41+ rm -rf .venv
42+ python3.9 -m venv .venv
43+ .venv/bin/pip install wheel
44+ .venv/bin/pip install -r requirements.txt
45+ .venv/bin/pip install " PySide2~=5.15"
46+ pyinstaller lime_tbx.spec
47+ rm -rf deployment/installer/linux/installer_files \
48+ deployment/installer/linux/lime_installer.zip \
49+ deployment/installer/debian/lime_*
50+ cd deployment/installer
51+ ./build_linux_installer.sh
52+ cd debian
53+ ./build_deb.sh
54+ cd ../../..
55+ }
56+
57+ main () {
58+ parse_args " $@ "
59+
60+ case " $MODE " in
61+ c)
62+ compile_c
63+ ;;
64+ pkg)
65+ # Skipping C compilation is done to avoid dirty tag version.
66+ echo " WARNING: Skipping C compilation during packaging"
67+ echo " C code is NOT compiled in this package build!"
68+ package_python
69+ ;;
70+ all)
71+ compile_c
72+ package_python
73+ ;;
74+ esac
75+ }
76+
77+ main " $@ "
0 commit comments