Setting up linuxcnc Stretch-uspace to build glade & linuxcnc

More
11 Jun 2018 00:13 - 13 Jun 2018 23:35 #112162 by InMyDarkestHour
First things first, this is a work in progress, so any problems will be welcomed.
Text in italics such as your-user-name is meant to be replaced by your user name.

Initial environment
Normal installation from this image
www.linuxcnc.org/testing-stretch-rtpreem...uspace-amd64-r10.iso

Upon first boot run to update apt
sudo apt-get update

Then run the following to update various packages (these include bug & security fixes and updates)
sudo apt-get dist-upgrade

So now the system is configured for apt and has latest fixes.
At this point you can choose to reboot or not.

Let's get the required glade version setup & installed
Create a build directory (which can be deleted later) The tilde character ~ is a shortcut for /home/your-user-name
mkdir ~/Downloads/glade-build
Change to created directory
cd ~/Downloads/glade-build
Download the glade sources
wget https://ftp.gnome.org/pub/GNOME/sources/glade3/3.8/glade3-3.8.6.tar.xz
Extract the glade sources
With x meaning extract, v meaning verbose, this is a personal preference and can be left out, and f means the next
text is the file your wish to work upon.

tar xvf glade3-3.8.6.tar.xz

So far so good.

Let's get the packages we need to build glade.
I put together a script to do the work, but if you want you can type it as one long command.
Anyway here is the script you can cut & paste into get-glade-deps.sh
A little explanation
# denotes the begining of comment
\ is a way of continuing the command on the next line, I feel it helps readability
Due to the way the script is run there is no shebang #!/bin/sh.
# run with sudo bash -c 'sh get-glade-dpes.sh'
apt-get install \
build-essential devscripts dh-make \
intltool python-gtk2-dev \
libxml2-dev \
gtk-doc-tools \
gnome-doc-utils \
liblablgtk2-gnome-ocaml-dev \
libglade2-dev \
libgladeui-common \
python-gtkglext1 \
devhelp \
itstool \
libcanberra-gtk-module \
libcanberra-gtk-dev

Now run the file with the following command
sudo bash -c 'sh get-glade-dpes.sh
If there is an error similar to this
./get-glade-deps.sh: 4: ./get-glade-deps.sh: intltool: not found
It points to an extra whitespace after the \ or a missing \ on the line before. Removing the whitespace after the \ or adding the missing \ on line 3 will fix it whatever the case my be. The last line does not require a final \ as it is the end of the multi line command.
If there is no errors from apt-get all has gone well.

Time to build glade deb packages
Change to the glade directory
cd glade3-3.8.6
Setup to build debs with dh-make
dh_make -c lgpl -s --createorig
Since we are making a very simple package for glade and one that does not get distributed we can basically ignore
Done. Please edit the files in the debian/ subdirectory now.
Time to make the deb packages
debuild -us -uc
At the end of the process lintian will through up some messages that can be ignored for our process. Any errors, which should be none will shows themselves up.

Installation of glade deb package
cd to the upper directory
cd ../
Running ls will give this ouput
get-glade-deps.sh glade3_3.8.6-1.debian.tar.xz
glade3-3.8.6 glade3_3.8.6-1.dsc
glade3_3.8.6-1_amd64.build glade3_3.8.6.orig.tar.xz
glade3_3.8.6-1_amd64.buildinfo glade3-3.8.6.tar.xz
glade3_3.8.6-1_amd64.changes glade3-dbgsym_3.8.6-1_amd64.deb
glade3_3.8.6-1_amd64.deb


The file of interest to us is glade3_3.8.6-1_amd64.deb. Since we already have the dependencies installed installation is as simple as
sudo dpkg -i glade3_3.8.6-1_amd64.deb
Now everything is setup, there is a menu entry in Programming, the catalog and pixmaps are ready to go and libraries are ready.

The source directory can now be removed by
rm -rf glade3-3.8.6

If you later wish to remove glade
sudo dpkg -r glade3
Last edit: 13 Jun 2018 23:35 by InMyDarkestHour. Reason: Removed make install steps and added dh-make to dep script & steps to create and install deb package
The following user(s) said Thank You: Mike_Eitel, trilobyte, phillc54, dokwine, fnaranjob

Please Log in or Create an account to join the conversation.

More
14 Jun 2018 00:06 - 14 Jun 2018 00:07 #112330 by InMyDarkestHour
Setup for a Build Environment for Linuxcnc

This is a continuation from the first post, all we a doing are adding the extra packages for building Linuxcnc from source.
I put together a script to do the work, but if you want you can type it as one long command.
Anyway here is the script you can cut & paste into get-linuxcnc-deps.sh
A little explanation
# denotes the begining of comment
\ is a way of continuing the command on the next line, I feel it helps readability
Due to the way the script is run there is no shebang #!/bin/sh.
# run with sudo bash -c 'sh get-linuxcnc-dpes.sh'
apt-get install \
devscripts \
tcl8.6-dev tk8.6-dev \
libreadline-gplv2-dev \
asciidoc dblatex \
dvipng graphviz groff \
imagemagick inkscape \
python-lxml source-highlight \
texlive-extra-utils \
texlive-font-utils \
texlive-fonts-recommended \
texlive-lang-cyrillic \
texlive-lang-french \
texlive-lang-german \
texlive-lang-polish \
texlive-lang-spanish \
texlive-latex-recommended \
w3c-linkchecker \
xsltproc \
libxmu-dev \
libglu1-mesa-dev libgl1-mesa-dev \
libboost-python-dev \
libmodbus-dev \
libusb-1.0-0-dev python-serial \
yapps2 \
asciidoc-dblatex \
libxaw7-dev \
-o APT::Install-Suggests=0 \
-o APT::Install-Recommends=0

Now run with the following command.
sudo bash -c 'sh get-linuxcnc-dpes.sh'

The last 2 lines are options to apt-get, they prevent the installation of about ~900MB of packages compared to ~190MB of packages.
If you get any errors whilst running the script please refer to the previous post regarding missing \ or extra whitespace at the end of a line.

Once apt-get finishes, without errors, you are ready to clone the linuxcnc repository with
cd ~
git clone git://github.com/linuxcnc/linuxcnc.git linuxcnc-dev
If want the master branch all is good
To checkout 2.7.13
cd linuxcnc-dev
git checkout 2.7

To checkout Linuxcnc 2.7-12 use this command in linuxcnc-dev directory
git checkout 0ba1ae2754ac05e86c87cad3d8b888a52c00f8e8 .
Do not forget . on the end

On the first build it will go something like this for a RIP build from the linuxcnc-dev directory.
cd src
./autogen.sh
./configure --with-realtime=uspace
make
sudo make setuid 

To run use the following
cd ../
. scripts/rip-environment
linuxcnc
Do not leave out the . before scripts/rip-environment

Have fun
Last edit: 14 Jun 2018 00:07 by InMyDarkestHour.

Please Log in or Create an account to join the conversation.

Time to create page: 0.072 seconds
Powered by Kunena Forum