Commit 328683ec authored by Jim Nelson's avatar Jim Nelson

Moved to waf for build system: #3690

This closes #3690 because waf fulfills that requirement, moving the .c's to a separate directory.  waf also gives us incremental builds, so -j4 is back.
parent 41faa361
.waf-*
.lock-wafbuild
.valencia
build/
# Only geary is built by default. Use "make all" to build command-line tools.
PROGRAM = geary
BUILD_ROOT = 1
VALAC := valac
VALAFLAGS := -g --enable-checking --fatal-warnings --vapidir=vapi
APPS := geary console watchmbox
ENGINE_SRC := \
src/engine/api/geary-account.vala \
src/engine/api/geary-credentials.vala \
src/engine/api/geary-email-location.vala \
src/engine/api/geary-email-properties.vala \
src/engine/api/geary-email.vala \
src/engine/api/geary-engine-error.vala \
src/engine/api/geary-engine-folder.vala \
src/engine/api/geary-engine.vala \
src/engine/api/geary-folder-properties.vala \
src/engine/api/geary-folder.vala \
src/engine/api/geary-imap-engine.vala \
src/engine/api/geary-local-interfaces.vala \
src/engine/api/geary-remote-interfaces.vala \
\
src/engine/common/common-interfaces.vala \
src/engine/common/common-message-data.vala \
src/engine/common/common-string.vala \
\
src/engine/imap/api/imap-account.vala \
src/engine/imap/api/imap-email-location.vala \
src/engine/imap/api/imap-email-properties.vala \
src/engine/imap/api/imap-folder-properties.vala \
src/engine/imap/api/imap-folder.vala \
src/engine/imap/command/imap-command-response.vala \
src/engine/imap/command/imap-commands.vala \
src/engine/imap/command/imap-command.vala \
src/engine/imap/decoders/imap-command-results.vala \
src/engine/imap/decoders/imap-fetch-data-decoder.vala \
src/engine/imap/decoders/imap-fetch-results.vala \
src/engine/imap/decoders/imap-list-results.vala \
src/engine/imap/decoders/imap-noop-results.vala \
src/engine/imap/decoders/imap-select-examine-results.vala \
src/engine/imap/decoders/imap-status-results.vala \
src/engine/imap/imap-error.vala \
src/engine/imap/message/imap-data-format.vala \
src/engine/imap/message/imap-fetch-data-type.vala \
src/engine/imap/message/imap-flag.vala \
src/engine/imap/message/imap-message-data.vala \
src/engine/imap/message/imap-message-set.vala \
src/engine/imap/message/imap-parameter.vala \
src/engine/imap/message/imap-tag.vala \
src/engine/imap/response/imap-response-code-type.vala \
src/engine/imap/response/imap-response-code.vala \
src/engine/imap/response/imap-server-data-type.vala \
src/engine/imap/response/imap-server-data.vala \
src/engine/imap/response/imap-server-response.vala \
src/engine/imap/response/imap-status-data-type.vala \
src/engine/imap/response/imap-status-response.vala \
src/engine/imap/response/imap-status.vala \
src/engine/imap/transport/imap-client-connection.vala \
src/engine/imap/transport/imap-client-session-manager.vala \
src/engine/imap/transport/imap-client-session.vala \
src/engine/imap/transport/imap-deserializer.vala \
src/engine/imap/transport/imap-mailbox.vala \
src/engine/imap/transport/imap-serializable.vala \
src/engine/imap/transport/imap-serializer.vala \
\
src/engine/rfc822/rfc822-mailbox-addresses.vala \
src/engine/rfc822/rfc822-mailbox-address.vala \
src/engine/rfc822/rfc822-message-data.vala \
\
src/engine/sqlite/abstract/sqlite-database.vala \
src/engine/sqlite/abstract/sqlite-row.vala \
src/engine/sqlite/abstract/sqlite-table.vala \
src/engine/sqlite/api/sqlite-account.vala \
src/engine/sqlite/api/sqlite-folder.vala \
src/engine/sqlite/email/sqlite-folder-row.vala \
src/engine/sqlite/email/sqlite-folder-table.vala \
src/engine/sqlite/email/sqlite-mail-database.vala \
src/engine/sqlite/email/sqlite-message-location-row.vala \
src/engine/sqlite/email/sqlite-message-location-table.vala \
src/engine/sqlite/email/sqlite-message-row.vala \
src/engine/sqlite/email/sqlite-message-table.vala \
src/engine/sqlite/imap/sqlite-imap-message-location-properties-row.vala \
src/engine/sqlite/imap/sqlite-imap-message-location-properties-table.vala \
\
src/engine/state/state-machine-descriptor.vala \
src/engine/state/state-machine.vala \
src/engine/state/state-mapping.vala \
\
src/engine/util/util-memory.vala \
src/engine/util/util-reference-semantics.vala \
src/engine/util/util-trillian.vala
COMMON_SRC := \
src/common/YorbaApplication.vala \
src/common/Date.vala
CLIENT_SRC := \
src/client/main.vala \
src/client/GearyApplication.vala \
src/client/ui/MainWindow.vala \
src/client/ui/MessageListView.vala \
src/client/ui/MessageListStore.vala \
src/client/ui/FolderListView.vala \
src/client/ui/FolderListStore.vala \
src/client/ui/MessageViewer.vala \
src/client/ui/MessageBuffer.vala \
src/client/util/Intl.vala
CONSOLE_SRC := \
src/console/main.vala
WATCHMBOX_SRC := \
src/tests/watchmbox.vala
ALL_SRC := $(ENGINE_SRC) $(COMMON_SRC) $(CLIENT_SRC) $(CONSOLE_SRC) $(WATCHMBOX_SRC)
EXTERNAL_PKGS := \
gio-2.0 >= 2.28.0 \
gee-1.0 >= 0.6.1 \
gtk+-2.0 >= 2.22.0 \
unique-1.0 >= 1.0.0 \
gmime-2.4 >= 2.4.14 \
sqlheavy-0.1 >= 0.0.1
EXTERNAL_BINDINGS := \
gio-2.0 \
gee-1.0 \
gtk+-2.0 \
unique-1.0 \
posix \
gmime-2.4 \
sqlheavy-0.1
VAPI_FILES := \
vapi/gmime-2.4.vapi
geary: $(ENGINE_SRC) $(COMMON_SRC) $(CLIENT_SRC) Makefile $(VAPI_FILES)
pkg-config --exists --print-errors '$(EXTERNAL_PKGS)'
$(VALAC) $(VALAFLAGS) $(foreach binding,$(EXTERNAL_BINDINGS),--pkg=$(binding)) \
$(ENGINE_SRC) $(COMMON_SRC) $(CLIENT_SRC) \
-o $@
.PHONY: all
all: $(APPS)
.PHONY: clean
clean:
rm -f $(ALL_SRC:.vala=.c)
rm -f $(ALL_SRC:.vala=.vala.c)
rm -f $(APPS)
console: $(ENGINE_SRC) $(COMMON_SRC) $(CONSOLE_SRC) Makefile
$(VALAC) $(VALAFLAGS) $(foreach binding,$(EXTERNAL_BINDINGS),--pkg=$(binding)) \
$(ENGINE_SRC) $(COMMON_SRC) $(CONSOLE_SRC) \
-o $@
watchmbox: $(ENGINE_SRC) $(COMMON_SRC) $(WATCHMBOX_SRC) Makefile
$(VALAC) $(VALAFLAGS) $(foreach binding,$(EXTERNAL_BINDINGS),--pkg=$(binding)) \
$(ENGINE_SRC) $(COMMON_SRC) $(WATCHMBOX_SRC) \
-o $@
# This file is merely to give Valencia (http://trac.yorba.org/wiki/Valencia) an indicator of the
# Geary project root. This file can be removed when this bug is fixed:
#
# http://trac.yorba.org/ticket/3410
#! /bin/sh
#
# This script is merely intended for developers to use to run console from
# the development directory, and is not needed or meant for installation.
if [ -f build/src/console/console ]
then
build/src/console/console "$@"
else
echo "Run './waf configure build' first."
fi
#! /bin/sh
#
# This script is merely intended for developers to use to run geary from
# the development directory, and is not needed or meant for installation.
if [ -f build/src/client/geary ]
then
build/src/client/geary "$@"
else
echo "Run './waf configure build' first."
fi
#! /usr/bin/env python
# encoding: utf-8
#
# Copyright 2011 Yorba Foundation
client_src = [
'geary-application.vala',
'main.vala',
'ui/folder-list-store.vala',
'ui/folder-list-view.vala',
'ui/main-window.vala',
'ui/message-buffer.vala',
'ui/message-list-store.vala',
'ui/message-list-view.vala',
'ui/message-viewer.vala',
'util/intl.vala'
]
client_uselib = 'GLIB GEE GTK'
client_packages = [ 'gtk+-2.0', 'glib-2.0', 'gee-1.0' ]
bld.program(
target = 'geary',
vapi_dirs = '../../vapi',
threading = True,
uselib = client_uselib + ' ' + bld.common_uselib + ' ' + bld.engine_uselib,
packages = client_packages + bld.common_packages + bld.engine_packages,
source = client_src + bld.common_src + bld.engine_src
)
#! /usr/bin/env python
# encoding: utf-8
#
# Copyright 2011 Yorba Foundation
console_src = [
'main.vala'
]
console_uselib = 'GEE GTK GLIB'
console_packages = [ 'gee-1.0', 'gtk+-2.0', 'glib-2.0' ]
bld.program(
target = 'console',
vapi_dirs = '../../vapi',
threading = True,
uselib = console_uselib + ' ' + bld.engine_uselib + ' ' + bld.common_uselib,
packages = console_packages + bld.engine_packages + bld.common_packages,
source = console_src + bld.common_src + bld.engine_src
)
/* Copyright 2011 Yorba Foundation
*
* This software is licensed under the GNU Lesser General Public License
* (version 2.1 or later). See the COPYING file in this distribution.
*/
MainLoop? main_loop = null;
Geary.Imap.ClientSession? sess = null;
string? user = null;
string? pass = null;
string? mailbox = null;
void on_exists(int exists) {
stdout.printf("EXISTS: %d\n", exists);
}
void on_expunged(Geary.Imap.MessageNumber expunged) {
stdout.printf("EXPUNGED: %d\n", expunged.value);
}
void on_recent(int recent) {
stdout.printf("RECENT: %d\n", recent);
}
async void async_start() {
try {
yield sess.connect_async();
yield sess.login_async(user, pass);
yield sess.examine_async(mailbox);
sess.unsolicited_exists.connect(on_exists);
sess.unsolicited_expunged.connect(on_expunged);
sess.unsolicited_recent.connect(on_recent);
sess.enable_keepalives(5);
} catch (Error err) {
debug("Error: %s", err.message);
}
}
int main(string[] args) {
if (args.length < 4) {
stderr.printf("usage: watchmbox <user> <pass> <mailbox>\n");
return 1;
}
main_loop = new MainLoop();
user = args[1];
pass = args[2];
mailbox = args[3];
sess = new Geary.Imap.ClientSession("imap.gmail.com", 993);
async_start.begin();
stdout.printf("Watching %s, Ctrl+C to exit...\n", mailbox);
main_loop.run();
return 0;
}
#! /usr/bin/env python
# encoding: utf-8
#
# Copyright 2011 Yorba Foundation
def build(bld):
bld.common_src = [
'../common/common-date.vala',
'../common/common-yorba-application.vala'
]
bld.common_uselib = 'GLIB UNIQUE'
bld.common_packages = ['glib-2.0', 'unique-1.0', 'posix' ]
bld.engine_src = [
'../engine/api/geary-account.vala',
'../engine/api/geary-credentials.vala',
'../engine/api/geary-email-location.vala',
'../engine/api/geary-email-properties.vala',
'../engine/api/geary-email.vala',
'../engine/api/geary-engine-error.vala',
'../engine/api/geary-engine-folder.vala',
'../engine/api/geary-engine.vala',
'../engine/api/geary-folder-properties.vala',
'../engine/api/geary-folder.vala',
'../engine/api/geary-imap-engine.vala',
'../engine/api/geary-local-interfaces.vala',
'../engine/api/geary-remote-interfaces.vala',
'../engine/common/common-interfaces.vala',
'../engine/common/common-message-data.vala',
'../engine/common/common-string.vala',
'../engine/imap/api/imap-account.vala',
'../engine/imap/api/imap-email-location.vala',
'../engine/imap/api/imap-email-properties.vala',
'../engine/imap/api/imap-folder-properties.vala',
'../engine/imap/api/imap-folder.vala',
'../engine/imap/command/imap-command-response.vala',
'../engine/imap/command/imap-commands.vala',
'../engine/imap/command/imap-command.vala',
'../engine/imap/decoders/imap-command-results.vala',
'../engine/imap/decoders/imap-fetch-data-decoder.vala',
'../engine/imap/decoders/imap-fetch-results.vala',
'../engine/imap/decoders/imap-list-results.vala',
'../engine/imap/decoders/imap-noop-results.vala',
'../engine/imap/decoders/imap-select-examine-results.vala',
'../engine/imap/decoders/imap-status-results.vala',
'../engine/imap/imap-error.vala',
'../engine/imap/message/imap-data-format.vala',
'../engine/imap/message/imap-fetch-data-type.vala',
'../engine/imap/message/imap-flag.vala',
'../engine/imap/message/imap-message-data.vala',
'../engine/imap/message/imap-message-set.vala',
'../engine/imap/message/imap-parameter.vala',
'../engine/imap/message/imap-tag.vala',
'../engine/imap/response/imap-response-code-type.vala',
'../engine/imap/response/imap-response-code.vala',
'../engine/imap/response/imap-server-data-type.vala',
'../engine/imap/response/imap-server-data.vala',
'../engine/imap/response/imap-server-response.vala',
'../engine/imap/response/imap-status-data-type.vala',
'../engine/imap/response/imap-status-response.vala',
'../engine/imap/response/imap-status.vala',
'../engine/imap/transport/imap-client-connection.vala',
'../engine/imap/transport/imap-client-session-manager.vala',
'../engine/imap/transport/imap-client-session.vala',
'../engine/imap/transport/imap-deserializer.vala',
'../engine/imap/transport/imap-mailbox.vala',
'../engine/imap/transport/imap-serializable.vala',
'../engine/imap/transport/imap-serializer.vala',
'../engine/rfc822/rfc822-mailbox-addresses.vala',
'../engine/rfc822/rfc822-mailbox-address.vala',
'../engine/rfc822/rfc822-message-data.vala',
'../engine/sqlite/abstract/sqlite-database.vala',
'../engine/sqlite/abstract/sqlite-row.vala',
'../engine/sqlite/abstract/sqlite-table.vala',
'../engine/sqlite/api/sqlite-account.vala',
'../engine/sqlite/api/sqlite-folder.vala',
'../engine/sqlite/email/sqlite-folder-row.vala',
'../engine/sqlite/email/sqlite-folder-table.vala',
'../engine/sqlite/email/sqlite-mail-database.vala',
'../engine/sqlite/email/sqlite-message-location-row.vala',
'../engine/sqlite/email/sqlite-message-location-table.vala',
'../engine/sqlite/email/sqlite-message-row.vala',
'../engine/sqlite/email/sqlite-message-table.vala',
'../engine/sqlite/imap/sqlite-imap-message-location-properties-row.vala',
'../engine/sqlite/imap/sqlite-imap-message-location-properties-table.vala',
'../engine/state/state-machine-descriptor.vala',
'../engine/state/state-machine.vala',
'../engine/state/state-mapping.vala',
'../engine/util/util-memory.vala',
'../engine/util/util-reference-semantics.vala',
'../engine/util/util-trillian.vala'
]
bld.engine_uselib = 'GLIB GEE GIO SQLHEAVY GMIME'
bld.engine_packages = ['glib-2.0', 'gee-1.0', 'gio-2.0', 'sqlheavy-0.1', 'gmime-2.4']
bld.recurse('client')
bld.recurse('console')
File added
#! /usr/bin/env python
# encoding: utf-8
#
# Copyright 2011 Yorba Foundation
# the following two variables are used by the target "waf dist"
VERSION = '0.0.0+trunk'
APPNAME = 'geary'
# these variables are mandatory ('/' are converted automatically)
top = '.'
out = 'build'
def options(opt):
opt.load('compiler_c')
opt.load('vala')
def configure(conf):
conf.load('compiler_c vala')
conf.check_cfg(
package='glib-2.0',
uselib_store='GLIB',
atleast_version='2.28.8',
mandatory=1,
args='--cflags --libs')
conf.check_cfg(
package='gio-2.0',
uselib_store='GIO',
atleast_version='2.28.0',
mandatory=1,
args='--cflags --libs')
conf.check_cfg(
package='gee-1.0',
uselib_store='GEE',
atleast_version='0.6.0',
mandatory=1,
args='--cflags --libs')
conf.check_cfg(
package='gtk+-2.0',
uselib_store='GTK',
atleast_version='2.22.0',
mandatory=1,
args='--cflags --libs')
conf.check_cfg(
package='unique-1.0',
uselib_store='UNIQUE',
atleast_version='1.0.0',
mandatory=1,
args='--cflags --libs')
conf.check_cfg(
package='sqlheavy-0.1',
uselib_store='SQLHEAVY',
atleast_version='0.0.1',
mandatory=1,
args='--cflags --libs')
conf.check_cfg(
package='gmime-2.4',
uselib_store='GMIME',
atleast_version='2.4.14',
mandatory=1,
args='--cflags --libs')
def build(bld):
bld.env.append_value('CFLAGS', ['-O2', '-g'])
bld.env.append_value('LINKFLAGS', ['-O2', '-g'])
bld.env.append_value('VALAFLAGS', ['-g', '--enable-checking', '--fatal-warnings'])
bld.recurse('src')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment