2019-06-16 20:59:06 +01:00
|
|
|
{ stdenv, lib, buildPythonApplication, fetchFromGitHub, makeWrapper
|
2019-04-13 12:22:12 +01:00
|
|
|
, aria
|
|
|
|
, libnotify
|
|
|
|
, pulseaudio
|
|
|
|
, psutil
|
|
|
|
, pyqt5
|
|
|
|
, requests
|
|
|
|
, setproctitle
|
2020-06-26 23:21:00 +01:00
|
|
|
, setuptools
|
2019-04-13 12:22:12 +01:00
|
|
|
, sound-theme-freedesktop
|
2020-07-01 18:58:36 +01:00
|
|
|
, wrapQtAppsHook
|
2019-04-13 12:22:12 +01:00
|
|
|
, youtube-dl
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonApplication rec {
|
|
|
|
pname = "persepolis";
|
2019-09-28 03:51:43 +01:00
|
|
|
version = "3.2.0";
|
2019-04-13 12:22:12 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "persepolisdm";
|
|
|
|
repo = "persepolis";
|
2019-09-09 00:38:31 +01:00
|
|
|
rev = version;
|
2019-09-28 03:51:43 +01:00
|
|
|
sha256 = "1rh7q432ynbysapsd075nif975ync71icpb71x2mb4j8jx1vzs45";
|
2019-04-13 12:22:12 +01:00
|
|
|
};
|
|
|
|
|
2019-09-28 03:51:43 +01:00
|
|
|
# see: https://github.com/persepolisdm/persepolis/blob/3.2.0/setup.py#L130
|
2019-04-13 12:22:12 +01:00
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
preBuild=''
|
|
|
|
substituteInPlace setup.py --replace "answer = input(" "answer = 'y'#"
|
|
|
|
'';
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
sed -i 's|/usr/share/sounds/freedesktop/stereo/|${sound-theme-freedesktop}/share/sounds/freedesktop/stereo/|' setup.py
|
|
|
|
sed -i "s|'persepolis = persepolis.__main__'|'persepolis = persepolis.scripts.persepolis:main'|" setup.py
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/share/applications
|
|
|
|
cp $src/xdg/com.github.persepolisdm.persepolis.desktop $out/share/applications
|
|
|
|
'';
|
|
|
|
|
2020-07-01 18:58:36 +01:00
|
|
|
# prevent double wrapping
|
|
|
|
dontWrapQtApps = true;
|
|
|
|
nativeBuildInputs = [ wrapQtAppsHook ];
|
|
|
|
|
|
|
|
# feed args to wrapPythonApp
|
|
|
|
makeWrapperArgs = [
|
|
|
|
"--prefix PATH : ${lib.makeBinPath [aria libnotify ]}"
|
|
|
|
''''${qtWrapperArgs[@]}''
|
|
|
|
];
|
2019-04-13 12:22:12 +01:00
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
pulseaudio
|
|
|
|
psutil
|
|
|
|
pyqt5
|
|
|
|
requests
|
|
|
|
setproctitle
|
2020-06-26 23:21:00 +01:00
|
|
|
setuptools
|
2019-04-13 12:22:12 +01:00
|
|
|
sound-theme-freedesktop
|
|
|
|
youtube-dl
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
2020-10-11 06:55:05 +01:00
|
|
|
description = "Persepolis Download Manager is a GUI for aria2";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://persepolisdm.github.io/";
|
2019-04-13 12:22:12 +01:00
|
|
|
license = licenses.gpl3;
|
|
|
|
maintainers = [ maintainers.linarcx ];
|
|
|
|
};
|
|
|
|
}
|