From b4766c3d43e9192e9e4c4b08a7fbf3483592bf6a Mon Sep 17 00:00:00 2001 From: JC Brand Date: Sun, 13 Dec 2015 14:45:14 +0000 Subject: [PATCH] sabnzbd: Fix OpenSSL wrapping. - Add SSL support by adding pyopenssl to PYTHONPATH - Update build script to use wrapPythonProgramsIn - Update the meta info --- pkgs/servers/sabnzbd/builder.sh | 7 ++----- pkgs/servers/sabnzbd/default.nix | 17 ++++++++++------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/pkgs/servers/sabnzbd/builder.sh b/pkgs/servers/sabnzbd/builder.sh index 3a5c8adb421e..c446891d8dc3 100644 --- a/pkgs/servers/sabnzbd/builder.sh +++ b/pkgs/servers/sabnzbd/builder.sh @@ -3,14 +3,11 @@ source $stdenv/setup tar xvfz $src mv SABnzbd-* $out -# Create a start script and let wrapProgram with toPythonPath wrap it so that python is started with cheetahTemplate in its importpath (classpath) mkdir $out/bin echo "$python/bin/python $out/SABnzbd.py \$*" > $out/bin/sabnzbd chmod +x $out/bin/sabnzbd -for i in $(cd $out/bin && ls); do - wrapProgram $out/bin/$i --prefix PYTHONPATH : "$(toPythonPath $python):$(toPythonPath $out):$(toPythonPath $cheetahTemplate):$(toPythonPath $sqlite3)" \ - --prefix PATH : "$par2cmdline/bin:$unzip/bin:$unrar/bin" -done +wrapPythonProgramsIn $out/bin "$pythonPath" +wrapProgram $out/bin/.sabnzbd-wrapped --prefix PATH : "$par2cmdline/bin:$unzip/bin:$unrar/bin" echo $out diff --git a/pkgs/servers/sabnzbd/default.nix b/pkgs/servers/sabnzbd/default.nix index 952d3b1196f2..ee2176ae49a1 100644 --- a/pkgs/servers/sabnzbd/default.nix +++ b/pkgs/servers/sabnzbd/default.nix @@ -1,21 +1,24 @@ -{stdenv, fetchurl, python, pythonPackages, cheetahTemplate, makeWrapper, par2cmdline, unzip, unrar}: +{stdenv, fetchurl, python, pythonPackages, par2cmdline, unzip, unrar}: stdenv.mkDerivation rec { version = "0.7.20"; name = "sabnzbd-${version}"; - + src = fetchurl { url = "mirror://sourceforge/sabnzbdplus/SABnzbd-${version}-src.tar.gz"; sha256 = "0hl7mwgyvm4d68346s7vlv0qlibfh2p2idpyzpjfvk8f79hs9cr0"; }; - buildInputs = [makeWrapper python sqlite3 cheetahTemplate]; - inherit stdenv python cheetahTemplate par2cmdline unzip unrar; - inherit (pythonPackages) sqlite3; + pythonPath = with pythonPackages; [ pyopenssl sqlite3 cheetah ]; + buildInputs = with pythonPackages; [wrapPython]; + inherit python par2cmdline unzip unrar; builder = ./builder.sh; - - meta = { + + meta = with stdenv.lib; { description = "Usenet NZB downloader, par2 repairer and auto extracting server"; + homepage = http://sabnzbd.org; + license = licenses.gpl2Plus; + platforms = platforms.linux; }; }