Skip to content

Commit 21391a0

Browse files
authored
Merge pull request #88 from PX4/mrpollo/update_gazebo
formula: update formulas & adds ci test * updates px4-dev formula to avoid installation errors * updates gazebo formula to harmonic to remain in line with px4 * adds ci sanity checks for the px4/px4 tap * adds ci px4-dev install plus build px4 test
2 parents b515f72 + b525e21 commit 21391a0

File tree

10 files changed

+233
-49
lines changed

10 files changed

+233
-49
lines changed

.github/workflows/test_bot.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Brew test-bot
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- '**'
10+
11+
jobs:
12+
test-bot:
13+
name: Check Style, and Audit Formula
14+
runs-on: ubuntu-24.04
15+
env:
16+
HOMEBREW_FORCE_VENDOR_RUBY: 1
17+
steps:
18+
- name: Activate Homebrew
19+
if: runner.os == 'Linux'
20+
run: echo "/home/linuxbrew/.linuxbrew/bin" >> "$GITHUB_PATH"
21+
22+
- name: Set up Homebrew
23+
id: set-up-homebrew
24+
uses: Homebrew/actions/setup-homebrew@master
25+
26+
- name: Cache Bundler RubyGems
27+
id: cache
28+
uses: actions/cache@v4
29+
with:
30+
path: ${{ steps.set-up-homebrew.outputs.gems-path }}
31+
key: ${{ runner.os }}-rubygems-${{ steps.set-up-homebrew.outputs.gems-hash }}
32+
restore-keys: ${{ runner.os }}-rubygems-
33+
34+
- run: brew test-bot --only-cleanup-before
35+
36+
- run: brew test-bot --only-setup
37+
38+
- run: brew test-bot --fail-fast --tap=px4/px4 --only-tap-syntax

.github/workflows/test_px4_dev.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Build, Test & Compile PX4 Projects
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- '**'
10+
11+
jobs:
12+
build:
13+
name: Building ${{ matrix.formula }}
14+
runs-on: macos-latest
15+
strategy:
16+
fail-fast: true
17+
matrix:
18+
include:
19+
- formula: px4-dev
20+
build_target: px4_fmu-v5
21+
#- formula: px4-sim-gazebo
22+
#build_target: px4_sitl_default
23+
24+
steps:
25+
- name: Checkout Homebrew tap
26+
uses: actions/checkout@v4
27+
with:
28+
repository: px4/homebrew-px4
29+
path: homebrew-px4
30+
31+
- name: Update Homebrew
32+
run: brew update
33+
34+
- name: Tap PX4/px4 repository
35+
working-directory: homebrew-px4
36+
run: brew tap px4/px4 "${{ github.workspace }}/homebrew-px4"
37+
38+
- name: Checkout PX4 Autopilot
39+
uses: actions/checkout@v4
40+
with:
41+
repository: PX4/PX4-Autopilot
42+
path: px4-autopilot
43+
fetch-depth: 0
44+
45+
- name: Set up Python
46+
uses: actions/setup-python@v5
47+
with:
48+
python-version: '3.11'
49+
50+
- name: Setup Python virtual environment
51+
working-directory: px4-autopilot
52+
run: |
53+
python3 -m venv venv
54+
source venv/bin/activate
55+
pip install --upgrade pip
56+
pip install -r Tools/setup/requirements.txt
57+
58+
- name: Add venv to PATH for subsequent steps
59+
run: echo "${{ github.workspace }}/px4-autopilot/venv/bin" >> "$GITHUB_PATH"
60+
61+
- name: Install formula
62+
run: brew install --build-from-source ${{ matrix.formula }}
63+
64+
- name: Run formula tests
65+
run: brew test ${{ matrix.formula }}
66+
67+
- name: Audit formula
68+
run: brew audit --strict --online ${{ matrix.formula }}
69+
70+
- name: Build PX4 Autopilot
71+
working-directory: px4-autopilot
72+
run: |
73+
source venv/bin/activate
74+
make ${{ matrix.build_target }}

Formula/asio@1.10.8.rb

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
class AsioAT1108 < Formula
2+
desc "Cross-platform C++ Library for asynchronous programming"
3+
homepage "https://think-async.com/Asio"
4+
url "https://downloads.sourceforge.net/project/asio/asio/1.10.8%20%28Stable%29/asio-1.10.8.tar.bz2"
5+
sha256 "26deedaebbed062141786db8cfce54e77f06588374d08cccf11c02de1da1ed49"
6+
license "BSL-1.0"
7+
head "https://github.com/chriskohlhoff/asio.git"
8+
keg_only :versioned_formula
9+
10+
depends_on "autoconf" => :build
11+
depends_on "automake" => :build
12+
depends_on "libtool" => :build
13+
depends_on "pkg-config" => :build
14+
depends_on "boost"
15+
16+
def install
17+
# Ensure C++11 compatibility
18+
ENV.cxx11
19+
20+
# Regenerate the configure script
21+
system "autoconf"
22+
23+
# Configure with Boost support
24+
args = %W[
25+
--disable-dependency-tracking
26+
--disable-silent-rules
27+
--prefix=#{prefix}
28+
--with-boost=#{Formula["boost"].opt_include}
29+
]
30+
system "./configure", *args
31+
32+
# Build and install
33+
system "make", "install"
34+
35+
# Install example programs
36+
pkgshare.install "src/examples"
37+
end
38+
39+
test do
40+
# Use the HTTP server example to verify functionality
41+
httpserver = pkgshare/"examples/cpp03/http/server/http_server"
42+
pid = fork do
43+
exec httpserver, "127.0.0.1", "8080", "."
44+
end
45+
sleep 1
46+
begin
47+
assert_match "404 Not Found", shell_output("curl -s http://127.0.0.1:8080")
48+
ensure
49+
Process.kill "TERM", pid
50+
Process.wait pid
51+
end
52+
end
53+
end

