• combining pybuild and cmake

    From Ole Streicher@21:1/5 to All on Sun Aug 7 15:00:02 2022
    Hi,

    I am working on a package (https://salsa.debian.org/debian-astro-team/sep), that needs a two-stage build: First, a library is built with cmake/make,
    and then a Python (wrapper) package is built the usual way.

    I tried to just have two commands in d/rules:

    ---------------------------8<------------------------------------------
    %:
    dh $@ --buildsystem=cmake
    PYBUILD_NAME=sep dh $@ --with python3 --buildsystem=pybuild ---------------------------8<------------------------------------------

    however this seems to completely confuse the whole build system: it
    somehow re-executes the cmake build in the second step, doesn't call
    setup.py at all, and then doesn't find files to put into the package.

    What is the proper way to do this?

    Best regards

    Ole

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jeremy Sowden@21:1/5 to Ole Streicher on Sun Aug 7 16:20:02 2022
    On 2022-08-07, at 14:26:07 +0200, Ole Streicher wrote:
    I am working on a package
    (https://salsa.debian.org/debian-astro-team/sep), that needs a
    two-stage build: First, a library is built with cmake/make, and then a
    Python (wrapper) package is built the usual way.

    I tried to just have two commands in d/rules:

    ---------------------------8<------------------------------------------
    %:
    dh $@ --buildsystem=cmake
    PYBUILD_NAME=sep dh $@ --with python3 --buildsystem=pybuild ---------------------------8<------------------------------------------

    however this seems to completely confuse the whole build system: it
    somehow re-executes the cmake build in the second step, doesn't call
    setup.py at all, and then doesn't find files to put into the package.

    What is the proper way to do this?

    Don't know whether it the proper way to do it, but this:

    $ cat debian/rules
    #!/usr/bin/make -f
    #export DH_VERBOSE=1

    %:
    dh $@ --with python3

    override_dh_auto_clean:
    dh_auto_clean -O--buildsystem=cmake
    dh_auto_clean -O--buildsystem=pybuild

    override_dh_auto_configure:
    dh_auto_configure -O--buildsystem=cmake
    dh_auto_configure -O--buildsystem=pybuild

    override_dh_auto_build:
    dh_auto_build -O--buildsystem=cmake
    dh_auto_build -O--buildsystem=pybuild

    override_dh_auto_install:
    dh_auto_install -O--buildsystem=cmake
    dh_auto_install -O--buildsystem=pybuild

    appears to put the right files in debian/tmp:

    $ find debian/tmp/
    debian/tmp/
    debian/tmp/usr
    debian/tmp/usr/lib
    debian/tmp/usr/lib/python3.10
    debian/tmp/usr/lib/python3.10/dist-packages
    debian/tmp/usr/lib/python3.10/dist-packages/sep-1.2.1.egg-info
    debian/tmp/usr/lib/python3.10/dist-packages/sep-1.2.1.egg-info/top_level.txt
    debian/tmp/usr/lib/python3.10/dist-packages/sep-1.2.1.egg-info/requires.txt
    debian/tmp/usr/lib/python3.10/dist-packages/sep-1.2.1.egg-info/PKG-INFO
    debian/tmp/usr/lib/python3.10/dist-packages/sep-1.2.1.egg-info/dependency_links.txt
    debian/tmp/usr/lib/python3.10/dist-packages/sep.cpython-310-x86_64-linux-gnu.so
    debian/tmp/usr/lib/x86_64-linux-gnu
    debian/tmp/usr/lib/x86_64-linux-gnu/libsep.so
    debian/tmp/usr/lib/x86_64-linux-gnu/libsep.so.0
    debian/tmp/usr/lib/x86_64-linux-gnu/libsep.so.0.6.0
    debian/tmp/usr/include
    debian/tmp/usr/include/sep.h

    J.

    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCgAdFiEEbB20U2PvQDe9VtUXKYasCr3xBA0FAmLvw8gACgkQKYasCr3x BA0wjA//QpWU2I5UaPu9Po0vH+lZLeIvmgsV02BFsiQjaPRXBPWDOm8zcZjmv/o1 q4Wm3mBhU09h8DTAiXDm5IGLXGdSdxwQR1fIBA692VFvLNbVmb/HZYZ8JtuwmC1P rBEeIUj/MRLiXlPFDdgLExyV7lSBnOyT+ZA4yrQAcKxwGiigYJlaY1yBYkbEPgAL 4L6UYCSpwE1/0aUbz+fqaq7mcqXqq1BYQnW5SHpIi7yunxY/zU6aw6qCnJCsbnim 38LEL+c3FMenNmIHf+h/Nb4E8uVqbrJpWcE5qXsCIdIM7xTK7Z4Ns0gJod1sx6My PvBQB1/UPVpojzd1Ob+7eShukTAJo7/XM5xwotdXErKQLUno45CYROPEnIdBtLBp n4tNX6UJKrqnOomQ89YQb5hXvo9bTxLwgJWTAK75yNFUZ9sFG+g5Jby9rfvwT8zA 40OCBstauDksnn46ddHMZVR4Fympv/pF76ZPIOf3rPHf+yRqZmdSynghnA1ZEfdP XzFJlNepr5wXRceMnWLVmmJL3V/4S5J/jBRm6GtBm8xiTUUwIXeXd3vZTvD3GgKT kUpUyQbRCoS7XMw00VyemWIacUXY4OESFzygNSOOghFjg/S/scsCQzCf8rRpP4CJ y857+5IVt399/zU1YAcNQLTcR5Zdi6cUAP7mK67I9APlNvW7ogo=
    =etQR
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ole Streicher@21:1/5 to Jeremy Sowden on Sun Aug 7 19:10:01 2022
    Hi Jeremy,

    Jeremy Sowden <[email protected]> writes:
    Don't know whether it the proper way to do it, but this:

    $ cat debian/rules
    #!/usr/bin/make -f
    #export DH_VERBOSE=1

    %:
    dh $@ --with python3

    override_dh_auto_clean:
    dh_auto_clean -O--buildsystem=cmake
    dh_auto_clean -O--buildsystem=pybuild
    [...]
    appears to put the right files in debian/tmp [...]

    That solves my problem. Thank you very much!

    Cheers

    Ole

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)