aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2021-06-19 19:18:36 +0200
committerThomas White <taw@physics.org>2021-06-19 19:49:05 +0200
commitb93b5347e21fa16ea8176223dd003774cec978e5 (patch)
tree88fbf41603964689fa7d4c99af421bb21c712abc
parent6416b2dac6905c1ee48df75fdf42d3f6929785db (diff)
Update meson.build (install Guile files)
Unfortunately, I can't see any practical way, using the build system, to compile the .scm files into .scm.go files in the system 'site-ccache' directory: Using generator objects, the produced objects are explicitly only allowed to be used as input for targets, not to be installed themselves. Using individual custom targets, there would have to be numerous repetitions of the entire kerfuffle required to invoke guild. One target can only process one file. A single custom target running a script which compiles everything - might work, but even that is tricky to get right. And it's completely unportable. For all the above cases, there is still no guarantee that the compiled objects would be installed after the sources, as necessary to prevent spurious recompilation. It doesn't even seem that much easier to do this with Autotools, supposedly the recommended build system for this. Trying to make this work, I've already spent more time than will likely ever be saved by pre-compiling the sources. Let's just install the source files and let Guile automatically compile them into the user cache location.
-rw-r--r--README.md8
-rw-r--r--meson.build37
2 files changed, 28 insertions, 17 deletions
diff --git a/README.md b/README.md
index 5fe52fb..76cac91 100644
--- a/README.md
+++ b/README.md
@@ -102,8 +102,12 @@ Getting started
1. Install and set up [OLA](https://openlighting.org) for your lighting environment.
2. Start olad if it's not already running: `olad &`
-3. Install [Guile](https://www.gnu.org/software/guile/), if it's not already there (there's a good chance it is). Version 3 is preferred because it's much faster (= ability to handle more fixtures with less CPU load), but version 2.2 works as well. You will need the development packages (C header files) as well.
-4. Run `./compile` to compile the very small Guile`<-->`OLA compatibility module. Follow the instructions to copy the shared library to a system location and run `ldconfig` to update the dynamic linker's cache.
+3. Install [Guile](https://www.gnu.org/software/guile/), if it's not already
+ there (there's a good chance it is). Version 3 is preferred because it's
+ much faster (= ability to handle more fixtures with less CPU load), but
+ version 2.2 works as well. You will need the development packages (C header
+ files) as well.
+4. Run `meson build`, `ninja -C build` and `sudo ninja -C build install`.
5. Run `guile -L /path/to/starlet/guile`
6. Once in the Guile REPL, import the Starlet modules: `(use-modules (starlet base) (starlet playback) (starlet fixture-library generic))`
7. Patch a fixture with `(patch-fixture! fix <generic-dimmer> 1 #:universe 2)` - replace 1 and 2 with the DMX address and universe (respectively) of a real dimmer.
diff --git a/meson.build b/meson.build
index 4b6b87d..dfe81e4 100644
--- a/meson.build
+++ b/meson.build
@@ -1,36 +1,43 @@
# Meson file for Starlet
project('starlet', ['c', 'cpp'],
- version : '0.1.0',
- license : 'GPL3+',
- default_options : ['buildtype=debugoptimized'])
+ version: '0.1.0',
+ license: 'GPL3+',
+ default_options: ['buildtype=debugoptimized'])
+
# Localisation
subdir('po')
add_project_arguments('-DLOCALEDIR="'+join_paths(get_option('prefix'), get_option('localedir'))+'"',
- language : 'c')
+ language: 'c')
# Dependencies
gnome = import('gnome')
cc = meson.get_compiler('c')
-mdep = cc.find_library('m', required : false)
-gtk_dep = dependency('gtk+-3.0', required : true)
-cairo_dep = dependency('cairo', required : true)
-pango_dep = dependency('pango', required : true)
-pangocairo_dep = dependency('pangocairo', required : true)
-guile_dep = dependency('guile-3.0', required : true)
-ola_dep = dependency('libola', required : true)
+gtk_dep = dependency('gtk+-3.0', required: true)
+cairo_dep = dependency('cairo', required: true)
+pango_dep = dependency('pango', required: true)
+pangocairo_dep = dependency('pangocairo', required: true)
+guile_dep = dependency('guile-3.0', required: true)
+ola_dep = dependency('libola', required: true)
+
+# The installation location for Scheme files
+guile_sitedir = guile_dep.get_pkgconfig_variable('sitedir')
# Guile OLA library
library('guile-ola', ['src/guile-ola.cpp'],
- dependencies : [guile_dep, ola_dep],
- install: true)
+ dependencies: [guile_dep, ola_dep],
+ install: true)
# Fixture display tool
executable('starlet-fixture-display',
['src/starlet-fixture-display.c',
'src/repl-connection.c'],
- dependencies : [gtk_dep],
- install : true)
+ dependencies: [gtk_dep, cairo_dep, pango_dep, pangocairo_dep],
+ install: true)
+
+
+# Install Scheme source files (all at once)
+install_subdir('guile/starlet', install_dir: guile_sitedir)