nixpkgs/pkgs/desktops/gnome/extensions/gsconnect/default.nix

120 lines
3 KiB
Nix
Raw Normal View History

{ lib, stdenv
, fetchFromGitHub
, substituteAll
, openssl
, gsound
, meson
, ninja
, pkg-config
, gobject-introspection
, wrapGAppsHook
, glib
, glib-networking
, gtk3
, openssh
, gnome
, gjs
, nixosTests
}:
2018-09-20 20:31:51 +00:00
stdenv.mkDerivation rec {
pname = "gnome-shell-extension-gsconnect";
2021-06-19 20:07:52 +00:00
version = "47";
outputs = [ "out" "installedTests" ];
2018-09-20 20:31:51 +00:00
src = fetchFromGitHub {
owner = "andyholmes";
repo = "gnome-shell-extension-gsconnect";
rev = "v${version}";
2021-06-19 20:07:52 +00:00
sha256 = "sha256-cpyB7ufjKTj7YVbPlQFJ4qaL6Rb/aBReKxCYzErT4+Q=";
2018-09-20 20:31:51 +00:00
};
patches = [
# Make typelibs available in the extension
(substituteAll {
src = ./fix-paths.patch;
gapplication = "${glib.bin}/bin/gapplication";
})
# Allow installing installed tests to a separate output
./installed-tests-path.patch
2018-09-20 20:31:51 +00:00
];
nativeBuildInputs = [
meson
ninja
pkg-config
2018-09-20 20:31:51 +00:00
gobject-introspection # for locating typelibs
wrapGAppsHook # for wrapping daemons
];
buildInputs = [
glib # libgobject
glib-networking
2018-09-20 20:31:51 +00:00
gtk3
2019-03-10 01:10:28 +00:00
gsound
2019-11-04 23:38:42 +00:00
gjs # for running daemon
gnome.evolution-data-server # for libebook-contacts typelib
2018-09-20 20:31:51 +00:00
];
mesonFlags = [
"-Dgnome_shell_libdir=${gnome.gnome-shell}/lib"
"-Dgsettings_schemadir=${glib.makeSchemaPath (placeholder "out") "${pname}-${version}"}"
2018-09-20 20:31:51 +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"
2018-09-20 20:31:51 +00:00
"-Dpost_install=true"
"-Dinstalled_test_prefix=${placeholder "installedTests"}"
2018-09-20 20:31:51 +00:00
];
postPatch = ''
patchShebangs meson/nmh.sh
patchShebangs meson/post-install.sh
patchShebangs installed-tests/prepare-tests.sh
2018-09-20 20:31:51 +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
'';
postFixup = ''
2018-09-20 20:31:51 +00:00
# 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"
2018-09-20 20:31:51 +00:00
done
# 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 20:31:51 +00:00
'';
passthru = {
extensionUuid = "gsconnect@andyholmes.github.io";
extensionPortalSlug = "gsconnect";
};
passthru = {
tests = {
installedTests = nixosTests.installed-tests.gsconnect;
};
};
meta = with lib; {
2018-09-20 20:31:51 +00:00
description = "KDE Connect implementation for Gnome Shell";
homepage = "https://github.com/andyholmes/gnome-shell-extension-gsconnect/wiki";
license = licenses.gpl2Plus;
maintainers = teams.gnome.members;
2018-09-20 20:31:51 +00:00
platforms = platforms.linux;
};
}