ilbers / isar

Integration System for Automated Root filesystem generation
Other
177 stars 72 forks source link

Allow architecture all for recipes #59

Closed berndschultze closed 5 years ago

berndschultze commented 5 years ago

We use a fork of the isar project and build python deb packages (among others). We would like to set the architecture to "all" for platform independent python packages. At the moment we build amd64 packages and the python packages also have this architecture in their debian control info, although they are platform independent.

We had a solution in the past. We changed the dpkg-raw.bbclass: ... PKG_ARCH ?= "${DISTRO_ARCH}" ... do_deb_package_prepare() { rm -rf ${D}/DEBIAN mkdir -p ${D}/DEBIAN cat<<-__EOF__ > ${D}/DEBIAN/control Package: ${PN} Architecture: ${PKG_ARCH} ...

We could just overwrite the PKG_ARCH variable in our recipes. This repository's version was: The version of this repo was [https://github.com/ilbers/isar/commit/f301ccb2b5b1ca4da0af490e7dfc63bdf2ae048b#diff-d0d8ba571805d63eb72f2f104a94b06f](url)

This would not work any more and it would also not be a good solution as we would lose this change the next time we refresh our repo with a new isar version. It would be nice if a solution for setting the architecture to "all" for a recipe for a platform independent package could be integrated in this repo. Thank you.

ismagulb commented 5 years ago

The best way to build packages is to use debianized source packages, the ones from Debian or your own. After using dh_make once, it shouldn't be more complicated than dpkg-raw.

Could you provide a minimal _all recipe that used to work?

berndschultze commented 5 years ago

We had a and still have a working bbclass to build the packages which does a fakeroot install: inherit dpkg-raw DEBIAN_DEPENDS = "python3" SETUP_PY_DIR = "${WORKDIR}/${SRCNAME}-${PV}"

do_install () { cd ${SETUP_PY_DIR} python3 setup.py install --root ${D} }

Then a specific python package recipe just overwrites the parameters: PV = "0.3.32" SRC_URI[md5sum] = "5872e6a131383d69e1ac31ce058a0aa9" SRC_URI[sha256sum] = "6582030f5a21b1bf7efa5d767b8ece68ce116380bc0defb624606b990ce5d891" SRCNAME = "pyhocon" SRC_URI = "https://files.pythonhosted.org/packages/source/p/${SRCNAME}/${SRCNAME}-${PV}.tar.gz"

inherit ourclass

DESCRIPTION = "Pyhocon deb package" DEBIAN_DEPENDS += ", python3-pyparsing" PKG_ARCH = "all"

It still works, but the architecture is set to amd64 as PKG_ARCH is no more functional. (This still works, but it would be nice to be able to set the architecture for recipes if possible.)

ismagulb commented 5 years ago

I'd still suggest to look at a dh_make tutorial for native packaging of pyhocon. That would make your package independent of Isar internals. dpkg-raw is really intended as a quick aid for typical cases, not as a permanent solution.

The arch is hard-coded to "any" in meta/classes/debianize.bbclass. You might want to make it configurable and send a patch to Isar mailing list.

For stock Isar, a workaround could be to let dpkg-raw generate debian/control for you, then provide your modified copy of that along with your recipe (check meta/classes/debianize.bbclass for the exact location).

berndschultze commented 5 years ago

Thank you for your help. We should probably switch to dh_make but can use the workaround until then. Sorry for the delay.

ismagulb commented 5 years ago

Thanks for the feedback!