guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 7/7] gnu: add python-geoip2 and python2-geoip2


From: Hartmut Goebel
Subject: [PATCH 7/7] gnu: add python-geoip2 and python2-geoip2
Date: Sun, 17 Apr 2016 22:50:57 +0200

* 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]