169abfc188
treewide: add mainProgram
143 lines
2.7 KiB
Nix
143 lines
2.7 KiB
Nix
{ lib
|
|
, stdenv
|
|
, fetchFromGitLab
|
|
, gitUpdater
|
|
, meson
|
|
, ninja
|
|
, pkg-config
|
|
, python3
|
|
, wrapGAppsHook
|
|
, libadwaita
|
|
, libhandy
|
|
, libxkbcommon
|
|
, libgudev
|
|
, callaudiod
|
|
, pulseaudio
|
|
, evince
|
|
, glib
|
|
, gtk4
|
|
, gnome
|
|
, gnome-desktop
|
|
, gcr
|
|
, pam
|
|
, systemd
|
|
, upower
|
|
, wayland
|
|
, dbus
|
|
, xvfb-run
|
|
, phoc
|
|
, feedbackd
|
|
, networkmanager
|
|
, polkit
|
|
, libsecret
|
|
, evolution-data-server
|
|
, nixosTests
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "phosh";
|
|
version = "0.33.0";
|
|
|
|
src = fetchFromGitLab {
|
|
domain = "gitlab.gnome.org";
|
|
group = "World";
|
|
owner = "Phosh";
|
|
repo = pname;
|
|
rev = "v${version}";
|
|
fetchSubmodules = true; # including gvc and libcall-ui which are designated as subprojects
|
|
sha256 = "sha256-t+1MYfsz7KqsMvN8TyLIUrTLTQPWQQpOSk/ysxgE7kg=";
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
libadwaita
|
|
meson
|
|
ninja
|
|
pkg-config
|
|
python3
|
|
wrapGAppsHook
|
|
];
|
|
|
|
buildInputs = [
|
|
evince
|
|
phoc
|
|
libhandy
|
|
libsecret
|
|
libxkbcommon
|
|
libgudev
|
|
callaudiod
|
|
evolution-data-server
|
|
pulseaudio
|
|
glib
|
|
gcr
|
|
networkmanager
|
|
polkit
|
|
gnome.gnome-control-center
|
|
gnome-desktop
|
|
gnome.gnome-session
|
|
gtk4
|
|
pam
|
|
systemd
|
|
upower
|
|
wayland
|
|
feedbackd
|
|
];
|
|
|
|
nativeCheckInputs = [
|
|
dbus
|
|
xvfb-run
|
|
];
|
|
|
|
# Temporarily disabled - Test is broken (SIGABRT)
|
|
doCheck = false;
|
|
|
|
mesonFlags = [
|
|
"-Dsystemd=true"
|
|
"-Dcompositor=${phoc}/bin/phoc"
|
|
# https://github.com/NixOS/nixpkgs/issues/36468
|
|
"-Dc_args=-I${glib.dev}/include/gio-unix-2.0"
|
|
];
|
|
|
|
checkPhase = ''
|
|
runHook preCheck
|
|
export NO_AT_BRIDGE=1
|
|
xvfb-run -s '-screen 0 800x600x24' dbus-run-session \
|
|
--config-file=${dbus}/share/dbus-1/session.conf \
|
|
meson test --print-errorlogs
|
|
runHook postCheck
|
|
'';
|
|
|
|
# Depends on GSettings schemas in gnome-shell
|
|
preFixup = ''
|
|
gappsWrapperArgs+=(
|
|
--prefix XDG_DATA_DIRS : "${gnome.gnome-shell}/share/gsettings-schemas/${gnome.gnome-shell.name}"
|
|
--set GNOME_SESSION "${gnome.gnome-session}/bin/gnome-session"
|
|
)
|
|
'';
|
|
|
|
postFixup = ''
|
|
mkdir -p $out/share/wayland-sessions
|
|
ln -s $out/share/applications/sm.puri.Phosh.desktop $out/share/wayland-sessions/
|
|
'';
|
|
|
|
passthru = {
|
|
providedSessions = [
|
|
"sm.puri.Phosh"
|
|
];
|
|
|
|
tests.phosh = nixosTests.phosh;
|
|
|
|
updateScript = gitUpdater {
|
|
rev-prefix = "v";
|
|
};
|
|
};
|
|
|
|
meta = with lib; {
|
|
description = "A pure Wayland shell prototype for GNOME on mobile devices";
|
|
homepage = "https://gitlab.gnome.org/World/Phosh/phosh";
|
|
changelog = "https://gitlab.gnome.org/World/Phosh/phosh/-/blob/v${version}/debian/changelog";
|
|
license = licenses.gpl3Plus;
|
|
maintainers = with maintainers; [ masipcat tomfitzhenry zhaofengli ];
|
|
platforms = platforms.linux;
|
|
mainProgram = "phosh-session";
|
|
};
|
|
}
|