about summary refs log tree commit diff
path: root/pkgs/applications/audio/easyaudiosync/default.nix
blob: 0b910dfb573b8e34d8ac8b97ff49f009f12114e3 (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
88
89
90
91
92
93
94
95
96
97
98
{ lib
, stdenv
, fetchFromGitHub
, pkg-config
, cmake
, qtbase
, qttools
, spdlog
, ffmpeg
, taglib
, wrapQtAppsHook
, makeDesktopItem
, copyDesktopItems
}:

stdenv.mkDerivation rec {
  pname = "easyaudiosync";
  version = "1.1.1";

  src = fetchFromGitHub {
    owner = "complexlogic";
    repo = "EasyAudioSync";
    rev = "v${version}";
    hash = "sha256-w98tj9BuixPhuDgwn74EYY0gvKH6kbfQmtg030RWRU0=";
  };

  patches = [
    ./0001-fix-project-name.patch
    ./0002-fix-qt67-deprecated-methods.patch
    ./0003-fix-darwin-app.patch
    ./0004-force-qt6.patch
  ];

  nativeBuildInputs = [
    cmake
    pkg-config
    wrapQtAppsHook
  ] ++ lib.optional stdenv.isLinux copyDesktopItems;

  buildInputs = [
    qtbase
    qttools
    ffmpeg
    spdlog
    taglib
  ];

  installPhase =
    ''
      runHook preInstall
    '' + lib.optionalString stdenv.isDarwin ''
      mkdir -p $out/Applications
      mv "easyaudiosync.app" "Easy Audio Sync.app"
      cp -r "Easy Audio Sync.app" $out/Applications
    '' + lib.optionalString stdenv.isLinux ''
      install -Dm755 easyaudiosync $out/bin/easyaudiosync

      for RES in 48 64 128 256; do
        install -Dm755 "$src/assets/icons/easyaudiosync''${RES}.png" "$out/share/icons/hicolor/''${RES}x''${RES}/apps/easyaudiosync.png"
      done

      install -Dm755 "$src/assets/icons/easyaudiosync.svg" "$out/share/icons/hicolor/scalable/apps/easyaudiosync.svg"
    '' + ''
      runHook postInstall
    '';

  desktopItems = [
    (makeDesktopItem {
      name = "easyaudiosync";
      exec = "easyaudiosync";
      icon = "easyaudiosync";
      desktopName = "Easy Audio Sync";
      categories = [
        "Qt"
        "Audio"
        "AudioVideo"
      ];
      comment = "Audio library syncing and conversion utility";
    })
  ];

  meta = with lib; {
    description = "Audio library syncing and conversion utility";
    longDescription = ''
      Easy Audio Sync is an audio library syncing and conversion utility.
      The intended use is syncing an audio library with many lossless files to a mobile device
      with limited storage.

      The program's design is inspired by the rsync utility. It supports folder-based
      source to destination syncing, with added audio transcoding capability, and is
      GUI-based instead of CLI-based.
    '';
    homepage = "https://github.com/complexlogic/EasyAudioSync";
    license = licenses.unlicense;
    maintainers = with maintainers; [ matteopacini ];
    platforms = platforms.linux ++ platforms.darwin;
  };
}