unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* pybitmessage fails to detect PyQt4.QtCore module due to sip error
@ 2016-06-26 20:36 ng0
  2016-06-27  2:06 ` Efraim Flashner
  0 siblings, 1 reply; 3+ messages in thread
From: ng0 @ 2016-06-26 20:36 UTC (permalink / raw)
  To: guix-devel

Hi,

I can't provide full patches yet, so these file-inserts
are to show where I'm at now.

The problem I run into is even though the new
package "python2-pyqt-4" in gnu/packages/qt.scm
builds, I get a failing detection in python ide
~~~~~
ng0Ⓐshadowwalker /gnu/store/fibig7q6h274m95bzrn9qfq421xiqs6c-pybitmessage-0.6.0/lib/python2.7/site-packages/pybitmessage$ python
Python 2.7.10 (default, Jan  1 1970, 00:00:01)
[GCC 4.9.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import PyQt4.QtCore
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  ImportError: No module named sip
~~~~~

and of course also in execution of the
depends.py of pybitmessage

~~~~~
ng0Ⓐshadowwalker /gnu/store/fibig7q6h274m95bzrn9qfq421xiqs6c-pybitmessage-0.6.0/lib/python2.7/site-packages/pybitmessage$ ./depends.py
INFO: Python version: 2.7.10 (default, Jan  1 1970, 00:00:01)
[GCC 4.9.3]
INFO: sqlite3 Module Version: 2.6.0
INFO: SQLite Library Version: 3.10.0
INFO: SQLite Library Source ID: 2016-01-06 11:01:07 fd0a50f0797d154fefff724624f00548b5320566
INFO: SQLite Library Compile Options: ENABLE_FTS3, ENABLE_RTREE, ENABLE_UNLOCK_NOTIFY, SECURE_DELETE, SYSTEM_MALLOC, THREADSAFE=1
INFO: Checking OpenSSL at /gnu/store/9id9n7zmrgarggv6zb6ak4vps0lh5j9b-openssl-1.0.2g/lib/libcrypto.so
INFO: OpenSSL Name: /gnu/store/9id9n7zmrgarggv6zb6ak4vps0lh5j9b-openssl-1.0.2g/lib/libcrypto.so
INFO: OpenSSL Version: OpenSSL 1.0.2h  3 May 2016
INFO: OpenSSL Compile Options: compiler: gcc -I. -I.. -I../include  -fPIC -DOPENSSL_PIC -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -Wa,--noexecstack -m64 -DL_ENDIAN -O3 -Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -DECP_NISTZ256_ASM
ERROR: The PyQt4 package is not available. PyBitmessage requires PyQt 4.8 or later and Qt 4.7 or later.
INFO: curses Module Version: 2.2
ERROR: The curses interface can not be used. The pythondialog package is not available.
CRITICAL: PyBitmessage cannot start. One or more dependencies are unavailable.
~~~~~

So at this moment, or at least for today, I'm stuck
and new input would be very welcome.

These are the packages:

~~~~~
gnu/packages/qt.scm:

(define-public python2-pyqt-4
  (package (inherit python-pyqt-4)
    (name "python2-pyqt-4")
    (native-inputs
     `(("python-sip" ,python2-sip)
       ("qt" ,qt-4)))
    (inputs
     `(("python" ,python-2)))))
~~~~~

~~~~~
gnu/packages/python.scm:
#:use-module (gnu packages qt)

(define-public pybitmessage
  (package
    (name "pybitmessage")
    (version "0.6.0")
    (source
     (origin
       (method url-fetch)
       (uri (string-append "https://github.com/Bitmessage/"
                           "PyBitmessage/archive/v" version ".tar.gz"))
       (file-name (string-append name "-" version ".tar.gz"))
       (sha256
        (base32
         "026wbbr7cxi5lml8j14905myb2p10icjixzry45mmaa2zsimrviv"))))
    (inputs
     `(("python" ,python-2)
       ("openssl" ,openssl)
       ("sqlite" ,sqlite)
       ("qt" ,qt-4)))
    (native-inputs
     `(("pkg-config" ,pkg-config)))
    (propagated-inputs
     `(("python2-pyqt-4" ,python2-pyqt-4)
       ("python2-pysqlite" ,python2-pysqlite)
       ("python2-pyopenssl" ,python2-pyopenssl)))
    ;; Todo: package: SocksiPy-1.00, PyElliptic, pydialog (ncurses).
    ;; XXX: pyelliptic is altered (backported) by PyBitmessage.
    (build-system gnu-build-system)
    (arguments
     `(#:modules ((srfi srfi-1)
                  ,@%gnu-build-system-modules)
       #:phases
       (modify-phases %standard-phases
         ;; A Makefile exists but needs too much patching.
         (replace 'build
           (lambda* (#:key outputs #:allow-other-keys)
             (chdir "src/bitmsghash")
             (system* "make")
             #t))
         (add-after 'unpack 'fix-unmatched-python-shebangs
           (lambda* (#:key inputs #:allow-other-keys)
             (substitute* "src/bitmessagemain.py"
               (("#!/usr/bin/env python2.7")
                (string-append "#!" (which "python"))))
             (substitute* "src/bitmessagecli.py"
               (("#!/usr/bin/env python2.7.x")
                (string-append "#!" (which "python"))))))
         (add-after 'unpack 'fix-depends
           (lambda* (#:key inputs #:allow-other-keys)
             (substitute* "src/depends.py"
               (("import ctypes.util")
                "import ctypes.util
            ctypes.util.find_library('m')")
               (("libcrypto.so")
                (string-append (assoc-ref inputs "openssl")
                               "/lib/libcrypto.so")))))
         (add-after 'unpack 'fix-local-files-in-paths
           (lambda* (#:key inputs outputs #:allow-other-keys)
             (substitute* "src/proofofwork.py"
               (("bitmsghash.so")
                (string-append (assoc-ref outputs "out")
                               "/lib/bitmsghash.so")))))
         (add-after 'unpack 'fix-pyelliptic
           (lambda* (#:key inputs outputs #:allow-other-keys)
             (substitute* "src/pyelliptic/openssl.py"
               (("libcrypto.so")
                (string-append (assoc-ref inputs "openssl")
                               "/lib/libcrypto.so"))
               (("libssl.so")
                (string-append (assoc-ref inputs "openssl")
                               "/lib/libssl.so")))))
         (delete 'check) ; not available
         (replace 'install
           (lambda* (#:key inputs outputs #:allow-other-keys)
             (let* ((out (assoc-ref outputs "out"))
                    (python (assoc-ref inputs "python"))
                    (python-version
                     (last (string-split python #\-)))
                    (python-major+minor
                     (string-join
                      (take (string-split python-version #\.) 2)
                      "."))
                    ;;(path (getenv "PYTHONPATH"))
                    (pylib (string-append out "/lib/python"
                                          python-major+minor
                                          "/site-packages"))
                    (bin (string-append out "/bin"))
                    (doc (string-append out "/share/man/man1"))
                    (lib (string-append out "/lib"))
                    (share (string-append out "/share/applications"))
                    (icons24 (string-append out "/share/icons/hicolor/24x24/apps"))
                    (iconss (string-append out "/share/icons/hicolor/scalable/apps"))
                    (pixmaps (string-append out "/share/pixmaps")))
               (chdir "../..")
               (install-file "src/bitmsghash/bitmsghash.so" lib)
               (delete-file-recursively "src/bitmsghash")
               (delete-file "src/build_osx.py")
               (copy-recursively "src" (string-append pylib "/pybitmessage"))
               (install-file "man/pybitmessage.1.gz" doc)
               (install-file "desktop/pybitmessage.desktop" share)
               (install-file "desktop/icon24.png" icons24)
               (install-file "desktop/can-icon.svg" iconss)
               (install-file "desktop/icon14.xpm" pixmaps)
               ;; this breaks at the minimum depends.py:
               ;; (for-each (lambda (file)
               ;;             (wrap-program file
               ;;               `("PYTHONPATH" ":" prefix (,path))))
               ;;           (find-files pylib "\\.*$"))
               ;; #t))))))
               ))))))
    (license license:expat)
    (description
     "Distributed and trustless peer-to-peer communications protocol
for sending encrypted messages to one person or many subscribers.")
    (synopsis "Distributed peer-to-peer communication")
    (home-page "https://bitmessage.org/")))
