Merge pull request #162992 from mweinelt/minidlna
This commit is contained in:
commit
44c88e44c9
|
@ -33,7 +33,9 @@ import ./make-test-python.nix ({ pkgs, ... }: {
|
||||||
server.succeed("mkdir -p /tmp/stuff && chown minidlna: /tmp/stuff")
|
server.succeed("mkdir -p /tmp/stuff && chown minidlna: /tmp/stuff")
|
||||||
server.wait_for_unit("minidlna")
|
server.wait_for_unit("minidlna")
|
||||||
server.wait_for_open_port("8200")
|
server.wait_for_open_port("8200")
|
||||||
server.succeed("curl --fail http://localhost:8200/")
|
# requests must be made *by IP* to avoid triggering minidlna's
|
||||||
client.succeed("curl --fail http://server:8200/")
|
# 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/")
|
||||||
'';
|
'';
|
||||||
})
|
})
|
||||||
|
|
|
@ -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
|
let
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
|
||||||
pname = "minidlna";
|
pname = "minidlna";
|
||||||
inherit version;
|
version = "1.3.1";
|
||||||
|
in
|
||||||
|
stdenv.mkDerivation {
|
||||||
|
inherit pname version;
|
||||||
|
|
||||||
src = fetchurl {
|
# tarball for 1.3.1 is missing
|
||||||
url = "mirror://sourceforge/project/minidlna/minidlna/${version}/minidlna-${version}.tar.gz";
|
src = fetchgit {
|
||||||
sha256 = "0qrw5ny82p5ybccw4pp9jma8nwl28z927v0j2561m0289imv1na7";
|
url = "https://git.code.sf.net/p/${pname}/git";
|
||||||
|
rev = "v${builtins.replaceStrings [ "." ] [ "_" ] version}";
|
||||||
|
hash = "sha256-nbvz/QHSZBTZEqX/utOoOF5vorhrxGqIBA9qfpIZzyU=";
|
||||||
};
|
};
|
||||||
|
|
||||||
preConfigure = ''
|
preConfigure = ''
|
||||||
export makeFlags="INSTALLPREFIX=$out"
|
export makeFlags="INSTALLPREFIX=$out"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
nativeBuildInputs = [ autoreconfHook ];
|
||||||
|
|
||||||
buildInputs = [ ffmpeg flac libvorbis libogg libid3tag libexif libjpeg sqlite gettext ];
|
buildInputs = [ ffmpeg flac libvorbis libogg libid3tag libexif libjpeg sqlite gettext ];
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
|
@ -23,6 +28,8 @@ stdenv.mkDerivation {
|
||||||
cp minidlnad.8 $out/share/man/man8
|
cp minidlnad.8 $out/share/man/man8
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
passthru.tests = { inherit (nixosTests) minidlna; };
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "Media server software";
|
description = "Media server software";
|
||||||
longDescription = ''
|
longDescription = ''
|
||||||
|
|
Loading…
Reference in a new issue