Skip to content

Commit

Permalink
switch to meson build system (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
aler9 authored Aug 21, 2024
1 parent 3b15ba9 commit 2ec6715
Show file tree
Hide file tree
Showing 17 changed files with 309 additions and 308 deletions.
10 changes: 6 additions & 4 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
*.o
/deps
/prefix
/mtxrpicam_*
/build
/subprojects/*
!/subprojects/packagefiles
!/subprojects/freetype.wrap
!/subprojects/libcamera.wrap
!/subprojects/x264.wrap
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ jobs:

- run: make -f utils.mk build_32

- run: tar -czf mtxrpicam_32.tar.gz mtxrpicam_32
- run: cd build && tar -czf mtxrpicam_32.tar.gz mtxrpicam_32

- uses: actions/upload-artifact@v4
with:
path: mtxrpicam_32.tar.gz
path: build/mtxrpicam_32.tar.gz
name: mtxrpicam_32.tar.gz

build_64:
Expand All @@ -29,11 +29,11 @@ jobs:

- run: make -f utils.mk build_64

- run: tar -czf mtxrpicam_64.tar.gz mtxrpicam_64
- run: cd build && tar -czf mtxrpicam_64.tar.gz mtxrpicam_64

- uses: actions/upload-artifact@v4
with:
path: mtxrpicam_64.tar.gz
path: build/mtxrpicam_64.tar.gz
name: mtxrpicam_64.tar.gz

github_release:
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ jobs:

- run: make -f utils.mk build_32

- run: tar -czf mtxrpicam_32.tar.gz mtxrpicam_32
- run: cd build && tar -czf mtxrpicam_32.tar.gz mtxrpicam_32

- uses: actions/upload-artifact@v4
with:
path: mtxrpicam_32.tar.gz
path: build/mtxrpicam_32.tar.gz
name: mtxrpicam_32.tar.gz

build_64:
Expand All @@ -30,11 +30,11 @@ jobs:

- run: make -f utils.mk build_64

- run: tar -czf mtxrpicam_64.tar.gz mtxrpicam_64
- run: cd build && tar -czf mtxrpicam_64.tar.gz mtxrpicam_64

- uses: actions/upload-artifact@v4
with:
path: mtxrpicam_64.tar.gz
path: build/mtxrpicam_64.tar.gz
name: mtxrpicam_64.tar.gz

test_bullseye_32:
Expand All @@ -47,9 +47,9 @@ jobs:
- uses: actions/download-artifact@v4
with:
name: mtxrpicam_32.tar.gz
path: .
path: build/

- run: tar xvf mtxrpicam_32.tar.gz
- run: cd build && tar xvf mtxrpicam_32.tar.gz

- run: make -f utils.mk test_bullseye_32

Expand All @@ -63,9 +63,9 @@ jobs:
- uses: actions/download-artifact@v4
with:
name: mtxrpicam_64.tar.gz
path: .
path: build/

- run: tar xvf mtxrpicam_64.tar.gz
- run: cd build && tar xvf mtxrpicam_64.tar.gz

- run: make -f utils.mk test_bullseye_64

Expand All @@ -79,9 +79,9 @@ jobs:
- uses: actions/download-artifact@v4
with:
name: mtxrpicam_32.tar.gz
path: .
path: build/

- run: tar xvf mtxrpicam_32.tar.gz
- run: cd build && tar xvf mtxrpicam_32.tar.gz

- run: make -f utils.mk test_bookworm_32

Expand All @@ -95,8 +95,8 @@ jobs:
- uses: actions/download-artifact@v4
with:
name: mtxrpicam_64.tar.gz
path: .
path: build/

- run: tar xvf mtxrpicam_64.tar.gz
- run: cd build && tar xvf mtxrpicam_64.tar.gz

- run: make -f utils.mk test_bookworm_64
10 changes: 6 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
*.o
/deps
/prefix
/mtxrpicam_*
/build
/subprojects/*
!/subprojects/packagefiles
!/subprojects/freetype.wrap
!/subprojects/libcamera.wrap
!/subprojects/x264.wrap
206 changes: 0 additions & 206 deletions Makefile

This file was deleted.

10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@ This is embedded into all MediaMTX releases and shouldn't normally be downloaded
```sh
sudo apt install -y \
g++ \
make \
xxd \
wget \
git \
cmake \
meson \
patch \
pkg-config \
python3-jinja2 \
python3-yaml \
Expand All @@ -31,10 +29,10 @@ This is embedded into all MediaMTX releases and shouldn't normally be downloaded
3. Build:

```sh
make -j$(nproc)
meson setup build && DESTDIR=./prefix ninja -C build install
```

This will produce the `mtxrpicam_32` or `mtxrpicam_64` folder (depending on the architecture).
This will produce the `build/mtxrpicam_32` or `build/mtxrpicam_64` folder (depending on the architecture).

## Cross-compile

Expand All @@ -48,15 +46,15 @@ This is embedded into all MediaMTX releases and shouldn't normally be downloaded
make -f utils.mk build
```

This will produce the `mtxrpicam_32` and `mtxrpicam_64` folders.
This will produce the `build/mtxrpicam_32` and `build/mtxrpicam_64` folders.

## Install

1. Download MediaMTX source code and open a terminal in it

2. Run `go generate ./...`

3. Copy `mtxrpicam_32` and/or `mtxrpicam_64` inside `internal/staticsources/rpicamera/`
3. Copy `build/mtxrpicam_32` and/or `build/mtxrpicam_64` inside `internal/staticsources/rpicamera/`

4. Compile MediaMTX

Expand Down
1 change: 1 addition & 0 deletions encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <fcntl.h>
#include <sys/ioctl.h>
#include <unistd.h>
#include <time.h>

#include <linux/videodev2.h>

Expand Down
Loading

0 comments on commit 2ec6715

Please sign in to comment.