[jhbuild] rewrite autotools build system to be independent of plain Makefile
- From: Frederic Peters <fpeters src gnome org>
- To: svn-commits-list gnome org
- Subject: [jhbuild] rewrite autotools build system to be independent of plain Makefile
- Date: Mon, 11 May 2009 11:39:34 -0400 (EDT)
commit 09846977c299e4328e59566e32951a7620569358
Author: Frederic Peters <fpeters 0d be>
Date: Mon May 11 17:32:13 2009 +0200
rewrite autotools build system to be independent of plain Makefile
Move from a top Makefile.am that was just enough to get the documentation
up on library.gnome.org (hacky and calling rules from Makefile.plain) to
proper autotools usage. (GNOME bug 582172)
---
Makefile.am | 32 +++++++++++-------------------
Makefile.plain | 4 ++-
jhbuild.in | 6 -----
jhbuild/Makefile.am | 13 ++++++++++++
jhbuild/buildbot/Makefile.am | 11 ++++++++++
jhbuild/buildbot/status/Makefile.am | 7 ++++++
jhbuild/buildbot/status/web/Makefile.am | 13 ++++++++++++
jhbuild/commands/Makefile.am | 17 ++++++++++++++++
jhbuild/cut_n_paste/Makefile.am | 7 ++++++
jhbuild/defaults.jhbuildrc | 5 +++-
jhbuild/frontends/Makefile.am | 21 ++++++++++++++++++++
jhbuild/frontends/terminal.py | 5 +++-
jhbuild/modtypes/Makefile.am | 14 +++++++++++++
jhbuild/utils/Makefile.am | 12 +++++++++++
jhbuild/versioncontrol/Makefile.am | 14 +++++++++++++
scripts/Makefile.am | 20 +++++++++++++++++++
scripts/jhbuild.in | 20 +++++++++++++++++++
17 files changed, 192 insertions(+), 29 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 70595b6..475f9e5 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,39 +1,31 @@
-SUBDIRS = po
+SUBDIRS = po scripts jhbuild
if DOC_INSTALLATION_ENABLED
SUBDIRS += doc
endif
+patchesdir = $(datadir)/jhbuild/patches/
+patches_DATA = $(wildcard $(top_srcdir)/patches/*.patch)
+
+modulesetsdir = $(datadir)/jhbuild/modulesets/
+modulesets_DATA = $(wildcard $(top_srcdir)/modulesets/*.modules) modulesets/moduleset.dtd
-PATCHES = $(wildcard $(top_srcdir)/patches/*.patch)
-SOURCES = $(shell find $(top_srcdir)/jhbuild/ -name '*.py' -or -name '*.glade') jhbuild/defaults.jhbuildrc
-MODULE_SETS = $(wildcard $(top_srcdir)/modulesets/*.modules) modulesets/moduleset.dtd
INTLTOOL = \
intltool-extract.in \
intltool-merge.in \
intltool-update.in
-EXTRA_DIST = gnome-doc-utils.make $(PATCHES) $(SOURCES) $(MODULE_SETS) \
- scripts/hg-update.py Makefile.plain install-check.c \
- po/Makefile.plain jhbuild.in jhbuild.desktop $(INTLTOOL)
+EXTRA_DIST = gnome-doc-utils.make $(patches_DATA) $(modulesets_DATA) \
+ install-check.c \
+ jhbuild.desktop $(INTLTOOL)
DISTCLEANFILES = \
intltool-extract \
intltool-merge \
intltool-update
-# those won't be executed by make distcheck, it is necessary as they build
-# in source tree and do install to ~/bin/
-all-local:
- if [ z"$(srcdir)" = z"." ]; then \
- $(MAKE) -f Makefile.plain; \
- fi
-
-install-exec-local:
- if [ z"$(srcdir)" = z"." ]; then \
- $(MAKE) -f Makefile.plain install \
- bindir="$(bindir)" \
- datarootdir="$(datarootdir)"; \
- fi
+bin_PROGRAMS = install-check
+
+install_check_SOURCES = install-check.c
diff --git a/Makefile.plain b/Makefile.plain
index bce8af1..41f859e 100644
--- a/Makefile.plain
+++ b/Makefile.plain
@@ -24,7 +24,9 @@ install: install-check
@if [ "x$(DISABLE_GETTEXT)" = x ]; then (cd po && $(MAKE) -f Makefile.plain install); fi
@echo "Creating $(bindir)/jhbuild"
@mkdir -p $(bindir)
- @sed "s,@jhbuilddir@,`pwd`,g" < jhbuild.in > $(bindir)/jhbuild
+ @sed -e "s,@jhbuilddir@,`pwd`,g" \
+ -e "s,USE_CHECKOUT_SRC = False,USE_CHECKOUT_SRC = True," < \
+ scripts/jhbuild.in > $(bindir)/jhbuild
@chmod a+x $(bindir)/jhbuild
@echo "Creating $(desktopdir)/jhbuild.desktop"
diff --git a/jhbuild.in b/jhbuild.in
deleted file mode 100644
index 1f88aab..0000000
--- a/jhbuild.in
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/usr/bin/env python
-import sys
-sys.path.insert(0, '@jhbuilddir@')
-
-import jhbuild.main
-jhbuild.main.main(sys.argv[1:])
diff --git a/jhbuild/Makefile.am b/jhbuild/Makefile.am
new file mode 100644
index 0000000..cd5fde4
--- /dev/null
+++ b/jhbuild/Makefile.am
@@ -0,0 +1,13 @@
+SUBDIRS = buildbot commands cut_n_paste frontends modtypes utils versioncontrol
+
+appdir = $(pythondir)/jhbuild/
+
+app_PYTHON = \
+ __init__.py \
+ config.py \
+ defaults.jhbuildrc \
+ errors.py \
+ main.py \
+ moduleset.py \
+ monkeypatch.py
+
diff --git a/jhbuild/buildbot/Makefile.am b/jhbuild/buildbot/Makefile.am
new file mode 100644
index 0000000..6e8374b
--- /dev/null
+++ b/jhbuild/buildbot/Makefile.am
@@ -0,0 +1,11 @@
+SUBDIRS = status
+
+appdir = $(pythondir)/jhbuild/buildbot/
+
+app_PYTHON = \
+ __init__.py \
+ changes.py \
+ factory.py \
+ scheduler.py \
+ steps.py
+
diff --git a/jhbuild/buildbot/status/Makefile.am b/jhbuild/buildbot/status/Makefile.am
new file mode 100644
index 0000000..ae4e842
--- /dev/null
+++ b/jhbuild/buildbot/status/Makefile.am
@@ -0,0 +1,7 @@
+SUBDIRS = web
+
+appdir = $(pythondir)/jhbuild/buildbot/status/
+
+app_PYTHON = \
+ __init__.py
+
diff --git a/jhbuild/buildbot/status/web/Makefile.am b/jhbuild/buildbot/status/web/Makefile.am
new file mode 100644
index 0000000..eca88df
--- /dev/null
+++ b/jhbuild/buildbot/status/web/Makefile.am
@@ -0,0 +1,13 @@
+appdir = $(pythondir)/jhbuild/buildbot/status/web/
+
+app_PYTHON = \
+ __init__.py \
+ bot.py \
+ build.py \
+ builder.py \
+ changes.py \
+ feeds.py \
+ logs.py \
+ step.py \
+ waterfall.py
+
diff --git a/jhbuild/commands/Makefile.am b/jhbuild/commands/Makefile.am
new file mode 100644
index 0000000..dd0284e
--- /dev/null
+++ b/jhbuild/commands/Makefile.am
@@ -0,0 +1,17 @@
+appdir = $(pythondir)/jhbuild/commands/
+
+app_PYTHON = \
+ __init__.py \
+ autobuild.py \
+ base.py \
+ bootstrap.py \
+ bot.py \
+ checkbranches.py \
+ checkmodulesets.py \
+ gui.py \
+ info.py \
+ rdepends.py \
+ sanitycheck.py \
+ snapshot.py \
+ tinderbox.py
+
diff --git a/jhbuild/cut_n_paste/Makefile.am b/jhbuild/cut_n_paste/Makefile.am
new file mode 100644
index 0000000..ac322fc
--- /dev/null
+++ b/jhbuild/cut_n_paste/Makefile.am
@@ -0,0 +1,7 @@
+appdir = $(pythondir)/jhbuild/cut_n_paste/
+
+app_PYTHON = \
+ __init__.py \
+ optparse.py \
+ subprocess.py
+
diff --git a/jhbuild/defaults.jhbuildrc b/jhbuild/defaults.jhbuildrc
index 0f6816e..ba4a517 100644
--- a/jhbuild/defaults.jhbuildrc
+++ b/jhbuild/defaults.jhbuildrc
@@ -8,7 +8,10 @@ if 'GTK_PATH' in os.environ.keys():
del os.environ['GTK_PATH']
# module directory
-modulesets_dir = os.path.join(os.path.dirname(__file__), '../modulesets')
+if DATADIR:
+ modulesets_dir = os.path.join(DATADIR, 'jhbuild/modulesets')
+else:
+ modulesets_dir = os.path.join(os.path.dirname(__file__), '../modulesets')
# what modules to build?
moduleset = 'gnome-2.28'
diff --git a/jhbuild/frontends/Makefile.am b/jhbuild/frontends/Makefile.am
new file mode 100644
index 0000000..d520fc2
--- /dev/null
+++ b/jhbuild/frontends/Makefile.am
@@ -0,0 +1,21 @@
+ICONS = \
+ icons/build.png \
+ icons/checkout.png \
+ icons/configure.png \
+ icons/error.png \
+ icons/install.png
+
+pkgdata_DATA = jhbuild.glade $(ICONS)
+
+EXTRA_DIST = $(pkgdata_DATA)
+
+appdir = $(pythondir)/jhbuild/frontends/
+
+app_PYTHON = \
+ __init__.py \
+ autobuild.py \
+ buildscript.py \
+ gtkui.py \
+ terminal.py \
+ tinderbox.py
+
diff --git a/jhbuild/frontends/terminal.py b/jhbuild/frontends/terminal.py
index 8cfa266..8267ab3 100644
--- a/jhbuild/frontends/terminal.py
+++ b/jhbuild/frontends/terminal.py
@@ -59,7 +59,10 @@ else:
pass
# tray icon stuff ...
-icondir = os.path.join(os.path.dirname(__file__), 'icons')
+if DATADIR:
+ icondir = os.path.join(DATADIR, 'jhbuild')
+else:
+ icondir = os.path.join(os.path.dirname(__file__), 'icons')
phase_map = {
'checkout': 'checkout.png',
'force_checkout': 'checkout.png',
diff --git a/jhbuild/modtypes/Makefile.am b/jhbuild/modtypes/Makefile.am
new file mode 100644
index 0000000..257264c
--- /dev/null
+++ b/jhbuild/modtypes/Makefile.am
@@ -0,0 +1,14 @@
+appdir = $(pythondir)/jhbuild/modtypes/
+
+app_PYTHON = \
+ __init__.py \
+ ant.py \
+ autotools.py \
+ cmake.py \
+ distutils.py \
+ linux.py \
+ perl.py \
+ tarball.py \
+ testmodule.py \
+ waf.py
+
diff --git a/jhbuild/utils/Makefile.am b/jhbuild/utils/Makefile.am
new file mode 100644
index 0000000..b6d63bf
--- /dev/null
+++ b/jhbuild/utils/Makefile.am
@@ -0,0 +1,12 @@
+appdir = $(pythondir)/jhbuild/utils/
+
+app_PYTHON = \
+ __init__.py \
+ cmds.py \
+ httpcache.py \
+ notify.py \
+ packagedb.py \
+ sxml.py \
+ trayicon.py \
+ unpack.py
+
diff --git a/jhbuild/versioncontrol/Makefile.am b/jhbuild/versioncontrol/Makefile.am
new file mode 100644
index 0000000..40d0307
--- /dev/null
+++ b/jhbuild/versioncontrol/Makefile.am
@@ -0,0 +1,14 @@
+appdir = $(pythondir)/jhbuild/versioncontrol/
+
+app_PYTHON = \
+ __init__.py \
+ arch.py \
+ bzr.py \
+ cvs.py \
+ darcs.py \
+ git.py \
+ hg.py \
+ mtn.py \
+ svn.py \
+ tarball.py
+
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
new file mode 100644
index 0000000..36ee33f
--- /dev/null
+++ b/scripts/Makefile.am
@@ -0,0 +1,20 @@
+EXTRA_DIST = hg-update.py jhbuild.in
+
+bin_SCRIPTS = jhbuild
+CLEANFILES = jhbuild
+
+jhbuild: jhbuild.in
+ sed \
+ -e s!\ prefix\@!$(prefix)! \
+ -e s!\ datadir\@!$(datadir)! \
+ -e s!\ pkgdatadir\@!$(pkgdatadir)! \
+ -e s!\ libexecdir\@!$(libexecdir)! \
+ -e s!\ libdir\@!$(libdir)! \
+ -e s!\ PACKAGE\@!$(PACKAGE)! \
+ -e s!\ VERSION\@!$(VERSION)! \
+ < $< > $@
+
+jhbuild: Makefile
+
+all-local: jhbuild
+
diff --git a/scripts/jhbuild.in b/scripts/jhbuild.in
new file mode 100644
index 0000000..12ce532
--- /dev/null
+++ b/scripts/jhbuild.in
@@ -0,0 +1,20 @@
+#!/usr/bin/env python
+
+import sys
+import __builtin__
+
+USE_CHECKOUT_SRC = False
+
+if USE_CHECKOUT_SRC:
+ sys.path.insert(0, '@jhbuilddir@')
+ pkgdatadir = None
+ datadir = None
+else:
+ pkgdatadir = "@pkgdatadir@"
+ datadir = "@datadir@"
+
+__builtin__.__dict__['PKGDATADIR'] = "@pkgdatadir@"
+__builtin__.__dict__['DATADIR'] = "@datadir@"
+
+import jhbuild.main
+jhbuild.main.main(sys.argv[1:])
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]