about summary refs log tree commit diff
path: root/pkgs/tools/misc/usbmuxd2/default.nix
blob: e4674eb386f15fa91b72cf0260258daf2597f1b4 (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
84
85
86
87
{ lib
, clangStdenv
, fetchFromGitHub
, autoreconfHook
, pkg-config
, libimobiledevice
, libusb1
, avahi
, clang
, git
}: let

  libgeneral = clangStdenv.mkDerivation rec {
    pname = "libgeneral";
    version = "74";
    src = fetchFromGitHub {
      owner = "tihmstar";
      repo = pname;
      rev = "refs/tags/${version}";
      hash = "sha256-6aowcIYssc1xqH6kTi/cpH2F7rgc8+lGC8HgZWYH2w0=";
      # Leave DotGit so that autoconfigure can read version from git tags
      leaveDotGit = true;
    };
    nativeBuildInputs = [
      autoreconfHook
      git
      pkg-config
    ];
    meta = with lib; {
      description = "Helper library used by usbmuxd2";
      homepage = "https://github.com/tihmstar/libgeneral";
      license = licenses.lgpl21;
      platforms = platforms.all;
    };
  };

in
clangStdenv.mkDerivation rec {
  pname = "usbmuxd2";
  version = "unstable-2023-12-12";

  src = fetchFromGitHub {
    owner = "tihmstar";
    repo = pname;
    rev = "2ce399ddbacb110bd5a83a6b8232d42c9a9b6e84";
    hash = "sha256-UVLLE73XuWTgGlpTMxUDykFmiBDqz6NCRO2rpRAYfow=";
    # Leave DotGit so that autoconfigure can read version from git tags
    leaveDotGit = true;
  };

  postPatch = ''
    # Checking for libgeneral version still fails
    sed -i 's/libgeneral >= $LIBGENERAL_MINVERS_STR/libgeneral/' configure.ac
  '';

  nativeBuildInputs = [
    autoreconfHook
    clang
    git
    pkg-config
  ];

  propagatedBuildInputs = [
    avahi
    libgeneral
    libimobiledevice
    libusb1
  ];

  configureFlags = [
    "--with-udevrulesdir=${placeholder "out"}/lib/udev/rules.d"
    "--with-systemdsystemunitdir=${placeholder "out"}/lib/systemd/system"
  ];

  makeFlags = [
    "sbindir=${placeholder "out"}/bin"
  ];

  meta = with lib; {
    homepage = "https://github.com/tihmstar/usbmuxd2";
    description = "Socket daemon to multiplex connections from and to iOS devices";
    license = licenses.lgpl3;
    platforms = platforms.linux;
    maintainers = with maintainers; [ onny ];
    mainProgram = "usbmuxd";
  };
}