Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/native_full_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: BT-Core Build Component in Native Environment

on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]

jobs:
native-build:
runs-on: ubuntu-latest

steps:
# ----------------------------------------
# Checkout
# ----------------------------------------
- name: Checkout source
uses: actions/checkout@v6

# ----------------------------------------
# Setup scripts permission
# ----------------------------------------
- name: Make scripts executable
run: |
chmod +x build_dependencies.sh
chmod +x cov_build.sh

# ----------------------------------------
# Install dependencies
# ----------------------------------------
- name: Run bt-core dependency setup
run: ./build_dependencies.sh

# ----------------------------------------
# Build project
# ----------------------------------------
- name: Run bt-core native build
run: ./cov_build.sh
58 changes: 58 additions & 0 deletions build_dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/bin/bash
set -e

echo "Installing system dependencies..."

sudo apt-get update
sudo apt-get install -y \
autoconf automake libtool pkg-config \
gcc g++ make \
libglib2.0-dev libdbus-1-dev libbluetooth-dev \
git

WORKSPACE=$(pwd)

echo "Setting up telemetry stub..."

git clone https://github.com/rdkcentral/telemetry.git
Comment on lines +14 to +17
Comment on lines +16 to +17

Comment on lines +17 to +18
mkdir -p ${WORKSPACE}/external/include
mkdir -p ${WORKSPACE}/external/lib
Comment on lines +17 to +20

cp telemetry/include/telemetry_busmessage_sender.h ${WORKSPACE}/external/include/
cp telemetry/include/telemetry2_0.h ${WORKSPACE}/external/include/

cat << 'EOF' > telemetry_stub.c
int t2_init(void) { return 0; }
int t2_event_s(const char* n, const char* v) { return 0; }
int t2_event_f(const char* n, float v) { return 0; }
int t2_event_d(const char* n, double v) { return 0; }
EOF

gcc -shared -fPIC telemetry_stub.c \
-o ${WORKSPACE}/external/lib/libtelemetry_msgsender.so

echo "Setting up BlueZ legacy headers..."

git clone https://github.com/bluez/bluez.git

mkdir -p ${WORKSPACE}/external/include/bluetooth/audio
mkdir -p ${WORKSPACE}/external/include/bluetooth

git -C bluez checkout tags/4.101

cp bluez/audio/ipc.h \
${WORKSPACE}/external/include/bluetooth/audio/ipc.h

git -C bluez checkout tags/5.48

cp bluez/profiles/audio/a2dp-codecs.h \
${WORKSPACE}/external/include/bluetooth/audio/a2dp-codecs.h

cp bluez/lib/bluetooth.h \
${WORKSPACE}/external/include/bluetooth/bluetooth.h

sed -i '1i#include <stdbool.h>\n' \
${WORKSPACE}/external/include/bluetooth/audio/ipc.h
Comment on lines +55 to +56
Comment on lines +55 to +56

echo "Dependencies setup completed."
29 changes: 29 additions & 0 deletions cov_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash
set -e

WORKSPACE=$(pwd)

echo "Bootstrapping autotools..."

libtoolize --force
aclocal
autoheader
automake --force-missing --add-missing
autoconf

echo "Configuring project..."

export CPPFLAGS="-I${WORKSPACE}/external/include"
export LDFLAGS="-L${WORKSPACE}/external/lib"
export CFLAGS="-Wno-error"
export CXXFLAGS="-Wno-error"
export LD_LIBRARY_PATH="${WORKSPACE}/external/lib"
Comment on lines +16 to +20

ac_cv_header_telemetry_busmessage_sender_h=yes ./configure

echo "Building Bluetooth components..."

make -C src/bt-ifce -j$(nproc)
make -C src -j$(nproc)

echo "Build completed successfully."
Loading