Skip to content

Commit

Permalink
Simplified meson build by making dependencies sub projects
Browse files Browse the repository at this point in the history
  • Loading branch information
dov committed Apr 21, 2024
1 parent 9efe984 commit 513a9cf
Show file tree
Hide file tree
Showing 16 changed files with 35 additions and 1,225 deletions.
57 changes: 6 additions & 51 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,74 +20,29 @@ libdcmtk-dev libpcre3-dev gcc g++ libsndfile-dev \
libglm-dev
```

## gob2

- Clone is a gtk preprocessor, which was modified for giv and the following version must be used.
- Clone from: https://github.com/dov/gob2/tree/cpp-new
- Check out the `cpp-new` branch.
- Compile as follows:
```
./autogen.sh --prefix=/usr/local
make install
```

## plis

- plis is a string library developed by the author.
- Install as follows:
```
git clone http://github.com/dov/libplis
cd libplis/libplis
scons -u install
```

# Linux

The prefered building system is scons under Linux. automake is currently broken, and I started porting to meson, but I haven't finished it.
The prefered building system is meson under Linux.

## Prerequisites for giv

### libplis

This is a small c++ string library that I have been using for various projects. To install do:

```
git clone http://github.com/dov/libplis
cd libplis
meson setup build && cd build && ninja
sudo ninja install
```

### gob2

This is a small c++ string library that I have been using for various projects. To install do:

```
git clone http://github.com/dov/gob2
cd gob2
git checkout cpp-new
./autogen.sh
make -j 8
make install
```

## Prerequisites for the plugins

- cfitsio-devel
- dcmtk
- libwebp

These are all available by dnf
These are all available by dnf or apt. However, if the dependencies are not found, the plugins are skipped automatically during build.

## Building giv

After all the above plugin have been installed, giv may be built:

To build giv do in the top directory

```
scons -j 8
scons -j 8 install
meson setup build
cd buid
ninja
ninja install
```

# Windows
Expand Down
19 changes: 18 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -1,11 +1,28 @@
# Work in progress
project('giv', ['c','cpp','vala'],
version : '0.9.38',
license: 'LGPLv3+')

PACKAGE_DOC_DIR = 'doc'
PACKAGE_PLUGIN_DIR = get_option('prefix') + 'lib/giv-1.0/plugins/'

add_global_arguments('-DSPDLOG_FMT_EXTERNAL',
language : 'cpp')

add_global_arguments(['-DPACKAGE_DOC_DIR="'+PACKAGE_DOC_DIR+'" ',
'-DPACKAGE_PLUGIN_DIR="'+PACKAGE_PLUGIN_DIR+'" '],
language : 'cpp')
add_global_arguments(['-DPACKAGE_DOC_DIR="'+PACKAGE_DOC_DIR+'" ',
'-DPACKAGE_PLUGIN_DIR="'+PACKAGE_PLUGIN_DIR+'" '],
language : 'c')

gob2_proj = subproject('gob2')

libsimple_dep = dependency(
'libplis',
fallback : ['libplis', 'libplis_dep'],
default_options: ['default_library=static']
)

gnome = import('gnome')
pkgconfig = import('pkgconfig')

Expand Down
2 changes: 1 addition & 1 deletion src/giv-data.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
*/
#include "giv-data.h"
#include "plis/plis.h"
#include "libplis/plis.h"

using namespace plis;

Expand Down
2 changes: 1 addition & 1 deletion src/giv-parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "giv-parser.h"
#include "giv-data.h"
#include "GivStringArray.h"
#include "plis/plis.h"
#include "libplis/plis.h"
#include "WordBoundaries.h"
#include <iostream>
#include <filesystem>
Expand Down
2 changes: 1 addition & 1 deletion src/giv-win.gob
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ requires 2.0.0
#include <math.h>
#include <gtk/gtk.h>
#include "giv-data.h"
#include "plis/plis.h"
#include "libplis/plis.h"
#include "givimage.h"
#include "glib-jsonrpc/glib-jsonrpc-server.h"
%}
Expand Down
2 changes: 1 addition & 1 deletion src/giv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "spdlog/spdlog.h"
#include "spdlog/async_logger.h"
#include <glib/gstdio.h>
#include <plis/plis.h>
#include <libplis/plis.h>


const int GIV_DEFAULT_PORT = 8448;
Expand Down
3 changes: 2 additions & 1 deletion src/gtkimageviewer/meson.build
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
gob2 = find_program('gob2')
patch_src = find_program('patch_src.py')

gob2 = gob2_proj.get_variable('gob2_exe')

gen_src = custom_target('gen-output',
output : ['gtk-image-viewer.h','gtk-image-viewer-private.h','gtk-image-viewer.c'],
input : 'gtk-image-viewer.gob',
Expand Down
15 changes: 2 additions & 13 deletions src/meson.build
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
gob2 = find_program('gob2')

PACKAGE_DOC_DIR = '../doc'
PACKAGE_PLUGIN_DIR = '/usr/local/lib/giv-1.0/plugins/'

add_global_arguments(['-DPACKAGE_DOC_DIR="'+PACKAGE_DOC_DIR+'" ',
'-DPACKAGE_PLUGIN_DIR="'+PACKAGE_PLUGIN_DIR+'" '],
language : 'cpp')
add_global_arguments(['-DPACKAGE_DOC_DIR="'+PACKAGE_DOC_DIR+'" ',
'-DPACKAGE_PLUGIN_DIR="'+PACKAGE_PLUGIN_DIR+'" '],
language : 'c')
gob2 = gob2_proj.get_variable('gob2_exe')

giv_widget_src = custom_target('gen-output',
output : ['giv-widget.h','giv-widget-private.h','giv-widget.cc'],
Expand All @@ -29,7 +19,6 @@ giv_widget_sources = [
'giv-data.cc',
'giv-markup.cc',
'giv_agg_arrowhead.cc',
'giv-settings.cc',
'clipper.cpp',
'SutherlandHodgmanPolygonClipping.cc'
]
Expand All @@ -46,7 +35,7 @@ gtk_dep = dependency('gtk+-3.0')
fmt_dep = dependency('fmt')
spdlog_dep = dependency('spdlog')
gmodule_dep = dependency('gmodule-2.0')
libplis_dep = dependency('plis')
libplis_dep = dependency('libplis')

libgivwidget = shared_library(
'giv-widget',
Expand Down
13 changes: 0 additions & 13 deletions src/plis/Makefile.am

This file was deleted.

7 changes: 0 additions & 7 deletions src/plis/SConscript

This file was deleted.

9 changes: 0 additions & 9 deletions src/plis/meson.build

This file was deleted.

Loading

0 comments on commit 513a9cf

Please sign in to comment.