Merge pull request #43133 from worldofpeace/gsignond

gsignond: init at 1.0.7
This commit is contained in:
Jan Tojnar 2018-10-26 19:29:56 +02:00 committed by GitHub
commit 82218835c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 420 additions and 0 deletions

View File

@ -234,6 +234,7 @@
./services/desktops/dleyna-server.nix
./services/desktops/flatpak.nix
./services/desktops/geoclue2.nix
./services/desktops/gsignond.nix
./services/desktops/pipewire.nix
./services/desktops/gnome3/at-spi2-core.nix
./services/desktops/gnome3/chrome-gnome-shell.nix

View File

@ -0,0 +1,43 @@
# Accounts-SSO gSignOn daemon
{ config, lib, pkgs, ... }:
with lib;
let
package = pkgs.gsignond.override { plugins = config.services.gsignond.plugins; };
in
{
###### interface
options = {
services.gsignond = {
enable = mkOption {
type = types.bool;
default = false;
description = ''
Whether to enable gSignOn daemon, a DBus service
which performs user authentication on behalf of its clients.
'';
};
plugins = mkOption {
type = types.listOf types.package;
default = [];
description = ''
What plugins to use with the gSignOn daemon.
'';
};
};
};
###### implementation
config = mkIf config.services.gsignond.enable {
environment.etc."gsignond.conf".source = "${package}/etc/gsignond.conf";
services.dbus.packages = [ package ];
};
}

View File

@ -0,0 +1,12 @@
diff --git a/meson.build b/meson.build
index cb1e0df..d90c85c 100644
--- a/meson.build
+++ b/meson.build
@@ -95,6 +95,6 @@ endif
configure_file(
input: 'gsignond.conf.in',
configuration: conf_data,
- install_dir: sysconf_dir,
+ install_dir: 'etc/',
output: 'gsignond.conf'
)

View File

@ -0,0 +1,69 @@
{ stdenv, fetchFromGitLab, pkgconfig, meson, ninja, glib, glib-networking
, sqlite, gobjectIntrospection, vala, gtk-doc, libsecret, docbook_xsl
, docbook_xml_dtd_43, docbook_xml_dtd_45, glibcLocales, makeWrapper
, symlinkJoin, gsignondPlugins, plugins }:
let
unwrapped = stdenv.mkDerivation rec {
pname = "gsignond";
version = "39022c86ddb5062a10fb0503ad9d81a8e532d527";
name = "${pname}-2018-10-04";
outputs = [ "out" "dev" "devdoc" ];
src = fetchFromGitLab {
owner = "accounts-sso";
repo = pname;
rev = version;
sha256 = "1gw8vbj3j6wxqy759z97arm8lnqhmraw9s2frv3ar6crnfhlidff";
};
nativeBuildInputs = [
docbook_xml_dtd_43
docbook_xml_dtd_45
docbook_xsl
glibcLocales
gobjectIntrospection
gtk-doc
meson
ninja
pkgconfig
vala
];
buildInputs = [
glib
glib-networking
libsecret
];
propagatedBuildInputs = [ sqlite ];
mesonFlags = [
"-Dbus_type=session"
"-Dextension=desktop"
];
LC_ALL = "en_US.UTF-8";
patches = [
./conf.patch
./plugin-load-env.patch
];
meta = with stdenv.lib; {
description = "D-Bus service which performs user authentication on behalf of its clients";
homepage = https://gitlab.com/accounts-sso/gsignond;
license = licenses.lgpl21Plus;
maintainers = with maintainers; [ worldofpeace ];
platforms = platforms.linux;
};
};
in if plugins == [] then unwrapped
else import ./wrapper.nix {
inherit stdenv makeWrapper symlinkJoin gsignondPlugins plugins;
gsignond = unwrapped;
}

View File

@ -0,0 +1,35 @@
diff --git a/src/gplugind/gsignond-plugin-loader.c b/src/gplugind/gsignond-plugin-loader.c
index 5497b32..979e1b4 100644
--- a/src/gplugind/gsignond-plugin-loader.c
+++ b/src/gplugind/gsignond-plugin-loader.c
@@ -38,11 +38,10 @@ gsignond_load_plugin (
gchar *plugin_filename;
GSignondPlugin *plugin;
-# ifdef ENABLE_DEBUG
const gchar *env_val = g_getenv("SSO_GPLUGINS_DIR");
if (env_val)
plugin_path = env_val;
-# endif
+
plugin_filename = g_module_build_path (plugin_path, plugin_type);
plugin = gsignond_load_plugin_with_filename (plugin_type,
plugin_filename);
diff --git a/src/gplugind/main.c b/src/gplugind/main.c
index 1c6cdb6..c85c623 100644
--- a/src/gplugind/main.c
+++ b/src/gplugind/main.c
@@ -93,11 +93,11 @@ _install_sighandlers (GMainLoop *main_loop)
static const gchar* _plugin_path(void)
{
const gchar *plugin_path = GSIGNOND_GPLUGINS_DIR;
-# ifdef ENABLE_DEBUG
+
const gchar *env_val = g_getenv("SSO_GPLUGINS_DIR");
if (env_val)
plugin_path = env_val;
-# endif
+
return plugin_path;
}

View File

@ -0,0 +1,38 @@
{ stdenv, fetchFromGitLab, pkgconfig, meson, ninja, vala, glib, gsignond, json-glib, libsoup, gobjectIntrospection }:
stdenv.mkDerivation rec {
name = "gsignond-plugin-lastfm-${version}";
version = "2018-05-07";
src = fetchFromGitLab {
owner = "accounts-sso";
repo = "gsignond-plugin-lastfm";
rev = "0a7a5f8511282e45cfe35987b81f27f158f0648c";
sha256 = "0ay6ir9zg9l0264x5xwd7c6j8qmwlhrifkkkjd1yrjh9sqxyfj7f";
};
nativeBuildInputs = [
gobjectIntrospection
meson
ninja
pkgconfig
vala
];
buildInputs = [
glib
gsignond
json-glib
libsoup
];
PKG_CONFIG_GSIGNOND_GPLUGINSDIR = "${placeholder "out"}/lib/gsignond/gplugins";
meta = with stdenv.lib; {
description = "Plugin for the Accounts-SSO gSignOn daemon handles the Last.FM credentials.";
homepage = https://gitlab.com/accounts-sso/gsignond-plugin-lastfm;
license = licenses.lgpl21Plus;
maintainers = with maintainers; [ worldofpeace ];
platforms = platforms.linux;
};
}

View File

@ -0,0 +1,36 @@
{ stdenv, fetchFromGitLab, pkgconfig, meson, ninja, vala, glib, gsignond, gobjectIntrospection }:
stdenv.mkDerivation rec {
name = "gsignond-plugin-mail-${version}";
version = "2018-10-04";
src = fetchFromGitLab {
owner = "accounts-sso";
repo = "gsignond-plugin-mail";
rev = "fbc6f34b246fec4ad2b37c696f8de7fdb9bde346";
sha256 = "1wvwz7qiwvj8iixprip3qd8lplzfnwcjfrbg2vd8xfsvid2zbviw";
};
nativeBuildInputs = [
gobjectIntrospection
meson
ninja
pkgconfig
vala
];
buildInputs = [
glib
gsignond
];
PKG_CONFIG_GSIGNOND_GPLUGINSDIR = "${placeholder "out"}/lib/gsignond/gplugins";
meta = with stdenv.lib; {
description = "Plugin for the Accounts-SSO gSignOn daemon that handles the E-Mail credentials.";
homepage = https://gitlab.com/accounts-sso/gsignond-plugin-mail;
license = licenses.lgpl21Plus;
maintainers = with maintainers; [ worldofpeace ];
platforms = platforms.linux;
};
}

View File

@ -0,0 +1,48 @@
{ stdenv, fetchFromGitLab, fetchpatch, pkgconfig, meson, ninja, glib, gsignond, check
, json-glib, libsoup, gnutls, gtk-doc, docbook_xml_dtd_43, docbook_xml_dtd_45
, docbook_xsl, glibcLocales, gobjectIntrospection }:
stdenv.mkDerivation rec {
name = "gsignond-plugin-oauth-${version}";
version = "2018-10-15";
src = fetchFromGitLab {
owner = "accounts-sso";
repo = "gsignond-plugin-oa";
rev = "d471cebfd7c50567b1244277a9559f18f8d58691";
sha256 = "00axl8wwp2arc6h4bpr4m3ik2hy8an0lbm48q2a9r94krmq56hnx";
};
nativeBuildInputs = [
check
docbook_xml_dtd_43
docbook_xml_dtd_45
docbook_xsl
glibcLocales
gobjectIntrospection
gtk-doc
meson
ninja
pkgconfig
];
buildInputs = [
glib
gnutls
gsignond
json-glib
libsoup
];
LC_ALL = "en_US.UTF-8";
PKG_CONFIG_GSIGNOND_GPLUGINSDIR = "${placeholder "out"}/lib/gsignond/gplugins";
meta = with stdenv.lib; {
description = "Plugin for the Accounts-SSO gSignOn daemon that handles the OAuth 1.0 and 2.0 authentication protocols.";
homepage = https://gitlab.com/accounts-sso/gsignond-plugin-oa;
license = licenses.lgpl21Plus;
maintainers = with maintainers; [ worldofpeace ];
platforms = platforms.linux;
};
}

View File

@ -0,0 +1,45 @@
{ stdenv, fetchFromGitLab, fetchpatch, pkgconfig, meson, ninja, glib, gsignond, gsasl, check
, gtk-doc, docbook_xml_dtd_43, docbook_xml_dtd_45, docbook_xsl, glibcLocales, gobjectIntrospection }:
stdenv.mkDerivation rec {
name = "gsignond-plugin-sasl-${version}";
version = "2018-10-15";
src = fetchFromGitLab {
owner = "accounts-sso";
repo = "gsignond-plugin-sasl";
rev = "b304c70b7dad9368b23b1205122d10de684c896a";
sha256 = "0knzw7c2fm2kzs1gxbrm4kk67522w9cpwqj7xvn86473068k90va";
};
nativeBuildInputs = [
check
docbook_xml_dtd_43
docbook_xml_dtd_45
docbook_xsl
glibcLocales
gobjectIntrospection
gtk-doc
meson
ninja
pkgconfig
];
buildInputs = [
glib
gsasl
gsignond
];
LC_ALL = "en_US.UTF-8";
PKG_CONFIG_GSIGNOND_GPLUGINSDIR = "${placeholder "out"}/lib/gsignond/gplugins";
meta = with stdenv.lib; {
description = "Plugin for the Accounts-SSO gSignOn daemon that handles the SASL authentication protocol.";
homepage = https://gitlab.com/accounts-sso/gsignond-plugin-sasl;
license = licenses.lgpl21Plus;
maintainers = with maintainers; [ worldofpeace ];
platforms = platforms.linux;
};
}

View File

@ -0,0 +1,23 @@
{ stdenv, makeWrapper, symlinkJoin, gsignond, gsignondPlugins, plugins }:
symlinkJoin {
name = "gsignond-with-plugins-${gsignond.version}";
paths = [ gsignond ] ++ plugins;
buildInputs = [ makeWrapper ];
postBuild = ''
wrapProgram $out/bin/gsignond \
--set SSO_GPLUGINS_DIR "$out/lib/gsignond/gplugins"
rm $out/share/dbus-1/services/com.google.code.AccountsSSO.gSingleSignOn.service
rm $out/share/dbus-1/services/com.google.code.AccountsSSO.SingleSignOn.service
substitute ${gsignond}/share/dbus-1/services/com.google.code.AccountsSSO.gSingleSignOn.service $out/share/dbus-1/services/com.google.code.AccountsSSO.gSingleSignOn.service \
--replace ${gsignond} $out
substitute ${gsignond}/share/dbus-1/services/com.google.code.AccountsSSO.SingleSignOn.service $out/share/dbus-1/services/com.google.code.AccountsSSO.SingleSignOn.service \
--replace ${gsignond} $out
'';
}

View File

@ -0,0 +1,57 @@
{ stdenv, fetchgit, pkgconfig, meson, ninja, vala, python3, gtk-doc, docbook_xsl, docbook_xml_dtd_43, docbook_xml_dtd_412, glib, check, gobjectIntrospection }:
stdenv.mkDerivation rec {
pname = "libsignon-glib";
version = "3639a2e90447e4640a03a44972560afe8f61aa48";
name = "${pname}-2018-10-24";
outputs = [ "out" "dev" "devdoc" "py" ];
src = fetchgit {
url = "https://gitlab.com/accounts-sso/${pname}";
rev = version;
fetchSubmodules = true;
sha256 = "1cq19zbsx4c57dc5gp3shp8lzcr1hw2ynylpn1nkvfyyrx80m60w";
};
nativeBuildInputs = [
check
docbook_xml_dtd_412
docbook_xml_dtd_43
docbook_xsl
gobjectIntrospection
gtk-doc
meson
ninja
pkgconfig
python3
vala
];
buildInputs = [
glib
python3.pkgs.pygobject3
];
mesonFlags = [
"-Dintrospection=true"
"-Dpy-overrides-dir=${placeholder "py"}/${python3.sitePackages}/gi/overrides"
];
postPatch = ''
chmod +x build-aux/gen-error-map.py
patchShebangs build-aux/gen-error-map.py
'';
meta = with stdenv.lib; {
description = ''
A library for managing single signon credentials which can be used from GLib applications
'';
homepage = https://gitlab.com/accounts-sso/libsignon-glib;
license = licenses.lgpl21;
maintainers = with maintainers; [ worldofpeace ];
platforms = platforms.linux;
};
}

View File

@ -10588,6 +10588,8 @@ with pkgs;
libsignal-protocol-c = callPackage ../development/libraries/libsignal-protocol-c { };
libsignon-glib = callPackage ../development/libraries/libsignon-glib { };
libsoundio = callPackage ../development/libraries/libsoundio {
inherit (darwin.apple_sdk.frameworks) AudioUnit;
};
@ -12846,6 +12848,17 @@ with pkgs;
zziplib = callPackage ../development/libraries/zziplib { };
gsignond = callPackage ../development/libraries/gsignond {
plugins = [];
};
gsignondPlugins = {
sasl = callPackage ../development/libraries/gsignond/plugins/sasl.nix { };
oauth = callPackage ../development/libraries/gsignond/plugins/oauth.nix { };
lastfm = callPackage ../development/libraries/gsignond/plugins/lastfm.nix { };
mail = callPackages ../development/libraries/gsignond/plugins/mail.nix { };
};
### DEVELOPMENT / LIBRARIES / AGDA
agda = callPackage ../build-support/agda {