Personal-use NixOS configuration
1# https://github.com/NixOS/nixpkgs/blob/0182a361324364ae3f436a63005877674cf45efb/pkgs/by-name/me/mediaelch/package.nix
2
3{
4 lib,
5 stdenv,
6 fetchFromGitHub,
7
8 cmake,
9
10 curl,
11 ffmpeg,
12 libmediainfo,
13 libzen,
14 libsForQt5,
15 qt6Packages,
16
17 qtVersion ? 6,
18}:
19
20let
21 qt' = if qtVersion == 5 then libsForQt5 else qt6Packages;
22
23in
24stdenv.mkDerivation (finalAttrs: {
25 pname = "mediaelch";
26 version = "2.13.0-unstable";
27
28 src = fetchFromGitHub {
29 owner = "Komet";
30 repo = "MediaElch";
31 rev = "d2a18102e426894f1d361e4056e940939a3a09f7";
32 hash = "sha256-x55T7JSf35rkAQR5vIUUc805LLMqeQsQUrXu4/TgEeY=";
33 fetchSubmodules = true;
34 };
35
36 nativeBuildInputs = [
37 cmake
38 qt'.qttools
39 qt'.wrapQtAppsHook
40 ];
41
42 buildInputs = [
43 curl
44 ffmpeg
45 libmediainfo
46 libzen
47 qt'.qtbase
48 qt'.qtdeclarative
49 qt'.qtmultimedia
50 qt'.qtsvg
51 qt'.qtwayland
52 qt'.quazip
53 ]
54 ++ lib.optionals (qtVersion == 6) [
55 qt'.qt5compat
56 ];
57
58 cmakeFlags = [
59 (lib.cmakeBool "DISABLE_UPDATER" true)
60 (lib.cmakeBool "ENABLE_TESTS" finalAttrs.finalPackage.doCheck or false)
61 (lib.cmakeBool "MEDIAELCH_FORCE_QT${toString qtVersion}" true)
62 (lib.cmakeBool "USE_EXTERN_QUAZIP" true)
63 ];
64
65 # libmediainfo.so.0 is loaded dynamically
66 qtWrapperArgs = [
67 "--prefix LD_LIBRARY_PATH : ${libmediainfo}/lib"
68 ];
69
70 env = {
71 HOME = "/tmp"; # for the font cache
72 LANG = "C.UTF-8";
73 QT_QPA_PLATFORM = "offscreen"; # the tests require a UI
74 };
75
76 doCheck = true;
77
78 checkTarget = "unit_test"; # the other tests require network connectivity
79
80 meta = {
81 homepage = "https://mediaelch.de/mediaelch/";
82 description = "Media Manager for Kodi";
83 mainProgram = "MediaElch";
84 license = lib.licenses.lgpl3Only;
85 maintainers = with lib.maintainers; [ stunkymonkey ];
86 platforms = lib.platforms.linux;
87 };
88})