From ea9c2fad54805b35441fa7b8cafe7643bfa5031e Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 26 Jan 2016 02:47:06 +0000 Subject: [PATCH] altermime: use mkDerivation --- pkgs/tools/networking/altermime/default.nix | 54 ++++++--------------- 1 file changed, 16 insertions(+), 38 deletions(-) diff --git a/pkgs/tools/networking/altermime/default.nix b/pkgs/tools/networking/altermime/default.nix index 1c9dbfe62354..e532739ecd4f 100644 --- a/pkgs/tools/networking/altermime/default.nix +++ b/pkgs/tools/networking/altermime/default.nix @@ -1,50 +1,28 @@ -x@{builderDefsPackage - - , ...}: -builderDefsPackage -(a : -let - helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++ - []; +{ stdenv, fetchurl }: - buildInputs = map (n: builtins.getAttr n x) - (builtins.attrNames (builtins.removeAttrs x helperArgNames)); - sourceInfo = rec { - baseName="altermime"; - version="0.3.10"; - name="${baseName}-${version}"; - url="http://www.pldaniels.com/${baseName}/${name}.tar.gz"; - hash="0vn3vmbcimv0n14khxr1782m76983zz9sf4j2kz5v86lammxld43"; - }; -in -rec { - src = a.fetchurl { - url = sourceInfo.url; - sha256 = sourceInfo.hash; +stdenv.mkDerivation rec { + baseName = "altermime"; + name = "${baseName}-${version}"; + version = "0.3.10"; + + src = fetchurl { + url = "http://www.pldaniels.com/${baseName}/${name}.tar.gz"; + sha256 = "0vn3vmbcimv0n14khxr1782m76983zz9sf4j2kz5v86lammxld43"; }; - inherit (sourceInfo) name version; - inherit buildInputs; + patches = map fetchurl (import ./debian-patches.nix); - patches = map a.fetchurl (import ./debian-patches.nix); - - phaseNames = ["doPatch" "fixTarget" "doMakeInstall"]; - fixTarget = a.fullDepEntry ('' + postPatch = '' sed -i Makefile -e "s@/usr/local@$out@" mkdir -p "$out/bin" - '') ["doUnpack" "minInit" "defEnsureDir"]; - + ''; + meta = { description = "MIME alteration tool"; - maintainers = with a.lib.maintainers; - [ + maintainers = with stdenv.lib.maintainers; [ raskin ]; - platforms = with a.lib.platforms; - linux; + platforms = with stdenv.lib.platforms; linux; downloadPage = "http://www.pldaniels.com/altermime/"; - inherit version; - updateWalker = true; }; -}) x - +}