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

persepolis: formatting

Addressing review comments of
https://github.com/NixOS/nixpkgs/pull/292837
parent cc0a9478
Loading
Loading
Loading
Loading
+6 −8
Original line number Diff line number Diff line
@@ -24,14 +24,9 @@ buildPythonApplication rec {
    owner = "persepolisdm";
    repo = "persepolis";
    rev = "refs/tags/${version}";
    sha256 = "sha256-2S6s/tWhI9RBFA26jkwxYTGeaok8S8zv/bY+Zr8TOak=";
    hash = "sha256-2S6s/tWhI9RBFA26jkwxYTGeaok8S8zv/bY+Zr8TOak=";
  };

  # Make setup automatic
  preBuild = ''
    substituteInPlace setup.py --replace "answer = input(" "answer = 'y'#"
  '';

  patches = lib.optionals stdenv.isDarwin [
    # Upstream does currently not allow building from source on macOS. These patches can likely
    # be removed if https://github.com/persepolisdm/persepolis/issues/943 is fixed upstream
@@ -44,6 +39,9 @@ buildPythonApplication rec {
  postPatch = ''
    sed -i "s|'persepolis = persepolis.__main__'|'persepolis = persepolis.scripts.persepolis:main'|" setup.py

    # Automatically answer yes to all interactive questions during setup
    substituteInPlace setup.py --replace-fail "answer = input(" "answer = 'y'#"

    # 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')"