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 761356 - Improvements to library-template build system templates
Improvements to library-template build system templates
Status: RESOLVED FIXED
Product: gnome-builder
Classification: Other
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: GNOME Builder Maintainers
GNOME Builder Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-01-31 10:54 UTC by Philip Withnall
Modified: 2016-02-11 10:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
library-template: Update autogen.sh to use latest GNOME recommendation (3.45 KB, patch)
2016-01-31 10:54 UTC, Philip Withnall
committed Details | Review
library-template: Port from glib-gettext/intltool to upstream gettext (7.81 KB, patch)
2016-01-31 10:54 UTC, Philip Withnall
committed Details | Review
library-template: Fix macro quoting in configure.ac (2.92 KB, patch)
2016-01-31 10:54 UTC, Philip Withnall
committed Details | Review
library-template: Conditionally add po to SUBDIRS if enable_i18n is true (924 bytes, patch)
2016-01-31 10:54 UTC, Philip Withnall
committed Details | Review
library-template: use AX_GENERATE_CHANGELOG macro to generate ChangeLog (2.22 KB, patch)
2016-01-31 10:54 UTC, Philip Withnall
committed Details | Review
library-template: Add AM_V_GEN to the AUTHORS rule (1.11 KB, patch)
2016-01-31 10:54 UTC, Philip Withnall
committed Details | Review
library-template: Remove AUTHORS from .PHONY target dependencies (1.18 KB, patch)
2016-01-31 10:54 UTC, Philip Withnall
committed Details | Review
library-template: Add $(NULL) terminator to Makefile.am lists (1.12 KB, patch)
2016-01-31 10:54 UTC, Philip Withnall
committed Details | Review
library-template: Automatically include API version in build system (3.86 KB, patch)
2016-01-31 10:55 UTC, Philip Withnall
committed Details | Review
library-template: Condense some AC_SUBST calls in configure.ac (1.33 KB, patch)
2016-01-31 10:55 UTC, Philip Withnall
committed Details | Review
library-template: Use AX_CHECK_ENABLE_DEBUG for debug compiler flags (2.56 KB, patch)
2016-01-31 10:55 UTC, Philip Withnall
committed Details | Review
library-template: Use AX_COMPILER_FLAGS for determining compiler flags (2.18 KB, patch)
2016-01-31 10:55 UTC, Philip Withnall
committed Details | Review

Description Philip Withnall 2016-01-31 10:54:24 UTC
Various patches to improve the library-template build system templates. There are still further improvements which could be made, such as standardising the naming and directory structure and ensuring it produces parallel-installable results. This will do for now though.

See:
 • https://developer.gnome.org/programming-guidelines/unstable/namespacing.html.enhttps://developer.gnome.org/programming-guidelines/unstable/parallel-installability.html.enhttps://developer.gnome.org/programming-guidelines/unstable/versioning.html.en

I have not actually tested these patches, so they might need some tweaking. Additionally, I’m not entirely sure of the changes to the Python script, though they seem to fit with what’s there already. Basically, this is a drive-by patch set and I make no apologies. Sorry.
Comment 1 Philip Withnall 2016-01-31 10:54:27 UTC
Created attachment 320109 [details] [review]
library-template: Update autogen.sh to use latest GNOME recommendation

Port the template autogen.sh to use the latest recommendation from
https://wiki.gnome.org/Projects/GnomeCommon/Migration#autogen.sh.
Comment 2 Philip Withnall 2016-01-31 10:54:32 UTC
Created attachment 320110 [details] [review]
library-template: Port from glib-gettext/intltool to upstream gettext

This requires version 0.19.6 of upstream gettext for AppData support:

https://lists.gnu.org/archive/html/info-gnu/2015-09/msg00003.html

It is an error to use glib-gettext and intltool together (as the
template was previously doing) — either use one or the other. However,
both are deprecated in favour of upstream gettext, which is alive again:

