From 29f70af9b7af87eebbf1a2b7327d3ab7973751a3 Mon Sep 17 00:00:00 2001 From: Walid Shouman Date: Sat, 13 Apr 2024 09:12:49 +0200 Subject: [PATCH] Add a linux build target to build inside a container --- Dockerfile | 26 ++++++++++++++++++++++++++ Makefile | 3 +++ build.mk | 3 +++ 3 files changed, 32 insertions(+) create mode 100644 Dockerfile create mode 100644 build.mk diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6960f3d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,26 @@ +# Use a base image with the required build tools installed. +FROM ubuntu:latest + +# Install build essentials and OBS Studio development libraries. +RUN apt-get update && apt-get install -y \ + build-essential \ + pkg-config \ + cmake \ + git \ + libobs-dev + +RUN apt-get install -y qt6-base-dev qt6-declarative-dev qt6-tools-dev + +# Copy the plugin source code into the container. +COPY . /plugin + +# Set the working directory to the plugin's source code. +WORKDIR /plugin + +ENV QT_INCLUDE /usr/include/x86_64-linux-gnu/qt6 +ENV QT_LIB /usr/lib/x86_64-linux-gnu/qt6 +ENV OBS_LIB /usr/lib/x86_64-linux-gnu + +# Specify the default command to build the plugin. +CMD ["make"] + diff --git a/Makefile b/Makefile index 31b98bd..49532f9 100644 --- a/Makefile +++ b/Makefile @@ -67,3 +67,6 @@ clean: .PHONY: uninstall uninstall: rm -r $(HOME)/.config/obs-studio/plugins/InstantReplay + +include build.mk + diff --git a/build.mk b/build.mk new file mode 100644 index 0000000..72e20d6 --- /dev/null +++ b/build.mk @@ -0,0 +1,3 @@ +build: + docker build -t obs-plugin-builder . + docker run --rm -v "$(PWD)":/plugin obs-plugin-builder