2022-10-21 18:38:19 +00:00
|
|
|
|
{ stdenv
|
|
|
|
|
, lib
|
2020-11-12 09:05:59 +00:00
|
|
|
|
, fetchFromGitHub
|
2022-10-21 18:38:19 +00:00
|
|
|
|
, fetchpatch
|
2020-11-12 09:05:59 +00:00
|
|
|
|
, substituteAll
|
|
|
|
|
, openssl
|
|
|
|
|
, gsound
|
|
|
|
|
, meson
|
|
|
|
|
, ninja
|
|
|
|
|
, pkg-config
|
|
|
|
|
, gobject-introspection
|
|
|
|
|
, wrapGAppsHook
|
|
|
|
|
, glib
|
2020-12-03 08:41:04 +00:00
|
|
|
|
, glib-networking
|
2020-11-12 09:05:59 +00:00
|
|
|
|
, gtk3
|
|
|
|
|
, openssh
|
2021-05-20 23:08:51 +00:00
|
|
|
|
, gnome
|
2022-10-21 18:38:19 +00:00
|
|
|
|
, evolution-data-server-gtk4
|
2020-11-12 09:05:59 +00:00
|
|
|
|
, gjs
|
|
|
|
|
, nixosTests
|
2022-10-21 18:38:19 +00:00
|
|
|
|
, desktop-file-utils
|
2020-11-12 09:05:59 +00:00
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-05-28 09:39:13 +00:00
|
|
|
|
pname = "gnome-shell-extension-gsconnect";
|
2023-04-29 16:46:19 +00:00
|
|
|
|
version = "55";
|
2020-11-12 09:05:59 +00:00
|
|
|
|
|
|
|
|
|
outputs = [ "out" "installedTests" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2022-03-30 09:31:56 +00:00
|
|
|
|
owner = "GSConnect";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
repo = "gnome-shell-extension-gsconnect";
|
|
|
|
|
rev = "v${version}";
|
2023-04-29 16:46:19 +00:00
|
|
|
|
hash = "sha256-n6NbNgl+2FOhly/BeR7I6BvPOYe7leAdeAegaqhcGJU=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
|
# Make typelibs available in the extension
|
|
|
|
|
(substituteAll {
|
|
|
|
|
src = ./fix-paths.patch;
|
|
|
|
|
gapplication = "${glib.bin}/bin/gapplication";
|
|
|
|
|
})
|
2020-11-12 09:05:59 +00:00
|
|
|
|
|
|
|
|
|
# Allow installing installed tests to a separate output
|
|
|
|
|
./installed-tests-path.patch
|
2020-04-24 23:36:52 +00:00
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2020-11-12 09:05:59 +00:00
|
|
|
|
meson
|
|
|
|
|
ninja
|
|
|
|
|
pkg-config
|
2020-04-24 23:36:52 +00:00
|
|
|
|
gobject-introspection # for locating typelibs
|
|
|
|
|
wrapGAppsHook # for wrapping daemons
|
2022-10-21 18:38:19 +00:00
|
|
|
|
desktop-file-utils # update-desktop-database
|
2020-04-24 23:36:52 +00:00
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
|
glib # libgobject
|
2020-12-03 08:41:04 +00:00
|
|
|
|
glib-networking
|
2020-04-24 23:36:52 +00:00
|
|
|
|
gtk3
|
|
|
|
|
gsound
|
|
|
|
|
gjs # for running daemon
|
2022-10-21 18:38:19 +00:00
|
|
|
|
evolution-data-server-gtk4 # for libebook-contacts typelib
|
2020-04-24 23:36:52 +00:00
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
mesonFlags = [
|
2021-05-20 23:08:51 +00:00
|
|
|
|
"-Dgnome_shell_libdir=${gnome.gnome-shell}/lib"
|
2020-04-24 23:36:52 +00:00
|
|
|
|
"-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"
|
2021-02-05 17:12:51 +00:00
|
|
|
|
"-Dinstalled_test_prefix=${placeholder "installedTests"}"
|
2020-04-24 23:36:52 +00:00
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
postPatch = ''
|
2020-11-12 09:05:59 +00:00
|
|
|
|
patchShebangs installed-tests/prepare-tests.sh
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
|
|
# TODO: do not include every typelib everywhere
|
|
|
|
|
# for example, we definitely do not need nautilus
|
|
|
|
|
for file in src/extension.js src/prefs.js; do
|
|
|
|
|
substituteInPlace "$file" \
|
|
|
|
|
--subst-var-by typelibPath "$GI_TYPELIB_PATH"
|
|
|
|
|
done
|
2022-10-21 18:38:19 +00:00
|
|
|
|
|
|
|
|
|
# slightly janky fix for gsettings_schemadir being removed
|
|
|
|
|
substituteInPlace data/config.js.in \
|
|
|
|
|
--subst-var-by GSETTINGS_SCHEMA_DIR ${glib.makeSchemaPath (placeholder "out") "${pname}-${version}"}
|
2020-04-24 23:36:52 +00:00
|
|
|
|
'';
|
|
|
|
|
|
2020-12-03 08:41:04 +00:00
|
|
|
|
postFixup = ''
|
2020-04-24 23:36:52 +00:00
|
|
|
|
# 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
|
2020-11-12 09:05:59 +00:00
|
|
|
|
|
2020-12-03 08:41:04 +00:00
|
|
|
|
# Wrap jasmine runner for tests
|
|
|
|
|
for file in $installedTests/libexec/installed-tests/gsconnect/minijasmine; do
|
|
|
|
|
echo "Wrapping program $file"
|
|
|
|
|
wrapGApp "$file"
|
|
|
|
|
done
|
2020-04-24 23:36:52 +00:00
|
|
|
|
'';
|
|
|
|
|
|
2021-07-14 22:03:04 +00:00
|
|
|
|
passthru = {
|
|
|
|
|
extensionUuid = "gsconnect@andyholmes.github.io";
|
|
|
|
|
extensionPortalSlug = "gsconnect";
|
|
|
|
|
};
|
2020-05-15 21:57:56 +00:00
|
|
|
|
|
2020-11-12 09:05:59 +00:00
|
|
|
|
passthru = {
|
|
|
|
|
tests = {
|
|
|
|
|
installedTests = nixosTests.installed-tests.gsconnect;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
|
description = "KDE Connect implementation for Gnome Shell";
|
2022-03-30 09:31:56 +00:00
|
|
|
|
homepage = "https://github.com/GSConnect/gnome-shell-extension-gsconnect/wiki";
|
2020-11-12 09:05:59 +00:00
|
|
|
|
license = licenses.gpl2Plus;
|
2021-06-28 23:13:55 +00:00
|
|
|
|
maintainers = teams.gnome.members;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
platforms = platforms.linux;
|
|
|
|
|
};
|
|
|
|
|
}
|