gnu: python-magic: Update to 0.4.15.

* gnu/packages/python.scm (python-magic) Updated to 0.4.15.

Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
This commit is contained in:
Adriano Peluso 2018-01-22 18:36:17 +01:00 committed by Danny Milosavljevic
parent 8a58182c12
commit ce4c9b73c8
No known key found for this signature in database
GPG Key ID: E71A35542C30BAA5
1 changed files with 27 additions and 26 deletions

View File

@ -8093,15 +8093,14 @@ is made as zipfile like as possible.")
(define-public python-magic (define-public python-magic
(package (package
(name "python-magic") (name "python-magic")
(version "0.4.3") (version "0.4.15")
(source (source
(origin (origin
(method url-fetch) (method url-fetch)
(uri (string-append "https://github.com/ahupp/python-magic/archive/" (uri (pypi-uri "python-magic" version))
version ".tar.gz"))
(sha256 (sha256
(base32 (base32
"17bgy92i7sb021f2s4mw1dcvpm6p1mi9jihridwy1pyn8mzvpjgk")) "1mgwig9pnzgkf86q9ji9pnc99bngms15lfszq5rgqb9db07mqxpk"))
(file-name (string-append name "-" version "-checkout")))) (file-name (string-append name "-" version "-checkout"))))
(build-system python-build-system) (build-system python-build-system)
(arguments (arguments
@ -8119,31 +8118,33 @@ is made as zipfile like as possible.")
;; expected. ;; expected.
'(#:tests? #f '(#:tests? #f
#:phases (modify-phases %standard-phases #:phases (modify-phases %standard-phases
;; Replace a specific method call with a hard-coded ;; Replace a specific method call with a hard-coded
;; path to the necessary libmagic.so file in the ;; path to the necessary libmagic.so file in the
;; store. If we don't do this, then the method call ;; store. If we don't do this, then the method call
;; will fail to find the libmagic.so file, which in ;; will fail to find the libmagic.so file, which in
;; turn will cause any application using ;; turn will cause any application using
;; python-magic to fail. ;; python-magic to fail.
(add-before 'build 'hard-code-path-to-libmagic (add-before 'build 'hard-code-path-to-libmagic
(lambda* (#:key inputs #:allow-other-keys) (lambda* (#:key inputs #:allow-other-keys)
(let ((file (assoc-ref inputs "file"))) (let ((file (assoc-ref inputs "file")))
(substitute* "magic.py" (substitute* "magic.py"
(("ctypes.util.find_library\\('magic'\\)") (("ctypes.util.find_library\\('magic'\\)")
(string-append "'" file "/lib/libmagic.so'"))) (string-append "'" file "/lib/libmagic.so'")))
#t))) #t)))
(add-before 'install 'disable-egg-compression (add-before 'install 'disable-egg-compression
(lambda _ (lambda _
(let ((port (open-file "setup.cfg" "a"))) (let ((port (open-file "setup.cfg" "a")))
(display "\n[easy_install]\nzip_ok = 0\n" (display "\n[easy_install]\nzip_ok = 0\n"
port) port)
(close-port port) (close-port port)
#t)))))) #t))))))
(inputs (inputs
;; python-magic needs to be able to find libmagic.so. ;; python-magic needs to be able to find libmagic.so.
`(("file" ,file))) `(("file" ,file)))
(home-page "https://github.com/ahupp/python-magic") (home-page
(synopsis "File type identification using libmagic") "https://github.com/ahupp/python-magic")
(synopsis
"File type identification using libmagic")
(description (description
"This module uses ctypes to access the libmagic file type "This module uses ctypes to access the libmagic file type
identification library. It makes use of the local magic database and identification library. It makes use of the local magic database and