about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/audio/sonobus/default.nix
blob: f9b71a03623ec3b737199f9cb04f359d5755e8ed (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
73
74
75
76
77
78
79
80
81
82
83
{ lib
, pkg-config
, stdenv
, fetchFromGitHub
, autoPatchelfHook
, alsa-lib
, cmake
, freetype
, libGL
, libX11
, libXcursor
, libXext
, libXinerama
, libXrandr
, libjack2
, libopus
, curl
, gtk3
, webkitgtk
}:

stdenv.mkDerivation rec {
  pname = "sonobus";
  version = "1.7.0";

  src = fetchFromGitHub {
    owner = "sonosaurus";
    repo = "sonobus";
    rev = version;
    sha256 = "sha256-zOPQK5X1E6t53DOjV7qSelyep4+m9aL4tRHqwyeuFQA=";
    fetchSubmodules = true;
  };

  nativeBuildInputs = [
    autoPatchelfHook
    cmake
    pkg-config
  ];

  buildInputs = [
    alsa-lib
    freetype
    libjack2
    libopus
    curl
    gtk3
    webkitgtk
  ];

  runtimeDependencies = [
    libGL
    libX11
    libXcursor
    libXext
    libXinerama
    libXrandr
  ];

  postPatch = lib.optionalString (stdenv.isLinux) ''
    # needs special setup on Linux, dunno if it can work on Darwin
    # https://github.com/NixOS/nixpkgs/issues/19098
    # Also, I get issues with linking without that, not sure why
    sed -i -e '/juce::juce_recommended_lto_flags/d' CMakeLists.txt
    patchShebangs linux/install.sh
  '';

  # The program does not provide any CMake install instructions
  installPhase = lib.optionalString (stdenv.isLinux) ''
    runHook preInstall
    cd ../linux
    ./install.sh "$out"
    runHook postInstall
  '';

  meta = with lib; {
    description = "High-quality network audio streaming";
    homepage = "https://sonobus.net/";
    license = with licenses; [ gpl3Plus ];
    maintainers = with maintainers; [ PowerUser64 ];
    platforms = platforms.unix;
    broken = stdenv.isDarwin;
  };
}