push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,128 @@
{
stdenv,
lib,
fetchFromGitHub,
replaceVars,
openssl,
gsound,
meson,
ninja,
pkg-config,
gobject-introspection,
wrapGAppsHook3,
glib,
glib-networking,
gtk3,
openssh,
gnome-shell,
evolution-data-server-gtk4,
gjs,
nixosTests,
desktop-file-utils,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "gnome-shell-extension-gsconnect";
version = "66";
outputs = [
"out"
"installedTests"
];
src = fetchFromGitHub {
owner = "GSConnect";
repo = "gnome-shell-extension-gsconnect";
rev = "v${finalAttrs.version}";
hash = "sha256-QPvdSmt4aUkPvaOUonovrCxW4pxrgoopXGi3KSukVD8=";
};
patches = [
# Make typelibs available in the extension
(replaceVars ./fix-paths.patch {
gapplication = "${glib.bin}/bin/gapplication";
# Replaced in postPatch
typelibPath = null;
})
# Allow installing installed tests to a separate output
./installed-tests-path.patch
];
nativeBuildInputs = [
meson
ninja
pkg-config
gobject-introspection # for locating typelibs
wrapGAppsHook3 # for wrapping daemons
desktop-file-utils # update-desktop-database
];
buildInputs = [
glib # libgobject
glib-networking
gtk3
gsound
gjs # for running daemon
evolution-data-server-gtk4 # for libebook-contacts typelib
];
mesonFlags = [
"-Dgnome_shell_libdir=${gnome-shell}/lib"
"-Dchrome_nmhdir=${placeholder "out"}/etc/opt/chrome/native-messaging-hosts"
"-Dchromium_nmhdir=${placeholder "out"}/etc/chromium/native-messaging-hosts"
"-Dopenssl_path=${openssl}/bin/openssl"
"-Dsshadd_path=${openssh}/bin/ssh-add"
"-Dsshkeygen_path=${openssh}/bin/ssh-keygen"
"-Dsession_bus_services_dir=${placeholder "out"}/share/dbus-1/services"
"-Dinstalled_test_prefix=${placeholder "installedTests"}"
];
postPatch = ''
patchShebangs installed-tests/prepare-tests.sh
# TODO: do not include every typelib everywhere
# for example, we definitely do not need nautilus
substituteInPlace src/__nix-prepend-search-paths.js \
--subst-var-by typelibPath "$GI_TYPELIB_PATH"
# slightly janky fix for gsettings_schemadir being removed
substituteInPlace data/config.js.in \
--subst-var-by GSETTINGS_SCHEMA_DIR \
${glib.makeSchemaPath (placeholder "out") "${finalAttrs.pname}-${finalAttrs.version}"}
'';
postFixup = ''
# Lets wrap the daemons
for file in $out/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/{daemon,nativeMessagingHost}.js; do
echo "Wrapping program $file"
wrapGApp "$file"
done
# Wrap jasmine runner for tests
for file in $installedTests/libexec/installed-tests/gsconnect/minijasmine; do
echo "Wrapping program $file"
wrapGApp "$file"
done
'';
passthru = {
extensionUuid = "gsconnect@andyholmes.github.io";
extensionPortalSlug = "gsconnect";
};
passthru = {
tests = {
installedTests = nixosTests.installed-tests.gsconnect;
};
};
meta = {
description = "KDE Connect implementation for Gnome Shell";
homepage = "https://github.com/GSConnect/gnome-shell-extension-gsconnect/wiki";
license = lib.licenses.gpl2Plus;
maintainers = with lib.maintainers; [ doronbehar ];
teams = [ lib.teams.gnome ];
platforms = lib.platforms.linux;
};
})

View File

@@ -0,0 +1,60 @@
diff --git a/data/org.gnome.Shell.Extensions.GSConnect.desktop.in b/data/org.gnome.Shell.Extensions.GSConnect.desktop.in
index 3fb887c3..e8cbe1bd 100644
--- a/data/org.gnome.Shell.Extensions.GSConnect.desktop.in
+++ b/data/org.gnome.Shell.Extensions.GSConnect.desktop.in
@@ -5,7 +5,7 @@
[Desktop Entry]
Type=Application
Name=GSConnect
-Exec=gapplication launch org.gnome.Shell.Extensions.GSConnect %U
+Exec=@gapplication@ launch org.gnome.Shell.Extensions.GSConnect %U
Terminal=false
NoDisplay=true
Icon=org.gnome.Shell.Extensions.GSConnect
diff --git a/src/__nix-prepend-search-paths.js b/src/__nix-prepend-search-paths.js
new file mode 100644
index 00000000..d009dfd9
--- /dev/null
+++ b/src/__nix-prepend-search-paths.js
@@ -0,0 +1,2 @@
+import GIRepository from 'gi://GIRepository';
+'@typelibPath@'.split(':').forEach(path => GIRepository.Repository.prepend_search_path(path));
diff --git a/src/extension.js b/src/extension.js
index 53ecd5fc..78782357 100644
--- a/src/extension.js
+++ b/src/extension.js
@@ -2,6 +2,8 @@
//
// SPDX-License-Identifier: GPL-2.0-or-later
+import './__nix-prepend-search-paths.js';
+
import Gio from 'gi://Gio';
import GObject from 'gi://GObject';
diff --git i/src/gsconnect-preferences w/src/gsconnect-preferences
index b16ddc7d..263dfb04 100755
--- a/src/gsconnect-preferences
+++ b/src/gsconnect-preferences
@@ -6,6 +6,8 @@
// -*- mode: js; -*-
+import './__nix-prepend-search-paths.js';
+
import Gdk from 'gi://Gdk?version=3.0';
import 'gi://GdkPixbuf?version=2.0';
import Gio from 'gi://Gio?version=2.0';
diff --git a/src/prefs.js b/src/prefs.js
index dd20fd20..5f82c53a 100644
--- a/src/prefs.js
+++ b/src/prefs.js
@@ -2,6 +2,8 @@
//
// SPDX-License-Identifier: GPL-2.0-or-later
+import './__nix-prepend-search-paths.js';
+
import Gio from 'gi://Gio';
import GLib from 'gi://GLib';
import Adw from 'gi://Adw';

View File

@@ -0,0 +1,33 @@
diff --git a/installed-tests/meson.build b/installed-tests/meson.build
index 5bc38bfd..02404c3a 100644
--- a/installed-tests/meson.build
+++ b/installed-tests/meson.build
@@ -2,8 +2,8 @@
#
# SPDX-License-Identifier: GPL-2.0-or-later
-installed_tests_execdir = join_paths(libexecdir, 'installed-tests', meson.project_name())
-installed_tests_metadir = join_paths(datadir, 'installed-tests', meson.project_name())
+installed_tests_execdir = join_paths(get_option('installed_test_prefix'), 'libexec', 'installed-tests', meson.project_name())
+installed_tests_metadir = join_paths(get_option('installed_test_prefix'), 'share', 'installed-tests', meson.project_name())
installed_tests_srcdir = meson.current_source_dir()
installed_tests_builddir = meson.current_build_dir()
diff --git a/meson_options.txt b/meson_options.txt
index 745c541c..b4b602ca 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -104,6 +104,13 @@ option(
description: 'Native Messaging Host directory for Mozilla'
)
+option(
+ 'installed_test_prefix',
+ type: 'string',
+ value: '',
+ description: 'Prefix for installed tests'
+)
+
option(
'installed_tests',
type: 'boolean',