Formula/fastcdr.rb

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
11
class Fastcdr < Formula
22
desc "OMG RTPS / DDS implementation"
33
homepage "http://www.eprosima.com/index.php/products-all/eprosima-fast-rtps"
4-
url "https://github.com/eProsima/Fast-CDR/archive/v1.0.22.tar.gz"
4+
url "https://github.com/eProsima/Fast-CDR/archive/refs/tags/v1.0.22.tar.gz"
55
sha256 "7ca7f09c633963622431bdb216eeb4145e378f81a2ce5113e341b9eee55e4f44"
66

77
depends_on "cmake" => :build
88

9-
# bottle do
10-
# root_url "http://px4-tools.s3.amazonaws.com"
11-
# cellar :any
12-
# sha256 "e33d048df94b0e4efcdc5249a979f6c3780607d96ef1a1f767c54ab425a4418a" => :sierra
13-
# end
14-
159
def install
16-
Dir.mkdir("./build")
17-
Dir.chdir("./build")
18-
system "cmake", "-DCMAKE_INSTALL_PREFIX:PATH=#{prefix}", ".."
19-
system "make"
20-
system "make", "install"
10+
build_dir = buildpath/"build"
11+
build_dir.mkpath
12+
13+
# Configure with updated minimum CMake policy to avoid compatibility errors
14+
system "cmake", "-S", ".", "-B", build_dir,
15+
"-DCMAKE_POLICY_VERSION_MINIMUM=3.5",
16+
*std_cmake_args
17+
system "cmake", "--build", build_dir
18+
system "cmake", "--install", build_dir
2119
end
2220
end

Formula/fastdds.rb

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,24 @@ class Fastdds < Formula
33
homepage "https://www.eprosima.com/index.php/products-all/eprosima-fast-dds"
44
url "https://github.com/eProsima/Fast-DDS/archive/refs/tags/v2.0.2.tar.gz"
55
sha256 "d8c87e84c41a5628cc41658476137b6a392f218b844a6f5e2ff5d8c359fd5b10"
6+
license "Apache-2.0"
67

78
depends_on "cmake" => :build
8-
depends_on "asio"
9-
depends_on "tinyxml2"
9+
depends_on "asio@1.10.8"
1010
depends_on "fastcdr"
1111
depends_on "foonathan-memory"
12-
12+
depends_on "tinyxml2"
1313

1414
def install
15-
Dir.mkdir("./build")
16-
Dir.chdir("./build")
17-
system "cmake", "-DCMAKE_INSTALL_PREFIX:PATH=#{prefix}", ".."
18-
system "make"
19-
system "make", "install"
15+
# Out-of-tree build to avoid nested chdir conflicts
16+
build_dir = buildpath/"build"
17+
build_dir.mkpath
18+
19+
# Configure, build, and install with updated CMake policy
20+
system "cmake", "-S", ".", "-B", build_dir,
21+
"-DCMAKE_POLICY_VERSION_MINIMUM=3.5",
22+
*std_cmake_args
23+
system "cmake", "--build", build_dir
24+
system "cmake", "--install", build_dir
2025
end
2126
end

Formula/fastddsgen.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
class Fastddsgen < Formula
2-
desc "Fast-DDS IDL code generator tool "
2+
desc "Fast-DDS IDL code generator tool"
33
homepage "https://www.eprosima.com/index.php/products-all/eprosima-fast-dds"
44
url "https://github.com/eProsima/Fast-DDS-Gen.git", tag: "v1.0.4"
55
sha256 "a75399160aab20490a64a4e936230f446441a2717c756e478bbd83822fcb97a2"
@@ -13,5 +13,4 @@ def install
1313
system "./gradlew", "assemble"
1414
system "./gradlew", "install", "--install_path=#{prefix}"
1515
end
16-
1716
end

Formula/foonathan-memory.rb

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
class FoonathanMemory < Formula
2-
desc "STL compatible C++ memory allocator library using a new RawAllocator concept that is similar to an Allocator but easier to use and write."
2+
desc "STL-compatible C++ allocator library with a simpler memory model"
33
homepage "https://memory.foonathan.net"
44
url "https://github.com/foonathan/memory/archive/refs/tags/v0.7-1.tar.gz"
55
sha256 "19eb61c5cba6ccc40b8ee741350fd29402a46641ba752c30b7079528d87dbc79"
@@ -8,11 +8,18 @@ class FoonathanMemory < Formula
88
depends_on "cmake" => :build
99

