Merge pull request #162992 from mweinelt/minidlna

This commit is contained in:
Martin Weinelt 2022-03-10 22:34:42 +01:00 committed by GitHub
commit 44c88e44c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 10 deletions

View File

@ -33,7 +33,9 @@ import ./make-test-python.nix ({ pkgs, ... }: {
server.succeed("mkdir -p /tmp/stuff && chown minidlna: /tmp/stuff")
server.wait_for_unit("minidlna")
server.wait_for_open_port("8200")
server.succeed("curl --fail http://localhost:8200/")
client.succeed("curl --fail http://server:8200/")
# requests must be made *by IP* to avoid triggering minidlna's
# DNS-rebinding protection
server.succeed("curl --fail http://$(getent ahostsv4 localhost | head -n1 | cut -f 1 -d ' '):8200/")
client.succeed("curl --fail http://$(getent ahostsv4 server | head -n1 | cut -f 1 -d ' '):8200/")
'';
})

View File

@ -1,20 +1,25 @@
{ lib, stdenv, fetchurl, ffmpeg, flac, libvorbis, libogg, libid3tag, libexif, libjpeg, sqlite, gettext }:
{ lib, stdenv, fetchgit, autoreconfHook, ffmpeg, flac, libvorbis, libogg, libid3tag, libexif, libjpeg, sqlite, gettext, nixosTests }:
let version = "1.3.0"; in
stdenv.mkDerivation {
let
pname = "minidlna";
inherit version;
version = "1.3.1";
in
stdenv.mkDerivation {
inherit pname version;
src = fetchurl {
url = "mirror://sourceforge/project/minidlna/minidlna/${version}/minidlna-${version}.tar.gz";
sha256 = "0qrw5ny82p5ybccw4pp9jma8nwl28z927v0j2561m0289imv1na7";
# tarball for 1.3.1 is missing
src = fetchgit {
url = "https://git.code.sf.net/p/${pname}/git";
rev = "v${builtins.replaceStrings [ "." ] [ "_" ] version}";
hash = "sha256-nbvz/QHSZBTZEqX/utOoOF5vorhrxGqIBA9qfpIZzyU=";
};
preConfigure = ''
export makeFlags="INSTALLPREFIX=$out"
'';
nativeBuildInputs = [ autoreconfHook ];
buildInputs = [ ffmpeg flac libvorbis libogg libid3tag libexif libjpeg sqlite gettext ];
postInstall = ''
@ -23,6 +28,8 @@ stdenv.mkDerivation {
cp minidlnad.8 $out/share/man/man8
'';
passthru.tests = { inherit (nixosTests) minidlna; };
meta = with lib; {
description = "Media server software";
longDescription = ''