~~~~~

thanks,
--
♥Ⓐ  Mx ng0
For non-prism friendly talk find me on
psyced.org / loupsycedyglgamf.onion

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: pybitmessage fails to detect PyQt4.QtCore module due to sip error
  2016-06-26 20:36 pybitmessage fails to detect PyQt4.QtCore module due to sip error ng0
@ 2016-06-27  2:06 ` Efraim Flashner
  2016-06-27 23:18   ` ng0
  0 siblings, 1 reply; 3+ messages in thread
From: Efraim Flashner @ 2016-06-27  2:06 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 9159 bytes --]

On Sun, Jun 26, 2016 at 08:36:27PM +0000, ng0 wrote:
> Hi,
> 
> I can't provide full patches yet, so these file-inserts
> are to show where I'm at now.
> 
> The problem I run into is even though the new
> package "python2-pyqt-4" in gnu/packages/qt.scm
> builds, I get a failing detection in python ide
> ~~~~~
> ng0Ⓐshadowwalker /gnu/store/fibig7q6h274m95bzrn9qfq421xiqs6c-pybitmessage-0.6.0/lib/python2.7/site-packages/pybitmessage$ python
> Python 2.7.10 (default, Jan  1 1970, 00:00:01)
> [GCC 4.9.3] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import PyQt4.QtCore
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   ImportError: No module named sip
> ~~~~~
> 
> and of course also in execution of the
> depends.py of pybitmessage
> 
> ~~~~~
> ng0Ⓐshadowwalker /gnu/store/fibig7q6h274m95bzrn9qfq421xiqs6c-pybitmessage-0.6.0/lib/python2.7/site-packages/pybitmessage$ ./depends.py
> INFO: Python version: 2.7.10 (default, Jan  1 1970, 00:00:01)
> [GCC 4.9.3]
> INFO: sqlite3 Module Version: 2.6.0
> INFO: SQLite Library Version: 3.10.0
> INFO: SQLite Library Source ID: 2016-01-06 11:01:07 fd0a50f0797d154fefff724624f00548b5320566
> INFO: SQLite Library Compile Options: ENABLE_FTS3, ENABLE_RTREE, ENABLE_UNLOCK_NOTIFY, SECURE_DELETE, SYSTEM_MALLOC, THREADSAFE=1
> INFO: Checking OpenSSL at /gnu/store/9id9n7zmrgarggv6zb6ak4vps0lh5j9b-openssl-1.0.2g/lib/libcrypto.so
> INFO: OpenSSL Name: /gnu/store/9id9n7zmrgarggv6zb6ak4vps0lh5j9b-openssl-1.0.2g/lib/libcrypto.so
> INFO: OpenSSL Version: OpenSSL 1.0.2h  3 May 2016
> INFO: OpenSSL Compile Options: compiler: gcc -I. -I.. -I../include  -fPIC -DOPENSSL_PIC -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -Wa,--noexecstack -m64 -DL_ENDIAN -O3 -Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -DECP_NISTZ256_ASM
> ERROR: The PyQt4 package is not available. PyBitmessage requires PyQt 4.8 or later and Qt 4.7 or later.
> INFO: curses Module Version: 2.2
> ERROR: The curses interface can not be used. The pythondialog package is not available.
> CRITICAL: PyBitmessage cannot start. One or more dependencies are unavailable.
> ~~~~~
> 
> So at this moment, or at least for today, I'm stuck
> and new input would be very welcome.
> 
> These are the packages:
> 
> ~~~~~
> gnu/packages/qt.scm:
> 
> (define-public python2-pyqt-4
>   (package (inherit python-pyqt-4)
>     (name "python2-pyqt-4")
>     (native-inputs
>      `(("python-sip" ,python2-sip)
>        ("qt" ,qt-4)))
>     (inputs
>      `(("python" ,python-2)))))
> ~~~~~
> 
> ~~~~~
> gnu/packages/python.scm:
> #:use-module (gnu packages qt)
> 
> (define-public pybitmessage
>   (package
>     (name "pybitmessage")
>     (version "0.6.0")
>     (source
>      (origin
>        (method url-fetch)
>        (uri (string-append "https://github.com/Bitmessage/"
>                            "PyBitmessage/archive/v" version ".tar.gz"))
>        (file-name (string-append name "-" version ".tar.gz"))
>        (sha256
>         (base32
>          "026wbbr7cxi5lml8j14905myb2p10icjixzry45mmaa2zsimrviv"))))
>     (inputs
>      `(("python" ,python-2)
>        ("openssl" ,openssl)
>        ("sqlite" ,sqlite)
>        ("qt" ,qt-4)))
>     (native-inputs
>      `(("pkg-config" ,pkg-config)))
>     (propagated-inputs
>      `(("python2-pyqt-4" ,python2-pyqt-4)
>        ("python2-pysqlite" ,python2-pysqlite)
>        ("python2-pyopenssl" ,python2-pyopenssl)))
>     ;; Todo: package: SocksiPy-1.00, PyElliptic, pydialog (ncurses).
>     ;; XXX: pyelliptic is altered (backported) by PyBitmessage.
>     (build-system gnu-build-system)
>     (arguments
>      `(#:modules ((srfi srfi-1)
>                   ,@%gnu-build-system-modules)
>        #:phases
>        (modify-phases %standard-phases
>          ;; A Makefile exists but needs too much patching.
>          (replace 'build
>            (lambda* (#:key outputs #:allow-other-keys)
>              (chdir "src/bitmsghash")
>              (system* "make")
>              #t))
>          (add-after 'unpack 'fix-unmatched-python-shebangs
>            (lambda* (#:key inputs #:allow-other-keys)
>              (substitute* "src/bitmessagemain.py"
>                (("#!/usr/bin/env python2.7")
>                 (string-append "#!" (which "python"))))
>              (substitute* "src/bitmessagecli.py"
>                (("#!/usr/bin/env python2.7.x")
>                 (string-append "#!" (which "python"))))))
>          (add-after 'unpack 'fix-depends
>            (lambda* (#:key inputs #:allow-other-keys)
>              (substitute* "src/depends.py"
>                (("import ctypes.util")
>                 "import ctypes.util
>             ctypes.util.find_library('m')")

I haven't tried playing with it myself yet, but this stood out to me.
The indentation is correct, but with the open quote that's a lot of
spaces. If it's supposed to be a new line then
ctypes.util.find_library('m') should be all the way on the left. I'm not
sure how python handles the extra spaces in .py files.

>                (("libcrypto.so")
>                 (string-append (assoc-ref inputs "openssl")
>                                "/lib/libcrypto.so")))))
>          (add-after 'unpack 'fix-local-files-in-paths
>            (lambda* (#:key inputs outputs #:allow-other-keys)
>              (substitute* "src/proofofwork.py"
>                (("bitmsghash.so")
>                 (string-append (assoc-ref outputs "out")
>                                "/lib/bitmsghash.so")))))
>          (add-after 'unpack 'fix-pyelliptic
>            (lambda* (#:key inputs outputs #:allow-other-keys)
>              (substitute* "src/pyelliptic/openssl.py"
>                (("libcrypto.so")
>                 (string-append (assoc-ref inputs "openssl")
>                                "/lib/libcrypto.so"))
>                (("libssl.so")
>                 (string-append (assoc-ref inputs "openssl")
>                                "/lib/libssl.so")))))
>          (delete 'check) ; not available
>          (replace 'install
>            (lambda* (#:key inputs outputs #:allow-other-keys)
>              (let* ((out (assoc-ref outputs "out"))
>                     (python (assoc-ref inputs "python"))
>                     (python-version
>                      (last (string-split python #\-)))
>                     (python-major+minor
>                      (string-join
>                       (take (string-split python-version #\.) 2)
>                       "."))
>                     ;;(path (getenv "PYTHONPATH"))
>                     (pylib (string-append out "/lib/python"
>                                           python-major+minor
>                                           "/site-packages"))
>                     (bin (string-append out "/bin"))
>                     (doc (string-append out "/share/man/man1"))
>                     (lib (string-append out "/lib"))
>                     (share (string-append out "/share/applications"))
>                     (icons24 (string-append out "/share/icons/hicolor/24x24/apps"))
>                     (iconss (string-append out "/share/icons/hicolor/scalable/apps"))
>                     (pixmaps (string-append out "/share/pixmaps")))
>                (chdir "../..")
>                (install-file "src/bitmsghash/bitmsghash.so" lib)
>                (delete-file-recursively "src/bitmsghash")
>                (delete-file "src/build_osx.py")
>                (copy-recursively "src" (string-append pylib "/pybitmessage"))
>                (install-file "man/pybitmessage.1.gz" doc)
>                (install-file "desktop/pybitmessage.desktop" share)
>                (install-file "desktop/icon24.png" icons24)
>                (install-file "desktop/can-icon.svg" iconss)
>                (install-file "desktop/icon14.xpm" pixmaps)
>                ;; this breaks at the minimum depends.py:
>                ;; (for-each (lambda (file)
>                ;;             (wrap-program file
>                ;;               `("PYTHONPATH" ":" prefix (,path))))
>                ;;           (find-files pylib "\\.*$"))
>                ;; #t))))))
>                ))))))
>     (license license:expat)
>     (description
>      "Distributed and trustless peer-to-peer communications protocol
> for sending encrypted messages to one person or many subscribers.")
>     (synopsis "Distributed peer-to-peer communication")
>     (home-page "https://bitmessage.org/")))
> ~~~~~
> 
> thanks,
> --
> ♥Ⓐ  Mx ng0
> For non-prism friendly talk find me on
> psyced.org / loupsycedyglgamf.onion
> 

-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: pybitmessage fails to detect PyQt4.QtCore module due to sip error
  2016-06-27  2:06 ` Efraim Flashner
@ 2016-06-27 23:18   ` ng0
  0 siblings, 0 replies; 3+ messages in thread
From: ng0 @ 2016-06-27 23:18 UTC (permalink / raw)
  To: guix-devel

Hi,

Efraim Flashner writes:

>> ~~~~~
>> gnu/packages/python.scm:
>> #:use-module (gnu packages qt)
>>
....
>>     (arguments
>>      `(#:modules ((srfi srfi-1)
>>                   ,@%gnu-build-system-modules)
>>        #:phases
>>        (modify-phases %standard-phases
>>          ;; A Makefile exists but needs too much patching.
>>          (replace 'build
>>            (lambda* (#:key outputs #:allow-other-keys)
>>              (chdir "src/bitmsghash")
>>              (system* "make")
>>              #t))
>>          (add-after 'unpack 'fix-unmatched-python-shebangs
>>            (lambda* (#:key inputs #:allow-other-keys)
>>              (substitute* "src/bitmessagemain.py"
>>                (("#!/usr/bin/env python2.7")
>>                 (string-append "#!" (which "python"))))
>>              (substitute* "src/bitmessagecli.py"
>>                (("#!/usr/bin/env python2.7.x")
>>                 (string-append "#!" (which "python"))))))
>>          (add-after 'unpack 'fix-depends
>>            (lambda* (#:key inputs #:allow-other-keys)
>>              (substitute* "src/depends.py"
>>                (("import ctypes.util")
>>                 "import ctypes.util
>>             ctypes.util.find_library('m')")
>
> I haven't tried playing with it myself yet, but this stood out to me.
> The indentation is correct, but with the open quote that's a lot of
> spaces. If it's supposed to be a new line then
> ctypes.util.find_library('m') should be all the way on the left. I'm not
> sure how python handles the extra spaces in .py files.
>

Those were added because python syntax required them to match. I
don't know in which way I could insert this precise (not like
displayed here, it's less in the resulting file) amount of white
spaces.

If I got the right part here pasted, it creates this:

import re
if re.match(r'linux|darwin|freebsd', sys.platform):
    try:
        import ctypes.util
        ctypes.util.find_library('m')
        path = ctypes.util.find_library('ssl')
        if path not in paths:
            paths.append(path)
    except:
        pass


it might be off in python syntax in the email in the snippet I
just pasted because it broke while pasting, had to recreate the
intendation.

--
♥Ⓐ  Mx ng0
For non-prism friendly talk find me on
psyced.org / loupsycedyglgamf.onion

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-06-27 23:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-26 20:36 pybitmessage fails to detect PyQt4.QtCore module due to sip error ng0
2016-06-27  2:06 ` Efraim Flashner
2016-06-27 23:18   ` ng0

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).