summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSebastian Reichel <sre@ring0.de>2018-06-29 00:58:19 +0200
committerSebastian Reichel <sre@ring0.de>2018-07-15 22:59:57 +0200
commit22df08c29f6e4566d418e2a80a8279303406a733 (patch)
treedecb3029284b966635855e1684bc07ef9d3c1a6f /src
parent17560f8bf49a0be2e0b490159e29f4894fe12cba (diff)
downloadserial-barcode-scanner-22df08c29f6e4566d418e2a80a8279303406a733.tar.bz2
build: switch to meson buildsystem
We build the project with 'meson' now instead of using custom configure script + GNU Makefiles. To build the project, go to the project root directory and use the following commands: Building: meson build cd build ninja Update Language Files: ninja shopsystem-pot ninja shopsystem-update-po Install: DESTDIR=./tmp ninja install
Diffstat (limited to 'src')
-rw-r--r--src/Makefile9
-rw-r--r--src/audio/Makefile10
-rw-r--r--src/backup/Makefile10
-rw-r--r--src/cli/Makefile10
-rw-r--r--src/config/Makefile10
-rw-r--r--src/curses-ui/Makefile10
-rw-r--r--src/database/Makefile10
-rw-r--r--src/input-device/Makefile10
-rw-r--r--src/invoice/Makefile13
-rw-r--r--src/libcairobarcode/Makefile11
-rw-r--r--src/mail/Makefile10
-rw-r--r--src/meson.build52
-rw-r--r--src/pdf-invoice/Makefile13
-rw-r--r--src/pdf-stock/Makefile20
-rw-r--r--src/pgp/Makefile10
-rw-r--r--src/scanner-session/Makefile10
-rw-r--r--src/serial-device/Makefile10
-rw-r--r--src/web/Makefile10
18 files changed, 52 insertions, 186 deletions
diff --git a/src/Makefile b/src/Makefile
deleted file mode 100644
index d5bb40f..0000000
--- a/src/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-DAEMONS=audio backup cli config curses-ui database input-device invoice mail pdf-invoice pdf-stock pgp scanner-session serial-device input-device web
-
-all:
- @$(foreach dir,$(DAEMONS),cd $(dir) && echo "Building $(dir)..." && make --no-print-directory all ; cd ..;)
-
-clean:
- @$(foreach dir,$(DAEMONS),cd $(dir) && make --no-print-directory clean ; cd ..;)
-
-.PHONY: all clean
diff --git a/src/audio/Makefile b/src/audio/Makefile
deleted file mode 100644
index 31d373d..0000000
--- a/src/audio/Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
-all: audio
- @echo > /dev/null
-
-audio: main.vala audio.vala audio-interface.vala ../config/config-interface.vala
- valac -X -D'GETTEXT_PACKAGE="shopsystem"' -X -w -o $@ --pkg gstreamer-1.0 --pkg gio-2.0 $^
-
-clean:
- rm -rf audio
-
-.PHONY: all clean
diff --git a/src/backup/Makefile b/src/backup/Makefile
deleted file mode 100644
index f2594c2..0000000
--- a/src/backup/Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
-all: backup
- @echo > /dev/null
-
-backup: main.vala ../mail/mailer-interface.vala ../config/config-interface.vala
- valac -X -D'GETTEXT_PACKAGE="shopsystem"' -X -w -o $@ --pkg gio-2.0 $^
-
-clean:
- rm -f backup
-
-.PHONY: all clean
diff --git a/src/cli/Makefile b/src/cli/Makefile
deleted file mode 100644
index a66ce8f..0000000
--- a/src/cli/Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
-all: cli
- @echo > /dev/null
-
-cli: main.vala cli.vala cli-interface.vala ../config/config-interface.vala
- valac -X -D'GETTEXT_PACKAGE="shopsystem"' -X -w -o $@ --pkg linux --pkg posix --pkg gio-2.0 $^
-
-clean:
- rm -rf cli
-
-.PHONY: all clean
diff --git a/src/config/Makefile b/src/config/Makefile
deleted file mode 100644
index bda0cbb..0000000
--- a/src/config/Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
-all: config
- @echo > /dev/null
-
-config: main.vala config.vala config-interface.vala
- valac -X -D'GETTEXT_PACKAGE="shopsystem"' -X -w -o $@ --pkg gio-2.0 $^
-
-clean:
- rm -rf config
-
-.PHONY: all clean
diff --git a/src/curses-ui/Makefile b/src/curses-ui/Makefile
deleted file mode 100644
index 2fa44b3..0000000
--- a/src/curses-ui/Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
-all: curses-ui
- @echo > /dev/null
-
-curses-ui: *.vala ../audio/audio-interface.vala ../scanner-session/scannersession-interface.vala ../config/config-interface.vala
- valac -X -D'GETTEXT_PACKAGE="shopsystem"' -X -w -o $@ --pkg curses -X -lncursesw --pkg posix --pkg gio-2.0 $^
-
-clean:
- rm -rf curses-ui
-
-.PHONY: all clean
diff --git a/src/database/Makefile b/src/database/Makefile
deleted file mode 100644
index 9e2956e..0000000
--- a/src/database/Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
-all: database
- @echo > /dev/null
-
-database: main.vala database.vala db-interface.vala ../config/config-interface.vala ../price.vapi
- valac -X -D'GETTEXT_PACKAGE="shopsystem"' -X -w -o $@ --pkg sqlite3 --pkg gee-0.8 --pkg gio-2.0 $^
-
-clean:
- rm -rf database
-
-.PHONY: all clean
diff --git a/src/input-device/Makefile b/src/input-device/Makefile
deleted file mode 100644
index 5e501df..0000000
--- a/src/input-device/Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
-all: input-device
- @echo > /dev/null
-
-input-device: main.vala input-device.vala input-device-interface.vala ../config/config-interface.vala
- valac -X -D'GETTEXT_PACKAGE="shopsystem"' -X -w -o $@ --pkg linux --pkg posix --pkg gio-2.0 $^
-
-clean:
- rm -rf input-device
-
-.PHONY: all clean
diff --git a/src/invoice/Makefile b/src/invoice/Makefile
deleted file mode 100644
index d8d72c0..0000000
--- a/src/invoice/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-all: invoice single-invoice
- @echo > /dev/null
-
-invoice: main.vala invoice.vala ../mail/mailer-interface.vala ../pdf-invoice/pdf-invoice-interface.vala ../database/db-interface.vala ../config/config-interface.vala ../price.vapi
- valac -X -D'GETTEXT_PACKAGE="shopsystem"' -X -w -o $@ --pkg gio-2.0 $^
-
-single-invoice: single.vala invoice.vala ../mail/mailer-interface.vala ../pdf-invoice/pdf-invoice-interface.vala ../database/db-interface.vala ../config/config-interface.vala ../price.vapi
- valac -X -D'GETTEXT_PACKAGE="shopsystem"' -X -w -o $@ --pkg gio-2.0 $^
-
-clean:
- rm -f invoice single-invoice
-
-.PHONY: all clean
diff --git a/src/libcairobarcode/Makefile b/src/libcairobarcode/Makefile
deleted file mode 100644
index b51cf30..0000000
--- a/src/libcairobarcode/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-include ../config.mk
-
-all: libcairobarcode.so
-
-libcairobarcode.so: ean.vala code39.vala error.vala
- ${VALAC} -o $@ -H libcairobarcode.h --library libcairobarcode -X -fPIC -X -shared --pkg cairo $^
-
-clean:
- rm -f libcairobarcode.h libcairobarcode.so libcairobarcode.vapi
-
-.PHONY: all clean
diff --git a/src/mail/Makefile b/src/mail/Makefile
deleted file mode 100644
index 70e9b5a..0000000
--- a/src/mail/Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
-all: mailer
- @echo > /dev/null
-
-mailer: main.vala mailer.vala mail.vala mailer-interface.vala ../config/config-interface.vala
- valac -X -D'GETTEXT_PACKAGE="shopsystem"' -X -w -o $@ --vapidir=../../vapi --pkg posix --pkg libesmtp --pkg gio-2.0 --pkg gmime-3.0 -X -D_GNU_SOURCE -X -lesmtp -X -lssl -X -lcrypto -X -ldl -X -pthread $^
-
-clean:
- rm -f mailer
-
-.PHONY: all clean
diff --git a/src/meson.build b/src/meson.build
new file mode 100644
index 0000000..e65d3a3
--- /dev/null
+++ b/src/meson.build
@@ -0,0 +1,52 @@
+add_project_arguments(['--vapidir', join_paths(meson.current_source_dir(), '..', 'vapi')], language: 'vala')
+add_project_arguments('-DGETTEXT_PACKAGE="shopsystem"', language:'c')
+
+glib_dep = dependency('glib-2.0')
+gobject_dep = dependency('gobject-2.0')
+gio_dep = dependency('gio-2.0')
+gstreamer_dep = dependency('gstreamer-1.0')
+gee_dep = dependency('gee-0.8')
+sqlite_dep = dependency('sqlite3')
+gmime_dep = dependency('gmime-3.0')
+rsvg_dep = dependency('librsvg-2.0')
+pangocairo_dep = dependency('pangocairo')
+cairo_dep = dependency('cairo')
+archive_dep = dependency('libarchive')
+soup_dep = dependency('libsoup-2.4')
+
+gpgme_lib = meson.get_compiler('c').find_library('gpgme')
+gpgme_vapi = meson.get_compiler('vala').find_library('gpgme', dirs: join_paths(meson.current_source_dir(), '..', 'vapi'))
+gpgerror_vapi = meson.get_compiler('vala').find_library('gpg-error', dirs: join_paths(meson.current_source_dir(), '..', 'vapi'))
+gpgme_dep = declare_dependency(dependencies: [gpgme_lib, gpgme_vapi, gpgerror_vapi])
+
+esmtp_lib = meson.get_compiler('c').find_library('libesmtp')
+esmtp_vapi = meson.get_compiler('vala').find_library('libesmtp')
+esmtp_dep = declare_dependency(dependencies: [esmtp_lib, esmtp_vapi])
+
+curses_lib = meson.get_compiler('c').find_library('ncursesw')
+curses_vapi = meson.get_compiler('vala').find_library('curses')
+curses_dep = declare_dependency(dependencies: [curses_lib, curses_vapi])
+
+gdk_dep = meson.get_compiler('vala').find_library('gdk-2.0') # gdk is only needed for librsvg vapi, not really used, so we only check for the vapi file
+posix_dep = meson.get_compiler('vala').find_library('posix')
+linux_dep = meson.get_compiler('vala').find_library('linux')
+
+libcairobarcode = library('libcairobarcode', ['libcairobarcode/ean.vala', 'libcairobarcode/code39.vala', 'libcairobarcode/error.vala'], dependencies: [gio_dep, cairo_dep], install: true, install_dir: [true, true, true])
+executable('shop-audio', ['audio/main.vala', 'audio/audio.vala', 'audio/audio-interface.vala', 'config/config-interface.vala'], dependencies :[gio_dep, gstreamer_dep], install: true)
+executable('shop-backup', ['backup/main.vala', 'mail/mailer-interface.vala', 'config/config-interface.vala'], dependencies: [gio_dep], install: true)
+executable('shop-cli', ['cli/main.vala', 'cli/cli.vala', 'cli/cli-interface.vala', 'config/config-interface.vala'], dependencies: [gio_dep], install: true)
+executable('shop-config', ['config/main.vala', 'config/config.vala', 'config/config-interface.vala'], dependencies: [gio_dep], install: true)
+executable('shop-curses-ui', ['curses-ui/clock.vala', 'curses-ui/curses-ui.vala', 'curses-ui/dialog.vala', 'curses-ui/logo.vala', 'curses-ui/main.vala', 'curses-ui/message_box.vala', 'curses-ui/message_box_overlay.vala', 'curses-ui/numbers.vala', 'curses-ui/status.vala', 'audio/audio-interface.vala', 'scanner-session/scannersession-interface.vala', 'config/config-interface.vala'], dependencies: [gio_dep, posix_dep, curses_dep], install: true)
+executable('shop-database', ['database/main.vala', 'database/database.vala', 'database/db-interface.vala', 'config/config-interface.vala', 'price.vapi'], dependencies: [gio_dep, gee_dep, sqlite_dep], install: true)
+executable('shop-input-device', ['input-device/main.vala', 'input-device/input-device.vala', 'input-device/input-device-interface.vala', 'config/config-interface.vala'], dependencies: [gio_dep, linux_dep], install: true)
+executable('shop-invoice', ['invoice/main.vala', 'invoice/invoice.vala', 'mail/mailer-interface.vala', 'pdf-invoice/pdf-invoice-interface.vala', 'database/db-interface.vala', 'config/config-interface.vala', 'price.vapi'], dependencies: [gio_dep], install: true)
+executable('shop-single-invoice', ['invoice/single.vala', 'invoice/invoice.vala', 'mail/mailer-interface.vala', 'pdf-invoice/pdf-invoice-interface.vala', 'database/db-interface.vala', 'config/config-interface.vala', 'price.vapi'], dependencies: [gio_dep], install: true)
+executable('shop-mailer', ['mail/main.vala', 'mail/mailer.vala', 'mail/mail.vala', 'mail/mailer-interface.vala', 'config/config-interface.vala'], dependencies: [gio_dep, posix_dep, esmtp_dep, gmime_dep], install: true)
+executable('shop-pdf-invoice', ['pdf-invoice/main.vala', 'pdf-invoice/pdf-invoice.vala', 'pdf-invoice/pdf-invoice-interface.vala', 'config/config-interface.vala', 'database/db-interface.vala', 'price.vapi'], dependencies: [gio_dep, pangocairo_dep, rsvg_dep, gdk_dep, posix_dep], install: true)
+executable('shop-test-pdf-invoice', ['pdf-invoice/test.vala', 'pdf-invoice/pdf-invoice-interface.vala', 'database/db-interface.vala', 'price.vapi'], dependencies: [gio_dep, pangocairo_dep, rsvg_dep, gdk_dep, posix_dep], install: true)
+executable('shop-pdf-stock', ['pdf-stock/main.vala', 'pdf-stock/pdf-stock.vala', 'database/db-interface.vala', 'price.vapi'], dependencies: [gio_dep, pangocairo_dep, cairo_dep, posix_dep], link_with: libcairobarcode, install: true)
+executable('shop-test-pdf-stock', ['pdf-stock/test.vala', 'pdf-stock/pdf-stock-interface.vala'], dependencies: [gio_dep], install: true)
+executable('shop-pgp', ['pgp/main.vala', 'pgp/pgp.vala', 'pgp/pgp-interface.vala', 'config/config-interface.vala'], dependencies: [gio_dep, gpgme_dep, archive_dep], c_args: ['-D_FILE_OFFSET_BITS=64'], install: true)
+executable('shop-scanner-session', ['scanner-session/main.vala', 'scanner-session/scannersession.vala', 'scanner-session/scannersession-interface.vala', 'database/db-interface.vala', 'input-device/input-device-interface.vala', 'cli/cli-interface.vala', 'audio/audio-interface.vala', 'price.vapi'], dependencies: [gio_dep], install: true)
+executable('shop-serial-device', ['serial-device/main.vala', 'serial-device/serial-device.vala', 'config/config-interface.vala'], dependencies: [gio_dep, linux_dep], install: true)
+executable('shop-web', ['web/main.vala', 'web/web.vala', 'web/websession.vala', 'web/csv.vala', 'web/template.vala', 'database/db-interface.vala', 'pgp/pgp-interface.vala', 'price.vapi', 'config/config-interface.vala', 'audio/audio-interface.vala'], dependencies: [gio_dep, gee_dep, soup_dep, posix_dep], install: true)
diff --git a/src/pdf-invoice/Makefile b/src/pdf-invoice/Makefile
deleted file mode 100644
index 91b8522..0000000
--- a/src/pdf-invoice/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-all: pdf-invoice
- @echo > /dev/null
-
-pdf-invoice: main.vala pdf-invoice.vala pdf-invoice-interface.vala ../config/config-interface.vala ../database/db-interface.vala ../price.vapi
- valac -X -D'GETTEXT_PACKAGE="shopsystem"' -X -w -g -o $@ --pkg pangocairo --pkg librsvg-2.0 --pkg posix --pkg gdk-2.0 --pkg gio-2.0 $^
-
-test: pdf-invoice-interface.vala ../database/db-interface.vala test.vala ../price.vapi
- valac -X -D'GETTEXT_PACKAGE="shopsystem"' -X -w -o $@ --pkg gio-2.0 $^
-
-clean:
- rm -rf pdf-invoice test
-
-.PHONY: all clean
diff --git a/src/pdf-stock/Makefile b/src/pdf-stock/Makefile
deleted file mode 100644
index 4e8f472..0000000
--- a/src/pdf-stock/Makefile
+++ /dev/null
@@ -1,20 +0,0 @@
-include ../../config.mk
-
-LIBCAIROBARCODE=-X -I../libcairobarcode -X -L../libcairobarcode -X -lcairobarcode
-
-all: pdf-stock
- @echo > /dev/null
-
-pdf-stock: main.vala pdf-stock.vala ../database/db-interface.vala ../price.vapi ../libcairobarcode/libcairobarcode.vapi
- ${VALAC} -X -D'GETTEXT_PACKAGE="shopsystem"' -X -w ${LIBCAIROBARCODE} -o $@ --pkg cairo --pkg pangocairo --pkg gio-2.0 --pkg posix $^
-
-test: test.vala pdf-stock-interface.vala
- ${VALAC} -X -D'GETTEXT_PACKAGE="shopsystem"' -X -w -o $@ --pkg gio-2.0 $^
-
-run: pdf-stock
- LD_LIBRARY_PATH=../libcairobarcode ./pdf-stock
-
-clean:
- rm -rf pdf-stock test
-
-.PHONY: all clean run
diff --git a/src/pgp/Makefile b/src/pgp/Makefile
deleted file mode 100644
index 5faa80f..0000000
--- a/src/pgp/Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
-all: pgp
- @echo > /dev/null
-
-pgp: main.vala pgp.vala pgp-interface.vala ../config/config-interface.vala
- valac -X -D'GETTEXT_PACKAGE="shopsystem"' --Xcc="-D_FILE_OFFSET_BITS=64" -X -w -o $@ --vapidir ../../vapi -X -lgpgme --pkg gpgme --pkg gio-2.0 --pkg libarchive $^
-
-clean:
- rm -rf pgp
-
-.PHONY: all clean
diff --git a/src/scanner-session/Makefile b/src/scanner-session/Makefile
deleted file mode 100644
index 28f0ea8..0000000
--- a/src/scanner-session/Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
-all: scanner-session
- @echo > /dev/null
-
-scanner-session: main.vala scannersession.vala scannersession-interface.vala ../database/db-interface.vala ../input-device/input-device-interface.vala ../cli/cli-interface.vala ../audio/audio-interface.vala ../price.vapi
- valac -X -D'GETTEXT_PACKAGE="shopsystem"' -X -w -o $@ --pkg gio-2.0 $^
-
-clean:
- rm -rf scanner-session
-
-.PHONY: all clean
diff --git a/src/serial-device/Makefile b/src/serial-device/Makefile
deleted file mode 100644
index 9c810ea..0000000
--- a/src/serial-device/Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
-all: serial-device
- @echo > /dev/null
-
-serial-device: main.vala serial-device.vala ../input-device/input-device-interface.vala ../config/config-interface.vala
- valac -X -D'GETTEXT_PACKAGE="shopsystem"' -X -w -o $@ --pkg linux --pkg posix --pkg gio-2.0 $^
-
-clean:
- rm -rf serial-device
-
-.PHONY: all clean
diff --git a/src/web/Makefile b/src/web/Makefile
deleted file mode 100644
index 22d7bbc..0000000
--- a/src/web/Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
-all: web
- @echo > /dev/null
-
-web: main.vala web.vala websession.vala csv.vala template.vala ../database/db-interface.vala ../pgp/pgp-interface.vala ../price.vapi ../config/config-interface.vala ../audio/audio-interface.vala
- valac -X -D'GETTEXT_PACKAGE="shopsystem"' -X -w -o $@ --vapidir=../../vapi --enable-experimental --pkg gee-0.8 --pkg gio-2.0 --pkg libsoup-2.4 --pkg posix $^
-
-clean:
- rm -rf web
-
-.PHONY: all clean