You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@dlech I can't figure out what needs to be added so that the library is installed into the correct location for Micropython as well. I am guessing the logic for python3 packaging is implicit here:
debhelper knows about python, so basically it does everything for you automatically. It doesn't know anything about micropython, so you have to do everything manually in the debian/rules file. And you will need to add the package that provides mpy-cross to the build depends in debian/control.
@dlech a few questions about the micropython-lib rules file and how it applies here:
Why does the mpy_files list include things like READMEs? As far as I can tell, it seems like the files that don't end with .mpy will match the % rule and therefore be passed to the dh command... but I don't understand what that's supposed to do.
Presuming I want the Micropython files in our existing package, I think I would need separate set of rules to execute dh without the python addon. Is that right, and if so what should the rule structure look like?
Why does the mpy_files list include things like READMEs?
The READMEs aren't supposed to be there. They probably just got overlooked since there are so many files.
As far as I can tell, it seems like the files that don't end with .mpy will match the % rule and therefore be passed to the dh command... but I don't understand what that's supposed to do.
Actually, they are only used as prerequisites. The .mpy files don't exist, so using them as a prerequisite causes them to be create via the %.mpy: %.py rule, but any other files already exist, so no action is taken on these files (other than installing them later in the override_dh_auto_install rule.
Presuming I want the Micropython files in our existing package,
They will need to be in the same source package, but in a different binary package. This means we need to add a second binary package (e.g. micropython-ev3dev2) to the debian/control file. Then we will need to add debian/python3-ev3dev2.install and debian/micropython-ev3dev2.install files to get the right files installed in the right packages. We can add the following to debian/rules to ensure we don't miss any files:
override_dh_install:
dh_install --fail-missing
I think I would need separate set of rules to execute dh without the python addon. Is that right, and if so what should the rule structure look like?
The rules file only gets called once when building the debian package, so we actually need to extend existing rules rather than adding new ones. So, we should be able to copy the overrides from the micropython-lib rules file but also call the base functions that we are overriding so that the python 3 package still gets built. Something like this should do the trick:
Activity
dlech commentedon Sep 15, 2018
Have a look at this: https://github.com/ev3dev/micropython-lib/blob/ev3dev-stretch/debian/rules
dlech commentedon Sep 15, 2018
debhelper knows about python, so basically it does everything for you automatically. It doesn't know anything about micropython, so you have to do everything manually in the
debian/rulesfile. And you will need to add the package that providesmpy-crossto the build depends indebian/control.WasabiFan commentedon Dec 2, 2018
@dlech a few questions about the micropython-lib
rulesfile and how it applies here:mpy_fileslist include things like READMEs? As far as I can tell, it seems like the files that don't end with.mpywill match the%rule and therefore be passed to thedhcommand... but I don't understand what that's supposed to do.dhwithout the python addon. Is that right, and if so what should the rule structure look like?dlech commentedon Dec 2, 2018
The READMEs aren't supposed to be there. They probably just got overlooked since there are so many files.
Actually, they are only used as prerequisites. The .mpy files don't exist, so using them as a prerequisite causes them to be create via the
%.mpy: %.pyrule, but any other files already exist, so no action is taken on these files (other than installing them later in theoverride_dh_auto_installrule.They will need to be in the same source package, but in a different binary package. This means we need to add a second binary package (e.g.
micropython-ev3dev2) to thedebian/controlfile. Then we will need to adddebian/python3-ev3dev2.installanddebian/micropython-ev3dev2.installfiles to get the right files installed in the right packages. We can add the following todebian/rulesto ensure we don't miss any files:override_dh_install: dh_install --fail-missingThe rules file only gets called once when building the debian package, so we actually need to extend existing rules rather than adding new ones. So, we should be able to copy the overrides from the
micropython-librules file but also call the base functions that we are overriding so that the python 3 package still gets built. Something like this should do the trick: