diff --git a/pkgs/development/libraries/gsignond/conf.patch b/pkgs/development/libraries/gsignond/conf.patch new file mode 100644 index 000000000000..0aa2034e3996 --- /dev/null +++ b/pkgs/development/libraries/gsignond/conf.patch @@ -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' + ) diff --git a/pkgs/development/libraries/gsignond/default.nix b/pkgs/development/libraries/gsignond/default.nix new file mode 100644 index 000000000000..11dcc2a2ee91 --- /dev/null +++ b/pkgs/development/libraries/gsignond/default.nix @@ -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; + } + diff --git a/pkgs/development/libraries/gsignond/plugin-load-env.patch b/pkgs/development/libraries/gsignond/plugin-load-env.patch new file mode 100644 index 000000000000..5da2b4c157e8 --- /dev/null +++ b/pkgs/development/libraries/gsignond/plugin-load-env.patch @@ -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; + } + diff --git a/pkgs/development/libraries/gsignond/wrapper.nix b/pkgs/development/libraries/gsignond/wrapper.nix new file mode 100644 index 000000000000..a5df6bbeafb2 --- /dev/null +++ b/pkgs/development/libraries/gsignond/wrapper.nix @@ -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 + ''; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 5495b34960de..5c243290eadd 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -12766,6 +12766,10 @@ with pkgs; zziplib = callPackage ../development/libraries/zziplib { }; + gsignond = callPackage ../development/libraries/gsignond { + plugins = []; + }; + ### DEVELOPMENT / LIBRARIES / AGDA agda = callPackage ../build-support/agda {