From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hartmut Goebel Subject: [PATCH 7/7] gnu: add python-geoip2 and python2-geoip2 Date: Sun, 17 Apr 2016 22:50:57 +0200 Message-ID: <1460926257-25147-8-git-send-email-h.goebel@crazy-compilers.com> References: <1460926257-25147-1-git-send-email-h.goebel@crazy-compilers.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49354) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1artg2-0001XF-8S for guix-devel@gnu.org; Sun, 17 Apr 2016 16:53:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1artey-0002Pt-1E for guix-devel@gnu.org; Sun, 17 Apr 2016 16:52:18 -0400 Received: from mail-out.m-online.net ([212.18.0.9]:53386) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1artex-0002PH-L2 for guix-devel@gnu.org; Sun, 17 Apr 2016 16:51:11 -0400 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 3qp3Mz0zGFz3hk7K for ; Sun, 17 Apr 2016 22:51:11 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.68]) by mail.m-online.net (Postfix) with ESMTP id 3qp3Mz0tfTzvdWJ for ; Sun, 17 Apr 2016 22:51:11 +0200 (CEST) Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.68]) (amavisd-new, port 10024) with ESMTP id wOtOTBgcR0Y8 for ; Sun, 17 Apr 2016 22:51:09 +0200 (CEST) Received: from hermia.goebel-consult.de (ppp-188-174-144-124.dynamic.mnet-online.de [188.174.144.124]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPS for ; Sun, 17 Apr 2016 22:51:09 +0200 (CEST) Received: from thisbe.goebel-consult.de (unknown [192.168.110.30]) by hermia.goebel-consult.de (Postfix) with ESMTP id A49D060A84 for ; Sun, 17 Apr 2016 22:50:59 +0200 (CEST) In-Reply-To: <1460926257-25147-1-git-send-email-h.goebel@crazy-compilers.com> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org * gnu/packages/python.scm (python-geoip2) (pythons-geoip2): New functions. --- gnu/packages/python.scm | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 197f236..330be07 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -63,6 +63,7 @@ #:use-module (gnu packages multiprecision) #:use-module (gnu packages networking) #:use-module (gnu packages ncurses) + #:use-module (gnu packages openstack) #:use-module (gnu packages pcre) #:use-module (gnu packages perl) #:use-module (gnu packages pkg-config) @@ -8889,3 +8890,36 @@ subnets (IPv4 or IPv6).") `(("python2-ipaddr" ,python2-ipaddr) ,@(package-inputs base)))))) +(define-public python-geoip2 + (package + (name "python-geoip2") + (version "2.3.0") + (source + (origin + (method url-fetch) + (uri (pypi-uri "geoip2" version)) + (sha256 + (base32 + "0jxh5p0d2ff1snv9n2xmjib2qw6vz0s2jgcdh69xblfssskgqnr6")))) + (build-system python-build-system) + (arguments `(#:tests? #f)) ; tests require a copy of the database + (inputs + `(("python-maxminddb" ,python-maxminddb) ; >=1.1.0 + ("python-requests" ,python-requests) ; >=2.4 + ("python-setuptools" ,python-setuptools))) + (native-inputs + `(("python-requests-mock" ,python-requests-mock) + ("python-six" ,python-six))) + (home-page "http://www.maxmind.com/") + (synopsis "MaxMind GeoIP2 API") + (description "Provides an API for the GeoIP2 web services and databases. +The API also works with MaxMind’s free GeoLite2 databases.") + (license asl2.0) + (properties `((python2-variant . ,(delay python2-mayminddb)))))) + +(define-public python2-geoip2 + (let ((base (package-with-python2 (strip-python2-variant python-geoip2)))) + (package (inherit base) + (inputs + `(("python2-ipaddr" ,python2-ipaddr) + ,@(package-inputs base)))))) -- 2.7.4