-
-
Notifications
You must be signed in to change notification settings - Fork 9.1k
libobs: Add OS keychain API #9122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
6ae3e4a
libobs: Add Windows keychain API implementation
derrod 15ed3b5
libobs: Add macOS keychain API implementation
derrod a40370f
libobs: Add OS keychain API stubs for *nix
derrod dee6dc3
cmake: Add finder for libsecret
derrod 50e56ea
build-aux: Add libsecret to flatpak
derrod 7ae14b9
libobs: Add libsecret keychain implementation
derrod File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| { | ||
| "name": "libsecret", | ||
| "buildsystem": "meson", | ||
| "config-opts": [ | ||
| "-Dmanpage=false", | ||
| "-Dvapi=false", | ||
| "-Dgtk_doc=false", | ||
| "-Dintrospection=false" | ||
| ], | ||
| "cleanup": [ | ||
| "/bin", | ||
| "/include", | ||
| "/lib/pkgconfig", | ||
| "/share/man" | ||
| ], | ||
| "sources": [ | ||
| { | ||
| "type": "archive", | ||
| "url": "https://download.gnome.org/sources/libsecret/0.20/libsecret-0.20.5.tar.xz", | ||
| "sha256": "3fb3ce340fcd7db54d87c893e69bfc2b1f6e4d4b279065ffe66dac9f0fd12b4d" | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,111 @@ | ||
| #[=======================================================================[.rst | ||
| FindLibsecret | ||
| ------------- | ||
|
|
||
| FindModule for libsecret and the associated library | ||
|
|
||
| Imported Targets | ||
| ^^^^^^^^^^^^^^^^ | ||
|
|
||
| .. versionadded:: 2.0 | ||
|
|
||
| This module defines the :prop_tgt:`IMPORTED` target ``Libsecret::Libsecret``. | ||
|
|
||
| Result Variables | ||
| ^^^^^^^^^^^^^^^^ | ||
|
|
||
| This module sets the following variables: | ||
|
|
||
| ``Libsecret_FOUND`` | ||
| True, if the library was found. | ||
| ``Libsecret_VERSION`` | ||
| Detected version of found Libsecret library. | ||
|
|
||
| Cache variables | ||
| ^^^^^^^^^^^^^^^ | ||
|
|
||
| The following cache variables may also be set: | ||
|
|
||
| ``Libsecret_INCLUDE_DIR`` | ||
| Directory containing ``secret.h``. | ||
|
|
||
| #]=======================================================================] | ||
|
|
||
| include(FindPackageHandleStandardArgs) | ||
|
|
||
| find_package(PkgConfig QUIET) | ||
| if(PKG_CONFIG_FOUND) | ||
| pkg_search_module(PC_Libsecret QUIET libsecret-1) | ||
| endif() | ||
|
|
||
| # Libsecret_set_soname: Set SONAME on imported library target | ||
| macro(Libsecret_set_soname) | ||
| if(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux") | ||
| execute_process( | ||
| COMMAND sh -c "${CMAKE_OBJDUMP} -p '${Libsecret_LIBRARY}' | grep SONAME" | ||
| OUTPUT_VARIABLE _output | ||
| RESULT_VARIABLE _result) | ||
|
|
||
| if(_result EQUAL 0) | ||
| string(REGEX REPLACE "[ \t]+SONAME[ \t]+([^ \t]+)" "\\1" _soname "${_output}") | ||
| set_property(TARGET Libsecret::Libsecret PROPERTY IMPORTED_SONAME "${_soname}") | ||
| unset(_soname) | ||
| endif() | ||
| endif() | ||
| unset(_output) | ||
| unset(_result) | ||
| endmacro() | ||
|
|
||
| find_path( | ||
| Libsecret_INCLUDE_DIR | ||
| NAMES libsecret/secret.h | ||
| HINTS ${PC_Libsecret_INCLUDE_DIRS} | ||
| PATHS /usr/include /usr/local/include | ||
| PATH_SUFFIXES libsecret-1 | ||
| DOC "Libsecret include directory") | ||
|
|
||
| find_library( | ||
| Libsecret_LIBRARY | ||
| NAMES secret secret-1 libsecret libsecret-1 | ||
| HINTS ${PC_Libsecret_LIBRARY_DIRS} | ||
| PATHS /usr/lib /usr/local/lib | ||
| DOC "Libsecret location") | ||
|
|
||
| if(PC_Libsecret_VERSION VERSION_GREATER 0) | ||
| set(Libsecret_VERSION ${PC_Libsecret_VERSION}) | ||
| elseif(EXISTS "${Libsecret_INCLUDE_DIR}/secret-version.h") | ||
| file(STRINGS "${Libsecret_INCLUDE_DIR}/secret-version.h" _version_string) | ||
| string(REGEX REPLACE "SECRET_[A-Z]+_VERSION \\(([0-9]+)\\)" "\\1\\.\\2\\.\\3" Libsecret_VERSION "${_version_string}") | ||
| else() | ||
| if(NOT Libsecret_FIND_QUIETLY) | ||
| message(AUTHOR_WARNING "Failed to find Libsecret version.") | ||
| endif() | ||
| set(Libsecret_VERSION 0.0.0) | ||
| endif() | ||
|
|
||
| find_package_handle_standard_args( | ||
| Libsecret | ||
| REQUIRED_VARS Libsecret_INCLUDE_DIR Libsecret_LIBRARY | ||
| VERSION_VAR Libsecret_VERSION REASON_FAILURE_MESSAGE "Ensure libsecret-1 is installed on the system.") | ||
| mark_as_advanced(Libsecret_INCLUDE_DIR Libsecret_LIBRARY) | ||
|
|
||
| if(Libsecret_FOUND) | ||
| if(NOT TARGET Libsecret::Libsecret) | ||
| if(IS_ABSOLUTE "${Libsecret_LIBRARY}") | ||
| add_library(Libsecret::Libsecret UNKNOWN IMPORTED) | ||
| set_property(TARGET Libsecret::Libsecret PROPERTY IMPORTED_LOCATION "${Libsecret_LIBRARY}") | ||
| else() | ||
| add_library(Libsecret::Libsecret INTERFACE IMPORTED) | ||
| set_property(TARGET Libsecret::Libsecret PROPERTY IMPORTED_LIBNAME "${Libsecret_LIBRARY}") | ||
| endif() | ||
|
|
||
| libsecret_set_soname() | ||
| set_target_properties(Libsecret::Libsecret PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${Libsecret_INCLUDE_DIR}") | ||
| endif() | ||
| endif() | ||
|
|
||
| include(FeatureSummary) | ||
| set_package_properties( | ||
| Libsecret PROPERTIES | ||
| URL "https://gnome.pages.gitlab.gnome.org/libsecret/index.html" | ||
| DESCRIPTION "Secret Service D-Bus client library") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,111 @@ | ||
| #[=======================================================================[.rst | ||
| FindLibsecret | ||
| ------------- | ||
|
|
||
| FindModule for libsecret and the associated library | ||
|
|
||
| Imported Targets | ||
| ^^^^^^^^^^^^^^^^ | ||
|
|
||
| .. versionadded:: 2.0 | ||
|
|
||
| This module defines the :prop_tgt:`IMPORTED` target ``Libsecret::Libsecret``. | ||
|
|
||
| Result Variables | ||
| ^^^^^^^^^^^^^^^^ | ||
|
|
||
| This module sets the following variables: | ||
|
|
||
| ``Libsecret_FOUND`` | ||
| True, if the library was found. | ||
| ``Libsecret_VERSION`` | ||
| Detected version of found Libsecret library. | ||
|
|
||
| Cache variables | ||
| ^^^^^^^^^^^^^^^ | ||
|
|
||
| The following cache variables may also be set: | ||
|
|
||
| ``Libsecret_INCLUDE_DIR`` | ||
| Directory containing ``secret.h``. | ||
|
|
||
| #]=======================================================================] | ||
|
|
||
| include(FindPackageHandleStandardArgs) | ||
|
|
||
| find_package(PkgConfig QUIET) | ||
| if(PKG_CONFIG_FOUND) | ||
| pkg_search_module(PC_Libsecret QUIET libsecret-1) | ||
| endif() | ||
|
|
||
| # Libsecret_set_soname: Set SONAME on imported library target | ||
| macro(Libsecret_set_soname) | ||
| if(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux") | ||
| execute_process( | ||
| COMMAND sh -c "${CMAKE_OBJDUMP} -p '${Libsecret_LIBRARY}' | grep SONAME" | ||
| OUTPUT_VARIABLE _output | ||
| RESULT_VARIABLE _result) | ||
|
|
||
| if(_result EQUAL 0) | ||
| string(REGEX REPLACE "[ \t]+SONAME[ \t]+([^ \t]+)" "\\1" _soname "${_output}") | ||
| set_property(TARGET Libsecret::Libsecret PROPERTY IMPORTED_SONAME "${_soname}") | ||
| unset(_soname) | ||
| endif() | ||
| endif() | ||
| unset(_output) | ||
| unset(_result) | ||
| endmacro() | ||
|
|
||
| find_path( | ||
| Libsecret_INCLUDE_DIR | ||
| NAMES libsecret/secret.h | ||
| HINTS ${PC_Libsecret_INCLUDE_DIRS} | ||
| PATHS /usr/include /usr/local/include | ||
| PATH_SUFFIXES libsecret-1 | ||
| DOC "Libsecret include directory") | ||
|
|
||
| find_library( | ||
| Libsecret_LIBRARY | ||
| NAMES secret secret-1 libsecret libsecret-1 | ||
| HINTS ${PC_Libsecret_LIBRARY_DIRS} | ||
| PATHS /usr/lib /usr/local/lib | ||
| DOC "Libsecret location") | ||
|
|
||
| if(PC_Libsecret_VERSION VERSION_GREATER 0) | ||
| set(Libsecret_VERSION ${PC_Libsecret_VERSION}) | ||
| elseif(EXISTS "${Libsecret_INCLUDE_DIR}/secret-version.h") | ||
| file(STRINGS "${Libsecret_INCLUDE_DIR}/secret-version.h" _version_string) | ||
| string(REGEX REPLACE "SECRET_[A-Z]+_VERSION \\(([0-9]+)\\)" "\\1\\.\\2\\.\\3" Libsecret_VERSION "${_version_string}") | ||
| else() | ||
| if(NOT Libsecret_FIND_QUIETLY) | ||
| message(AUTHOR_WARNING "Failed to find Libsecret version.") | ||
| endif() | ||
| set(Libsecret_VERSION 0.0.0) | ||
| endif() | ||
|
|
||
| find_package_handle_standard_args( | ||
| Libsecret | ||
| REQUIRED_VARS Libsecret_INCLUDE_DIR Libsecret_LIBRARY | ||
| VERSION_VAR Libsecret_VERSION REASON_FAILURE_MESSAGE "Ensure libsecret-1 is installed on the system.") | ||
| mark_as_advanced(Libsecret_INCLUDE_DIR Libsecret_LIBRARY) | ||
|
|
||
| if(Libsecret_FOUND) | ||
| if(NOT TARGET Libsecret::Libsecret) | ||
| if(IS_ABSOLUTE "${Libsecret_LIBRARY}") | ||
| add_library(Libsecret::Libsecret UNKNOWN IMPORTED) | ||
| set_property(TARGET Libsecret::Libsecret PROPERTY IMPORTED_LOCATION "${Libsecret_LIBRARY}") | ||
| else() | ||
| add_library(Libsecret::Libsecret INTERFACE IMPORTED) | ||
| set_property(TARGET Libsecret::Libsecret PROPERTY IMPORTED_LIBNAME "${Libsecret_LIBRARY}") | ||
| endif() | ||
|
|
||
| libsecret_set_soname() | ||
| set_target_properties(Libsecret::Libsecret PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${Libsecret_INCLUDE_DIR}") | ||
| endif() | ||
| endif() | ||
|
|
||
| include(FeatureSummary) | ||
| set_package_properties( | ||
| Libsecret PROPERTIES | ||
| URL "https://gnome.pages.gitlab.gnome.org/libsecret/index.html" | ||
| DESCRIPTION "Secret Service D-Bus client library") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.