about summary refs log tree commit diff
path: root/pkgs/by-name/mu/multiplex/package.nix
blob: f5d13a7570c5c743baa890e5836c16f271f9be13 (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,
  buildGoModule,
  fetchFromGitHub,
  pkg-config,
  gobject-introspection,
  blueprint-compiler,
  wrapGAppsHook4,
  libadwaita,
}:

buildGoModule rec {
  pname = "multiplex";
  version = "0.1.5";

  src = fetchFromGitHub {
    owner = "pojntfx";
    repo = "multiplex";
    rev = "v${version}";
    hash = "sha256-qc8RHvU7uGbqtMGy/mYXHCxqvE6gekgfFOWwej33+zQ=";
  };

  vendorHash = "sha256-VLlco6CeedoUM5gy8+5yLffAtMsjH/RQ+U4VYvY5mcg=";

  nativeBuildInputs = [
    pkg-config
    gobject-introspection
    blueprint-compiler
    wrapGAppsHook4
  ];

  buildInputs = [ libadwaita ];

  # generate files requested by go:generate
  # don't generate in goModules because buildInputs isn't available
  preBuild = ''
    if [[ ! $name == *"-go-modules" ]]; then
      go generate ./internal/resources/resources.go
    fi
  '';

  postInstall = ''
    install -Dm644 -t $out/share/applications com.pojtinger.felicitas.Multiplex.desktop
    install -Dm644 -t $out/share/metainfo internal/resources/com.pojtinger.felicitas.Multiplex.metainfo.xml
    # The provided pixmap icons appears to be a bit blurry so not installing them
    install -Dm644 docs/icon.svg $out/share/icons/hicolor/scalable/apps/com.pojtinger.felicitas.Multiplex.svg
    install -Dm644 docs/icon-symbolic.svg $out/share/icons/hicolor/symbolic/apps/com.pojtinger.felicitas.Multiplex-symbolic.svg
  '';

  meta = {
    description = "Watch torrents with your friends";
    longDescription = ''
      Multiplex is an app to watch torrents together, providing an experience similar
      to Apple's SharePlay and Amazon's Prime Video Watch Party.

      It enables you to:
      - Stream any file directly using a wide range of video and audio formats with
        the mpv video player.
      - Host online watch parties while preserving your privacy by synchronizing
        video playback with friends without a central server using weron.
      - Bypass internet restrictions by optionally separating the hTorrent HTTP to
        BitTorrent gateway and user interface into two separate components.
    '';
    homepage = "https://github.com/pojntfx/multiplex";
    license = with lib.licenses; [
      agpl3Plus
      cc0
    ];
    mainProgram = "multiplex";
    maintainers = with lib.maintainers; [ aleksana ];
  };
}