Skip to content

Commit 4fc9ee0

Browse files
LS-FCEFyNaramg
authored andcommitted
Initial FreeBSD Support
Via #189 and #263
1 parent bccd01f commit 4fc9ee0

13 files changed

Lines changed: 73 additions & 7 deletions

Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,15 @@ ifneq ($(findstring ayatana,$(APPINDICATOR)),)
2828
CFLAGS += -DUSE_AYATANA_APPINDICATOR
2929
endif
3030

31+
UNAME_S := $(shell uname -s)
32+
ifeq ($(UNAME_S),FreeBSD)
33+
CC ?= $(shell pkg info | grep -o '^gcc[0-9]*' | head -n 1)
34+
JPEG_DIR = /usr/local
35+
JPEG_INCLUDE = $(JPEG_DIR)/include
36+
JPEG_LIB = $(JPEG_DIR)/lib
37+
USBMUXD = -lusbmuxd-2.0
38+
endif
39+
3140
all: droidcam-cli droidcam
3241

3342
ifeq "$(RELEASE)" ""

README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,35 @@ To use DroidCam with Pipewire ([Source](https://gitlab.freedesktop.org/pipewire/
8484
* Go to the Input Devices tab
8585
* Check which VU meter reacts to the phone's audio input (eg. Built-in Audio Pro 1), this is the desired audio input device.
8686
* Inside pavucontrol you can now set this device as default input or choose it as the input device for individual apps etc.
87+
88+
89+
FreeBSD
90+
========
91+
92+
## Initial considerations
93+
94+
Please make sure that you add your user to the webcamd group after the installation of the dependencies, this can be done by running `doas pw groupmod webcamd -m $USER`
95+
96+
You will also want to enable webcamd and the cuse module to load at boot for that you'll need to modify __/etc/rc.conf__ and __/boot/loader.conf__ with:
97+
98+
>webcamd_enable="YES"
99+
100+
and
101+
102+
>cuse_load="YES"
103+
104+
respectively.
105+
106+
## Getting all the necessary dependencies
107+
108+
Run `doas pkg install gmake gcc pkgconf libjpeg-turbo usbmuxd libusbmuxd alsa-lib v4l_compat speex ffmpeg webcamd libappindicator`
109+
110+
## Building and Installing
111+
112+
Run `gmake`, or `gmake droidcam-cli` if you wish to only build the command line version of droidcam.
113+
114+
To install, run `doas ./install-client`
115+
116+
## Running
117+
118+
You'll need to run `doas webcamd -B -c v4l2loopback` before launching droidcam

install-client

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
set -e
33

44
if [ -z "$SUDO_USER" ]; then

install-dkms

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
#
33
# Usage: ./install-dkms [640 480]
44

install-sound

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
#
33
REPO_PATH="$(/usr/bin/dirname $([ -L $0 ] && /bin/readlink -f $0 || echo $0))"
44
source "${REPO_PATH}/install.common"

install-video

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
set -e
33

44
REPO_PATH="$(/usr/bin/dirname $([ -L $0 ] && /bin/readlink -f $0 || echo $0))"

install.common

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
# You should not call this directly.
33
# This is supposed to be sourced from install and install-dkms scripts
44

src/connection.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@
1616
#include <time.h>
1717
#include <unistd.h>
1818

19+
#if __FreeBSD__
20+
#include <netinet/in.h>
21+
#include <ifaddrs.h>
22+
#include <net/if.h>
23+
#endif
24+
1925
#include "common.h"
2026
#include "connection.h"
2127

src/decoder.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,14 @@
1414
#include <stdlib.h>
1515
#include <string.h>
1616
#include <errno.h>
17+
18+
#if __linux__
1719
#include <linux/limits.h>
20+
#endif
21+
22+
#if __FreeBSD__
23+
#include <sys/limits.h>
24+
#endif
1825

1926
#include "common.h"
2027
#include "decoder.h"

src/settings.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,15 @@
99
#include <stdio.h>
1010
#include <stdlib.h>
1111
#include <string.h>
12+
13+
#if __linux__
1214
#include <linux/limits.h>
15+
#endif
16+
17+
#if __FreeBSD__
18+
#include <sys/limits.h>
19+
#include <sys/param.h>
20+
#endif
1321

1422
#include "common.h"
1523
#include "settings.h"

0 commit comments

Comments
 (0)