1010
def install
11-
Dir.mkdir("./build")
12-
Dir.chdir("./build")
13-
system "cmake", "-DCMAKE_INSTALL_PREFIX:PATH=#{prefix}", ".."
14-
system "make"
15-
system "make", "install"
16-
end
11+
# Use out-of-tree build directory to avoid nested chdir conflicts
12+
build_dir = buildpath/"build"
13+
build_dir.mkpath
14+
15+
# Configure with tests disabled and CMake compatibility policy
16+
system "cmake", "-S", ".", "-B", build_dir,
17+
"-DFOONATHAN_MEMORY_BUILD_TESTS=OFF",
18+
"-DCMAKE_POLICY_VERSION_MINIMUM=3.5",
19+
*std_cmake_args
1720

21+
# Build and install
22+
system "cmake", "--build", build_dir
23+
system "cmake", "--install", build_dir
24+
end
1825
end

Formula/kconfig-frontends.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,8 @@ def install
3535
--disable-debug
3636
--disable-dependency-tracking
3737
]
38-
if Hardware::CPU.arm?
39-
args << "--disable-nconf"
40-
end
41-
38+
args << "--disable-nconf" if Hardware::CPU.arm?
39+
4240
system "./configure", *args
4341
system "make", "install"
4442
end

Formula/px4-dev.rb

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
class Px4Dev < Formula
22
desc "PX4 development toolchain"
3-
homepage "http://px4.io"
4-
url "https://raw.githubusercontent.com/PX4/PX4-Autopilot/master/Tools/px4.py"
5-
version "1.11.0"
3+
homepage "https://px4.io"
4+
url "https://raw.githubusercontent.com/PX4/PX4-Autopilot/main/Tools/px4.py"
5+
version "1.15.0"
66
sha256 "5eda2111dc20c092dc8241768121cf4173edabb593b2b199e6c233b5088c52aa"
7+
78
depends_on "ant"
89
depends_on "astyle"
910
depends_on "bash-completion"
@@ -18,8 +19,19 @@ class Px4Dev < Formula
1819
depends_on "python"
1920

2021
def install
21-
mkdir_p "#{bin}/"
22-
cp "px4.py", "#{bin}/"
22+
# Patch px4.py to use HTTPS for remote tag lookup instead of SSH
23+
inreplace "px4.py",
24+
"git@github.com:PX4/PX4-Autopilot.git",
25+
"https://github.com/PX4/PX4-Autopilot.git"
26+
27+
# Install the px4 script
28+
bin.install "px4.py"
2329
ohai "PX4 Toolchain Installed"
2430
end
31+
32+
test do
33+
# Ensure the script runs without SSH errors and prints release info
34+
output = shell_output("#{bin}/px4.py")
35+
assert_match(/PX4 Release/, output)
36+
end
2537
end

Formula/px4-sim-gazebo.rb

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,28 @@ def message
1212
end
1313

1414
class Px4SimGazebo < Formula
15-
desc "PX4 Gazebo simulation"
15+
desc "PX4 Gazebo Simulation Toolkit"
1616
homepage "http://px4.io"
17-
url "https://raw.githubusercontent.com/PX4/PX4-Autopilot/master/Tools/px4.py"
18-
version "1.11.0"
19-
sha256 "6e4a8a6aad592a0c156d16233e16ee276fd6cc63b620be5bd047375b1352e27d"
17+
url "https://raw.githubusercontent.com/PX4/PX4-Autopilot/main/Tools/px4.py"
18+
version "1.15.0"
19+
sha256 "5eda2111dc20c092dc8241768121cf4173edabb593b2b199e6c233b5088c52aa"
2020
depends_on "exiftool"
2121
depends_on "glog"
2222
depends_on "graphviz"
23-
depends_on "gst-libav"
24-
depends_on "gst-plugins-bad"
25-
depends_on "gst-plugins-base"
26-
depends_on "gst-plugins-good"
27-
depends_on "gst-plugins-ugly"
2823
depends_on "gstreamer"
2924
depends_on "opencv"
30-
depends_on "osrf/simulation/gazebo11"
25+
depends_on "osrf/simulation/gz-harmonic"
3126
depends_on "protobuf"
3227
depends_on "px4-dev"
3328

3429
def install
3530
mkdir_p "#{bin}/"
3631
cp "px4.py", "#{bin}/px4-sim-gazebo.py"
37-
ohai "PX4 Gazebo simulation installed"
32+
ohai "PX4 Gazebo Simulation Installed"
33+
end
34+
35+
test do
36+
output = shell_output("#{bin}/gz sim --version 2> /dev/null")
37+
assert_match "Gazebo Sim, version 8*", output
3838
end
3939
end

0 commit comments

Comments
 (0)