https://wiki.gnome.org/Projects/GnomeCommon/Migration#line-204

This has not been extensively tested, but should be the right general
shape.
Comment 3 Philip Withnall 2016-01-31 10:54:36 UTC
Created attachment 320111 [details] [review]
library-template: Fix macro quoting in configure.ac

To keep this pedant happy. I can’t explain why it’s better than before.
Comment 4 Philip Withnall 2016-01-31 10:54:40 UTC
Created attachment 320112 [details] [review]
library-template: Conditionally add po to SUBDIRS if enable_i18n is true
Comment 5 Philip Withnall 2016-01-31 10:54:44 UTC
Created attachment 320113 [details] [review]
library-template: use AX_GENERATE_CHANGELOG macro to generate ChangeLog

This removes some more boilerplate code.

http://www.gnu.org/software/autoconf-archive/ax_generate_changelog.html
Comment 6 Philip Withnall 2016-01-31 10:54:49 UTC
Created attachment 320114 [details] [review]
library-template: Add AM_V_GEN to the AUTHORS rule

This should expose it in the automake output so the user can see it’s
been generated.
Comment 7 Philip Withnall 2016-01-31 10:54:54 UTC
Created attachment 320115 [details] [review]
library-template: Remove AUTHORS from .PHONY target dependencies

.PHONY targets are targets which don’t really exist — AUTHORS is the
name of a generated file, so it does exist.

https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html
Comment 8 Philip Withnall 2016-01-31 10:54:59 UTC
Created attachment 320116 [details] [review]
library-template: Add $(NULL) terminator to Makefile.am lists

This makes it easier to add new list entries without causing noise in
the diff by fiddling with backslashes.
Comment 9 Philip Withnall 2016-01-31 10:55:03 UTC
Created attachment 320117 [details] [review]
library-template: Automatically include API version in build system

Rather than hard-coding version 1.0 everywhere, use the api_version
(formerly interface_age) variable to do it magically.
Comment 10 Philip Withnall 2016-01-31 10:55:07 UTC
Created attachment 320118 [details] [review]
library-template: Condense some AC_SUBST calls in configure.ac
Comment 11 Philip Withnall 2016-01-31 10:55:11 UTC
Created attachment 320119 [details] [review]
library-template: Use AX_CHECK_ENABLE_DEBUG for debug compiler flags

This removes another load of boilerplate.

http://www.gnu.org/software/autoconf-archive/ax_check_enable_debug.html

We use the AX_IS_RELEASE macro to check whether to enable debug by
default, using the micro-version policy.

http://www.gnu.org/software/autoconf-archive/ax_is_release.html
Comment 12 Philip Withnall 2016-01-31 10:55:15 UTC
Created attachment 320120 [details] [review]
library-template: Use AX_COMPILER_FLAGS for determining compiler flags

This uses a standard set of warning flags, and makes them available
in WARN_CFLAGS, WARN_LDFLAGS, WARN_CXXFLAGS and WARN_SCANNERFLAGS.

http://www.gnu.org/software/autoconf-archive/ax_compiler_flags.html
Comment 13 Igor Gnatenko 2016-01-31 11:53:02 UTC
Review of attachment 320111 [details] [review]:

Looks good. I really like this style.
Comment 14 Igor Gnatenko 2016-01-31 11:54:53 UTC
Review of attachment 320113 [details] [review]:

Didn't know about this before. Nice feature in autoconf.
Comment 15 Igor Gnatenko 2016-01-31 11:56:06 UTC
Review of attachment 320119 [details] [review]:

looks good.
Comment 16 Igor Gnatenko 2016-01-31 11:56:42 UTC
Review of attachment 320120 [details] [review]:

+1
Comment 17 Igor Gnatenko 2016-01-31 11:57:02 UTC
Review of attachment 320116 [details] [review]:

