After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 654555 - Don't have two ways to be installed
Don't have two ways to be installed
Status: RESOLVED FIXED
Product: jhbuild
Classification: Infrastructure
Component: general
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: Jhbuild maintainers
Jhbuild QA
Depends on:
Blocks:
 
 
Reported: 2011-07-13 13:53 UTC by Colin Walters
Modified: 2011-10-09 00:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Enhance autogen.sh so only 1 way to install JHBuild (6.86 KB, patch)
2011-07-31 12:20 UTC, Craig Keogh
reviewed Details | Review
[doc] Update manual for 1 way to install JHBuild (1.84 KB, patch)
2011-07-31 12:21 UTC, Craig Keogh
none Details | Review
Add /Makefile.inc to .gitignore (530 bytes, patch)
2011-07-31 12:21 UTC, Craig Keogh
none Details | Review
Enhance autogen.sh so only 1 way to install JHBuild (9.33 KB, patch)
2011-08-27 05:24 UTC, Craig Keogh
none Details | Review
Enhance autogen.sh so only 1 way to install JHBuild (9.27 KB, patch)
2011-08-27 05:33 UTC, Craig Keogh
none Details | Review
Proposed patch (465 bytes, patch)
2011-10-08 21:18 UTC, Gert Kulyk
none Details | Review

Description Colin Walters 2011-07-13 13:53:52 UTC
There are two ways to build/install jhbuild:

* Normal ./configure --prefix=..., make; make install
* make -f Makefile.plain install

For the latter case, PKGDATADIR is None, and all code referencing data files have to handle both PKGDATADIR and SRCDIR.

This is a maintenance and code pain.  We could fix this by instead installing jhbuild in ~/.local, i.e. ~/.local/bin/jhbuild, ~/.local/share/jhbuild. 

Downside: Some people have ~/bin in their path, ~/.local/bin is not by default.
Comment 1 Craig Keogh 2011-07-13 23:51:13 UTC
I like the idea. What I would like is one way:

./autogen.sh --prefix=...; make; make install

