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

Re: combining pybuild and cmake



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.

Attachment: signature.asc
Description: PGP signature


Reply to: