rickyrockrat / parcellite

GNU General Public License v3.0
220 stars 29 forks source link

Building fails on Ubuntu #52

Closed felagund closed 3 years ago

felagund commented 3 years ago

Both on Ubuntu 20.10 and 18.04, buliding parcellite fails. Details are in this bug report: https://github.com/rickyrockrat/parcellite/issues/44#issuecomment-708706942

This also seems to be related: https://github.com/rickyrockrat/parcellite/issues/40

rickyrockrat commented 3 years ago

Working on it. Using ubuntu 20.04 in docker to see if I can get it to build there and get some debs up.

rickyrockrat commented 3 years ago

I used a docker build like so: FROM ubuntu:20.04 RUN apt-get update && apt-get -y install sudo bash RUN sudo apt-get -y install build-essential gcc automake gettext intltool pkg-config vim libgtk2.0-dev

WORKDIR / ENTRYPOINT /bin/bash

Then mounted my source directory via a docker run, and followed these steps: ./autogen.sh I ignored these messages configure.ac:7: warning: AM_INIT_AUTOMAKE: two- and three-arguments forms are deprecated. For more info, see: configure.ac:7: https://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_005fINIT_005fAUTOMAKE-invocation src/Makefile.am:3: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS') src/Makefile.am:1: warning: 'CFLAGS' is a user variable, you should not override it; src/Makefile.am:1: use 'AM_CFLAGS' instead autoconf... Then ran ./configure then ran make. It built a parcellite exeutable.

Can you confirm installing the packages above works?

rickyrockrat commented 3 years ago

I did the same thing with a 20.10 Ubuntu, and it also builds. Lots of deprecated warnings, of course.

felagund commented 3 years ago

No, that does not work for me on my install. Make says make: *** No targets specified and no makefile found. Stop.

The error messages are the same still.

No idea how docker image differs from an actuall install. Could it be I have more packages installed and they somehow get in conflict with each other (there are several versions of automake in the repositories for example).

Sorry for responding late, I was travelling without my computer.

aaFn commented 3 years ago

Hi @rickyrockrat , reopening this one as I have the same problem on RHEL 8.4 (and it really looks like #40 and https://github.com/rickyrockrat/parcellite/issues/44#issuecomment-708706942 as said above

I have the following installed:

autoconf-0:2.69-27.el8.noarch automake-0:1.16.1-7.el8.noarch gettext-0:0.19.8.1-17.el8.x86_64 gettext-common-devel-0:0.19.8.1-17.el8.noarch gettext-devel-0:0.19.8.1-17.el8.x86_64 intltool-0:0.51.0-11.el8.noarch gtk2-devel-0:2.24.32-5.el8.x86_64

only one version of autoconf and automake.

./autogen.sh reports:

Making aclocal.m4 writable ...
intltoolize...
aclocal...
autoheader...
automake...
configure.ac:7: warning: AM_INIT_AUTOMAKE: two- and three-arguments forms are deprecated.  For more info, see:
configure.ac:7: https://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_005fINIT_005fAUTOMAKE-invocation
src/Makefile.am:3: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
src/Makefile.am:1: warning: 'CFLAGS' is a user variable, you should not override it;
src/Makefile.am:1: use 'AM_CFLAGS' instead
autoconf...
configure.ac:7: error: possibly undefined macro: AC_PACKAGE_TARNAME
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
configure.ac:7: error: possibly undefined macro: AC_PACKAGE_VERSION
now run configure

Then ./configure --prefix=/usr/local

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
/home/berthaud/Downloads/parcellite-latest-github/parcellite-master/missing: Unknown `--is-lightweight' option
Try `/home/berthaud/Downloads/parcellite-latest-github/parcellite-master/missing --help' for more information
configure: WARNING: 'missing' script is too old or missing
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
./configure: line 2835: syntax error near unexpected token `('
./configure: line 2835: ` PACKAGE=AC_PACKAGE_TARNAME()'

And of course make fails : make: *** No targets specified and no makefile found. Stop. so nothing is built.

According to this https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Initializing-configure.html, AC_INIT should be called (which defines AC_PACKAGE_TARNAME .. etc ..), not AM_INIT_AUTOMAKE

Any idea of what to do to make the build work ? Thanks, aaFn.

rickyrockrat commented 2 years ago

Interesting. This builds on a 'real' centos 7.8 machine just fine. I'll fire up a docker container when I get time. In the mean time, I created a Makefile.simple which should build on 99% of the systems out there. Sorry I just now saw this. My email is getting busy.

cd src make -f Makefile.simple

felagund commented 2 years ago

This indeed makes it compile. I guess like this it installs into /usr/bin/ and not to /usr/local/bin but that is something I can live with, thanks!

aaFn commented 2 years ago

Compile is ok here also with the .simple version (given how simple it is, we couldn't expect less 😁 ). I modified /usr/bin/ to /usr/local/bin before running.

Of course, missing is the integration with the desktop menus .. this is only to create the executable itself then. I guess a longer term action is to refresh the overall automake structure to make sure it is working properly everywhere.

Thank you @rickyrockrat

rickyrockrat commented 2 years ago

Since this fixed it, I will add a top level make that integrates all of it. I find most auto-discover tools way too complicated while a simple make file runs, well, pretty much everywhere.

And perhaps I will just focus on a couple generic make files running on all platforms. With Docker it's pretty easy to test these days. I'm hoping in December to get a release out with a package for both apt and rpm systems. Thanks for all the feedback.

felagund commented 2 years ago

I just tried with Kubuntu 21.10 and even building with ./configure works now, by the way.

rickyrockrat commented 2 years ago

Thanks for letting me know about 21.10...but it will fail again soon on some other platform. Sorry it's taking so long to get a full solution out. It's kind of in maintenance mode since I am going to have to completely re-write. GTK2 is going away and I am not planning on using any toolkit if I can help it.

rickyrockrat commented 2 years ago

OK, I updated master with a full set of Makefile.simple. Please see the readme on usage. You should be able to set prefix and DESTDIR and put the install anywhere you want.