nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 clangStdenv,
4 fetchFromGitHub,
5 autoreconfHook,
6 pkg-config,
7 libimobiledevice,
8 libusb1,
9 avahi,
10 clang,
11 git,
12 libgeneral,
13}:
14clangStdenv.mkDerivation {
15 pname = "usbmuxd2";
16 version = "unstable-2023-12-12";
17
18 src = fetchFromGitHub {
19 owner = "tihmstar";
20 repo = "usbmuxd2";
21 rev = "2ce399ddbacb110bd5a83a6b8232d42c9a9b6e84";
22 hash = "sha256-u7qRKH5y+Q1HnnumjVm3Ce4SlT3YaEVSPUXYOAiFBes=";
23 # Leave DotGit so that autoconfigure can read version from git tags
24 leaveDotGit = true;
25 };
26
27 postPatch = ''
28 # Checking for libgeneral version still fails
29 sed -i 's/libgeneral >= $LIBGENERAL_MINVERS_STR/libgeneral/' configure.ac
30
31 # Otherwise, it will complain about no matching function for call to 'find'
32 sed -i 1i'#include <algorithm>' usbmuxd2/Muxer.cpp
33 '';
34
35 nativeBuildInputs = [
36 autoreconfHook
37 clang
38 git
39 pkg-config
40 ];
41
42 propagatedBuildInputs = [
43 avahi
44 libgeneral
45 libimobiledevice
46 libusb1
47 ];
48
49 doInstallCheck = true;
50
51 configureFlags = [
52 "--with-udevrulesdir=${placeholder "out"}/lib/udev/rules.d"
53 "--with-systemdsystemunitdir=${placeholder "out"}/lib/systemd/system"
54 ];
55
56 makeFlags = [
57 "sbindir=${placeholder "out"}/bin"
58 ];
59
60 meta = {
61 homepage = "https://github.com/tihmstar/usbmuxd2";
62 description = "Socket daemon to multiplex connections from and to iOS devices";
63 license = lib.licenses.lgpl3;
64 platforms = lib.platforms.linux;
65 maintainers = with lib.maintainers; [ onny ];
66 mainProgram = "usbmuxd";
67 };
68}