2020-11-12 09:05:59 +00:00
|
|
|
|
{ stdenv
|
|
|
|
|
, fetchFromGitHub
|
|
|
|
|
, substituteAll
|
|
|
|
|
, openssl
|
|
|
|
|
, gsound
|
|
|
|
|
, meson
|
|
|
|
|
, ninja
|
|
|
|
|
, pkg-config
|
|
|
|
|
, gobject-introspection
|
|
|
|
|
, wrapGAppsHook
|
|
|
|
|
, glib
|
|
|
|
|
, gtk3
|
|
|
|
|
, openssh
|
|
|
|
|
, gnome3
|
|
|
|
|
, gjs
|
|
|
|
|
, nixosTests
|
|
|
|
|
, atk
|
|
|
|
|
, harfbuzz
|
|
|
|
|
, pango
|
|
|
|
|
, gdk-pixbuf
|
|
|
|
|
, gsettings-desktop-schemas
|
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
|
pname = "gnome-shell-gsconnect";
|
2020-11-15 13:44:38 +00:00
|
|
|
|
version = "44";
|
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}";
|
2020-11-15 13:44:38 +00:00
|
|
|
|
sha256 = "C+8mhK4UOs2iZplDyY45bCX0mMGgwVV/ZfaPpYUlWxA=";
|
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
|
|
|
|
|
gtk3
|
|
|
|
|
gsound
|
|
|
|
|
gjs # for running daemon
|
|
|
|
|
gnome3.evolution-data-server # for libebook-contacts typelib
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
mesonFlags = [
|
|
|
|
|
"-Dgnome_shell_libdir=${gnome3.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"
|
2020-11-12 09:05:59 +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-11-12 09:05:59 +00:00
|
|
|
|
postFixup = let
|
|
|
|
|
testDeps = [
|
|
|
|
|
gtk3 harfbuzz atk pango.out gdk-pixbuf
|
|
|
|
|
];
|
|
|
|
|
in ''
|
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
|
|
|
|
|
|
|
|
|
wrapProgram "$installedTests/libexec/installed-tests/gsconnect/minijasmine" \
|
|
|
|
|
--prefix XDG_DATA_DIRS : "${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name}" \
|
|
|
|
|
--prefix GI_TYPELIB_PATH : "${stdenv.lib.makeSearchPath "lib/girepository-1.0" testDeps}"
|
2020-04-24 23:36:52 +00:00
|
|
|
|
'';
|
|
|
|
|
|
2020-05-15 21:57:56 +00:00
|
|
|
|
uuid = "gsconnect@andyholmes.github.io";
|
|
|
|
|
|
2020-11-12 09:05:59 +00:00
|
|
|
|
passthru = {
|
|
|
|
|
tests = {
|
|
|
|
|
installedTests = nixosTests.installed-tests.gsconnect;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
|
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;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
maintainers = with maintainers; [ etu ];
|
|
|
|
|
platforms = platforms.linux;
|
|
|
|
|
};
|
|
|
|
|
}
|