Author Topic: Code::Blocks build dependencies under ubuntu?  (Read 416 times)

Offline cacb

  • Regular
  • ***
  • Posts: 424
Code::Blocks build dependencies under ubuntu?
« on: February 20, 2020, 01:50:20 pm »
Hi,

With reference to http://forums.codeblocks.org/index.php/topic,22137.msg150688.html#msg150688

Last night I was trying to build Code::Blocks for a virtual machine running Kubuntu 18.04.04 and used the latest from https://github.com/obfuscated/codeblocks_sf 

In order for ./configure to work successfully a number of dependencies must be met, but I am not quite sure what they are these days, so my question is whether this is documented somewhere? I would like to make a shell script that, given a fresh "off the shelf" Kubuntu 18.04, installed all required codeblocks build dependencies and then successfully built the whole thing.

My attempt list night failed with a message from ./configure I could not quite understand, most likely I made some mistake. If required, I can repeat the excercise and provide the exact message, but first I would try to ensure I have all the dependencies satisified, therefore the question about build dependencies.

Are the build dependencies documented somewhere?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12377
    • Travis build status
Re: Code::Blocks build dependencies under ubuntu?
« Reply #1 on: February 20, 2020, 07:39:30 pm »
Yes, in the configure script.
If you want to have problem free building just use
Code: [Select]
dpkg-buildpackage -us -uc
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline cacb

  • Regular
  • ***
  • Posts: 424
Re: Code::Blocks build dependencies under ubuntu?
« Reply #2 on: February 20, 2020, 08:44:22 pm »
Yes, in the configure script.
Ok, I guess that refers to the configure.ac file. I am not familiar with that syntax, but it is probably the correct answer  :P

If you want to have problem free building just use
Code: [Select]
dpkg-buildpackage -us -uc
Thanks, you are right, this works fine. I checked the meaning of the options -us -uc and I guess it just means avoiding some warnings of "unsigned source".

Using dpkg-buildpackage you get *.deb files that install to /usr, which is fine for this kind of virtual machine that I am setting up. But if you want it in a different location I guess the correct way is to edit debian/rules and under DEB_CONFIGURE_EXTRA_FLAGS set the --prefix=/usr to something different.


Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12377
    • Travis build status
Re: Code::Blocks build dependencies under ubuntu?
« Reply #3 on: February 20, 2020, 08:53:07 pm »
No idea, I don't use debian regularly, I just make sure it builds on ubuntu, because of popularity.
But why would you care where a package is installed? Its default is just fine. The idea is that locally build package is superseding the distro version, so you have no conflicts. Debian/ubuntu are shipping old versions anyway.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline cacb

  • Regular
  • ***
  • Posts: 424
Re: Code::Blocks build dependencies under ubuntu?
« Reply #4 on: February 20, 2020, 09:18:35 pm »
But why would you care where a package is installed? Its default is just fine. The idea is that locally build package is superseding the distro version, so you have no conflicts. Debian/ubuntu are shipping old versions anyway.

In this case the default is fine, I agree. My comment was actually inspired by what you said in another thread about installing to places where you can just delete without causing conflicts with other software.
http://forums.codeblocks.org/index.php/topic,22137.msg150685.html#msg150685

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12377
    • Travis build status
Re: Code::Blocks build dependencies under ubuntu?
« Reply #5 on: February 20, 2020, 11:45:24 pm »
Using packages means that you can uninstall all added files. This is the job of the package system - to manage all the files of the package.

make install/uninstall doesn't track files, they use the build rules to do this job, so if the rules change between the install and uninstall steps the uninstall won't be complete and there would be misery and suffering.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline cacb

  • Regular
  • ***
  • Posts: 424
Re: Code::Blocks build dependencies under ubuntu?
« Reply #6 on: February 21, 2020, 06:32:36 am »
Using packages means that you can uninstall all added files. This is the job of the package system - to manage all the files of the package.
A valid point. Thanks.

Offline cacb

  • Regular
  • ***
  • Posts: 424
Re: Code::Blocks build dependencies under ubuntu?
« Reply #7 on: February 27, 2020, 06:51:24 pm »
Yes, in the configure script.
If you want to have problem free building just use
Code: [Select]
dpkg-buildpackage -us -uc

Hi, I am revisiting this because I am experiencing trouble with this method as well. I still need to satisfy dependencies manually, and when I do the build still fails.

I began with a clean install of Kubuntu 18.04 running under virtualbox.

sudo apt install git
git clone https://github.com/obfuscated/codeblocks_sf
cd codeblocks_sf/
dpkg-buildpackage -us -uc


This fails because dpkg-dev is not installed, so I try again

sudo apt-install dpkg-dev
dpkg-buildpackage -us -uc


This results in the following message

dpkg-buildpackage -us -uc
dpkg-buildpackage: info: source package codeblocks
dpkg-buildpackage: info: source version 17.12svn11267
dpkg-buildpackage: info: source distribution unstable
dpkg-buildpackage: info: source changed by Jens Lody <[email protected]>
dpkg-buildpackage: info: host architecture amd64
 dpkg-source --before-build codeblocks_sf
dpkg-checkbuilddeps: error: Unmet build dependencies: debhelper (>= 7.4.11~) cdbs automake (>= 1.9) libtool (>= 1.4) libwxgtk2.8-dev | libwxgtk3.0-dev wx-common libbz2-dev zlib1g-dev libgtk2.0-dev libgamin-dev libboost1.40-dev | libboost-dev (>= 1.40) libboost-system-dev libhunspell-dev libfontconfig1-dev libglib2.0-dev
dpkg-buildpackage: warning: build dependencies/conflicts unsatisfied; aborting
dpkg-buildpackage: warning: (Use -d flag to override.)


