Hi, I am relatively new to packaging and lately I have tried to get a python package to work on NixOS.
The package at hand is osdlyrics and the following code gets the package installed.
{ stdenv
, lib
, pkg-config
, autoconf
, python3
, gtk2
, dbus-glib
, dbus
, libnotify
, automake
, fetchFromGitHub
, intltool
, libappindicator-gtk2
, desktop-file-utils
, mpd
, sqlite
, gobject-introspection
, libpthreadstubs
}:
stdenv.mkDerivation rec {
pname = "osdlyrics";
version = "0.5.5-rc2";
src = fetchFromGitHub {
owner = "osdlyrics";
repo = pname;
rev = version;
sha256 = "1cgm38xyx4f9grlb0n72xcwgibgqhqy7v6fkdiispyndlxy7w0j9";
};
python = python3.withPackages (
ps: [
ps.future ps.pydbus ps.dbus-python ps.pygobject3
ps.pygobject2 ps.pycurl ps.chardet
]
);
nativeBuildInputs = [
autoconf
automake
pkg-config
];
propagatedBuildInputs = [
intltool
python
gtk2
dbus-glib
libnotify
libappindicator-gtk2
desktop-file-utils
mpd
sqlite
gobject-introspection
libpthreadstubs
];
installPhase = ''
runHook preInstall
patchShebangs ./autogen.sh
substituteInPlace autogen.sh \
--replace "/usr/bin/python2" "${python}/bin/python"
./autogen.sh --prefix=$out PYTHON=${python}/bin/python
make
make install
mkdir -p $out/lib/osdlyrics/daemon/osdlyrics/
cp -r $out/${python.sitePackages}/osdlyrics/* $out/lib/osdlyrics/daemon/osdlyrics/
runHook postInstall
'';
meta = with lib; {
homepage = "https://github.com/osdlyrics/osdlyrics";
description = "Displays synced lyrics for songs";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ dasj19 ];
};
}
There are 3 binaries in $out/bin and osdlyrics-daemon fails to find and execute dbus services that are crucial for the application to work.
osdlyrics-daemon
WARNING:root:Cannot activate proxy org.osdlyrics.PlayerProxy.Http: org.freedesktop.DBus.Error.Spawn.ChildExited: Process org.osdlyrics.PlayerProxy.Http exited with status 1
WARNING:root:Cannot activate proxy org.osdlyrics.PlayerProxy.Mpd: org.freedesktop.DBus.Error.Spawn.ChildExited: Process org.osdlyrics.PlayerProxy.Mpd exited with status 1
WARNING:root:Cannot activate proxy org.osdlyrics.PlayerProxy.Mpris1: org.freedesktop.DBus.Error.Spawn.ChildExited: Process org.osdlyrics.PlayerProxy.Mpris1 exited with status 1
WARNING:root:Cannot activate proxy org.osdlyrics.PlayerProxy.Mpris2: org.freedesktop.DBus.Error.Spawn.ChildExited: Process org.osdlyrics.PlayerProxy.Mpris2 exited with status 1
WARNING:root:Cannot activate lyric source org.osdlyrics.LyricSourcePlugin.xiami: org.freedesktop.DBus.Error.Spawn.ChildExited: Process org.osdlyrics.LyricSourcePlugin.xiami exited with status 1
WARNING:root:Cannot activate lyric source org.osdlyrics.LyricSourcePlugin.viewlyrics: org.freedesktop.DBus.Error.Spawn.ChildExited: Process org.osdlyrics.LyricSourcePlugin.viewlyrics exited with status 1
WARNING:root:Cannot activate lyric source org.osdlyrics.LyricSourcePlugin.netease: org.freedesktop.DBus.Error.Spawn.ChildExited: Process org.osdlyrics.LyricSourcePlugin.netease exited with status 1
WARNING:root:Cannot activate lyric source org.osdlyrics.LyricSourcePlugin.lrc123: org.freedesktop.DBus.Error.Spawn.ChildExited: Process org.osdlyrics.LyricSourcePlugin.lrc123 exited with status 1
What am I missing in the package definition?