about summary refs log tree commit diff
path: root/nixpkgs/pkgs/by-name/mo/monophony/package.nix
blob: 7589c172af0e75156b24bfe93b1d4a6c48015cd9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
{ lib
, fetchFromGitLab
, python3Packages
, wrapGAppsHook4
, gst_all_1
, gobject-introspection
, yt-dlp
, libadwaita
, libsoup_3
, glib-networking
, nix-update-script
}:
python3Packages.buildPythonApplication rec {
  pname = "monophony";
  version = "2.6.1";
  format = "other";

  sourceRoot = "source/source";
  src = fetchFromGitLab {
    owner = "zehkira";
    repo = "monophony";
    rev = "v${version}";
    hash = "sha256-op6XUfP0EM9P5vT2nM4o+NOHxBcASIl1+6Mp/u9ub3U=";
  };

  pythonPath = with python3Packages; [
    mpris-server
    pygobject3
    ytmusicapi
  ];

  nativeBuildInputs = [
    python3Packages.nuitka
    gobject-introspection
    wrapGAppsHook4
  ];

  buildInputs = [
    libadwaita
    # needed for gstreamer https
    libsoup_3
    glib-networking
  ] ++ (with gst_all_1; [
    gst-plugins-base
    gst-plugins-good
    gstreamer
  ]);

  installFlags = [ "prefix=$(out)" ];

  preFixup = ''
    buildPythonPath "$pythonPath"
    gappsWrapperArgs+=(
      --prefix PYTHONPATH : "$program_PYTHONPATH"
      --prefix PATH : "${lib.makeBinPath [yt-dlp]}"
      # needed for gstreamer https
      --prefix LD_LIBRARY_PATH : "${lib.getLib libsoup_3}/lib"
    )
  '';

  passthru.updateScript = nix-update-script { };

  meta = with lib; {
    homepage = "https://gitlab.com/zehkira/monophony";
    description = "Linux app for streaming music from YouTube";
    longDescription = "Monophony is a free and open source Linux app for streaming music from YouTube. It has no ads and does not require an account.";
    license = licenses.agpl3Plus;
    mainProgram = "monophony";
    platforms = platforms.linux;
    maintainers = with maintainers; [ quadradical ];
  };
}