19 , enableDuktape ? true
25 , enableLibmagic ? true
27 , enableLibmatroska ? true
30 , enableAvcodec ? false
32 , enableLibexif ? true
36 , enableFFmpegThumbnailer ? false
38 , enableInotifyTools ? true
43 libupnp' = libupnp.overrideAttrs (super: rec {
44 cmakeFlags = super.cmakeFlags or [ ] ++ [
45 "-Dblocking_tcp_connections=OFF"
51 { name = "AVCODEC"; enable = enableAvcodec; packages = [ ffmpeg ]; }
52 { name = "CURL"; enable = enableCurl; packages = [ curl ]; }
53 { name = "EXIF"; enable = enableLibexif; packages = [ libexif ]; }
54 { name = "EXIV2"; enable = enableExiv2; packages = [ exiv2 ]; }
55 { name = "FFMPEGTHUMBNAILER"; enable = enableFFmpegThumbnailer; packages = [ ffmpegthumbnailer ]; }
56 { name = "INOTIFY"; enable = enableInotifyTools; packages = [ inotify-tools ]; }
57 { name = "JS"; enable = enableDuktape; packages = [ duktape ]; }
58 { name = "MAGIC"; enable = enableLibmagic; packages = [ file ]; }
59 { name = "MATROSKA"; enable = enableLibmatroska; packages = [ libmatroska libebml ]; }
60 { name = "MYSQL"; enable = enableMysql; packages = [ libmysqlclient ]; }
61 { name = "TAGLIB"; enable = enableTaglib; packages = [ taglib ]; }
64 inherit (lib) flatten optionals;
67 stdenv.mkDerivation rec {
71 src = fetchFromGitHub {
75 sha256 = "sha256-j5J0u0zIjHY2kP5P8IzN2h+QQSCwsel/iTspad6V48s=";
79 # Can be removed on the next bump, see:
80 # https://github.com/gerbera/gerbera/pull/2840.
82 name = "gerbera-fmt10.patch";
83 url = "https://github.com/gerbera/gerbera/commit/37957aac0aea776e6f843af2358916f81056a405.patch";
84 hash = "sha256-U7dyFGEbelVZeHYX/4fLOC0k+9pUKZ8qP/LIVXWCMcU=";
88 postPatch = lib.optionalString enableMysql ''
89 substituteInPlace cmake/FindMySQL.cmake \
90 --replace /usr/include/mysql ${lib.getDev libmysqlclient}/include/mariadb \
91 --replace /usr/lib/mysql ${lib.getLib libmysqlclient}/lib/mariadb
95 # systemd service will be generated alongside the service
97 ] ++ map (e: "-DWITH_${e.name}=${if e.enable then "ON" else "OFF"}") options;
99 nativeBuildInputs = [ cmake pkg-config ];
109 ] ++ flatten (builtins.catAttrs "packages" (builtins.filter (e: e.enable) options));
111 passthru.tests = { inherit (nixosTests) mediatomb; };
114 homepage = "https://docs.gerbera.io/";
115 description = "UPnP Media Server for 2020";
117 Gerbera is a Mediatomb fork.
118 It allows to stream your digital media through your home network and consume it on all kinds
119 of UPnP supporting devices.
121 license = licenses.gpl2Only;
122 maintainers = with maintainers; [ ardumont ];
123 platforms = platforms.linux;
124 mainProgram = "gerbera";