2021-01-15 22:18:51 +00:00
|
|
|
|
{ lib, stdenv
|
2020-11-12 09:05:59 +00:00
|
|
|
|
, fetchFromGitHub
|
|
|
|
|
, 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
|
2020-11-12 09:05:59 +00:00
|
|
|
|
, gjs
|
|
|
|
|
, nixosTests
|
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-05-28 09:39:13 +00:00
|
|
|
|
pname = "gnome-shell-extension-gsconnect";
|
2021-05-20 23:08:51 +00:00
|
|
|
|
version = "46";
|
2020-11-12 09:05:59 +00:00
|
|
|
|
|
|
|
|
|
outputs = [ "out" "installedTests" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
|
owner = "andyholmes";
|
|
|
|
|
repo = "gnome-shell-extension-gsconnect";
|
|
|
|
|
rev = "v${version}";
|
2021-05-20 23:08:51 +00:00
|
|
|
|
sha256 = "161379kipr6z6gbhchb5b17djrkg5fbvblyyabzkc2gv05r3h6fw";
|
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
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
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
|
2021-05-20 23:08:51 +00:00
|
|
|
|
gnome.evolution-data-server # 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
|
|
|
|
"-Dgsettings_schemadir=${glib.makeSchemaPath (placeholder "out") "${pname}-${version}"}"
|
|
|
|
|
"-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"
|
|
|
|
|
"-Dpost_install=true"
|
2021-02-05 17:12:51 +00:00
|
|
|
|
"-Dinstalled_test_prefix=${placeholder "installedTests"}"
|
2020-04-24 23:36:52 +00:00
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
|
patchShebangs meson/nmh.sh
|
|
|
|
|
patchShebangs meson/post-install.sh
|
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
|
|
|
|
|
'';
|
|
|
|
|
|
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";
|
|
|
|
|
homepage = "https://github.com/andyholmes/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;
|
|
|
|
|
};
|
|
|
|
|
}
|