also like this style.
Comment 18 Philip Withnall 2016-01-31 12:22:03 UTC
(In reply to Igor Gnatenko from comment #13)
> Review of attachment 320111 [details] [review] [review]:
> 
> Looks good. I really like this style.

If you want an example of the build system I’m copying all of this out of:

https://github.com/pwithnall/dunfell

Other things which could be added at some point:
 • AX_CODE_COVERAGE (http://www.gnu.org/software/autoconf-archive/ax_code_coverage.html)
 • AX_VALGRIND_CHECK (http://www.gnu.org/software/autoconf-archive/ax_valgrind_check.html)
Comment 19 Philip Withnall 2016-02-10 09:44:41 UTC
Can I get some review on the other patches? Rebasing the accepted ones to be pushed first is a bit of a pain.
Comment 20 Christian Hergert 2016-02-11 00:23:29 UTC
(In reply to Philip Withnall from comment #19)
> Can I get some review on the other patches? Rebasing the accepted ones to be
> pushed first is a bit of a pain.

Sorry, it was a gumption trap, I'll take a look.
Comment 21 Christian Hergert 2016-02-11 00:25:06 UTC
Review of attachment 320109 [details] [review]:

LGTM
Comment 22 Christian Hergert 2016-02-11 00:26:20 UTC
Review of attachment 320110 [details] [review]:

LGTM
Comment 23 Christian Hergert 2016-02-11 00:27:19 UTC
Review of attachment 320112 [details] [review]:

You can also do {{if enable_i18n}}po {{end}} if you feel like keeping it on a single line.

Either way, LGTM.
Comment 24 Christian Hergert 2016-02-11 00:27:39 UTC
Review of attachment 320114 [details] [review]:

LGTM
Comment 25 Christian Hergert 2016-02-11 00:28:18 UTC
Review of attachment 320115 [details] [review]:

Hrmm, not sure where i copied that from. Anyway, as long as distcheck works, im happy :)
Comment 26 Christian Hergert 2016-02-11 00:30:49 UTC
Review of attachment 320117 [details] [review]:

LGTM. I was always a bit torn on doing API_VERSION because we don't actually rev them very often. But either way, seems like good hygiene.
Comment 27 Christian Hergert 2016-02-11 00:31:22 UTC
Review of attachment 320118 [details] [review]:

Oh duh!
Comment 28 Christian Hergert 2016-02-11 00:31:50 UTC
Go ahead and push! Thanks again!
Comment 29 Philip Withnall 2016-02-11 10:52:42 UTC
Attachment 320109 [details] pushed as e404e91 - library-template: Update autogen.sh to use latest GNOME recommendation
Attachment 320110 [details] pushed as ffadf66 - library-template: Port from glib-gettext/intltool to upstream gettext
Attachment 320111 [details] pushed as e6d4e10 - library-template: Fix macro quoting in configure.ac
Attachment 320112 [details] pushed as 51b5eb1 - library-template: Conditionally add po to SUBDIRS if enable_i18n is true
Attachment 320113 [details] pushed as 6e7846e - library-template: use AX_GENERATE_CHANGELOG macro to generate ChangeLog
Attachment 320114 [details] pushed as 94c2795 - library-template: Add AM_V_GEN to the AUTHORS rule
Attachment 320115 [details] pushed as 6e777d5 - library-template: Remove AUTHORS from .PHONY target dependencies
Attachment 320116 [details] pushed as 3e9c1c4 - library-template: Add $(NULL) terminator to Makefile.am lists
Attachment 320117 [details] pushed as 8287551 - library-template: Automatically include API version in build system
Attachment 320118 [details] pushed as b325386 - library-template: Condense some AC_SUBST calls in configure.ac
Attachment 320119 [details] pushed as fb9387c - library-template: Use AX_CHECK_ENABLE_DEBUG for debug compiler flags
Attachment 320120 [details] pushed as 6de6fd5 - library-template: Use AX_COMPILER_FLAGS for determining compiler flags