btrbk: add mainProgram (#356350)
[NixPkgs.git] / pkgs / by-name / my / mympd / package.nix
blob251c343c17df8cb2be8ad71d755b20dc735d269f
1 { lib
2 , stdenv
3 , fetchFromGitHub
4 , cmake
5 , pkg-config
6 , libmpdclient
7 , openssl
8 , lua5_3
9 , libid3tag
10 , flac
11 , pcre2
12 , gzip
13 , perl
14 , jq
15 , nixosTests
18 stdenv.mkDerivation (finalAttrs: {
19   pname = "mympd";
20   version = "18.1.2";
22   src = fetchFromGitHub {
23     owner = "jcorporation";
24     repo = "myMPD";
25     rev = "v${finalAttrs.version}";
26     sha256 = "sha256-4BGW7jDeqwhbAi1LODeiFrmBIzv0qAMKT3IVRgYn87E=";
27   };
29   nativeBuildInputs = [
30     pkg-config
31     cmake
32     gzip
33     perl
34     jq
35   ];
36   preConfigure = ''
37     env MYMPD_BUILDDIR=$PWD/build ./build.sh createassets
38   '';
39   buildInputs = [
40     libmpdclient
41     openssl
42     lua5_3
43     libid3tag
44     flac
45     pcre2
46   ];
48   cmakeFlags = [
49     # Otherwise, it tries to parse $out/etc/mympd.conf on startup.
50     "-DCMAKE_INSTALL_SYSCONFDIR=/etc"
51     # similarly here
52     "-DCMAKE_INSTALL_LOCALSTATEDIR=/var/lib/mympd"
53   ];
54   hardeningDisable = [
55     # causes redefinition of _FORTIFY_SOURCE
56     "fortify3"
57   ];
58   # 5 tests out of 23 fail, probably due to the sandbox...
59   doCheck = false;
61   passthru.tests = { inherit (nixosTests) mympd; };
63   meta = {
64     homepage = "https://jcorporation.github.io/myMPD";
65     description = "Standalone and mobile friendly web mpd client with a tiny footprint and advanced features";
66     maintainers = [ lib.maintainers.doronbehar ];
67     platforms = lib.platforms.linux;
68     license = lib.licenses.gpl2Plus;
69     mainProgram = "mympd";
70   };