From 0703985bef52771c9381520832476e147e4006bb Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Tue, 13 Oct 2020 22:57:48 +0200 Subject: [PATCH] =?UTF-8?q?gnomeExtensions.gsconnect:=2041=20=E2=86=92=204?= =?UTF-8?q?3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/andyholmes/gnome-shell-extension-gsconnect/releases/tag/v42 https://github.com/andyholmes/gnome-shell-extension-gsconnect/releases/tag/v43 - Added installed tests. - Corrected license. --- nixos/tests/installed-tests/default.nix | 1 + nixos/tests/installed-tests/gsconnect.nix | 7 +++ .../gnome-3/extensions/gsconnect/default.nix | 58 ++++++++++++++++--- .../gsconnect/installed-tests-path.patch | 30 ++++++++++ 4 files changed, 89 insertions(+), 7 deletions(-) create mode 100644 nixos/tests/installed-tests/gsconnect.nix create mode 100644 pkgs/desktops/gnome-3/extensions/gsconnect/installed-tests-path.patch diff --git a/nixos/tests/installed-tests/default.nix b/nixos/tests/installed-tests/default.nix index 50ca8ad2b50..e5d7009bb7b 100644 --- a/nixos/tests/installed-tests/default.nix +++ b/nixos/tests/installed-tests/default.nix @@ -94,6 +94,7 @@ in glib-networking = callInstalledTest ./glib-networking.nix {}; gnome-photos = callInstalledTest ./gnome-photos.nix {}; graphene = callInstalledTest ./graphene.nix {}; + gsconnect = callInstalledTest ./gsconnect.nix {}; ibus = callInstalledTest ./ibus.nix {}; libgdata = callInstalledTest ./libgdata.nix {}; glib-testing = callInstalledTest ./glib-testing.nix {}; diff --git a/nixos/tests/installed-tests/gsconnect.nix b/nixos/tests/installed-tests/gsconnect.nix new file mode 100644 index 00000000000..ac39f743578 --- /dev/null +++ b/nixos/tests/installed-tests/gsconnect.nix @@ -0,0 +1,7 @@ +{ pkgs, makeInstalledTest, ... }: + +makeInstalledTest { + tested = pkgs.gnomeExtensions.gsconnect; + + withX11 = true; +} diff --git a/pkgs/desktops/gnome-3/extensions/gsconnect/default.nix b/pkgs/desktops/gnome-3/extensions/gsconnect/default.nix index 98827fd3f6a..e2159e2e386 100644 --- a/pkgs/desktops/gnome-3/extensions/gsconnect/default.nix +++ b/pkgs/desktops/gnome-3/extensions/gsconnect/default.nix @@ -1,16 +1,41 @@ -{ stdenv, fetchFromGitHub, substituteAll, python3, openssl, gsound -, meson, ninja, libxml2, pkgconfig, gobject-introspection, wrapGAppsHook -, glib, gtk3, at-spi2-core, upower, openssh, gnome3, gjs }: +{ stdenv +, fetchFromGitHub +, substituteAll +, python3 +, openssl +, gsound +, meson +, ninja +, libxml2 +, pkgconfig +, gobject-introspection +, wrapGAppsHook +, glib +, gtk3 +, at-spi2-core +, upower +, openssh +, gnome3 +, gjs +, nixosTests +, atk +, harfbuzz +, pango +, gdk-pixbuf +, gsettings-desktop-schemas +}: stdenv.mkDerivation rec { pname = "gnome-shell-gsconnect"; - version = "41"; + version = "43"; + + outputs = [ "out" "installedTests" ]; src = fetchFromGitHub { owner = "andyholmes"; repo = "gnome-shell-extension-gsconnect"; rev = "v${version}"; - sha256 = "0lcj7k16jki54bsyh01j4ss4hhfddnahcw02zlmlkl637qdv1b5j"; + sha256 = "0hm14hg4nhv9hrmjcf9dgm7dsvzpjfifihjmb6yc78y9yjw0i3v7"; }; patches = [ @@ -19,6 +44,9 @@ stdenv.mkDerivation rec { src = ./fix-paths.patch; gapplication = "${glib.bin}/bin/gapplication"; }) + + # Allow installing installed tests to a separate output + ./installed-tests-path.patch ]; nativeBuildInputs = [ @@ -51,11 +79,13 @@ stdenv.mkDerivation rec { "-Dsshkeygen_path=${openssh}/bin/ssh-keygen" "-Dsession_bus_services_dir=${placeholder "out"}/share/dbus-1/services" "-Dpost_install=true" + "-Dinstalled_test_prefix=${placeholder ''installedTests''}" ]; postPatch = '' patchShebangs meson/nmh.sh patchShebangs meson/post-install.sh + patchShebangs installed-tests/prepare-tests.sh # TODO: do not include every typelib everywhere # for example, we definitely do not need nautilus @@ -65,20 +95,34 @@ stdenv.mkDerivation rec { done ''; - postFixup = '' + postFixup = let + testDeps = [ + gtk3 harfbuzz atk pango.out gdk-pixbuf + ]; + in '' # Let’s 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 + + wrapProgram "$installedTests/libexec/installed-tests/gsconnect/minijasmine" \ + --prefix XDG_DATA_DIRS : "${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name}" \ + --prefix GI_TYPELIB_PATH : "${stdenv.lib.makeSearchPath "lib/girepository-1.0" testDeps}" ''; uuid = "gsconnect@andyholmes.github.io"; + passthru = { + tests = { + installedTests = nixosTests.installed-tests.gsconnect; + }; + }; + meta = with stdenv.lib; { description = "KDE Connect implementation for Gnome Shell"; homepage = "https://github.com/andyholmes/gnome-shell-extension-gsconnect/wiki"; - license = licenses.gpl2; + license = licenses.gpl2Plus; maintainers = with maintainers; [ etu ]; platforms = platforms.linux; }; diff --git a/pkgs/desktops/gnome-3/extensions/gsconnect/installed-tests-path.patch b/pkgs/desktops/gnome-3/extensions/gsconnect/installed-tests-path.patch new file mode 100644 index 00000000000..78e1ad96d74 --- /dev/null +++ b/pkgs/desktops/gnome-3/extensions/gsconnect/installed-tests-path.patch @@ -0,0 +1,30 @@ +diff --git a/installed-tests/meson.build b/installed-tests/meson.build +index c7eff2fb..ef4f6052 100644 +--- a/installed-tests/meson.build ++++ b/installed-tests/meson.build +@@ -1,5 +1,5 @@ +-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 8912e052..ca6ee5eb 100644 +--- a/meson_options.txt ++++ b/meson_options.txt +@@ -116,6 +116,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',