From 29950f9eddf803031d9158273e9280e177f109c8 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Mon, 5 Aug 2024 03:33:40 +0200 Subject: Add meson build --- README.md | 6 ++++++ depends/mglpp | 2 +- install.sh | 13 +++++++++++++ meson.build | 26 ++++++++++++++++++++++++++ project.conf | 2 +- uninstall.sh | 10 ++++++++++ 6 files changed, 57 insertions(+), 2 deletions(-) create mode 100755 install.sh create mode 100644 meson.build create mode 100755 uninstall.sh diff --git a/README.md b/README.md index 6aa58fb..c4a12d4 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,8 @@ # GPU Screen Recorder Notification Notification in the style of NVIDIA ShadowPlay. + +# Dependencies +x11, xrandr, xrender, xfixes, opengl + +# Installation +Run `sudo ./install.sh`. This will install gsr-notify to `/usr/bin/gsr-notify`. You can run meson commands manually to install gsr-notify to another directory. \ No newline at end of file diff --git a/depends/mglpp b/depends/mglpp index 5d5a88a..7d23e51 160000 --- a/depends/mglpp +++ b/depends/mglpp @@ -1 +1 @@ -Subproject commit 5d5a88afbc57ee72c7bbab05ee58aebd64ee3f66 +Subproject commit 7d23e514e3271690ddc465a21faa1fa24063826a diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..962a2f8 --- /dev/null +++ b/install.sh @@ -0,0 +1,13 @@ +#!/bin/sh -e + +script_dir=$(dirname "$0") +cd "$script_dir" + +[ $(id -u) -ne 0 ] && echo "You need root privileges to run the install script" && exit 1 + +rm -rf build +meson setup build +meson configure --prefix=/usr --buildtype=release -Dstrip=true build +ninja -C build install + +echo "Successfully installed gsr-notify" diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..90fa050 --- /dev/null +++ b/meson.build @@ -0,0 +1,26 @@ +project('gsr-notify', ['cpp'], version : '1.0.0', default_options : ['warning_level=2'], subproject_dir : 'depends') + +if get_option('buildtype') == 'debug' + add_project_arguments('-g3', language : ['cpp']) +elif get_option('buildtype') == 'release' + add_project_arguments('-DNDEBUG', language : ['cpp']) +endif + +src = [ + 'src/main.cpp', +] + +mglpp_proj = subproject('mglpp') +mglpp_dep = mglpp_proj.get_variable('mglpp_dep') + +dep = [ + mglpp_dep, + dependency('xfixes'), +] + +executable( + meson.project_name(), + src, + install : true, + dependencies : dep, +) \ No newline at end of file diff --git a/project.conf b/project.conf index c3cfb3e..3c20791 100644 --- a/project.conf +++ b/project.conf @@ -1,5 +1,5 @@ [package] -name = "gpu-screen-recorder-notification" +name = "gsr-notify" type = "executable" version = "0.1.0" platforms = ["posix"] diff --git a/uninstall.sh b/uninstall.sh new file mode 100755 index 0000000..ba0b5b6 --- /dev/null +++ b/uninstall.sh @@ -0,0 +1,10 @@ +#!/bin/sh -e + +script_dir=$(dirname "$0") +cd "$script_dir" + +[ $(id -u) -ne 0 ] && echo "You need root privileges to run the uninstall script" && exit 1 + +ninja -C build uninstall + +echo "Successfully uninstalled gsr-notify" -- cgit v1.2.3