That just works if you have autotools installed or not, gnome-common installed or not, gnome-doc-utils installed or not. (Use autogen.sh rather than configure so configure isn't in git, and most people use JHBuild from git)
Comment 2 Craig Keogh 2011-07-31 12:20:35 UTC
Created attachment 192940 [details] [review]
Enhance autogen.sh so only 1 way to install JHBuild

If gnome-common and gnome-doc-utils are available, autogen.sh will
configure JHBuild to install via autotools.

If gnome-common and gnome-doc-utils are not available, autogen.sh will
configure JHBuild to install via a plain Makefile.

autogen.sh is used to configure JHBuild because the most common way to
obtain JHBuild is via git and a 'configure' should not be checked into
git.
Comment 3 Craig Keogh 2011-07-31 12:21:06 UTC
Created attachment 192941 [details] [review]
[doc] Update manual for 1 way to install JHBuild
Comment 4 Craig Keogh 2011-07-31 12:21:34 UTC
Created attachment 192942 [details] [review]
Add /Makefile.inc to .gitignore
Comment 5 Colin Walters 2011-08-06 15:37:30 UTC
Review of attachment 192940 [details] [review]:

Very clever approach overall.  Did you test it in both setups?

::: autogen.sh
@@ +46,3 @@
+#   characters. Invalid variable names are ignored.
+# parse_commandline is not using getopt as getopt doesn't support the long form
+# on Solaris, BSD and MacOS.

Kind of gross code; you could consider writing autogen.sh in Python you know.  It's not like jhbuild will run without Python anyways.

(But not a problem if you're happy with the shell script)

@@ +113,3 @@
+configure_with_autotools()
+{
+  touch $srcdir/ChangeLog # required for automake

I just pushed a commit which should fix this:

http://git.gnome.org/browse/jhbuild/commit/?id=b69c27b30785874b5e8f312c9b36630a742deef2
Comment 6 Craig Keogh 2011-08-07 02:32:55 UTC
(In reply to comment #5)
> Review of attachment 192940 [details] [review]:
> 
> Very clever approach overall.  Did you test it in both setups?

Yes, I did test both.

Here is a use case I didn't cater for: What is someone is following some old instructions and tries the Makefile.plain method without running autogen.sh.  
There should be a message to guide the user in this case. I'll fix this.

> Kind of gross code; you could consider writing autogen.sh in Python you know. 
> It's not like jhbuild will run without Python anyways.

Yes, agree the code is ugly. I never thought of writing it in Python. Not a bad idea. There may be some bash-only code in my autogen.sh and may not work on all platforms - using Python would alleviate that problem.

Thank you for the review.
Comment 7 Colin Walters 2011-08-07 09:51:33 UTC
(In reply to comment #6)
>
> Yes, agree the code is ugly. I never thought of writing it in Python. Not a bad
> idea. There may be some bash-only code in my autogen.sh and may not work on all
> platforms - using Python would alleviate that problem.

It's up to you, as far as I'm concerned it's good to commit (after removing the ChangeLog bit).
Comment 8 Craig Keogh 2011-08-09 00:04:14 UTC
What about i18n? Something like this [1]. (Side node: i18n is easier in Python so that adds strength to the 'rewrite in Python' argument)

After this bug is fixed, need to roll new JHBuild tarball and update the online manual as soon as possible. Maybe consider landing this bug same time as bug 646510. Then only one tarball required.

[1] http://www.gnu.org/s/hello/manual/gettext/sh.html
Comment 9 Craig Keogh 2011-08-27 05:24:52 UTC
Created attachment 194902 [details] [review]
Enhance autogen.sh so only 1 way to install JHBuild


I've incorporated:
- Colin's comment
- added i18n support
- Display an error message if a user tries the old Makefile.plain method (i.e. following outdated instructions)
Comment 10 Craig Keogh 2011-08-27 05:33:19 UTC
Created attachment 194903 [details] [review]
Enhance autogen.sh so only 1 way to install JHBuild


I've incorporated:
- Colin's comment
- added i18n support
- Display an error message if a user tries the old Makefile.plain method (i.e.
following outdated instructions)

Attachment 194902 [details] had the wrong file mode. Now fixed.
Comment 11 Colin Walters 2011-09-29 21:04:16 UTC
This still looks good to me.  Go ahead and commit, Craig?
Comment 12 Craig Keogh 2011-10-03 07:40:37 UTC
Frédéric,

If you agree, could you push the 3 patches and roll a JHBuild tarball? The changes affect the way JHBuild is installed - I want the JHBuild install instructions [1] to be accurate for new users. I'll update the wiki.

[1] http://developer.gnome.org/jhbuild/stable/
Comment 13 Frederic Peters 2011-10-08 16:17:56 UTC
It failed distcheck (autogen.sh was not distributed), fixed, pushed, and released a 3.2.1 tarball.
Comment 14 Andrés G. Aragoneses (IRC: knocte) 2011-10-08 17:34:34 UTC
Guys, I guess bug 648300 is now obsolete because ofthe fix for this? Can you confirm?

Thanks
Comment 15 Gert Kulyk 2011-10-08 19:40:00 UTC
The changes to autogen.sh introduced in the commit fixing this bug are not compatible with all sh implementations, e.g. dash used in debian and ubuntu. Either the script needs to be fixed to work with those shells or you'll need to replace #!/bin/sh by #!/bin/bash.
Comment 16 Frederic Peters 2011-10-08 21:03:49 UTC
Thanks.

commit 87546661a7bc4bf562675a354eb2125597831288
Author: Frédéric Péters <fpeters@0d.be>
Date:   Sat Oct 8 17:02:57 2011 -0400

    Switch autogen.sh to /bin/bash as it uses bashisms (GNOME bug 654555)
Comment 17 Gert Kulyk 2011-10-08 21:18:14 UTC
Created attachment 198633 [details] [review]
Proposed patch

I'm not used to write shell scripts, but I think I found a workaround for the bashisms using expr command from coreutils. I'm attaching a patch that works for me (/bin/sh linked to dash), but maybe needs a deeper review.
Comment 18 Craig Keogh 2011-10-09 00:11:45 UTC
Thanks Frédéric! I updated the wiki [1].

[1] http://live.gnome.org/Jhbuild