Hi Gordon, Ken,

Thanks for your useful explainations.  Neither of them solved my
problem fully, but the combination did. :-)

To document this for future readers, this is what I did, which is
different from the approach taken by the PIP package, but allows
for offline-building just from the pristine qpid-proton source.

I decided to reuse as much of the original build process as possible.
So I disabled everything except for the Python bindings and built
qpid-proton normally:

    cmake \
        -DBUILD_CPP=OFF -DBUILD_PERL=OFF -DBUILD_RUBY=OFF -DBUILD_JAVA=OFF \
        -DBUILD_GO=OFF -DBUILD_JAVASCRIPT=OFF -DBUILD_PHP=OFF

    make -j 4

Now, all I needed to do was to assemble the second last build results,
that is, all *.o files of Proton-C and Proton-Python.  Listing them
was fairly straight forward:

    find \
        proton-c/CMakeFiles/qpid-proton.dir \
        proton-c/bindings/python/CMakeFiles/_cproton.dir \
        -name '*.o'

Using this as a sub command, I linked them together into a single *.so
file, taking care of the OpenSSL dependency:

    gcc \
        -shared \
        $(find \
            proton-c/CMakeFiles/qpid-proton.dir \
            proton-c/bindings/python/CMakeFiles/_cproton.dir \
            -name '*.o') \
        $(pkg-config openssl --libs) \
        -o _cproton.so

Interestingly, the resulting *.so had very few dependencies in total,
but it worked!  I did not even need link to "libpython2.7.so.*".

    $ ldd _cproton.so

    linux-vdso.so.1 (0x00007ffe98189000)
    libssl.so.1.0.2 => /usr/lib/x86_64-linux-gnu/libssl.so.1.0.2 
(0x00007f37510b2000)
    libcrypto.so.1.0.2 => /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.2 
(0x00007f3750c4f000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f37508ad000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f37506a9000)
    /lib64/ld-linux-x86-64.so.2 (0x000055b75c64f000)

Finally, I stripped debug symbols and similar from _cproton.so to
reduce its size, which was not necessary but a matter of taste:

    strip -s _cproton.so

Afterwards, I needed to install just the following files:

    _cproton.so
    proton-c/bindings/python/cproton.py
    proton-c/bindings/python/proton/*.py


Regards,
Volker

-- 
Volker Diels-Grabsch
----<<<((()))>>>----

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to