Skip to content

Commit

Permalink
Add debian distribution (#154)
Browse files Browse the repository at this point in the history
* save

* add debian distribution

* github action

* save

* swap ubuntu for debian

* use ubuntu-latest
  • Loading branch information
darioalessandro authored Jan 5, 2024
1 parent e02127b commit d8eee8a
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 1 deletion.
40 changes: 40 additions & 0 deletions .github/workflows/cut-video-daemon-dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Build and Package DEB

on:
push:
branches:
- main
- add-debian-distribution
tags:
- '*'

jobs:
build_and_package:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true

- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y pkg-config libclang-dev libvpx-dev libasound2-dev libv4l-dev cmake
- name: Build and Create DEB Package
run: |
cargo install cargo-deb
cd video-daemon
cargo deb
- uses: actions/upload-artifact@v2
with:
name: video-daemon.deb
path: video-daemon/target/debian/*.deb
11 changes: 11 additions & 0 deletions video-daemon/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,20 @@
name = "video-daemon"
version = "0.1.0"
edition = "2021"
description = "Stream audio and video to the videocall-rs backend"
license = "MIT"
authors = [
"Griffin Obeid <griffin@securityunion.dev>",
"Dario Lencina <dario@securityunion.dev>",
]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[package.metadata.deb]
maintainer = "Dario Lencina <dario@securityunion.dev>"
license-file = ["../LICENSE.md", "4"]
depends = "libvpx7 (>= 1.11.0), libvpx-dev (>= 1.11.0), libc6 (>= 2.34), libasound2-dev (>=1.2.8), libv4l-dev (>=1.22.1)"

[dependencies]
anyhow = "1.0.75"
base64 = "0.21.4"
Expand Down
9 changes: 8 additions & 1 deletion video-daemon/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
### Dependencies

```sh
sudo apt install build-essential pkg-config libclang-dev libvpx-dev libasound2-dev cmake
sudo apt install build-essential pkg-config libclang-dev libvpx-dev libasound2-dev libv4l-dev cmake
```

## Running locally
Expand All @@ -20,3 +20,10 @@ RUST_LOG=info cargo run -- --user-id <user-id> --video-device-index 2 --meeting-
URL can be your local webtransport server or prod https://transport.rustlemania.com
```

# Compile deb

1. Install `cargo-deb` with `cargo install cargo-deb`
2. run `cargo deb` this will generate the deb file at `target/debian/video-daemon...deb`
3. Verify dependencies: `dpkg-deb -I <path_to_deb_file>`
4. Install deb file: `sudo dpkg -i <path_to_deb_file>`
28 changes: 28 additions & 0 deletions video-daemon/check_versions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

# List of packages to check
packages=(
"build-essential"
"pkg-config"
"libclang-dev"
"libvpx-dev"
"libasound2-dev"
"cmake"
"libv4l-dev"
)

# Function to check the version of a package
check_package_version() {
package=$1
version=$(dpkg-query -W -f='${Version}\n' $package 2>/dev/null)
if [ -z "$version" ]; then
echo "$package is not installed."
else
echo "$package version: $version"
fi
}

# Check the version of each package
for package in "${packages[@]}"; do
check_package_version $package
done

0 comments on commit d8eee8a

Please sign in to comment.