Skip to content

Commit 20e260b

Browse files
authored
[Actions] Build Packager on Linux with its dependencies (32- and 64-bit) (#351)
* Install all necessary packages to build OPKG repository and enabled building of Packager * Use the development template to test * Check the config paths of PKG * Add a PKG config path to the opkg lib directly * No need for brackets as PKG_CONFIG_PATH is an env variable and not runner's one * Try adding the path to a global env variable of the runner * Fix the path to point to the pkg file and not just the whole lib * Update the prefix so that opkg ends up in the default path for cmake to find it * Update the env variable with a new path as well * Try the default path instead.. * Add more debugging info.. * Fix the includedir in the libopkg.pc * Try to locate the headers * Ls more paths to find the real install place * Try with the most default settings * Try to copy the headers and put them in the correct spot * Use the GitHub workspace variable to be more robust for any future changes * Make sure to build libopkg for 32 bit in 32 bit builds * Make sure to install 32 bit packages for the 32 bit build of libopkg * Update the PKG_CONFIG_PATH to include the i386 linux packages for 32 bit libopkg build * Simplify the formatting * Use the template for master after the testing is done
1 parent a4dd08c commit 20e260b

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

.github/workflows/Linux build template.yml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
echo "deb http://archive.ubuntu.com/ubuntu/ jammy-updates main universe restricted multiverse" | sudo tee -a /etc/apt/sources.list
2929
sudo dpkg --add-architecture i386
3030
sudo apt-get update
31-
sudo apt install python3-pip build-essential cmake ninja-build libusb-1.0-0-dev ${{matrix.architecture == '32' && 'zlib1g-dev:i386 libssl-dev:i386 gcc-13-multilib g++-13-multilib' || 'zlib1g-dev libssl-dev'}}
31+
sudo apt install python3-pip build-essential cmake ninja-build libusb-1.0-0-dev autoconf automake libtool libtool-bin pkg-config ${{matrix.architecture == '32' && 'zlib1g-dev:i386 libssl-dev:i386 gcc-13-multilib g++-13-multilib libarchive-dev:i386 libcurl4-openssl-dev:i386 libgpgme-dev:i386 libgpg-error-dev:i386' || 'zlib1g-dev libssl-dev libarchive-dev libcurl4-openssl-dev libgpgme-dev libgpg-error-dev'}}
3232
python3 -m venv venv
3333
source venv/bin/activate
3434
pip install jsonref
@@ -60,10 +60,31 @@ jobs:
6060
regex_flags: 'gim'
6161
search_string: ${{github.event.pull_request.body}}
6262

63+
- name: Checkout libopkg
64+
uses: actions/checkout@v4
65+
with:
66+
path: opkg
67+
repository: oe-mirrors/opkg
68+
6369
# ----- Build & upload artifacts -----
70+
- name: Build libopkg
71+
run: |
72+
export PKG_CONFIG_PATH=/usr/lib/${{matrix.architecture == '32' && 'i386' || 'x86_64'}}-linux-gnu/pkgconfig:$PKG_CONFIG_PATH
73+
cd opkg
74+
./autogen.sh || true
75+
./configure --prefix=/usr/local ${{matrix.architecture == '32' && 'CFLAGS="-m32" LDFLAGS="-m32"' || ''}}
76+
make
77+
sudo make install
78+
79+
- name: Install libopkg headers
80+
run: |
81+
sudo mkdir -p /usr/local/include/libopkg
82+
sudo cp $GITHUB_WORKSPACE/opkg/libopkg/*.h /usr/local/include/libopkg
83+
6484
- name: Build ThunderNanoServicesRDK
6585
run: |
6686
source venv/bin/activate
87+
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
6788
cmake -G Ninja -S ThunderNanoServicesRDK -B ${{matrix.build_type}}/build/ThunderNanoServicesRDK \
6889
-DCMAKE_CXX_FLAGS="-Wall -Wextra -Wpedantic -Werror -m${{matrix.architecture}}" \
6990
-DCMAKE_C_FLAGS="-Wall -Wextra -Wpedantic -Werror -m${{matrix.architecture}}" \
@@ -77,6 +98,7 @@ jobs:
7798
-DPLUGIN_MONITOR=ON \
7899
-DPLUGIN_OPENCDMI=ON \
79100
-DPLUGIN_PERFORMANCEMETRICS=ON \
101+
-DPLUGIN_PACKAGER=ON \
80102
${{steps.plugins.outputs.first_match}}
81103
cmake --build ${{matrix.build_type}}/build/ThunderNanoServicesRDK --target install
82104

0 commit comments

Comments
 (0)