Bug 245403 - multimedia/obs-studio: Reimplement os_get_executable_path_ptr() with sysctl(3) as replacement of r530454
Summary: multimedia/obs-studio: Reimplement os_get_executable_path_ptr() with sysctl(3...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Yuri Victorovich
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-06 17:23 UTC by Ka Ho Ng
Modified: 2020-04-06 19:00 UTC (History)
1 user (show)

See Also:
yuri: maintainer-feedback+


Attachments
A patch to libobs/util/platform-nix.c (1.02 KB, text/plain)
2020-04-06 17:23 UTC, Ka Ho Ng
no flags Details
A patch to libobs/util/platform-nix.c (1.04 KB, patch)
2020-04-06 17:49 UTC, Ka Ho Ng
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ka Ho Ng freebsd_committer freebsd_triage 2020-04-06 17:23:39 UTC
Created attachment 213130 [details]
A patch to libobs/util/platform-nix.c

This is another fix to the problem mentioned in https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=245299 , with a more FreeBSD-centric fix by using sysctl(KERN_PROC_PATHNAME) instead of using obsoleted procfs.
Comment 1 Yuri Victorovich freebsd_committer freebsd_triage 2020-04-06 17:30:21 UTC
Thank you for your patch,  Ka Ho Ng.

Could you create a pull request for this patch at https://github.com/obsproject/obs-studio

This way we would be able to just add your patch from there.

Thank you,
Yuri
Comment 2 Yuri Victorovich freebsd_committer freebsd_triage 2020-04-06 17:33:25 UTC
Also,

> #if defined(__FreeBSD__)

should be replaced with
> #if defined(__FreeBSD__) || defined(__OpenBSD__) || || defined(__NetBSD__) || defined(__DragonFly__)

to catch all BSDs.
Comment 3 Ka Ho Ng freebsd_committer freebsd_triage 2020-04-06 17:43:41 UTC
(In reply to Yuri Victorovich from comment #2)

I am not sure if such change is applicable to other BSDs. For example in NetBSD, KERN_PROC_PATHNAME is available as the fourth level name when the second level name is KERN_PROC_ARGS. For OpenBSD I cannot find alternatives for KERN_PROC_PATHNAME. DragonflyBSD seems to have KERN_PROC_PATHNAME as FreeBSD, so I would include support for that.
Comment 4 Ka Ho Ng freebsd_committer freebsd_triage 2020-04-06 17:49:03 UTC
Created attachment 213132 [details]
A patch to libobs/util/platform-nix.c
Comment 5 Yuri Victorovich freebsd_committer freebsd_triage 2020-04-06 17:54:14 UTC
(In reply to Ka Ho Ng from comment #4)

If you can, please create a pull request on https://github.com/obsproject/obs-studio

If you can't, please let me know and I would add it myself.


Thanks,
Yuri
Comment 6 Ka Ho Ng freebsd_committer freebsd_triage 2020-04-06 18:17:10 UTC
(In reply to Yuri Victorovich from comment #5)

Okay. I just created a PR here: https://github.com/obsproject/obs-studio/pull/2663 .
Comment 7 Yuri Victorovich freebsd_committer freebsd_triage 2020-04-06 18:31:02 UTC
Committed, thanks!
Comment 8 commit-hook freebsd_committer freebsd_triage 2020-04-06 18:31:46 UTC
A commit references this bug:

Author: yuri
Date: Mon Apr  6 18:30:57 UTC 2020
New revision: 530917
URL: https://svnweb.freebsd.org/changeset/ports/530917

Log:
  multimedia/obs-studio: Change FreeBSD and Dragonfly support in os_get_executable_path_ptr() from procfs(5) to sysctl/KERN_PROC_PATHNAME

  PR:		245403
  Submitted by:	Ka Ho Ng <khng300@gmail.com>

Changes:
  head/multimedia/obs-studio/Makefile
  head/multimedia/obs-studio/distinfo
  head/multimedia/obs-studio/files/patch-libobs_util_platform-nix.c