From ea1cd70128a0ca02881a345a3b2b891b0b7a0c7c Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 14 Mar 2014 17:54:40 +0100 Subject: [PATCH] geoip: Convert to mkDerivation Also, drop unused zlib dependency and add some meta attributes. --- pkgs/development/libraries/geoip/default.nix | 29 ++++++++----------- .../libraries/geoip/src-for-default.nix | 8 ----- .../libraries/geoip/src-info-for-default.nix | 6 ---- pkgs/top-level/all-packages.nix | 4 +-- 4 files changed, 13 insertions(+), 34 deletions(-) delete mode 100644 pkgs/development/libraries/geoip/src-for-default.nix delete mode 100644 pkgs/development/libraries/geoip/src-info-for-default.nix diff --git a/pkgs/development/libraries/geoip/default.nix b/pkgs/development/libraries/geoip/default.nix index 94c0505bc6fa..1abcb7c6943d 100644 --- a/pkgs/development/libraries/geoip/default.nix +++ b/pkgs/development/libraries/geoip/default.nix @@ -1,24 +1,19 @@ -a : -let - s = import ./src-for-default.nix; - buildInputs = with a; [ - zlib - ]; -in -rec { - src = a.fetchUrlFromSrcInfo s; +{ stdenv, fetchurl }: - inherit (s) name; - inherit buildInputs; - configureFlags = []; +let version = "1.6.0"; in - /* doConfigure should be removed if not needed */ - phaseNames = ["doConfigure" "doMakeInstall"]; +stdenv.mkDerivation { + name = "geoip-${version}"; + + src = fetchurl { + url = "http://geolite.maxmind.com/download/geoip/api/c/GeoIP-${version}.tar.gz"; + sha256 = "0dd6si4cvip73kxdn43apg6yygvaf7dnk5awqfg9w2fd2ll0qnh7"; + }; meta = { description = "Geolocation API"; - maintainers = [ - a.lib.maintainers.raskin - ]; + maintainers = [ stdenv.lib.maintainers.raskin ]; + license = stdenv.lib.licenses.lgpl21; + platforms = stdenv.lib.platforms.linux; }; } diff --git a/pkgs/development/libraries/geoip/src-for-default.nix b/pkgs/development/libraries/geoip/src-for-default.nix deleted file mode 100644 index 1fc4b9b8755a..000000000000 --- a/pkgs/development/libraries/geoip/src-for-default.nix +++ /dev/null @@ -1,8 +0,0 @@ -rec { - advertisedUrl="http://geolite.maxmind.com/download/geoip/api/c/GeoIP-1.4.6.tar.gz"; - version = "1.4.6"; - url="http://geolite.maxmind.com/download/geoip/api/c/GeoIP-1.6.0.tar.gz"; - hash = "0dd6si4cvip73kxdn43apg6yygvaf7dnk5awqfg9w2fd2ll0qnh7"; - name = "geoip-1.6.0"; - -} diff --git a/pkgs/development/libraries/geoip/src-info-for-default.nix b/pkgs/development/libraries/geoip/src-info-for-default.nix deleted file mode 100644 index 99c79227c630..000000000000 --- a/pkgs/development/libraries/geoip/src-info-for-default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ - downloadPage = "http://geolite.maxmind.com/download/geoip/api/c/"; - sourceRegexp = "GeoIP-[0-9.]+[.]tar[.]gz"; - choiceCommand = "tail -1"; - baseName = "geoip"; -} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c9644afbbbca..619ea319dc4c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4235,9 +4235,7 @@ let geoclue2 = callPackage ../development/libraries/geoclue/2.0.nix {}; - geoip = builderDefsPackage ../development/libraries/geoip { - inherit zlib; - }; + geoip = callPackage ../development/libraries/geoip { }; geoipjava = callPackage ../development/libraries/java/geoipjava { };