Merge pull request #150634 from bobby285271/pantheon-stable

[21.11] Pantheon 6.1
This commit is contained in:
Bobby Rong
2021-12-20 16:32:50 +08:00
committed by GitHub
29 changed files with 510 additions and 239 deletions

View File

@@ -105,8 +105,14 @@ switchboard-with-plugs.override {
</term>
<listitem>
<para>
AppCenter has been available since 20.03, but it is of little use. This is because there is no functioning PackageKit backend for Nix 2.0. The Flatpak backend will not work before <link xlink:href="https://github.com/elementary/appcenter/issues/1076">flag for Flatpak-only</link> is provided. See this <link xlink:href="https://github.com/NixOS/nixpkgs/issues/70214">issue</link>.
AppCenter has been available since 20.03, but it is of little use. This is because there is no functioning PackageKit backend for Nix 2.0. Starting from 21.11, the Flatpak backend should work so you can install some Flatpak applications using it. See this <link xlink:href="https://github.com/NixOS/nixpkgs/issues/70214">issue</link>.
</para>
<para>
To use AppCenter on NixOS, add <literal>pantheon.appcenter</literal> to <xref linkend="opt-environment.systemPackages" />, <link linkend="module-services-flatpak">enable Flatpak support</link> and optionally add the <literal>appcenter</literal> Flatpak remote:
</para>
<screen>
<prompt>$ </prompt>flatpak remote-add --if-not-exists appcenter https://flatpak.elementary.io/repo.flatpakrepo
</screen>
</listitem>
</varlistentry>
</variablelist>

View File

@@ -1,5 +1,7 @@
{ lib, stdenv
{ lib
, stdenv
, fetchurl
, fetchpatch
, meson
, ninja
, pkg-config
@@ -57,9 +59,12 @@ stdenv.mkDerivation rec {
patches = lib.optionals withPantheon [
# Make this respect dark mode settings from Pantheon
# https://github.com/elementary/evince
# The patch currently differs from upstream (updated for evince 41).
./pantheon-dark-style.patch
# https://github.com/elementary/evince/pull/21
# https://github.com/elementary/evince/pull/31
(fetchpatch {
url = "https://raw.githubusercontent.com/elementary/evince/c8364019ee2c2dffd2a1bccf79b8f4e526aa22af/dark-style.patch";
sha256 = "sha256-nKELRXnM6gMRTGmWdO1Qqlo9ciy+4HOK5z2CYOoi2Lo=";
})
];
postPatch = ''

View File

@@ -1,86 +0,0 @@
diff --git a/meson.build b/meson.build
index bcb69cf7..4a18c08c 100644
--- a/meson.build
+++ b/meson.build
@@ -162,6 +162,7 @@ gmodule_dep = dependency('gmodule-2.0')
gmodule_no_export_dep = dependency('gmodule-no-export-2.0', version: glib_req_version)
gtk_dep = dependency('gtk+-3.0', version: gtk_req_version)
gthread_dep = dependency('gthread-2.0', version: glib_req_version)
+granite_dep = dependency('granite')
# Keep the version here synchronised with subprojects/libhandy.wrap
hdy_dep = dependency('libhandy-1', version: hdy_req_version, fallback: ['libhandy', 'libhandy_dep'])
diff --git a/shell/ev-application.c b/shell/ev-application.c
index e704bda2..d705328c 100644
--- a/shell/ev-application.c
+++ b/shell/ev-application.c
@@ -30,6 +30,7 @@
#include <glib/gi18n.h>
#include <glib/gstdio.h>
#include <gtk/gtk.h>
+#include <granite.h>
#include <handy.h>
#ifdef GDK_WINDOWING_X11
#include <gdk/gdkx.h>
@@ -176,7 +177,7 @@ ev_spawn (const char *uri,
g_string_append_printf (cmd, " %s", path);
g_free (path);
-
+
/* Page label */
if (dest) {
switch (ev_link_dest_get_dest_type (dest)) {
@@ -940,6 +941,20 @@ ev_application_migrate_config_dir (EvApplication *application)
g_free (old_accels);
}
+static void
+ev_application_set_prefers_color_scheme ()
+{
+ GtkSettings* gtk_settings = gtk_settings_get_default ();
+ GraniteSettings* granite_settings = granite_settings_get_default ();
+
+ g_object_set (
+ gtk_settings,
+ "gtk-application-prefer-dark-theme",
+ granite_settings_get_prefers_color_scheme (granite_settings) == GRANITE_SETTINGS_COLOR_SCHEME_DARK,
+ NULL
+ );
+}
+
static void
ev_application_startup (GApplication *gapplication)
{
@@ -992,6 +1007,7 @@ ev_application_startup (GApplication *gapplication)
EvApplication *application = EV_APPLICATION (gapplication);
const gchar **it;
+ GraniteSettings* granite_settings = granite_settings_get_default ();
g_application_set_resource_base_path (gapplication, "/org/gnome/evince");
@@ -999,6 +1015,11 @@ ev_application_startup (GApplication *gapplication)
hdy_init ();
+ ev_application_set_prefers_color_scheme ();
+
+ g_signal_connect (granite_settings, "notify::prefers-color-scheme",
+ G_CALLBACK(ev_application_set_prefers_color_scheme), NULL);
+
for (it = action_accels; it[0]; it += g_strv_length ((gchar **)it) + 1)
gtk_application_set_accels_for_action (GTK_APPLICATION (application), it[0], &it[1]);
}
diff --git a/shell/meson.build b/shell/meson.build
index 7cbc48f2..a3089b13 100644
--- a/shell/meson.build
+++ b/shell/meson.build
@@ -52,6 +52,7 @@ sources += gnome.compile_resources(
deps = [
gdk_pixbuf_dep,
gnome_desktop_dep,
+ granite_dep,
hdy_dep,
libevmisc_dep,
libevproperties_dep,

View File

@@ -0,0 +1,240 @@
From b5d7cb20713eff3b3729e5c5fdd2f15680a29385 Mon Sep 17 00:00:00 2001
From: Bobby Rong <rjl931189261@126.com>
Date: Sun, 31 Oct 2021 23:12:46 +0800
Subject: [PATCH] build: add packagekit_backend option
---
.github/workflows/main.yml | 7 +++++++
meson_options.txt | 1 +
src/Application.vala | 4 ++++
src/Core/BackendAggregator.vala | 2 ++
src/Core/Package.vala | 21 +++++++++++++--------
src/Core/UpdateManager.vala | 6 ++++++
src/Views/Homepage.vala | 4 ++++
src/meson.build | 10 ++++++++--
8 files changed, 45 insertions(+), 10 deletions(-)
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index daf13654..5dc5a2fb 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -42,6 +42,13 @@ jobs:
meson configure -Dcurated=false -Dpayments=false -Dsharing=false -Dname=Pop\!_Shop build
ninja -C build install
+ - name: Build (NixOS)
+ env:
+ DESTDIR: out
+ run: |
+ meson configure -Dcurated=false -Dpayments=false -Dpackagekit_backend=false build
+ ninja -C build install
+
lint:
runs-on: ubuntu-latest
diff --git a/meson_options.txt b/meson_options.txt
index 0ae93d07..37a6cd8a 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -4,3 +4,4 @@ option('name', type : 'string', value : 'AppCenter', description : 'The name of
option('payments', type : 'boolean', value : true, description : 'Enable payment features and display paid apps')
option('sharing', type : 'boolean', value : true, description : 'Display sharing features, i.e. copyable URLs to appcenter.elementary.io')
option('hide_upstream_distro_apps', type : 'boolean', value : true, description : 'Used for hiding Ubuntu repo apps on elementary OS')
+option('packagekit_backend', type : 'boolean', value : true, description : 'Enable PackageKit backend')
diff --git a/src/Application.vala b/src/Application.vala
index 65fae5aa..7c075076 100644
--- a/src/Application.vala
+++ b/src/Application.vala
@@ -167,9 +167,11 @@ public class AppCenter.App : Gtk.Application {
var client = AppCenterCore.Client.get_default ();
+#if PACKAGEKIT_BACKEND
if (fake_update_packages != null) {
AppCenterCore.PackageKitBackend.get_default ().fake_packages = fake_update_packages;
}
+#endif
if (silent) {
NetworkMonitor.get_default ().network_changed.connect ((available) => {
@@ -183,6 +185,7 @@ public class AppCenter.App : Gtk.Application {
return;
}
+#if PACKAGEKIT_BACKEND
if (local_path != null) {
var file = File.new_for_commandline_arg (local_path);
@@ -192,6 +195,7 @@ public class AppCenter.App : Gtk.Application {
warning ("Failed to load local AppStream XML file: %s", e.message);
}
}
+#endif
if (main_window == null) {
main_window = new MainWindow (this);
diff --git a/src/Core/BackendAggregator.vala b/src/Core/BackendAggregator.vala
index 539dba98..feb1eaa9 100644
--- a/src/Core/BackendAggregator.vala
+++ b/src/Core/BackendAggregator.vala
@@ -26,8 +26,10 @@ public class AppCenterCore.BackendAggregator : Backend, Object {
construct {
backends = new Gee.ArrayList<unowned Backend> ();
+#if PACKAGEKIT_BACKEND
backends.add (PackageKitBackend.get_default ());
backends.add (UbuntuDriversBackend.get_default ());
+#endif
backends.add (FlatpakBackend.get_default ());
unowned Gtk.Application app = (Gtk.Application) GLib.Application.get_default ();
diff --git a/src/Core/Package.vala b/src/Core/Package.vala
index d6f12f15..8dbd7a22 100644
--- a/src/Core/Package.vala
+++ b/src/Core/Package.vala
@@ -328,7 +328,14 @@ public class AppCenterCore.Package : Object {
public string origin_description {
owned get {
unowned string origin = component.get_origin ();
- if (backend is PackageKitBackend) {
+ if (backend is FlatpakBackend) {
+ var fp_package = this as FlatpakPackage;
+ if (fp_package != null && fp_package.installation == FlatpakBackend.system_installation) {
+ return _("%s (system-wide)").printf (origin);
+ }
+ return origin;
+#if PACKAGEKIT_BACKEND
+ } else if (backend is PackageKitBackend) {
if (origin == APPCENTER_PACKAGE_ORIGIN) {
return _("AppCenter");
} else if (origin == ELEMENTARY_STABLE_PACKAGE_ORIGIN) {
@@ -336,15 +343,9 @@ public class AppCenterCore.Package : Object {
} else if (origin.has_prefix ("ubuntu-")) {
return _("Ubuntu (non-curated)");
}
- } else if (backend is FlatpakBackend) {
- var fp_package = this as FlatpakPackage;
- if (fp_package != null && fp_package.installation == FlatpakBackend.system_installation) {
- return _("%s (system-wide)").printf (origin);
- }
-
- return origin;
} else if (backend is UbuntuDriversBackend) {
return _("Ubuntu Drivers");
+#endif
}
return _("Unknown Origin (non-curated)");
@@ -434,11 +435,15 @@ public class AppCenterCore.Package : Object {
_author_title = null;
backend_details = null;
+#if PACKAGEKIT_BACKEND
// The version on a PackageKit package comes from the package not AppStream, so only reset the version
// on other backends
if (!(backend is PackageKitBackend)) {
_latest_version = null;
}
+#else
+ _latest_version = null;
+#endif
this.component = component;
}
diff --git a/src/Core/UpdateManager.vala b/src/Core/UpdateManager.vala
index 9deceaf5..c92c0d37 100644
--- a/src/Core/UpdateManager.vala
+++ b/src/Core/UpdateManager.vala
@@ -52,6 +52,7 @@ public class AppCenterCore.UpdateManager : Object {
installed_package.update_state ();
}
+#if PACKAGEKIT_BACKEND
Pk.Results pk_updates;
unowned PackageKitBackend client = PackageKitBackend.get_default ();
try {
@@ -60,10 +61,12 @@ public class AppCenterCore.UpdateManager : Object {
warning ("Unable to get updates from PackageKit backend: %s", e.message);
return 0;
}
+#endif
uint os_count = 0;
string os_desc = "";
+#if PACKAGEKIT_BACKEND
var package_array = pk_updates.get_package_array ();
debug ("PackageKit backend reports %d updates", package_array.length);
@@ -87,6 +90,7 @@ public class AppCenterCore.UpdateManager : Object {
);
}
});
+#endif
os_updates.component.set_pkgnames ({});
os_updates.change_information.clear_update_info ();
@@ -159,6 +163,7 @@ public class AppCenterCore.UpdateManager : Object {
count += 1;
}
+#if PACKAGEKIT_BACKEND
pk_updates.get_details_array ().foreach ((pk_detail) => {
var pk_package = new Pk.Package ();
try {
@@ -181,6 +186,7 @@ public class AppCenterCore.UpdateManager : Object {
critical (e.message);
}
});
+#endif
os_updates.update_state ();
return count;
diff --git a/src/Views/Homepage.vala b/src/Views/Homepage.vala
index 3673903f..2e128e77 100644
--- a/src/Views/Homepage.vala
+++ b/src/Views/Homepage.vala
@@ -107,9 +107,13 @@ public class AppCenter.Homepage : AbstractView {
column_spacing = 24,
orientation = Gtk.Orientation.VERTICAL
};
+#if PACKAGEKIT_BACKEND
grid.add (banner_revealer);
grid.add (recently_updated_revealer);
grid.add (categories_label);
+#else
+ category_flow.margin_top = 12;
+#endif
grid.add (category_flow);
scrolled_window = new Gtk.ScrolledWindow (null, null) {
diff --git a/src/meson.build b/src/meson.build
index 7b319fc6..d1d77931 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -12,10 +12,8 @@ appcenter_files = files(
'Core/FlatpakBackend.vala',
'Core/Job.vala',
'Core/Package.vala',
- 'Core/PackageKitBackend.vala',
'Core/ScreenshotCache.vala',
'Core/Task.vala',
- 'Core/UbuntuDriversBackend.vala',
'Core/UpdateManager.vala',
'Dialogs/InstallFailDialog.vala',
'Dialogs/NonCuratedWarningDialog.vala',
@@ -76,6 +74,14 @@ if get_option('hide_upstream_distro_apps')
args += '--define=HIDE_UPSTREAM_DISTRO_APPS'
endif
+if get_option('packagekit_backend')
+ args += '--define=PACKAGEKIT_BACKEND'
+ appcenter_files += files(
+ 'Core/PackageKitBackend.vala',
+ 'Core/UbuntuDriversBackend.vala',
+ )
+endif
+
executable(
meson.project_name(),
appcenter_files,

View File

@@ -30,20 +30,21 @@
stdenv.mkDerivation rec {
pname = "appcenter";
version = "3.9.0";
version = "3.9.1";
src = fetchFromGitHub {
owner = "elementary";
repo = pname;
rev = version;
sha256 = "sha256-+r19n42FPoBArZNDF4ZAdUBZqsSxpLwpeBoyaRJBCrg=";
sha256 = "sha256-xktIHQHmz5gh72NEz9UQ9fMvBlj1BihWxHgxsHmTIB0=";
};
passthru = {
updateScript = nix-update-script {
attrPath = "pantheon.${pname}";
};
};
patches = [
# Introduces a packagekit_backend meson flag.
# Makes appcenter actually work by using only the flatpak backend.
# https://github.com/elementary/appcenter/pull/1739
./add-packagekit-backend-option.patch
];
nativeBuildInputs = [
appstream-glib
@@ -78,6 +79,8 @@ stdenv.mkDerivation rec {
mesonFlags = [
"-Dpayments=false"
"-Dcurated=false"
# This option is introduced in add-packagekit-backend-option.patch
"-Dpackagekit_backend=false"
];
postPatch = ''
@@ -85,6 +88,12 @@ stdenv.mkDerivation rec {
patchShebangs meson/post_install.py
'';
passthru = {
updateScript = nix-update-script {
attrPath = "pantheon.${pname}";
};
};
meta = with lib; {
homepage = "https://github.com/elementary/appcenter";
description = "An open, pay-what-you-want app store for indie developers, designed for elementary OS";

View File

@@ -21,21 +21,13 @@
stdenv.mkDerivation rec {
pname = "elementary-calculator";
version = "1.7.1";
repoName = "calculator";
version = "1.7.2";
src = fetchFromGitHub {
owner = "elementary";
repo = repoName;
repo = "calculator";
rev = version;
sha256 = "sha256-GoQFWhEhUBVLYL1vsIIBMT8pKc0dK/ploiGfUtJAJQU=";
};
passthru = {
updateScript = nix-update-script {
attrPath = "pantheon.${pname}";
};
sha256 = "sha256-U0wXrw9ZJwkqZAtTTHmTzqYhwF9V2JZEZZdDak3kPIc=";
};
nativeBuildInputs = [
@@ -63,6 +55,12 @@ stdenv.mkDerivation rec {
patchShebangs meson/post_install.py
'';
passthru = {
updateScript = nix-update-script {
attrPath = "pantheon.${pname}";
};
};
meta = with lib; {
homepage = "https://github.com/elementary/calculator";
description = "Calculator app designed for elementary OS";

View File

@@ -25,15 +25,13 @@
stdenv.mkDerivation rec {
pname = "elementary-camera";
version = "6.0.2";
repoName = "camera";
version = "6.0.3";
src = fetchFromGitHub {
owner = "elementary";
repo = repoName;
repo = "camera";
rev = version;
sha256 = "sha256-uVeV+LKA/W7WVUAvVWaSNRzeh1MUrhRjvS0HuhZZJ04=";
sha256 = "sha256-xIv+mOlZV58XD0Z6Vc2wA1EQUxT5BaQ0zhYc9v+ne1w=";
};
nativeBuildInputs = [

View File

@@ -28,17 +28,15 @@
stdenv.mkDerivation rec {
pname = "elementary-dock";
version = "unstable-2021-11-08";
version = "unstable-2021-12-08";
outputs = [ "out" "dev" ];
repoName = "dock";
src = fetchFromGitHub {
owner = "elementary";
repo = repoName;
rev = "51e8d3ddfbed0dfce3158d80f997ab183e92567b";
sha256 = "sha256-w6HGxEAXNod/uMEEfSz9nRNTRrCbcEqJCP9EFkVbX1U=";
repo = "dock";
rev = "5e4b5ba2eec3b522e107ad834a59c0f1271d4699";
sha256 = "sha256-/Ul21t9VFxhmlQbfx4eY86UKU33hiRfXF9OPHBzPe5o=";
};
nativeBuildInputs = [

View File

@@ -32,23 +32,15 @@
stdenv.mkDerivation rec {
pname = "elementary-files";
version = "6.1.0";
repoName = "files";
version = "6.1.1";
outputs = [ "out" "dev" ];
src = fetchFromGitHub {
owner = "elementary";
repo = repoName;
repo = "files";
rev = version;
sha256 = "sha256-aGiFEeSvDV5rPD2Ll/BuDoWclEPhR1UuoCxUSS9CGmw=";
};
passthru = {
updateScript = nix-update-script {
attrPath = "pantheon.${pname}";
};
sha256 = "sha256-5TSzV8MQG81aCCR8yiCPhKJaLrp/fwf4mjP32KkcbbY=";
};
nativeBuildInputs = [
@@ -88,6 +80,12 @@ stdenv.mkDerivation rec {
patchShebangs meson/post_install.py
'';
passthru = {
updateScript = nix-update-script {
attrPath = "pantheon.${pname}";
};
};
meta = with lib; {
description = "File browser designed for elementary OS";
homepage = "https://github.com/elementary/files";

View File

@@ -25,21 +25,13 @@
stdenv.mkDerivation rec {
pname = "elementary-mail";
version = "6.3.0";
repoName = "mail";
version = "6.3.1";
src = fetchFromGitHub {
owner = "elementary";
repo = repoName;
repo = "mail";
rev = version;
sha256 = "sha256-lIVAMTtRrzJI5Qcd6y24ZmtzFWeTSbcKiEhG8hLC+PM=";
};
passthru = {
updateScript = nix-update-script {
attrPath = "pantheon.${pname}";
};
sha256 = "sha256-wOu9jvvwG53vzcNa38nk4eREZWW7Cin8el4qApQ8gI8=";
};
nativeBuildInputs = [
@@ -72,6 +64,12 @@ stdenv.mkDerivation rec {
patchShebangs meson/post_install.py
'';
passthru = {
updateScript = nix-update-script {
attrPath = "pantheon.${pname}";
};
};
meta = with lib; {
description = "Mail app designed for elementary OS";
homepage = "https://github.com/elementary/mail";

View File

@@ -19,21 +19,13 @@
stdenv.mkDerivation rec {
pname = "elementary-screenshot";
version = "6.0.1";
repoName = "screenshot";
version = "6.0.2";
src = fetchFromGitHub {
owner = "elementary";
repo = repoName;
repo = "screenshot";
rev = version;
sha256 = "sha256-MDmk+0IUCe6PSV5QOjjDRedv7X3lcBJ04jn9cE9DP3M=";
};
passthru = {
updateScript = nix-update-script {
attrPath = "pantheon.${pname}";
};
sha256 = "sha256-n+L08C/W5YnHZ5P3F1NGUYE2SH94sc4+kr1x+wXZ+cw=";
};
nativeBuildInputs = [
@@ -60,6 +52,12 @@ stdenv.mkDerivation rec {
patchShebangs meson/post_install.py
'';
passthru = {
updateScript = nix-update-script {
attrPath = "pantheon.${pname}";
};
};
meta = with lib; {
description = "Screenshot tool designed for elementary OS";
homepage = "https://github.com/elementary/screenshot";

View File

@@ -26,21 +26,13 @@
stdenv.mkDerivation rec {
pname = "elementary-tasks";
version = "6.0.4";
repoName = "tasks";
version = "6.1.0";
src = fetchFromGitHub {
owner = "elementary";
repo = repoName;
repo = "tasks";
rev = version;
sha256 = "1gb51gm8qgd8yzhqb7v69p2f1fgm3qf534if4lc85jrjsb8hgmhl";
};
passthru = {
updateScript = nix-update-script {
attrPath = "pantheon.${pname}";
};
sha256 = "sha256-Gt9Hp9m28QdAFnKIT1xcbiSM5cn6kW7wEXmi/iFfu8k=";
};
nativeBuildInputs = [
@@ -74,6 +66,12 @@ stdenv.mkDerivation rec {
patchShebangs meson/post_install.py
'';
passthru = {
updateScript = nix-update-script {
attrPath = "pantheon.${pname}";
};
};
meta = with lib; {
homepage = "https://github.com/elementary/tasks";
description = "Synced tasks and reminders on elementary OS";

View File

@@ -2,7 +2,6 @@
, stdenv
, fetchFromGitHub
, nix-update-script
, fetchpatch
, pkg-config
, meson
, ninja
@@ -24,30 +23,13 @@
stdenv.mkDerivation rec {
pname = "elementary-terminal";
version = "6.0.0";
repoName = "terminal";
version = "6.0.1";
src = fetchFromGitHub {
owner = "elementary";
repo = repoName;
repo = "terminal";
rev = version;
sha256 = "08akr4sv4jy9kd4s26kib6j7i8hc3vs0sp71fifv7ww4mi9cm6jc";
};
patches = [
# Upstream code not respecting our localedir
# https://github.com/elementary/terminal/pull/611
(fetchpatch {
url = "https://github.com/elementary/terminal/commit/4f6f2d9f58642ed904240c247cc0a0846baecb6b.patch";
sha256 = "04pbd72migxw8i949v3bmw8kfi5nr02rjcwfrx3b6xkiic9825sv";
})
];
passthru = {
updateScript = nix-update-script {
attrPath = "pantheon.${pname}";
};
sha256 = "sha256-4q7YQ4LxuiM/TRae1cc3ncmw7QwE1soC2Sh+GZ+Gpq0=";
};
nativeBuildInputs = [
@@ -81,6 +63,12 @@ stdenv.mkDerivation rec {
patchShebangs meson/post_install.py
'';
passthru = {
updateScript = nix-update-script {
attrPath = "pantheon.${pname}";
};
};
meta = with lib; {
description = "Terminal emulator designed for elementary OS";
longDescription = ''

View File

@@ -21,15 +21,13 @@
stdenv.mkDerivation rec {
pname = "elementary-videos";
version = "2.8.0";
repoName = "videos";
version = "2.8.1";
src = fetchFromGitHub {
owner = "elementary";
repo = repoName;
repo = "videos";
rev = version;
sha256 = "sha256-FFCtQ42LygfjowehwZcISWTfv8PBZTH0X8mPrpiG8Ug=";
sha256 = "sha256-Ki6i9u+oXOBTH+dVJ9RgBxszD7Wvdrfahd9abyjFYJY=";
};
nativeBuildInputs = [

View File

@@ -18,13 +18,13 @@
stdenv.mkDerivation rec {
pname = "switchboard-plug-onlineaccounts";
version = "6.2.2";
version = "6.3.0";
src = fetchFromGitHub {
owner = "elementary";
repo = pname;
rev = version;
sha256 = "sha256-L1SL8YbsYKdE+mvRW/fxjNoiyXRXTyV2ru7/tZzgTfM=";
sha256 = "sha256-aRh2zbKqcGOH4Qw5gdJw07hod8a/QGWUcJo/2R9erQs=";
};
nativeBuildInputs = [

View File

@@ -2,30 +2,35 @@
, stdenv
, fetchFromGitHub
, nix-update-script
, gettext
, meson
, ninja
, gettext
, python3
}:
stdenv.mkDerivation rec {
pname = "elementary-wallpapers";
version = "6.0.0";
repoName = "wallpapers";
version = "6.1.0";
src = fetchFromGitHub {
owner = "elementary";
repo = repoName;
repo = "wallpapers";
rev = version;
sha256 = "1qpf8w7x9sp3sd4zpsrlj5ywpwqkq4ywbagm4sf25cwwn82dl59b";
sha256 = "sha256-E/cUxa/GNt/01EjuuvurHxJu3qV9e+jcdcCi2+NxVDA=";
};
nativeBuildInputs = [
gettext
meson
ninja
python3
];
postPatch = ''
chmod +x meson/symlink.py
patchShebangs meson/symlink.py
'';
passthru = {
updateScript = nix-update-script {
attrPath = "pantheon.${pname}";

View File

@@ -4,23 +4,37 @@
lib.makeScope pkgs.newScope (self: with self; {
switchboardPlugs = [
switchboard-plug-a11y switchboard-plug-about
switchboard-plug-applications switchboard-plug-bluetooth
switchboard-plug-datetime switchboard-plug-display
switchboard-plug-keyboard switchboard-plug-mouse-touchpad
switchboard-plug-network switchboard-plug-notifications
switchboard-plug-onlineaccounts switchboard-plug-pantheon-shell
switchboard-plug-power switchboard-plug-printers
switchboard-plug-security-privacy switchboard-plug-sharing
switchboard-plug-sound switchboard-plug-wacom
switchboard-plug-a11y
switchboard-plug-about
switchboard-plug-applications
switchboard-plug-bluetooth
switchboard-plug-datetime
switchboard-plug-display
switchboard-plug-keyboard
switchboard-plug-mouse-touchpad
switchboard-plug-network
switchboard-plug-notifications
switchboard-plug-onlineaccounts
switchboard-plug-pantheon-shell
switchboard-plug-power
switchboard-plug-printers
switchboard-plug-security-privacy
switchboard-plug-sharing
switchboard-plug-sound
switchboard-plug-wacom
];
wingpanelIndicators = [
wingpanel-applications-menu wingpanel-indicator-a11y
wingpanel-indicator-bluetooth wingpanel-indicator-datetime
wingpanel-indicator-keyboard wingpanel-indicator-network
wingpanel-indicator-nightlight wingpanel-indicator-notifications
wingpanel-indicator-power wingpanel-indicator-session
wingpanel-applications-menu
wingpanel-indicator-a11y
wingpanel-indicator-bluetooth
wingpanel-indicator-datetime
wingpanel-indicator-keyboard
wingpanel-indicator-network
wingpanel-indicator-nightlight
wingpanel-indicator-notifications
wingpanel-indicator-power
wingpanel-indicator-session
wingpanel-indicator-sound
];
@@ -207,6 +221,13 @@ lib.makeScope pkgs.newScope (self: with self; {
elementary-wallpapers = callPackage ./artwork/elementary-wallpapers { };
### THIRD-PARTY
# Put packages that ONLY works with Pantheon in pkgs/desktops/pantheon/third-party,
# specifically third party switchboard plugins and wingpanel indicators.
# Please call these packages in pkgs/top-level/all-packages.nix instead of this file.
# https://github.com/NixOS/nixpkgs/issues/115222#issuecomment-906868654
} // lib.optionalAttrs (config.allowAliases or true) {
### ALIASES

View File

@@ -44,6 +44,12 @@ stdenv.mkDerivation rec {
url = "https://github.com/elementary/gala/commit/cc83db8fe398feae9f3e4caa8352b65f0c8c96d4.patch";
sha256 = "sha256-CPO3EHIzqHAV6ZLHngivCdsD8je8CK/NHznfxSEkhzc=";
})
# WindowSwitcher: Clear indicator background
# https://github.com/elementary/gala/pull/1318
(fetchpatch {
url = "https://github.com/elementary/gala/commit/cce53acffecba795b6cc48916d4621a47996d2c9.patch";
sha256 = "sha256-5aTZE6poo4sQMTLfk9Nhw4G4BW8i9dvpWktizRIS58Q=";
})
];
nativeBuildInputs = [

View File

@@ -26,15 +26,13 @@
stdenv.mkDerivation rec {
pname = "wingpanel-applications-menu";
version = "2.10.1";
repoName = "applications-menu";
version = "2.10.2";
src = fetchFromGitHub {
owner = "elementary";
repo = repoName;
repo = "applications-menu";
rev = version;
sha256 = "sha256-e9InWx5b2DAFK7m7z/oCW7Mw/ymBNz1Sc7vT65kkZ9o=";
sha256 = "sha256-xBuMJzIFOueSvNwvXc85AI9NHuMW3bOblNsyuDkIzyk=";
};
patches = [

View File

@@ -1,7 +1,6 @@
{ lib
, stdenv
, fetchFromGitHub
, fetchpatch
, nix-update-script
, substituteAll
, pkg-config
@@ -24,13 +23,13 @@
stdenv.mkDerivation rec {
pname = "wingpanel-indicator-datetime";
version = "2.3.1";
version = "2.4.0";
src = fetchFromGitHub {
owner = "elementary";
repo = pname;
rev = version;
sha256 = "sha256-/kbwZVzOlC3ATCuXVMdf2RIskoGQKG1evaDYO3yFerg=";
sha256 = "sha256-GxlnzLDrZmDDAGlUMoM4k4SkbCqra3Th6ugRAj3Wse4=";
};
patches = [
@@ -38,12 +37,6 @@ stdenv.mkDerivation rec {
src = ./fix-paths.patch;
elementary_calendar = elementary-calendar;
})
# Fix incorrect month shown on re-opening indicator if previously changed month
# https://github.com/elementary/wingpanel-indicator-datetime/pull/284
(fetchpatch {
url = "https://github.com/elementary/wingpanel-indicator-datetime/commit/9b0bed98e09dfdad62f43a95d956d2f53d824e65.patch";
sha256 = "sha256-MQfz4Uzo59SmmfQNi58OA7CIHHkm2TODQz2fmmIall4=";
})
];
nativeBuildInputs = [

View File

@@ -1,8 +1,21 @@
diff --git a/src/Indicator.vala b/src/Indicator.vala
index 4aba03c..6385bc9 100644
--- a/src/Indicator.vala
+++ b/src/Indicator.vala
@@ -55,7 +55,7 @@ public class DateTime.Indicator : Wingpanel.Indicator {
panel_label.button_press_event.connect ((e) => {
if (e.button == Gdk.BUTTON_MIDDLE) {
- var command = "io.elementary.calendar --show-day %s".printf (new GLib.DateTime.now_local ().format ("%F"));
+ var command = "@elementary_calendar@/bin/io.elementary.calendar --show-day %s".printf (new GLib.DateTime.now_local ().format ("%F"));
try {
var appinfo = AppInfo.create_from_commandline (command, null, AppInfoCreateFlags.NONE);
appinfo.launch_uris (null, null);
diff --git a/src/Widgets/calendar/CalendarView.vala b/src/Widgets/calendar/CalendarView.vala
index 6e0d530a..2f90f96c 100644
index cb54253..7477d1a 100644
--- a/src/Widgets/calendar/CalendarView.vala
+++ b/src/Widgets/calendar/CalendarView.vala
@@ -222,7 +222,7 @@ public class DateTime.Widgets.CalendarView : Gtk.Grid {
@@ -242,7 +242,7 @@ public class DateTime.Widgets.CalendarView : Gtk.Grid {
// TODO: As far as maya supports it use the Dbus Activation feature to run the calendar-app.
public void show_date_in_maya (GLib.DateTime date) {

View File

@@ -16,13 +16,13 @@
stdenv.mkDerivation rec {
pname = "wingpanel-indicator-notifications";
version = "6.0.2";
version = "6.0.4";
src = fetchFromGitHub {
owner = "elementary";
repo = pname;
rev = version;
sha256 = "sha256-ZuOZlfxtRq8ZcrXGe9wlFGwn2isdvMoXQveKKnEPFdo=";
sha256 = "sha256-tIpR/WIhE0Mmt2EploNNDVlAX4OUNI3VnEflTLVkfSo=";
};
nativeBuildInputs = [

View File

@@ -22,19 +22,13 @@
stdenv.mkDerivation rec {
pname = "wingpanel";
version = "3.0.1";
version = "3.0.2";
src = fetchFromGitHub {
owner = "elementary";
repo = pname;
rev = version;
sha256 = "078yi36r452sc33mv2ck8z0icya1lhzhickllrlhc60rdri36sb8";
};
passthru = {
updateScript = nix-update-script {
attrPath = "pantheon.${pname}";
};
sha256 = "sha256-WvkQx+9YjKCINpyVg8KjCV0GAb0rJfblSFaO14/4oas=";
};
nativeBuildInputs = [
@@ -75,6 +69,12 @@ stdenv.mkDerivation rec {
)
'';
passthru = {
updateScript = nix-update-script {
attrPath = "pantheon.${pname}";
};
};
meta = with lib; {
description = "The extensible top panel for Pantheon";
longDescription = ''

View File

@@ -0,0 +1,58 @@
{ lib
, stdenv
, fetchFromGitHub
, substituteAll
, meson
, ninja
, pkg-config
, vala
, gtk3
, libindicator-gtk3
, pantheon
, indicator-application-gtk3
}:
stdenv.mkDerivation rec {
pname = "wingpanel-indicator-ayatana";
version = "unstable-2021-12-01";
src = fetchFromGitHub {
owner = "Lafydev";
repo = pname;
rev = "53dc05919cdba772c787620a4bee5821e38c53cd";
sha256 = "sha256-T0OHzqENyeAr0pvXUaRMwF1RpwKVyDAF5P5G9S28COU=";
};
patches = [
# Fixes install path for wingpanel indicator
# https://github.com/Lafydev/wingpanel-indicator-ayatana/pull/30
./fix-indicator-dir.patch
# Tells the indicator the path for libapplication.so
(substituteAll {
src = ./fix-libapplication-dir.patch;
indicator_application = indicator-application-gtk3;
})
];
nativeBuildInputs = [
meson
ninja
pkg-config
vala
];
buildInputs = [
gtk3
libindicator-gtk3
pantheon.granite
pantheon.wingpanel
];
meta = with lib; {
description = "Ayatana Compatibility Indicator for Wingpanel";
homepage = "https://github.com/Lafydev/wingpanel-indicator-ayatana";
license = licenses.lgpl21Plus;
platforms = platforms.linux;
maintainers = teams.pantheon.members;
};
}

View File

@@ -0,0 +1,16 @@
diff --git a/meson.build b/meson.build
index 4aeab2b..dc44e6c 100644
--- a/meson.build
+++ b/meson.build
@@ -25,8 +25,10 @@ dependencies = {
'wingpanel': wingpanel
}
+libdir = join_paths(get_option('prefix'), get_option('libdir'))
+
indicator_name = 'ayatana'
-indicator_dir = dependencies['wingpanel'].get_pkgconfig_variable('indicatorsdir')
+indicator_dir = dependencies['wingpanel'].get_pkgconfig_variable('indicatorsdir', define_variable: ['libdir', libdir])
# ----------------------------------------------------------------------------------------------------------------------
# Bindings:

View File

@@ -0,0 +1,13 @@
diff --git a/src/IndicatorFactory.vala b/src/IndicatorFactory.vala
index 9411de0..632d83b 100644
--- a/src/IndicatorFactory.vala
+++ b/src/IndicatorFactory.vala
@@ -24,7 +24,7 @@ public class AyatanaCompatibility.IndicatorFactory : Object, IndicatorLoader {
public Gee.Collection<IndicatorIface> get_indicators () {
if (indicators == null) {
indicators = new Gee.LinkedList<IndicatorIface> ();
- load_indicator (File.new_for_path (Constants.AYATANA_INDICATOR_DIR), "libapplication.so");
+ load_indicator (File.new_for_path ("@indicator_application@/lib/indicators3/7/"), "libapplication.so");
}
return indicators.read_only_view;

View File

@@ -8385,7 +8385,7 @@ with pkgs;
pamtester = callPackage ../tools/security/pamtester { };
pantheon-tweaks = callPackage ../applications/system/pantheon-tweaks { };
pantheon-tweaks = callPackage ../desktops/pantheon/third-party/pantheon-tweaks { };
paperless-ng = callPackage ../applications/office/paperless-ng { };
@@ -10848,6 +10848,8 @@ with pkgs;
chase = callPackage ../tools/system/chase { };
wingpanel-indicator-ayatana = callPackage ../desktops/pantheon/third-party/wingpanel-indicator-ayatana { };
wimlib = callPackage ../tools/archivers/wimlib { };
wipe = callPackage ../tools/security/wipe { };