Commit cc0a9478 authored by Felix Uhl's avatar Felix Uhl
Browse files

persepolis: refactor: re-enable checkPhase

parent fa188528
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -23,14 +23,6 @@ index 985d28d..933f3df 100755
 
 # Checking dependencies!
 not_installed = ''
@@ -100,6 +96,7 @@ else:
     print('paplay is found!')
 
 # sound-theme-freedesktop
+notifications_path = ''
 if os_type == 'Linux':
     notifications_path = '/usr/share/sounds/freedesktop/stereo/'
 elif os_type == 'FreeBSD' or os_type == 'OpenBSD':
@@ -139,7 +136,7 @@ if sys.argv[1] == "test":
 
 DESCRIPTION = 'Persepolis Download Manager'
+17 −5
Original line number Diff line number Diff line
@@ -27,9 +27,6 @@ buildPythonApplication rec {
    sha256 = "sha256-2S6s/tWhI9RBFA26jkwxYTGeaok8S8zv/bY+Zr8TOak=";
  };

  # see: https://github.com/persepolisdm/persepolis/blob/3.2.0/setup.py#L130
  doCheck = false;

  # Make setup automatic
  preBuild = ''
    substituteInPlace setup.py --replace "answer = input(" "answer = 'y'#"
@@ -45,8 +42,13 @@ buildPythonApplication rec {
  ];

  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

    # Ensure dependencies with hard-coded FHS paths are properly detected
    substituteInPlace setup.py --replace-fail "isdir(notifications_path)" "isdir('${sound-theme-freedesktop}/share/sounds/freedesktop')"

    # Fix oversight in test script (can be removed once https://github.com/persepolisdm/persepolis/pull/942 is merged upstream)
    substituteInPlace setup.py --replace-fail "sys.exit('0')" "sys.exit(0)"
  '';

  postInstall = ''
@@ -64,6 +66,16 @@ buildPythonApplication rec {
    "\${qtWrapperArgs[@]}"
  ];

  # The presence of these dependencies is checked during setuptoolsCheckPhase,
  # but apart from that, they're not required during build, only runtime
  nativeCheckInputs = [
    aria2
    libnotify
    pulseaudio
    sound-theme-freedesktop
    ffmpeg
  ];

  propagatedBuildInputs = [
    pulseaudio
    psutil