From 1c9ad3ec47cd529d0681f602d4337cd91d57fd75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Federico=20Dami=C3=A1n=20Schonborn?= Date: Thu, 16 Feb 2023 19:14:29 -0300 Subject: [PATCH] budgie.budgie-control-center: init at 1.2.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Federico Damián Schonborn --- .../budgie/budgie-control-center/default.nix | 175 +++++++++++++++++ .../budgie/budgie-control-center/paths.patch | 185 ++++++++++++++++++ pkgs/desktops/budgie/default.nix | 1 + 3 files changed, 361 insertions(+) create mode 100644 pkgs/desktops/budgie/budgie-control-center/default.nix create mode 100644 pkgs/desktops/budgie/budgie-control-center/paths.patch diff --git a/pkgs/desktops/budgie/budgie-control-center/default.nix b/pkgs/desktops/budgie/budgie-control-center/default.nix new file mode 100644 index 000000000000..b8444f72e1fc --- /dev/null +++ b/pkgs/desktops/budgie/budgie-control-center/default.nix @@ -0,0 +1,175 @@ +{ lib +, stdenv +, fetchFromGitHub +, substituteAll +, accountsservice +, budgie-desktop +, clutter +, clutter-gtk +, colord +, colord-gtk +, cups +, docbook-xsl-nons +, fontconfig +, gcr +, gdk-pixbuf +, gettext +, glib +, glib-networking +, glibc +, gnome +, gnome-desktop +, gnome-online-accounts +, gsettings-desktop-schemas +, gsound +, gtk3 +, ibus +, libcanberra-gtk3 +, libepoxy +, libgnomekbd +, libgtop +, libgudev +, libhandy +, libkrb5 +, libnma +, libpulseaudio +, libpwquality +, librsvg +, libsecret +, libwacom +, libxml2 +, libxslt +, meson +, modemmanager +, networkmanager +, networkmanagerapplet +, ninja +, pkg-config +, polkit +, samba +, shadow +, shared-mime-info +, tzdata +, udisks2 +, upower +, webp-pixbuf-loader +, wrapGAppsHook +}: + +stdenv.mkDerivation rec { + pname = "budgie-control-center"; + version = "1.2.0"; + + src = fetchFromGitHub { + owner = "BuddiesOfBudgie"; + repo = pname; + rev = "v${version}"; + fetchSubmodules = true; + sha256 = "sha256-z9apestNLEUKzrCMNo0BNAWeyE6FsUCAzcHIom8LcUs="; + }; + + patches = [ + (substituteAll { + src = ./paths.patch; + budgie_desktop = budgie-desktop; + gcm = gnome.gnome-color-manager; + inherit cups glibc libgnomekbd shadow; + inherit networkmanagerapplet tzdata; + }) + ]; + + nativeBuildInputs = [ + docbook-xsl-nons + gettext + libxslt + meson + ninja + pkg-config + shared-mime-info + wrapGAppsHook + ]; + + buildInputs = [ + accountsservice + clutter + clutter-gtk + colord + colord-gtk + fontconfig + gcr + gdk-pixbuf + glib + glib-networking + gnome-desktop + gnome-online-accounts + gnome.adwaita-icon-theme + gnome.cheese + gnome.gnome-bluetooth_1_0 + gnome.gnome-remote-desktop + gnome.gnome-settings-daemon + gnome.gnome-user-share + gnome.mutter + gsettings-desktop-schemas + gsound + gtk3 + ibus + libcanberra-gtk3 + libepoxy + libgtop + libgudev + libhandy + libkrb5 + libnma + libpulseaudio + libpwquality + librsvg + libsecret + libwacom + libxml2 + modemmanager + networkmanager + polkit + samba + udisks2 + upower + ]; + + preConfigure = '' + # For ITS rules + addToSearchPath "XDG_DATA_DIRS" "${polkit.out}/share" + ''; + + postInstall = '' + # Pull in WebP support for gnome-backgrounds. + # In postInstall to run before gappsWrapperArgsHook. + export GDK_PIXBUF_MODULE_FILE="${gnome._gdkPixbufCacheBuilder_DO_NOT_USE { + extraLoaders = [ + librsvg + webp-pixbuf-loader + ]; + }}" + ''; + + preFixup = '' + gappsWrapperArgs+=( + # Sound theme + --prefix XDG_DATA_DIRS : "${budgie-desktop}/share" + # Thumbnailers (for setting user profile pictures) + --prefix XDG_DATA_DIRS : "${gdk-pixbuf}/share" + --prefix XDG_DATA_DIRS : "${librsvg}/share" + # WM keyboard shortcuts + --prefix XDG_DATA_DIRS : "${gnome.mutter}/share" + ) + ''; + + separateDebugInfo = true; + + meta = with lib; { + description = "A fork of GNOME Control Center for the Budgie 10 Series"; + homepage = "https://github.com/BuddiesOfBudgie/budgie-control-center"; + mainProgram = "budgie-control-center"; + platforms = platforms.linux; + maintainers = [ maintainers.federicoschonborn ]; + license = licenses.gpl2Plus; + }; +} diff --git a/pkgs/desktops/budgie/budgie-control-center/paths.patch b/pkgs/desktops/budgie/budgie-control-center/paths.patch new file mode 100644 index 000000000000..584d12038285 --- /dev/null +++ b/pkgs/desktops/budgie/budgie-control-center/paths.patch @@ -0,0 +1,185 @@ +diff --git a/panels/color/cc-color-panel.c b/panels/color/cc-color-panel.c +index a2f90b093..7801b4a5e 100644 +--- a/panels/color/cc-color-panel.c ++++ b/panels/color/cc-color-panel.c +@@ -587,7 +587,7 @@ gcm_prefs_calibrate_cb (CcColorPanel *prefs) + + /* run with modal set */ + argv = g_ptr_array_new_with_free_func (g_free); +- g_ptr_array_add (argv, g_strdup ("gcm-calibrate")); ++ g_ptr_array_add (argv, g_build_filename ("@gcm@", "bin", "gcm-calibrate", NULL)); + g_ptr_array_add (argv, g_strdup ("--device")); + g_ptr_array_add (argv, g_strdup (cd_device_get_id (prefs->current_device))); + g_ptr_array_add (argv, g_strdup ("--parent-window")); +@@ -940,7 +940,7 @@ gcm_prefs_profile_view (CcColorPanel *prefs, CdProfile *profile) + + /* open up gcm-viewer as a info pane */ + argv = g_ptr_array_new_with_free_func (g_free); +- g_ptr_array_add (argv, g_strdup ("gcm-viewer")); ++ g_ptr_array_add (argv, g_build_filename ("@gcm@", "bin", "gcm-viewer", NULL)); + g_ptr_array_add (argv, g_strdup ("--profile")); + g_ptr_array_add (argv, g_strdup (cd_profile_get_id (profile))); + g_ptr_array_add (argv, g_strdup ("--parent-window")); +@@ -1186,15 +1186,12 @@ gcm_prefs_device_clicked (CcColorPanel *prefs, CdDevice *device) + static void + gcm_prefs_profile_clicked (CcColorPanel *prefs, CdProfile *profile, CdDevice *device) + { +- g_autofree gchar *s = NULL; +- + /* get profile */ + g_debug ("selected profile = %s", + cd_profile_get_filename (profile)); + + /* allow getting profile info */ +- if (cd_profile_get_filename (profile) != NULL && +- (s = g_find_program_in_path ("gcm-viewer")) != NULL) ++ if (cd_profile_get_filename (profile) != NULL) + gtk_widget_set_sensitive (prefs->toolbutton_profile_view, TRUE); + else + gtk_widget_set_sensitive (prefs->toolbutton_profile_view, FALSE); +diff --git a/panels/datetime/tz.h b/panels/datetime/tz.h +index b6b7ab9d0..31f268e91 100644 +--- a/panels/datetime/tz.h ++++ b/panels/datetime/tz.h +@@ -4,7 +4,7 @@ + * Copyright (C) 2000-2001 Ximian, Inc. + * + * Authors: Hans Petter Jansson +- * ++ * + * Largely based on Michael Fulbright's work on Anaconda. + * + * This program is free software; you can redistribute it and/or modify +@@ -27,11 +27,7 @@ + + G_BEGIN_DECLS + +-#ifndef __sun +-# define TZ_DATA_FILE "/usr/share/zoneinfo/zone.tab" +-#else +-# define TZ_DATA_FILE "/usr/share/lib/zoneinfo/tab/zone_sun.tab" +-#endif ++#define TZ_DATA_FILE "@tzdata@/share/zoneinfo/zone.tab" + + typedef struct _TzDB TzDB; + typedef struct _TzLocation TzLocation; +diff --git a/panels/info-overview/cc-info-overview-panel.c b/panels/info-overview/cc-info-overview-panel.c +index 25cda02d3..db664bc56 100644 +--- a/panels/info-overview/cc-info-overview-panel.c ++++ b/panels/info-overview/cc-info-overview-panel.c +@@ -156,7 +156,7 @@ load_budgie_version (char **version) + gsize length; + g_autoptr(VersionData) data = NULL; + +- if (!g_file_get_contents (DATADIR "/budgie/budgie-version.xml", ++ if (!g_file_get_contents ("@budgie_desktop@/share/budgie/budgie-version.xml", + &contents, + &length, + &error)) +diff --git a/panels/keyboard/cc-input-list-box.c b/panels/keyboard/cc-input-list-box.c +index 191207490..37e0fddc2 100644 +--- a/panels/keyboard/cc-input-list-box.c ++++ b/panels/keyboard/cc-input-list-box.c +@@ -62,7 +62,7 @@ struct _CcInputListBox { + }; + + G_DEFINE_TYPE (CcInputListBox, cc_input_list_box, GTK_TYPE_LIST_BOX) +- ++ + typedef struct + { + CcInputListBox *panel; +@@ -223,10 +223,10 @@ row_layout_cb (CcInputListBox *self, + layout_variant = cc_input_source_get_layout_variant (source); + + if (layout_variant && layout_variant[0]) +- commandline = g_strdup_printf ("gkbd-keyboard-display -l \"%s\t%s\"", ++ commandline = g_strdup_printf ("@libgnomekbd@/bin/gkbd-keyboard-display -l \"%s\t%s\"", + layout, layout_variant); + else +- commandline = g_strdup_printf ("gkbd-keyboard-display -l %s", ++ commandline = g_strdup_printf ("@libgnomekbd@/bin/gkbd-keyboard-display -l %s", + layout); + + g_spawn_command_line_async (commandline, NULL); +diff --git a/panels/network/connection-editor/net-connection-editor.c b/panels/network/connection-editor/net-connection-editor.c +index 505b8ee25..62e94009f 100644 +--- a/panels/network/connection-editor/net-connection-editor.c ++++ b/panels/network/connection-editor/net-connection-editor.c +@@ -267,9 +267,9 @@ net_connection_editor_do_fallback (NetConnectionEditor *self, const gchar *type) + g_autoptr(GError) error = NULL; + + if (self->is_new_connection) { +- cmdline = g_strdup_printf ("nm-connection-editor --type='%s' --create", type); ++ cmdline = g_strdup_printf ("@networkmanagerapplet@/bin/nm-connection-editor --type='%s' --create", type); + } else { +- cmdline = g_strdup_printf ("nm-connection-editor --edit='%s'", ++ cmdline = g_strdup_printf ("@networkmanagerapplet@/bin/nm-connection-editor --edit='%s'", + nm_connection_get_uuid (self->connection)); + } + +diff --git a/panels/network/net-device-bluetooth.c b/panels/network/net-device-bluetooth.c +index 372c0c4f8..464f4b6a0 100644 +--- a/panels/network/net-device-bluetooth.c ++++ b/panels/network/net-device-bluetooth.c +@@ -141,7 +141,7 @@ options_button_clicked_cb (NetDeviceBluetooth *self) + + connection = net_device_get_find_connection (self->client, self->device); + uuid = nm_connection_get_uuid (connection); +- cmdline = g_strdup_printf ("nm-connection-editor --edit %s", uuid); ++ cmdline = g_strdup_printf ("@networkmanagerapplet@/bin/nm-connection-editor --edit %s", uuid); + g_debug ("Launching '%s'\n", cmdline); + if (!g_spawn_command_line_async (cmdline, &error)) + g_warning ("Failed to launch nm-connection-editor: %s", error->message); +diff --git a/panels/network/net-device-mobile.c b/panels/network/net-device-mobile.c +index f50fd5d07..c6f6f776e 100644 +--- a/panels/network/net-device-mobile.c ++++ b/panels/network/net-device-mobile.c +@@ -522,7 +522,7 @@ options_button_clicked_cb (NetDeviceMobile *self) + + connection = net_device_get_find_connection (self->client, self->device); + uuid = nm_connection_get_uuid (connection); +- cmdline = g_strdup_printf ("nm-connection-editor --edit %s", uuid); ++ cmdline = g_strdup_printf ("@networkmanagerapplet@/bin/nm-connection-editor --edit %s", uuid); + g_debug ("Launching '%s'\n", cmdline); + if (!g_spawn_command_line_async (cmdline, &error)) + g_warning ("Failed to launch nm-connection-editor: %s", error->message); +diff --git a/panels/printers/pp-host.c b/panels/printers/pp-host.c +index a31a606e3..ed5133d29 100644 +--- a/panels/printers/pp-host.c ++++ b/panels/printers/pp-host.c +@@ -256,7 +256,7 @@ _pp_host_get_snmp_devices_thread (GTask *task, + devices = g_ptr_array_new_with_free_func (g_object_unref); + + argv = g_new0 (gchar *, 3); +- argv[0] = g_strdup ("/usr/lib/cups/backend/snmp"); ++ argv[0] = g_strdup ("@cups@/lib/cups/backend/snmp"); + argv[1] = g_strdup (priv->hostname); + + /* Use SNMP to get printer's informations */ +diff --git a/panels/user-accounts/run-passwd.c b/panels/user-accounts/run-passwd.c +index 86f53d4fc..0b052856f 100644 +--- a/panels/user-accounts/run-passwd.c ++++ b/panels/user-accounts/run-passwd.c +@@ -150,7 +150,7 @@ spawn_passwd (PasswdHandler *passwd_handler, GError **error) + gchar **envp; + gint my_stdin, my_stdout, my_stderr; + +- argv[0] = "/usr/bin/passwd"; /* Is it safe to rely on a hard-coded path? */ ++ argv[0] = "/run/wrappers/bin/passwd"; /* Is it safe to rely on a hard-coded path? */ + argv[1] = NULL; + + envp = g_get_environ (); +diff --git a/panels/user-accounts/user-utils.c b/panels/user-accounts/user-utils.c +index 0de83479e..628e35247 100644 +--- a/panels/user-accounts/user-utils.c ++++ b/panels/user-accounts/user-utils.c +@@ -497,7 +497,7 @@ is_valid_username_async (const gchar *username, + * future, so it would be nice to have some official way for this + * instead of relying on the current "--login" implementation. + */ +- argv[0] = "/usr/sbin/usermod"; ++ argv[0] = "@shadow@/bin/usermod"; + argv[1] = "--login"; + argv[2] = data->username; + argv[3] = "--"; diff --git a/pkgs/desktops/budgie/default.nix b/pkgs/desktops/budgie/default.nix index e188af785ab3..51da56e99b0e 100644 --- a/pkgs/desktops/budgie/default.nix +++ b/pkgs/desktops/budgie/default.nix @@ -1,6 +1,7 @@ { lib, pkgs }: lib.makeScope pkgs.newScope (self: with self; { + budgie-control-center = callPackage ./budgie-control-center { }; budgie-desktop = callPackage ./budgie-desktop { }; budgie-desktop-view = callPackage ./budgie-desktop-view { }; budgie-screensaver = callPackage ./budgie-screensaver { };