From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 2A6eB//pB2CZLgAA0tVLHw (envelope-from ) for ; Wed, 20 Jan 2021 08:29:51 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 8O97A//pB2BoKAAAB5/wlQ (envelope-from ) for ; Wed, 20 Jan 2021 08:29:51 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 1B62694030E for ; Wed, 20 Jan 2021 08:29:50 +0000 (UTC) Received: from localhost ([::1]:46070 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l28s9-0002td-3J for larch@yhetil.org; Wed, 20 Jan 2021 03:29:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:36648) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l28rO-0002Vg-S3 for guix-patches@gnu.org; Wed, 20 Jan 2021 03:29:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:41222) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l28rO-0000HN-Jy for guix-patches@gnu.org; Wed, 20 Jan 2021 03:29:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l28rO-0007VA-GY for guix-patches@gnu.org; Wed, 20 Jan 2021 03:29:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#45707] [PATCH] gnu: Add obs-v4l2sink. Resent-From: Alexey Abramov Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 20 Jan 2021 08:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45707 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 45707-submit@debbugs.gnu.org id=B45707.161113130428791 (code B ref 45707); Wed, 20 Jan 2021 08:29:02 +0000 Received: (at 45707) by debbugs.gnu.org; 20 Jan 2021 08:28:24 +0000 Received: from localhost ([127.0.0.1]:52768 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l28qa-0007U8-TK for submit@debbugs.gnu.org; Wed, 20 Jan 2021 03:28:24 -0500 Received: from mx4.mail.mmer.org ([178.22.66.29]:51665) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l28qW-0007Tx-3f for 45707@debbugs.gnu.org; Wed, 20 Jan 2021 03:28:12 -0500 Received: from delta.lan (unknown [10.147.19.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx4.mail.mmer.org (Postfix) with ESMTPSA id 169D99CC5A; Wed, 20 Jan 2021 07:57:22 +0000 (UTC) From: Alexey Abramov References: <87turt4ogl.fsf@gmail.com> <87turt2m7v.fsf@delta.lan> <87pn28aoqi.fsf_-_@gnu.org> <87k0setadp.fsf@delta.lan> <87a6t8y2ob.fsf@gnu.org> Date: Wed, 20 Jan 2021 09:28:00 +0100 In-Reply-To: <87a6t8y2ob.fsf@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Sat, 16 Jan 2021 22:47:32 +0100") Message-ID: <87zh14vwq7.fsf@delta.lan> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Evan , 45707@debbugs.gnu.org Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -2.35 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 1B62694030E X-Spam-Score: -2.35 X-Migadu-Scanner: scn0.migadu.com X-TUID: ZOoQVRWs8GzA --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s writes: > Hi, > > Alexey Abramov skribis: > >> Thanks Ludo. With this patch, obs will check OBS_PLUGINS_PATH environmen= t variable for a *default* location of modules.=20 > > OK. > >> Plugins might also have some data. I am not sure if it is safe to >> use relative path thought. Would it be better to use >> OBS_PLUGINS_DATA_PATH var? > > I don=E2=80=99t know, how does this patch change the situation wrt. findi= ng a > plugin=E2=80=99s data? They have locals in their data directory at least. And probably something e= lse, yes. > >> From 9ade5607aab510cc88561efb7c0b08567b5e19fe Mon Sep 17 00:00:00 2001 >> From: Alexey Abramov >> Date: Fri, 15 Jan 2021 17:26:37 +0100 >> Subject: [PATCH] gnu: obs: Use an environment variable for plugins locat= ion. >> >> * gnu/local.mk (dist_patch_DATA): Add it. >> * gnu/packages/video.scm (obs): Use it. >> * gnu/packages/patches/obs-override-default-modules-location.patch: Patc= h it. > > Some minor issues: > >> +++ b/gnu/packages/patches/obs-override-default-modules-location.patch > > =E2=80=98guix lint=E2=80=99 might complain about the file name length. := -) > Perhaps remove =E2=80=98override-default-=E2=80=99 from the file name. > Done. Passed. >> @@ -0,0 +1,32 @@ >> +From 96e3c05043eb6b682b105e9080b45efeee33dcd0 Mon Sep 17 00:00:00 2001 >> +From: Alexey Abramov >> +Date: Fri, 15 Jan 2021 17:07:17 +0100 >> +Subject: [PATCH] Use an environment variable for a default modules loca= tion >> + >> +--- >> + libobs/obs-nix.c | 10 ++++++++-- > > If it comes from another distro, please indicate it clearly at the top > of the file. > >> ++ char *obs_plugins_path =3D getenv("OBS_PLUGINS_PATH"); >> ++ if (obs_plugins_path) { >> ++ struct dstr obs_plugins_data_path; >> ++ dstr_init_copy(&obs_plugins_data_path, obs_plugins_path); >> ++ dstr_cat(&obs_plugins_data_path, "/../../share/obs/obs-plugins/%modu= le%"); > > Shouldn=E2=80=99t it be lib/obs-plugins, as your =E2=80=98search-path-spe= cification=E2=80=99 > indicates? That is a data directory. With the new patch it will be taken from OBS_PLUGINS_DATA_DIRECTORY. %module% part is required for data. > >> + (native-search-paths >> + (list (search-path-specification >> + (variable "OBS_PLUGINS_PATH") >> + (separator #f) ;single entry >> + (files '("lib/obs-plugins"))))) > > How about renaming the variable to =E2=80=98OBS_PLUGINS_DIRECTORY=E2=80= =99 given that > it designates a single directory rather than a search path? Done. > > Could you send an updated patch? Attached. I also tested the obs patch with this [1] and this [2] and haven't seen any erros. obs loads plugins successfully. --8<---------------cut here---------------start------------->8--- info: --------------------------------- info: Loaded Modules: info: v4l2sink.so <------ this info: text-freetype2.so=20=20 info: spectralizer.so <------ this info: rtmp-services.so info: obs-x264.so info: obs-transitions.so info: obs-outputs.so info: obs-filters.so info: obs-ffmpeg.so info: linux-v4l2.so info: linux-pulseaudio.so info: linux-jack.so info: linux-decklink.so info: linux-capture.so info: linux-alsa.so info: libwlrobs.so <------ this info: image-source.so info: frontend-tools.so info: decklink-ouput-ui.so info: decklink-captions.so info: --------------------------------- ~ master* =E2=87=A1 =CE=BB find /gnu/store/3s84wmh9pqcryfzx0rrri8sqff7fqlqn-obs-wlrobs-1.0/ /gnu/store/3s84wmh9pqcryfzx0rrri8sqff7fqlqn-obs-wlrobs-1.0/ /gnu/store/3s84wmh9pqcryfzx0rrri8sqff7fqlqn-obs-wlrobs-1.0/lib /gnu/store/3s84wmh9pqcryfzx0rrri8sqff7fqlqn-obs-wlrobs-1.0/lib/obs-plugins /gnu/store/3s84wmh9pqcryfzx0rrri8sqff7fqlqn-obs-wlrobs-1.0/lib/obs-plugins/= libwlrobs.so ~ master* =E2=87=A1 =CE=BB find /gnu/store/rmz58nv5qcwr1pm38nx7aicyfq4jbp4a-obs-spectralizer-1.= 3.3/=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20 /gnu/store/rmz58nv5qcwr1pm38nx7aicyfq4jbp4a-obs-spectralizer-1.3.3/ /gnu/store/rmz58nv5qcwr1pm38nx7aicyfq4jbp4a-obs-spectralizer-1.3.3/share /gnu/store/rmz58nv5qcwr1pm38nx7aicyfq4jbp4a-obs-spectralizer-1.3.3/share/doc /gnu/store/rmz58nv5qcwr1pm38nx7aicyfq4jbp4a-obs-spectralizer-1.3.3/share/do= c/obs-spectralizer-1.3.3 /gnu/store/rmz58nv5qcwr1pm38nx7aicyfq4jbp4a-obs-spectralizer-1.3.3/share/do= c/obs-spectralizer-1.3.3/COPYING.txt /gnu/store/rmz58nv5qcwr1pm38nx7aicyfq4jbp4a-obs-spectralizer-1.3.3/share/obs /gnu/store/rmz58nv5qcwr1pm38nx7aicyfq4jbp4a-obs-spectralizer-1.3.3/share/ob= s/obs-plugins /gnu/store/rmz58nv5qcwr1pm38nx7aicyfq4jbp4a-obs-spectralizer-1.3.3/share/ob= s/obs-plugins/spectralizer /gnu/store/rmz58nv5qcwr1pm38nx7aicyfq4jbp4a-obs-spectralizer-1.3.3/share/ob= s/obs-plugins/spectralizer/locale /gnu/store/rmz58nv5qcwr1pm38nx7aicyfq4jbp4a-obs-spectralizer-1.3.3/share/ob= s/obs-plugins/spectralizer/locale/ko-KR.ini /gnu/store/rmz58nv5qcwr1pm38nx7aicyfq4jbp4a-obs-spectralizer-1.3.3/share/ob= s/obs-plugins/spectralizer/locale/ru-RU.ini /gnu/store/rmz58nv5qcwr1pm38nx7aicyfq4jbp4a-obs-spectralizer-1.3.3/share/ob= s/obs-plugins/spectralizer/locale/en-US.ini /gnu/store/rmz58nv5qcwr1pm38nx7aicyfq4jbp4a-obs-spectralizer-1.3.3/lib /gnu/store/rmz58nv5qcwr1pm38nx7aicyfq4jbp4a-obs-spectralizer-1.3.3/lib/obs-= plugins /gnu/store/rmz58nv5qcwr1pm38nx7aicyfq4jbp4a-obs-spectralizer-1.3.3/lib/obs-= plugins/spectralizer.so --8<---------------cut here---------------end--------------->8--- Footnotes: [1] https://issues.guix.gnu.org/45960 [2] https://issues.guix.gnu.org/45961 --=20 Alexey --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: attachment; filename=0001-gnu-obs-Use-an-environment-variable-for-plugins-loca.patch Content-Transfer-Encoding: quoted-printable >From f67bf04b57f45f0ca11cb6b902d22f7c4d44e005 Mon Sep 17 00:00:00 2001 From: Alexey Abramov Date: Fri, 15 Jan 2021 17:26:37 +0100 Subject: [PATCH] gnu: obs: Use an environment variable for plugins location. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/video.scm (obs): Use it. * gnu/packages/patches/obs-modules-location.patch: Patch it. --- gnu/local.mk | 1 + .../patches/obs-modules-location.patch | 33 +++++++++++++++++++ gnu/packages/video.scm | 14 +++++++- 3 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/obs-modules-location.patch diff --git a/gnu/local.mk b/gnu/local.mk index 6f66021c78..aaf19302be 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1405,6 +1405,7 @@ dist_patch_DATA =3D \ %D%/packages/patches/nvi-dbpagesize-binpower.patch \ %D%/packages/patches/nvi-db4.patch \ %D%/packages/patches/nyacc-binary-literals.patch \ + %D%/packages/patches/obs-modules-location.patch \ %D%/packages/patches/ocaml-bitstring-fix-configure.patch \ %D%/packages/patches/ocaml-cairo2-caml_ba_array-fix.patch \ %D%/packages/patches/ocaml-CVE-2015-8869.patch \ diff --git a/gnu/packages/patches/obs-modules-location.patch b/gnu/packages= /patches/obs-modules-location.patch new file mode 100644 index 0000000000..18b286d006 --- /dev/null +++ b/gnu/packages/patches/obs-modules-location.patch @@ -0,0 +1,33 @@ +From d250434e6c8eb4f8c8cb47ef3cc6e6de8fa8f828 Mon Sep 17 00:00:00 2001 +From: Alexey Abramov +Date: Fri, 15 Jan 2021 17:07:17 +0100 +Subject: [PATCH] Use environment variable for a default module location + +diff --git a/libobs/obs-nix.c b/libobs/obs-nix.c +index 382fa0546..481ea0f14 100644 +*** a/libobs/obs-nix.c +--- b/libobs/obs-nix.c +@@ -66,8 +66,19 @@ +=20 + void add_default_module_paths(void) + { +- for (int i =3D 0; i < module_patterns_size; i++) +- obs_add_module_path(module_bin[i], module_data[i]); ++ char *bin_directory =3D getenv("OBS_PLUGINS_DIRECTORY"); ++ char *data_directory =3D getenv("OBS_PLUGINS_DATA_DIRECTORY"); ++ if (bin_directory && data_directory) { ++ struct dstr dstr_data_directory; ++ dstr_init_copy(&dstr_data_directory, data_directory); ++ dstr_cat(&dstr_data_directory, "/%module%"); ++ obs_add_module_path(bin_directory, dstr_data_directory.array); ++ dstr_free(&dstr_data_directory); ++ ++ } else { ++ for (int i =3D 0; i < module_patterns_size; i++) ++ obs_add_module_path(module_bin[i], module_data[i]); ++ } + } +=20 + /* +--=20 +2.29.2 \ No newline at end of file diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm index 97cb7d6837..49823e9a88 100644 --- a/gnu/packages/video.scm +++ b/gnu/packages/video.scm @@ -47,6 +47,7 @@ ;;; Copyright =C2=A9 2020 Alexandru-Sergiu Marton ;;; Copyright =C2=A9 2020 Ivan Kozlov ;;; Copyright =C2=A9 2020 Antoine C=C3=B4t=C3=A9 +;;; Copyright =C2=A9 2021 Alexey Abramov ;;; ;;; This file is part of GNU Guix. ;;; @@ -3088,7 +3089,9 @@ be used for realtime video capture via Linux-specific= APIs.") (file-name (git-file-name name version)) (sha256 (base32 - "1k1asqiqw757v59ayx0w029ril947hs0lcp8n91knzjl891fr4nc")))) + "1k1asqiqw757v59ayx0w029ril947hs0lcp8n91knzjl891fr4nc")) + (patches + (search-patches "obs-modules-location.patch")))) (build-system cmake-build-system) (arguments `(#:configure-flags @@ -3103,6 +3106,15 @@ be used for realtime video capture via Linux-specifi= c APIs.") (wrap-program (string-append out "/bin/obs") `("QT_PLUGIN_PATH" ":" prefix (,plugin-path)))) #t))))) + (native-search-paths + (list (search-path-specification + (variable "OBS_PLUGINS_DIRECTORY") + (separator #f) ;single entry + (files '("lib/obs-plugins"))) + (search-path-specification + (variable "OBS_PLUGINS_DATA_DIRECTORY") + (separator #f) ;single entry + (files '("share/obs/obs-plugins"))))) (native-inputs `(("cmocka" ,cmocka) ("pkg-config" ,pkg-config))) --=20 2.29.2 --=-=-=--