Author Topic: Unable to build for Ubuntu PPA  (Read 10527 times)

Offline Xaviou

  • Regular
  • ***
  • Posts: 408
    • X@v's wxStuff
Unable to build for Ubuntu PPA
« on: August 03, 2023, 12:42:29 am »
Hi.
I was trying to setup a PPA repository, to provide Nightly Builds for Ubuntu users, but after a few tests, I encountered a build problem.

I first had to force "setup_control.sh" with debian version 11, because Ubuntu 22.04 LTS is based on Debain Bookworm in an unstable version, witch still have libwxgtk-3.0 instead of libwxgtk-3.2 present in the stable version. (I'll soon make a second update of this script with this)

The main problem is that the build fails because of the "PKG_CHECK_MODULES" macro in the configure scipt, and I really don't know how to get rid of this.
I've attached the build log if needed.

Does anyone have a solution for this ?

Regards
Xav'
The french wxWidgets site : http://www.wxdev.fr
My wxWidgets's stuff : https://wxstuff.xaviou.fr/

Offline blauzahn

  • Almost regular
  • **
  • Posts: 173
Re: Unable to build for Ubuntu PPA
« Reply #1 on: August 03, 2023, 06:34:50 am »
Because of the not up to date wxwidgets I always use wxwidgets trunk which I install in /opt/wx. There, wxwidgets trunk can coexist with the version provided by the Linux distro. That way you still can install other programs of your distro which rely on its original wxwidgets. I use it on Ubuntu as well as on Arch, Raspberry PI OS. It has been a while that I used it on FreeBSD also. It is an out of tree build in order to keep trunk relatively clean, apart from the changes made by bootstrap.

On distros based on apt-packages I install wxwidgets and cb with checkinstall. This probably isn't suitable for being used in a PPA repository though. I never bothered to make one because I just call checkinstall which creates and installs a debian package for me.

a snippet out of my wxwidgets Makefile:
Code
trunk=trunk
build=build
WX_PREFIX=/opt/wx

config:
    @mkdir -p $(build)
    @(cd $(build) && ../$(trunk)/configure --prefix=$(WX_PREFIX) --with-cxx=14)

a snippet out of my cb Makefile:
Code
trunk=trunk
build=build
WX_PREFIX=/opt/wx

bootstrap:
    (cd $(trunk) && ACLOCAL_FLAGS="-I `$(WX_PREFIX)/bin/wx-config --prefix`/share/aclocal" ./bootstrap )

config:
@mkdir -p $(build)
(cd $(build) && \
  LT_SYS_LIBRARY_PATH=$(WX_PREFIX)/lib \
  ../$(trunk)/configure \
  --with-wx-config=$(WX_PREFIX)/bin/wx-config --with-wx-prefix=$(WX_PREFIX) \
    --disable-code-completion \
  --with-contrib-plugins=all,-NassiShneiderman,-codesnippets)

Have a nice day.

Offline Xaviou

  • Regular
  • ***
  • Posts: 408
    • X@v's wxStuff
Re: Unable to build for Ubuntu PPA
« Reply #2 on: August 04, 2023, 12:23:22 pm »
Hi.

Well, the problem is not wxWidgets related : it is only the call to the "PKG_CHECK_MODULES" macro.
It appears only once in the configure script for Ubuntu (see attached configure file):
Code
19863 : PKG_CHECK_MODULES(zlib, zlib, HAVE_ZLIB=yes, HAVE_ZLIB=no)
And this is the line causing the error:
Code
......
checking for vsnprintf... yes
/<<PKGBUILDDIR>>/./configure: line 19863: syntax error near unexpected token `zlib,'
/<<PKGBUILDDIR>>/./configure: line 19863: `PKG_CHECK_MODULES(zlib, zlib, HAVE_ZLIB=yes, HAVE_ZLIB=no)'
make: *** [/usr/share/cdbs/1/class/autotools.mk:46: debian/stamp-autotools] Error 2
dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2

Regards
Xav'
The french wxWidgets site : http://www.wxdev.fr
My wxWidgets's stuff : https://wxstuff.xaviou.fr/

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1605
Re: Unable to build for Ubuntu PPA
« Reply #3 on: August 04, 2023, 01:36:30 pm »
There are references to this issue here:
Quote
This happens when pkg-config has not been installed when running autoreconf prior to executing configure script.

Offline Xaviou

  • Regular
  • ***
  • Posts: 408
    • X@v's wxStuff
Re: Unable to build for Ubuntu PPA
« Reply #4 on: August 04, 2023, 01:54:20 pm »
Hi
There are references to this issue here:
Quote
This happens when pkg-config has not been installed when running autoreconf prior to executing configure script.
I've checked this : pkg-config has been installed.

I think I've found a fix : adding AC_CONFIG_MACRO_DIRS([m4]) after LT_INIT (configure.ac line 27) seems to do the job.

I'll launch a ppa build to confirm.
Regards
Xav'
The french wxWidgets site : http://www.wxdev.fr
My wxWidgets's stuff : https://wxstuff.xaviou.fr/

Offline Xaviou

  • Regular
  • ***
  • Posts: 408
    • X@v's wxStuff
Re: Unable to build for Ubuntu PPA
« Reply #5 on: August 06, 2023, 10:35:34 am »
Hi.

I think I've found a fix : adding AC_CONFIG_MACRO_DIRS([m4]) after LT_INIT (configure.ac line 27) seems to do the job.

This fix works : I have succeeded  in building Code::Blocks for Ubuntu 22.04 and 23.04 (the build for 22.10 has been rejected saying that it was an obsolete version that won't accept new updated  :o ).
I' post a diff ASAP : I also have to modify the "setup_control.sh" file as ubuntu's wxWidgets dependencies for a version are not the same that the debian version it was created from.

I have another question regarding building with ppa : I saw in the "official" ppa ( https://launchpad.net/~codeblocks-devs ) that it was possible to launch builds for both i386 and amd64.
My ppa has i386 enabled, but as I create the source package on a 64bits VM of Ubuntu, it only launch amd64 builds.

I tried to modify manually the buildinfo file before signing the changes, replacing "Build-Architecture: amd64" by "Build-Architecture: i386 amd64", and updating the checksums in the ".changes" file.
Then I launched the "signing and uploading" process witch succeeded.

But I didn't received any acceptance or rejection mail as usual so I think the source package wasn't accepted.

Does anyone know how to specify both i386 and amd64 when creating the source package ?
I have also tested with "debuild -ai386" but it didn't worked : the sousrce package was created for amd64.

Regards
Xav'
The french wxWidgets site : http://www.wxdev.fr
My wxWidgets's stuff : https://wxstuff.xaviou.fr/

Offline sodev

  • Lives here!
  • ****
  • Posts: 500
Re: Unable to build for Ubuntu PPA
« Reply #6 on: August 07, 2023, 05:09:04 pm »
Ubuntu 22.10 is a non-LTS release and its support ended last month, probably because of that new packages aren't accepted.

Recent Ubuntu versions (20.04 or later? i can't remember) dropped the 32 bit subsystem completely, you can't do 32 bit builds for these releases.

Offline Xaviou

  • Regular
  • ***
  • Posts: 408
    • X@v's wxStuff
Re: Unable to build for Ubuntu PPA
« Reply #7 on: August 07, 2023, 08:59:50 pm »
Hi
Ubuntu 22.10 is a non-LTS release and its support ended last month, probably because of that new packages aren't accepted.
You're definitely right.

Recent Ubuntu versions (20.04 or later? i can't remember) dropped the 32 bit subsystem completely, you can't do 32 bit builds for these releases.
It seems a bit older than that : having a look in alternatives mirrors for download shows that the last available 32bits version is 16.04.

So this problem seems to be solved...

Thank you
Regards
Xav'
The french wxWidgets site : http://www.wxdev.fr
My wxWidgets's stuff : https://wxstuff.xaviou.fr/

Offline Xaviou

  • Regular
  • ***
  • Posts: 408
    • X@v's wxStuff
Re: Unable to build for Ubuntu PPA
« Reply #8 on: August 07, 2023, 10:40:23 pm »
Hi.
Here are 2 patchs:
  • diff1.patch if another update of the "setup_control.sh" script, using "lsb_release" to obtain codename instead of a simple "cat /etc/debian_version"
  • diff2.patch is an addition to allow automatic building for ppa

Regards
Xav'
The french wxWidgets site : http://www.wxdev.fr
My wxWidgets's stuff : https://wxstuff.xaviou.fr/

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1605
Re: Unable to build for Ubuntu PPA
« Reply #9 on: August 08, 2023, 09:45:10 am »
Patchs applied in r13331 and r13332, thank you.

Offline sodev

  • Lives here!
  • ****
  • Posts: 500
Re: Unable to build for Ubuntu PPA
« Reply #10 on: August 08, 2023, 04:04:59 pm »
According to this wxWidgets commit it may be more future proof to not use lsb_release but parse that information from /etc/os-release instead.

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1605
Re: Unable to build for Ubuntu PPA
« Reply #11 on: August 08, 2023, 06:31:22 pm »
Then the first part of setup_control.sh should be similar to this...
Code
if [ "$#" -ne 1 ] || [ -z "${1##*detect*}" ]; then
    echo "Doing version detection"
    test -e /etc/os-release && os_release='/etc/os-release' || os_release='/usr/lib/os-release'
    . "$os_release"
    if [ $ID = "debian" ] || [ $ID = "ubuntu" ]; then
        version=$VERSION_CODENAME
    else
        version=`cat /etc/debian_version`
    fi
else
    version=$1
fi

echo "Found version: $version"

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1605
Re: Unable to build for Ubuntu PPA
« Reply #12 on: August 09, 2023, 12:53:14 pm »
@xaviou, does the code in the previous post work for you?. os-release was added to systemd in 2012.

Offline Xaviou

  • Regular
  • ***
  • Posts: 408
    • X@v's wxStuff
Re: Unable to build for Ubuntu PPA
« Reply #13 on: August 09, 2023, 05:19:51 pm »
Hi

@xaviou, does the code in the previous post work for you?. os-release was added to systemd in 2012.
Seems to be ok : testedswith Debian Buster/Bullseye/Bookworm and Ubuntu Jammy/Lunar

Regards
Xav'
The french wxWidgets site : http://www.wxdev.fr
My wxWidgets's stuff : https://wxstuff.xaviou.fr/

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1605
Re: Unable to build for Ubuntu PPA
« Reply #14 on: August 09, 2023, 05:31:39 pm »
Applied in r13333, thank you for testing.