1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-21 21:54:10 +00:00
nixpkgs/pkgs/desktops/gnome/extensions/gsconnect/default.nix
piegames bffbf4617a gnomeExtensions: integrate manually packaged extensions better with the others
Their keys are now not used directly. Instead, we go the standard route of mapping to the
UUID in order to apply the rename procedure. This makes sure the manual override always does
the correct thing, and also gives us more consistency overall.
2021-07-14 03:35:11 +02:00

120 lines
3 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{ lib, stdenv
, fetchFromGitHub
, substituteAll
, openssl
, gsound
, meson
, ninja
, pkg-config
, gobject-introspection
, wrapGAppsHook
, glib
, glib-networking
, gtk3
, openssh
, gnome
, gjs
, nixosTests
}:
stdenv.mkDerivation rec {
pname = "gnome-shell-extension-gsconnect";
version = "46";
outputs = [ "out" "installedTests" ];
src = fetchFromGitHub {
owner = "andyholmes";
repo = "gnome-shell-extension-gsconnect";
rev = "v${version}";
sha256 = "161379kipr6z6gbhchb5b17djrkg5fbvblyyabzkc2gv05r3h6fw";
};
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
];
nativeBuildInputs = [
meson
ninja
pkg-config
gobject-introspection # for locating typelibs
wrapGAppsHook # for wrapping daemons
];
buildInputs = [
glib # libgobject
glib-networking
gtk3
gsound
gjs # for running daemon
gnome.evolution-data-server # for libebook-contacts typelib
];
mesonFlags = [
"-Dgnome_shell_libdir=${gnome.gnome-shell}/lib"
"-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"
"-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
for file in src/extension.js src/prefs.js; do
substituteInPlace "$file" \
--subst-var-by typelibPath "$GI_TYPELIB_PATH"
done
'';
postFixup = ''
# 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"
done
# Wrap jasmine runner for tests
for file in $installedTests/libexec/installed-tests/gsconnect/minijasmine; do
echo "Wrapping program $file"
wrapGApp "$file"
done
'';
passthru = {
extensionUuid = "gsconnect@andyholmes.github.io";
extensionPortalSlug = "gsconnect";
};
passthru = {
tests = {
installedTests = nixosTests.installed-tests.gsconnect;
};
};
meta = with lib; {
description = "KDE Connect implementation for Gnome Shell";
homepage = "https://github.com/andyholmes/gnome-shell-extension-gsconnect/wiki";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ etu ];
platforms = platforms.linux;
};
}