2021-01-11 07:54:33 +00:00
|
|
|
|
{ lib, stdenv
|
2020-10-13 21:57:48 +01:00
|
|
|
|
, fetchFromGitHub
|
|
|
|
|
, substituteAll
|
|
|
|
|
, openssl
|
|
|
|
|
, gsound
|
|
|
|
|
, meson
|
|
|
|
|
, ninja
|
2020-10-18 00:03:02 +01:00
|
|
|
|
, pkg-config
|
2020-10-13 21:57:48 +01:00
|
|
|
|
, gobject-introspection
|
|
|
|
|
, wrapGAppsHook
|
|
|
|
|
, glib
|
2020-11-28 18:24:15 +00:00
|
|
|
|
, glib-networking
|
2020-10-13 21:57:48 +01:00
|
|
|
|
, gtk3
|
|
|
|
|
, openssh
|
2021-05-07 22:18:14 +01:00
|
|
|
|
, gnome
|
2020-10-13 21:57:48 +01:00
|
|
|
|
, gjs
|
|
|
|
|
, nixosTests
|
|
|
|
|
}:
|
2018-09-20 21:31:51 +01:00
|
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-05-24 21:01:59 +01:00
|
|
|
|
pname = "gnome-shell-extension-gsconnect";
|
2022-03-20 02:06:55 +00:00
|
|
|
|
version = "50";
|
2020-10-13 21:57:48 +01:00
|
|
|
|
|
|
|
|
|
outputs = [ "out" "installedTests" ];
|
2018-09-20 21:31:51 +01:00
|
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2022-03-20 02:06:55 +00:00
|
|
|
|
owner = "GSConnect";
|
2018-09-20 21:31:51 +01:00
|
|
|
|
repo = "gnome-shell-extension-gsconnect";
|
|
|
|
|
rev = "v${version}";
|
2022-03-20 02:06:55 +00:00
|
|
|
|
sha256 = "sha256-uUpdjBsVeS99AYDpGlXP9fMqGxWj+XfVubNoGJs76G0=";
|
2018-09-20 21:31:51 +01:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
|
# Make typelibs available in the extension
|
|
|
|
|
(substituteAll {
|
|
|
|
|
src = ./fix-paths.patch;
|
|
|
|
|
gapplication = "${glib.bin}/bin/gapplication";
|
|
|
|
|
})
|
2020-10-13 21:57:48 +01:00
|
|
|
|
|
|
|
|
|
# Allow installing installed tests to a separate output
|
|
|
|
|
./installed-tests-path.patch
|
2018-09-20 21:31:51 +01:00
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2020-10-18 00:03:02 +01:00
|
|
|
|
meson
|
|
|
|
|
ninja
|
|
|
|
|
pkg-config
|
2018-09-20 21:31:51 +01:00
|
|
|
|
gobject-introspection # for locating typelibs
|
|
|
|
|
wrapGAppsHook # for wrapping daemons
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
|
glib # libgobject
|
2020-11-28 18:24:15 +00:00
|
|
|
|
glib-networking
|
2018-09-20 21:31:51 +01:00
|
|
|
|
gtk3
|
2019-03-10 01:10:28 +00:00
|
|
|
|
gsound
|
2019-11-04 23:38:42 +00:00
|
|
|
|
gjs # for running daemon
|
2021-05-07 22:18:14 +01:00
|
|
|
|
gnome.evolution-data-server # for libebook-contacts typelib
|
2018-09-20 21:31:51 +01:00
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
mesonFlags = [
|
2021-05-07 22:18:14 +01:00
|
|
|
|
"-Dgnome_shell_libdir=${gnome.gnome-shell}/lib"
|
2019-08-26 08:44:25 +01:00
|
|
|
|
"-Dgsettings_schemadir=${glib.makeSchemaPath (placeholder "out") "${pname}-${version}"}"
|
2018-09-20 21:31:51 +01: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"
|
2020-02-11 16:01:25 +00:00
|
|
|
|
"-Dsession_bus_services_dir=${placeholder "out"}/share/dbus-1/services"
|
2018-09-20 21:31:51 +01:00
|
|
|
|
"-Dpost_install=true"
|
2021-01-24 09:19:10 +00:00
|
|
|
|
"-Dinstalled_test_prefix=${placeholder "installedTests"}"
|
2018-09-20 21:31:51 +01:00
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
|
patchShebangs meson/nmh.sh
|
|
|
|
|
patchShebangs meson/post-install.sh
|
2020-10-13 21:57:48 +01:00
|
|
|
|
patchShebangs installed-tests/prepare-tests.sh
|
2018-09-20 21:31:51 +01: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-11-28 18:24:15 +00:00
|
|
|
|
postFixup = ''
|
2018-09-20 21:31:51 +01:00
|
|
|
|
# Let’s wrap the daemons
|
2020-01-24 12:45:11 +00:00
|
|
|
|
for file in $out/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/{daemon,nativeMessagingHost}.js; do
|
2019-09-22 08:38:09 +01:00
|
|
|
|
echo "Wrapping program $file"
|
|
|
|
|
wrapGApp "$file"
|
2018-09-20 21:31:51 +01:00
|
|
|
|
done
|
2020-10-13 21:57:48 +01:00
|
|
|
|
|
2020-11-28 18:24:15 +00:00
|
|
|
|
# Wrap jasmine runner for tests
|
|
|
|
|
for file in $installedTests/libexec/installed-tests/gsconnect/minijasmine; do
|
|
|
|
|
echo "Wrapping program $file"
|
|
|
|
|
wrapGApp "$file"
|
|
|
|
|
done
|
2018-09-20 21:31:51 +01:00
|
|
|
|
'';
|
|
|
|
|
|
2021-05-29 16:34:26 +01:00
|
|
|
|
passthru = {
|
|
|
|
|
extensionUuid = "gsconnect@andyholmes.github.io";
|
|
|
|
|
extensionPortalSlug = "gsconnect";
|
|
|
|
|
};
|
2018-08-30 10:09:58 +01:00
|
|
|
|
|
2020-10-13 21:57:48 +01:00
|
|
|
|
passthru = {
|
|
|
|
|
tests = {
|
|
|
|
|
installedTests = nixosTests.installed-tests.gsconnect;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
|
meta = with lib; {
|
2018-09-20 21:31:51 +01:00
|
|
|
|
description = "KDE Connect implementation for Gnome Shell";
|
2022-03-20 02:06:55 +00:00
|
|
|
|
homepage = "https://github.com/GSConnect/gnome-shell-extension-gsconnect/wiki";
|
2020-10-13 21:57:48 +01:00
|
|
|
|
license = licenses.gpl2Plus;
|
2021-06-25 12:16:02 +01:00
|
|
|
|
maintainers = teams.gnome.members;
|
2018-09-20 21:31:51 +01:00
|
|
|
|
platforms = platforms.linux;
|
|
|
|
|
};
|
|
|
|
|
}
|