Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

building Debian packages with docker #3

Open
jallwine opened this issue Oct 5, 2020 · 2 comments
Open

building Debian packages with docker #3

jallwine opened this issue Oct 5, 2020 · 2 comments

Comments

@jallwine
Copy link

jallwine commented Oct 5, 2020

The MachineKit-HAL documentation does a great job explaining how to build Debian packages using docker. Is there a comparable process for EMCApplication?

@cerna
Copy link
Contributor

cerna commented Oct 6, 2020

@jallwine,
not in written form. I was planning to implement automatic building in Github Actions, but somehow it is taking longer than expected (procrastination, not that it is somehow complicated).

The LinuxCNC builds natively, there is no support for cross building as far as I know. So I have been using QEMU. You will need to use either multiarch/qemu-user-static (last time I have tried it they were using older version of QEMU with missing one important syscall needed in gLibC), follow direction in this issue or install it from package (for Debian, use the SID version, it has no dependencies).

Then run for Debian 10 Buster and armhf:

 docker run --rm -it -v "$(pwd):/emca/emca" debian:buster@sha256:82c62e2f1ed6045d002f848c1ddd4d910161e1f5007398097ac0f8512d70a969 bash -i
dpkg --print-architecture && uname -m
apt update
apt upgrade
apt install build-essential fakeroot devscripts equivs sudo curl python python3
adduser mk
echo "ALL ALL = (ALL) NOPASSWD: ALL" >> /etc/sudoers
chown -R mk:mk /emca
su mk
curl -k \
  'https://dl.cloudsmith.io/public/machinekit/machinekit/cfg/setup/bash.deb.sh' \
  | sudo -E bash
curl -k \
  'https://dl.cloudsmith.io/public/machinekit/machinekit-hal/cfg/setup/bash.deb.sh' \
  | sudo -E bash
debian/configure machinekit-hal no-docs
Patch the debian/changelog last entry to include version line without the - before 1 (2.9.0~pre0.23503.1.git078075e92~buster)
Patch the debian/control file to include python3 specific packages
mk-build-deps -irs sudo
Patch the generated debian/rules file to include --with-python=python3 --with-boost-python=boost_python-py35 in configure stage and also other python2 specific commands
dpkg-buildpackage -us -uc
cp ../*.deb . 

In QEMU it can happen that the automatic @cloudsmith-io script will have problem with importing keys (this is also reason why I am using the curl -k), so you may be forced to set it up manually: Machinekit repo example.

It takes a quite some time to compile it on my i7-8550u. And as you can see, there is some need for patching. (Basically to copy the LinuxCNC/linuxcnc#943 PR.) I will try to create PR addressing this soon.

The version line problem (2.9.0~pre0.23503.1.git078075e92~buster) is caused by later version of Debian packaging standard used and the fact that EMCApplication is using in-tree packaging, so the Debianization package version number is considered invalid.

I will also create a page in documentation (so I don't forget it again).


Another reason is to install version of Machinekit-HAL (machinekit-hal and machinekit-hal-dev) from before the Python 3 switch - which I just realized is not possible for you.

@cerna
Copy link
Contributor

cerna commented Oct 13, 2020

@jallwine,
I have added basic documentation for EMCApplication to the Machinekit website.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants