From 49b43bb82bd0717b0c6fb08bd5036cac4b1de6d4 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Sat, 6 Jan 2024 10:24:26 +0100 Subject: [PATCH] rebuilt with aarch64 build fix, debug package and patches [release 0.105-3mamba;Wed Apr 28 2021] --- ...alog-Make-the-label-wrap-at-70-chars.patch | 32 +++++ ...om-accountsservice-instead-of-lookin.patch | 135 ++++++++++++++++++ ...nt-user-to-authenticate-with-by-defa.patch | 78 ++++++++++ ...mestamps-when-displaying-authenticat.patch | 35 +++++ polkit-gnome.spec | 65 ++++----- 5 files changed, 307 insertions(+), 38 deletions(-) create mode 100644 polkit-gnome-0.105-Auth-dialog-Make-the-label-wrap-at-70-chars.patch create mode 100644 polkit-gnome-0.105-Get-user-icon-from-accountsservice-instead-of-lookin.patch create mode 100644 polkit-gnome-0.105-Select-the-current-user-to-authenticate-with-by-defa.patch create mode 100644 polkit-gnome-0.105-Use-fresh-X11-timestamps-when-displaying-authenticat.patch diff --git a/polkit-gnome-0.105-Auth-dialog-Make-the-label-wrap-at-70-chars.patch b/polkit-gnome-0.105-Auth-dialog-Make-the-label-wrap-at-70-chars.patch new file mode 100644 index 0000000..76b96f4 --- /dev/null +++ b/polkit-gnome-0.105-Auth-dialog-Make-the-label-wrap-at-70-chars.patch @@ -0,0 +1,32 @@ +From: Lars Uebernickel +Date: Fri, 17 Oct 2014 15:35:25 +0200 +Subject: Auth dialog: Make the label wrap at 70 chars + +Because GtkWindow doesn't have a default width anymore. + +Bug: https://bugzilla.gnome.org/show_bug.cgi?id=738688 +Bug-Ubuntu: https://launchpad.net/bugs/1382566 +--- + src/polkitgnomeauthenticationdialog.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/polkitgnomeauthenticationdialog.c b/src/polkitgnomeauthenticationdialog.c +index d307516..efd4185 100644 +--- a/src/polkitgnomeauthenticationdialog.c ++++ b/src/polkitgnomeauthenticationdialog.c +@@ -574,6 +574,7 @@ polkit_gnome_authentication_dialog_constructed (GObject *object) + g_free (s); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); ++ gtk_label_set_max_width_chars (GTK_LABEL (label), 70); + gtk_box_pack_start (GTK_BOX (main_vbox), label, FALSE, FALSE, 0); + + /* secondary message */ +@@ -601,6 +602,7 @@ polkit_gnome_authentication_dialog_constructed (GObject *object) + } + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); ++ gtk_label_set_max_width_chars (GTK_LABEL (label), 70); + gtk_box_pack_start (GTK_BOX (main_vbox), label, FALSE, FALSE, 0); + + /* user combobox */ diff --git a/polkit-gnome-0.105-Get-user-icon-from-accountsservice-instead-of-lookin.patch b/polkit-gnome-0.105-Get-user-icon-from-accountsservice-instead-of-lookin.patch new file mode 100644 index 0000000..4314939 --- /dev/null +++ b/polkit-gnome-0.105-Get-user-icon-from-accountsservice-instead-of-lookin.patch @@ -0,0 +1,135 @@ +From: Marc Deslauriers +Date: Mon, 30 Apr 2018 18:03:22 +0000 +Subject: Get user icon from accountsservice instead of looking in ~/.face + +Bug: https://bugzilla.gnome.org/show_bug.cgi?id=669857 +Bug-Ubuntu: https://launchpad.net/bugs/928249 +--- + src/polkitgnomeauthenticationdialog.c | 107 ++++++++++++++++++++++++++++++---- + 1 file changed, 97 insertions(+), 10 deletions(-) + +diff --git a/src/polkitgnomeauthenticationdialog.c b/src/polkitgnomeauthenticationdialog.c +index efd4185..565da87 100644 +--- a/src/polkitgnomeauthenticationdialog.c ++++ b/src/polkitgnomeauthenticationdialog.c +@@ -135,6 +135,102 @@ user_combobox_changed (GtkComboBox *widget, + } + } + ++static GdkPixbuf * ++get_user_icon (char *username) ++{ ++ GError *error; ++ GDBusConnection *connection; ++ GVariant *find_user_result; ++ GVariant *get_icon_result; ++ GVariant *icon_result_variant; ++ const gchar *user_path; ++ const gchar *icon_filename; ++ GdkPixbuf *pixbuf; ++ ++ error = NULL; ++ connection = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, &error); ++ ++ if (connection == NULL) ++ { ++ g_warning ("Unable to connect to system bus: %s", error->message); ++ g_error_free (error); ++ return NULL; ++ } ++ ++ find_user_result = g_dbus_connection_call_sync (connection, ++ "org.freedesktop.Accounts", ++ "/org/freedesktop/Accounts", ++ "org.freedesktop.Accounts", ++ "FindUserByName", ++ g_variant_new ("(s)", ++ username), ++ G_VARIANT_TYPE ("(o)"), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ NULL, ++ &error); ++ ++ if (find_user_result == NULL) ++ { ++ g_warning ("Accounts couldn't find user: %s", error->message); ++ g_error_free (error); ++ return NULL; ++ } ++ ++ user_path = g_variant_get_string (g_variant_get_child_value (find_user_result, 0), ++ NULL); ++ ++ get_icon_result = g_dbus_connection_call_sync (connection, ++ "org.freedesktop.Accounts", ++ user_path, ++ "org.freedesktop.DBus.Properties", ++ "Get", ++ g_variant_new ("(ss)", ++ "org.freedesktop.Accounts.User", ++ "IconFile"), ++ G_VARIANT_TYPE ("(v)"), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ NULL, ++ &error); ++ ++ g_variant_unref (find_user_result); ++ ++ if (get_icon_result == NULL) ++ { ++ g_warning ("Accounts couldn't find user icon: %s", error->message); ++ g_error_free (error); ++ return NULL; ++ } ++ ++ g_variant_get_child (get_icon_result, 0, "v", &icon_result_variant); ++ icon_filename = g_variant_get_string (icon_result_variant, NULL); ++ ++ if (icon_filename == NULL) ++ { ++ g_warning ("Accounts didn't return a valid filename for user icon"); ++ pixbuf = NULL; ++ } ++ else ++ { ++ /* TODO: we probably shouldn't hard-code the size to 16x16 */ ++ pixbuf = gdk_pixbuf_new_from_file_at_size (icon_filename, ++ 16, ++ 16, ++ &error); ++ if (pixbuf == NULL) ++ { ++ g_warning ("Couldn't open user icon: %s", error->message); ++ g_error_free (error); ++ } ++ } ++ ++ g_variant_unref (icon_result_variant); ++ g_variant_unref (get_icon_result); ++ ++ return pixbuf; ++} ++ + static void + create_user_combobox (PolkitGnomeAuthenticationDialog *dialog) + { +@@ -197,16 +293,7 @@ create_user_combobox (PolkitGnomeAuthenticationDialog *dialog) + g_free (gecos); + + /* Load users face */ +- pixbuf = NULL; +- if (passwd->pw_dir != NULL) +- { +- gchar *path; +- path = g_strdup_printf ("%s/.face", passwd->pw_dir); +- /* TODO: we probably shouldn't hard-code the size to 16x16 */ +- pixbuf = gdk_pixbuf_new_from_file_at_scale (path, 16, 16, TRUE, NULL); +- g_free (path); +- } +- ++ pixbuf = get_user_icon (dialog->priv->users[n]); + /* fall back to avatar-default icon */ + if (pixbuf == NULL) + { diff --git a/polkit-gnome-0.105-Select-the-current-user-to-authenticate-with-by-defa.patch b/polkit-gnome-0.105-Select-the-current-user-to-authenticate-with-by-defa.patch new file mode 100644 index 0000000..91f67bb --- /dev/null +++ b/polkit-gnome-0.105-Select-the-current-user-to-authenticate-with-by-defa.patch @@ -0,0 +1,78 @@ +From: Utopia Maintenance Team + +Date: Mon, 30 Apr 2018 17:56:52 +0000 +Subject: Select the current user to authenticate with by default + +Bug: http://bugzilla.gnome.org/show_bug.cgi?id=596188 +Bug-Ubuntu: https://launchpad.net/bugs/435227 +--- + src/polkitgnomeauthenticationdialog.c | 23 ++++++++++++++--------- + 1 file changed, 14 insertions(+), 9 deletions(-) + +diff --git a/src/polkitgnomeauthenticationdialog.c b/src/polkitgnomeauthenticationdialog.c +index 743cc96..d307516 100644 +--- a/src/polkitgnomeauthenticationdialog.c ++++ b/src/polkitgnomeauthenticationdialog.c +@@ -138,7 +138,7 @@ user_combobox_changed (GtkComboBox *widget, + static void + create_user_combobox (PolkitGnomeAuthenticationDialog *dialog) + { +- int n; ++ int n, i, selected_index = 0; + GtkComboBox *combo; + GtkTreeIter iter; + GtkCellRenderer *renderer; +@@ -162,7 +162,7 @@ create_user_combobox (PolkitGnomeAuthenticationDialog *dialog) + + + /* For each user */ +- for (n = 0; dialog->priv->users[n] != NULL; n++) ++ for (i = 0, n = 0; dialog->priv->users[n] != NULL; n++) + { + gchar *gecos; + gchar *real_name; +@@ -224,6 +224,14 @@ create_user_combobox (PolkitGnomeAuthenticationDialog *dialog) + USERNAME_COL, dialog->priv->users[n], + -1); + ++ i++; ++ if (passwd->pw_uid == getuid ()) ++ { ++ selected_index = i; ++ g_free (dialog->priv->selected_user); ++ dialog->priv->selected_user = g_strdup (dialog->priv->users[n]); ++ } ++ + g_free (real_name); + g_object_unref (pixbuf); + } +@@ -252,8 +260,8 @@ create_user_combobox (PolkitGnomeAuthenticationDialog *dialog) + user_combobox_set_sensitive, + NULL, NULL); + +- /* Initially select the "Select user..." ... */ +- gtk_combo_box_set_active (GTK_COMBO_BOX (combo), 0); ++ /* Select the default user */ ++ gtk_combo_box_set_active (GTK_COMBO_BOX (combo), selected_index); + + /* Listen when a new user is selected */ + g_signal_connect (GTK_WIDGET (combo), +@@ -719,16 +727,13 @@ polkit_gnome_authentication_dialog_constructed (GObject *object) + gtk_widget_set_tooltip_markup (label, s); + g_free (s); + +- if (have_user_combobox) ++ /* Disable password entry and authenticate until have a user selected */ ++ if (have_user_combobox && gtk_combo_box_get_active (GTK_COMBO_BOX (dialog->priv->user_combobox)) == 0) + { +- /* ... and make the password entry and "Authenticate" button insensitive */ + gtk_widget_set_sensitive (dialog->priv->prompt_label, FALSE); + gtk_widget_set_sensitive (dialog->priv->password_entry, FALSE); + gtk_widget_set_sensitive (dialog->priv->auth_button, FALSE); + } +- else +- { +- } + + gtk_widget_realize (GTK_WIDGET (dialog)); + diff --git a/polkit-gnome-0.105-Use-fresh-X11-timestamps-when-displaying-authenticat.patch b/polkit-gnome-0.105-Use-fresh-X11-timestamps-when-displaying-authenticat.patch new file mode 100644 index 0000000..362e028 --- /dev/null +++ b/polkit-gnome-0.105-Use-fresh-X11-timestamps-when-displaying-authenticat.patch @@ -0,0 +1,35 @@ +From: Jeffrey Knockel +Date: Mon, 30 Apr 2018 18:05:20 +0000 +Subject: Use fresh X11 timestamps when displaying authentication dialog + +This circumvents focus-stealing prevention. + +Bug: https://bugzilla.gnome.org/show_bug.cgi?id=676076 +Bug-Debian: https://bugs.debian.org/684300 +Bug-Ubuntu: https://launchpad.net/bugs/946171 +--- + src/polkitgnomeauthenticator.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/src/polkitgnomeauthenticator.c b/src/polkitgnomeauthenticator.c +index 23163b4..e57d76e 100644 +--- a/src/polkitgnomeauthenticator.c ++++ b/src/polkitgnomeauthenticator.c +@@ -26,6 +26,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -306,7 +307,8 @@ session_request (PolkitAgentSession *session, + } + + gtk_widget_show_all (GTK_WIDGET (authenticator->dialog)); +- gtk_window_present (GTK_WINDOW (authenticator->dialog)); ++ gtk_window_present_with_time (GTK_WINDOW (authenticator->dialog), ++ gdk_x11_get_server_time (gtk_widget_get_window (GTK_WIDGET (authenticator->dialog)))); + password = polkit_gnome_authentication_dialog_run_until_response_for_prompt (POLKIT_GNOME_AUTHENTICATION_DIALOG (authenticator->dialog), + modified_request, + echo_on, diff --git a/polkit-gnome.spec b/polkit-gnome.spec index e4147af..ae116fe 100644 --- a/polkit-gnome.spec +++ b/polkit-gnome.spec @@ -1,47 +1,42 @@ Name: polkit-gnome Version: 0.105 -Release: 2mamba +Release: 3mamba Summary: PolicyKit integration for the GNOME desktop Group: System/Libraries Vendor: openmamba Distribution: openmamba -Packager: gil +Packager: Silvan Calarco URL: http://www.freedesktop.org/wiki/Software/PolicyKit Source: ftp://ftp.gnome.org/pub/gnome/sources/polkit-gnome/%{version}/polkit-gnome-%{version}.tar.xz +Patch0: polkit-gnome-0.105-Select-the-current-user-to-authenticate-with-by-defa.patch +Patch1: polkit-gnome-0.105-Auth-dialog-Make-the-label-wrap-at-70-chars.patch +Patch2: polkit-gnome-0.105-Get-user-icon-from-accountsservice-instead-of-lookin.patch +Patch3: polkit-gnome-0.105-Use-fresh-X11-timestamps-when-displaying-authenticat.patch License: LGPL ## AUTOBUILDREQ-BEGIN BuildRequires: glibc-devel -BuildRequires: gtk-doc BuildRequires: libatk-devel +BuildRequires: libbrotli-devel +BuildRequires: libbzip2-devel BuildRequires: libcairo-devel BuildRequires: libexpat-devel -BuildRequires: libfontconfig-devel BuildRequires: libfreetype-devel BuildRequires: libgdk-pixbuf-devel BuildRequires: libglib-devel -BuildRequires: libglitz-devel -BuildRequires: libgtk-devel +BuildRequires: libgraphite2-devel +BuildRequires: libgtk3-devel +BuildRequires: libharfbuzz-devel BuildRequires: libpango-devel -BuildRequires: libpixman-devel BuildRequires: libpng-devel -BuildRequires: libpthread-stubs-devel -BuildRequires: libselinux-devel -BuildRequires: libstdc++6-devel -BuildRequires: libX11-devel -BuildRequires: libXau-devel -BuildRequires: libxcb-devel -BuildRequires: libxcb-util-devel -BuildRequires: libXdmcp-devel -BuildRequires: libXrender-devel +BuildRequires: libpolkit-devel +BuildRequires: libsystemd-devel BuildRequires: libz-devel -BuildRequires: polkit-devel ## AUTOBUILDREQ-END BuildRequires: gobject-introspection-devel Provides: polkit-gnome-devel -Obsoletes: polkit-gnome-devel -Obsoletes: polkit-gnome-apidocs +Obsoletes: polkit-gnome-devel < 0.105-3mamba +Obsoletes: polkit-gnome-apidocs < 0.105-3mamba Requires: at-spi2-core -BuildRoot: %{_tmppath}/%{name}-%{version}-root %description %{name} provides an authentication agent for PolicyKit that matches the look and feel of the GNOME desktop @@ -54,7 +49,7 @@ Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release} %description devel PolicyKit integration for the GNOME desktop. -This package contains static libraries and header files need for development. +This package contains static libraries and header files needed for development. %package apidocs Summary: %{name} API documentation @@ -64,13 +59,21 @@ Requires: gtk-doc %description apidocs %{name} API documentation. +%debug_package + %prep %setup -q +sed -i "s,| arm-\* |,| aarch64-\* | arm-\* |," config.sub +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 %build %configure \ --enable-gtk-doc \ --disable-introspection + make %install @@ -89,27 +92,13 @@ make install DESTDIR=%{buildroot} %files -f %{name}-1.lang %defattr(-,root,root) -#%{_sysconfdir}/xdg/autostart/polkit-gnome-*.desktop -#%{_libdir}/libpolkit-gtk-*.so.* %{_libexecdir}/polkit-gnome-* -# %{_libdir}/girepository-1.0/*.typelib %doc AUTHORS COPYING -# NEWS README TODO - -#%files devel -#%defattr(-,root,root) -#%{_includedir}/polkit-gtk-1/polkitgtk/*.h -#%{_libdir}/libpolkit-gtk-*.*a -#%{_libdir}/libpolkit-gtk-*.so -#%{_exec_prefix}/lib/pkgconfig/*.pc -# %{_datadir}/gir-1.0/*.gir - -#%files apidocs -#%defattr(-,root,root) -#%dir %{_datadir}/gtk-doc/html/polkit-gtk-1 -#%{_datadir}/gtk-doc/html/polkit-gtk-1/* %changelog +* Wed Apr 28 2021 Silvan Calarco 0.105-3mamba +- rebuilt with aarch64 build fix, debug package and patches + * Sun May 04 2014 Silvan Calarco 0.105-2mamba - require at-spi2-core