I thought the dependencies would be resolved automatically to get a problem free build, but that is not what I am seeing. Ok, lets try to install those dependencies manually then.

sudo apt install debhelper cdbs automake libtool libwxgtk3.0-dev wx-common libbz2-dev zlib1g-dev libgtk2.0-dev libgamin-dev libboost-dev libboost-system-dev libhunspell-dev libfontconfig1-dev libglib2.0-dev

And then try again:

[email protected]:~/codeblocks_sf$ dpkg-buildpackage -us -uc
dpkg-buildpackage: info: source package codeblocks
dpkg-buildpackage: info: source version 17.12svn11267
dpkg-buildpackage: info: source distribution unstable
dpkg-buildpackage: info: source changed by Jens Lody <[email protected]>
dpkg-buildpackage: info: host architecture amd64
 dpkg-source --before-build codeblocks_sf
 fakeroot debian/rules clean
test -x debian/rules
rm -f debian/stamp-makefile-build debian/stamp-makefile-install
/usr/bin/make -C . -j1 -k distclean
make[1]: Entering directory '/home/ca/codeblocks_sf'
make[1]: *** No rule to make target 'distclean'.
make[1]: Leaving directory '/home/ca/codeblocks_sf'
/usr/share/cdbs/1/class/makefile.mk:91: recipe for target 'makefile-clean' failed
make: [makefile-clean] Error 2 (ignored)
rm -f debian/stamp-autotools
rmdir --ignore-fail-on-non-empty .
rmdir: failed to remove '.': Invalid argument
/usr/share/cdbs/1/class/autotools.mk:64: recipe for target 'makefile-clean' failed
make: [makefile-clean] Error 1 (ignored)
set -e;
rm -f debian/stamp-autotools-files
dh_clean
dh_clean: Compatibility levels before 9 are deprecated (level 7 in use)
 dpkg-source -b codeblocks_sf
dpkg-source: info: using source format '3.0 (native)'
dpkg-source: info: building codeblocks in codeblocks_17.12svn11267.tar.xz
dpkg-source: info: building codeblocks in codeblocks_17.12svn11267.dsc
 debian/rules build
test -x debian/rules
mkdir -p "."
set -e;   mv ./src/sdk/wxpropgrid/build/config.guess ./src/sdk/wxpropgrid/build/config.guess.cdbs-orig; cp --remove-destination /usr/share/misc/config.guess ./src/sdk/wxpropgrid/build/config.guess;   mv ./src/plugins/contrib/SpellChecker/wxspellchecker/build/config.guess ./src/plugins/contrib/SpellChecker/wxspellchecker/build/config.guess.cdbs-orig; cp --remove-destination /usr/share/misc/config.guess ./src/plugins/contrib/SpellChecker/wxspellchecker/build/config.guess;   mv ./src/plugins/contrib/wxContribItems/wxchart/build/config.guess ./src/plugins/contrib/wxContribItems/wxchart/build/config.guess.cdbs-orig; cp --remove-destination /usr/share/misc/config.guess ./src/plugins/contrib/wxContribItems/wxchart/build/config.guess;
set -e;   mv ./src/sdk/wxpropgrid/build/config.sub ./src/sdk/wxpropgrid/build/config.sub.cdbs-orig; cp --remove-destination /usr/share/misc/config.sub ./src/sdk/wxpropgrid/build/config.sub;   mv ./src/plugins/contrib/SpellChecker/wxspellchecker/build/config.sub ./src/plugins/contrib/SpellChecker/wxspellchecker/build/config.sub.cdbs-orig; cp --remove-destination /usr/share/misc/config.sub ./src/plugins/contrib/SpellChecker/wxspellchecker/build/config.sub;   mv ./src/plugins/contrib/wxContribItems/wxchart/build/config.sub ./src/plugins/contrib/wxContribItems/wxchart/build/config.sub.cdbs-orig; cp --remove-destination /usr/share/misc/config.sub ./src/plugins/contrib/wxContribItems/wxchart/build/config.sub;
touch debian/stamp-autotools-files
chmod a+x /home/ca/codeblocks_sf/./configure
chmod: cannot access '/home/ca/codeblocks_sf/./configure': No such file or directory
/usr/share/cdbs/1/class/autotools.mk:44: recipe for target 'debian/stamp-autotools' failed
make: *** [debian/stamp-autotools] Error 1
dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2
[email protected]:~/codeblocks_sf$


So what I actually going on here? Why is it failing and what can I do to fix it? Looks like the build is consistently failing on 'distclean' and then unable to recover? It seems to me the repository has an issue...

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12377
    • Travis build status
Re: Code::Blocks build dependencies under ubuntu?
« Reply #8 on: February 29, 2020, 01:54:16 pm »
You have to run the boostrap script in the main folder of the repo. It will turn the configure.ac file in configure file then you're good to go.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline cacb

  • Regular
  • ***
  • Posts: 424
Re: Code::Blocks build dependencies under ubuntu?
« Reply #9 on: March 01, 2020, 03:34:03 pm »
You have to run the boostrap script in the main folder of the repo. It will turn the configure.ac file in configure file then you're good to go.

Ok, thanks, that was one of the missing pieces indeed! I still found that this works only if the dependencies are already satisfied, so in my script that runs this I have to install the packages mentioned earlier. But now it builds properly.

Thanks again.