From 6dc45870af2d6b73f4d09d9dc852827f05234509 Mon Sep 17 00:00:00 2001 From: Rob Vermaas Date: Sun, 24 Jun 2012 20:24:58 +0200 Subject: [PATCH] * Add MiniDLNA 1.0.24, media server --- pkgs/tools/networking/minidlna/config.patch | 57 +++++++++++++++++++++ pkgs/tools/networking/minidlna/default.nix | 28 ++++++++++ pkgs/top-level/all-packages.nix | 2 + 3 files changed, 87 insertions(+) create mode 100644 pkgs/tools/networking/minidlna/config.patch create mode 100644 pkgs/tools/networking/minidlna/default.nix diff --git a/pkgs/tools/networking/minidlna/config.patch b/pkgs/tools/networking/minidlna/config.patch new file mode 100644 index 000000000000..74442a756562 --- /dev/null +++ b/pkgs/tools/networking/minidlna/config.patch @@ -0,0 +1,57 @@ +diff -rc minidlna-1.0.24/genconfig.sh minidlna-1.0.24-new/genconfig.sh +*** minidlna-1.0.24/genconfig.sh 2012-06-24 20:08:26.697884140 +0200 +--- minidlna-1.0.24-new/genconfig.sh 2012-06-24 20:10:44.742874979 +0200 +*************** +*** 38,68 **** + + ${RM} ${CONFIGFILE} + +- # Detect if there are missing headers +- # NOTE: This check only works with a normal distro +- [ ! -e "/usr/include/sqlite3.h" ] && MISSING="libsqlite3 $MISSING" +- [ ! -e "/usr/include/jpeglib.h" ] && MISSING="libjpeg $MISSING" +- [ ! -e "/usr/include/libexif/exif-loader.h" ] && MISSING="libexif $MISSING" +- [ ! -e "/usr/include/id3tag.h" ] && MISSING="libid3tag $MISSING" +- [ ! -e "/usr/include/ogg/ogg.h" ] && MISSING="libogg $MISSING" +- [ ! -e "/usr/include/vorbis/codec.h" ] && MISSING="libvorbis $MISSING" +- [ ! -e "/usr/include/FLAC/metadata.h" ] && MISSING="libflac $MISSING" +- [ ! -e "/usr/include/ffmpeg/avutil.h" -a \ +- ! -e "/usr/include/libavutil/avutil.h" -a \ +- ! -e "/usr/include/ffmpeg/libavutil/avutil.h" ] && MISSING="libavutil $MISSING" +- [ ! -e "/usr/include/ffmpeg/avformat.h" -a \ +- ! -e "/usr/include/libavformat/avformat.h" -a \ +- ! -e "/usr/include/ffmpeg/libavformat/avformat.h" ] && MISSING="libavformat $MISSING" +- [ ! -e "/usr/include/ffmpeg/avcodec.h" -a \ +- ! -e "/usr/include/libavcodec/avcodec.h" -a \ +- ! -e "/usr/include/ffmpeg/libavcodec/avcodec.h" ] && MISSING="libavcodec $MISSING" +- if [ -n "$MISSING" ]; then +- echo -e "\nERROR! Cannot continue." +- echo -e "The following required libraries are either missing, or are missing development headers:\n" +- echo -e "$MISSING\n" +- exit 1 +- fi +- + echo "/* MiniDLNA Project" >> ${CONFIGFILE} + echo " * http://sourceforge.net/projects/minidlna/" >> ${CONFIGFILE} + echo " * (c) 2008-2009 Justin Maggard" >> ${CONFIGFILE} +--- 38,43 ---- +diff -rc minidlna-1.0.24/Makefile minidlna-1.0.24-new/Makefile +*** minidlna-1.0.24/Makefile 2012-06-24 20:16:08.673195909 +0200 +--- minidlna-1.0.24-new/Makefile 2012-06-24 20:16:18.615267052 +0200 +*************** +*** 64,70 **** + $(INSTALL) -d $(ETCINSTALLDIR) + $(INSTALL) --mode=0644 minidlna.conf $(ETCINSTALLDIR) + +! minidlna: $(BASEOBJS) $(LNXOBJS) $(LIBS) + @echo Linking $@ + @$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(BASEOBJS) $(LNXOBJS) $(LIBS) + +--- 64,70 ---- + $(INSTALL) -d $(ETCINSTALLDIR) + $(INSTALL) --mode=0644 minidlna.conf $(ETCINSTALLDIR) + +! minidlna: $(BASEOBJS) $(LNXOBJS) + @echo Linking $@ + @$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(BASEOBJS) $(LNXOBJS) $(LIBS) + diff --git a/pkgs/tools/networking/minidlna/default.nix b/pkgs/tools/networking/minidlna/default.nix new file mode 100644 index 000000000000..736ca980cfbc --- /dev/null +++ b/pkgs/tools/networking/minidlna/default.nix @@ -0,0 +1,28 @@ +{stdenv, fetchurl, libav, flac, libvorbis, libogg, libid3tag, libexif, libjpeg, sqlite }: +stdenv.mkDerivation rec { + name = "minidlna-1.0.24"; + src = fetchurl { + url = mirror://sourceforge/project/minidlna/minidlna/1.0.24/minidlna_1.0.24_src.tar.gz; + sha256 = "0hmrrrq7d8940rckwj93bcdpdxxy3qfkjl17j5k31mi37hqc42l4"; + }; + + preConfigure = '' + export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${libav}/include/libavutil -I${libav}/include/libavcodec -I${libav}/include/libavformat" + export makeFlags="INSTALLPREFIX=$out" + ''; + + buildInputs = [ libav flac libvorbis libogg libid3tag libexif libjpeg sqlite ]; + patches = [ ./config.patch ]; + + meta = { + description = "MiniDLNA Media Server"; + longDescription = '' + MiniDLNA (aka ReadyDLNA) is server software with the aim of being fully + compliant with DLNA/UPnP-AV clients. + ''; + homepage = http://sourceforge.net/projects/minidlna/; + license = stdenv.lib.licenses.gpl2; + + platforms = stdenv.lib.platforms.all; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 45df41e84bd6..64829164584d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -947,6 +947,8 @@ let less = callPackage ../tools/misc/less { }; + minidlna = callPackage ../tools/networking/minidlna { }; + most = callPackage ../tools/misc/most { }; netperf = callPackage ../applications/networking/netperf { };