Skip to content

Commit aecda30

Browse files
committed
Bumped version to 0.9.36
1 parent 61bc531 commit aecda30

File tree

12 files changed

+195
-43
lines changed

12 files changed

+195
-43
lines changed

INSTALL

Lines changed: 0 additions & 20 deletions
This file was deleted.

INSTALL.md

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
# Background
2+
3+
Building giv isn't that easy, due to the large number of of dependencies, including some patches and some obsolete tools. Especially building it for windows is hard because of the cross compiling the dependencies.
4+
5+
It is my goal to simplify this in the future, but currently the goal of this document is to describe how to build.
6+
7+
The building steps below have been tested on Fedora, but they probably work with small modifications under any Linux system.
8+
9+
# Prerequisites
10+
11+
Both the linux and the cross compilation build require the following dependencies:
12+
13+
- https://github.com/dov/gob2/tree/cpp-new - The `cpp-new` branch.
14+
- vala - "Any" resent version will do
15+
- scons
16+
17+
# Linux
18+
19+
The prefered building system is scons under Linux. automake is currently broken, and I started porting to meson, but I haven't finished it.
20+
21+
## Prerequisites for giv
22+
23+
### libplis
24+
25+
This is a small c++ string library that I have been using for various projects. To install do:
26+
27+
```
28+
git clone http://github.com/dov/libplis
29+
cd libplis
30+
./autogen.sh --prefix=/usr/local; make -j 8 install
31+
```
32+
33+
## Prerequisites for the plugins
34+
35+
- cfitsio-devel
36+
- dcmtk
37+
- libwebp
38+
39+
These are all available by dnf
40+
41+
## Building giv
42+
43+
Giv may be built:
44+
45+
To build giv do in the top directory
46+
47+
```
48+
scons -j 8
49+
scons -j 8 install
50+
```
51+
52+
# Windows
53+
54+
The windows build and installer are cross compiled with mingw libraries under Linux. The following are the requirements for building giv under Fedora:
55+
56+
```
57+
sudo dnf -y install mingw64-filesystem
58+
sudo dnf -y install mingw64-gcc
59+
sudo dnf -y install mingw64-gcc-c++
60+
sudo dnf -y install mingw32-nsis
61+
sudo dnf -y install mingw64-pcre
62+
sudo dnf -y install mingw64-gtk3
63+
sudo dnf -y install mingw64-libzip
64+
sudo dnf -y install mingw64-libwebp
65+
```
66+
67+
The following libraries are not available as binary downloads and may be installed from source as follows described below:
68+
69+
## Prerequisites
70+
71+
### libplis
72+
73+
```
74+
git clone http://github.com/dov/libplis
75+
# The following is needed to generate the "compile" file
76+
./autogen.sh --prefix=/usr/local
77+
mingw64-configure --prefix=/usr/local/mingw64 --exec_prefix=/usr/local/mingw64 --libdir=/usr/local/mingw64/lib --includedir=/usr/local/mingw64/include
78+
make install
79+
```
80+
81+
### dcmtk
82+
83+
- TBD - (I got it to work by tweaking with the CMakeCache.txt file, but I don't have a reproducible method. Mail me for my CMakeCache.txt file if you want)
84+
85+
86+
### cfitsio
87+
- Using cmake toolchain
88+
```
89+
mkcd /space3/pub-repos/cfitsio-4.2.0/build_mingw64/
90+
cmake -DCMAKE_TOOLCHAIN_FILE=/home/dov/git/dov-env/cmake/mingw-w64-x86_64.cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mingw64 ..
91+
```
92+
- This fails because of missing zlibrary
93+
- Edit `CMakeCache.txt`
94+
- Search for the missing library and change them, e.g.:
95+
```
96+
//Path to a file.
97+
ZLIB_INCLUDE_DIR:PATH=/usr/x86_64-w64-mingw32/sys-root/mingw/include/
98+
99+
//Path to a library.
100+
ZLIB_LIBRARY_DEBUG:FILEPATH=/usr/x86_64-w64-mingw32/sys-root/mingw/lib/libz.a
101+
102+
//Path to a library.
103+
ZLIB_LIBRARY_RELEASE:FILEPATH=/usr/x86_64-w64-mingw32/sys-root/mingw/lib/libz.a
104+
```
105+
- After this change, ~cmake~ may be run again and it worked
106+
107+
### fmt
108+
- Compilation:
109+
```
110+
unzip ~/hd/Download/fmt-9.1.0.zip
111+
cd fmt-9.1.0
112+
mkdir build_mingw64
113+
cd build_mingw64
114+
cmake -DFMT_TEST=OFF -DCMAKE_TOOLCHAIN_FILE=/home/dov/git/dov-env/cmake/mingw-w64-x86_64.cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mingw64 ..
115+
```
116+
117+
### glm
118+
- Currently the main branch is broken with regards to installation. The following pull request fixes it. Use this glm version:
119+
- https://github.com/g-truc/glm/pull/1117
120+
- Compilation
121+
122+
```
123+
wget https://github.com/Tachi107/glm/archive/refs/heads/cmake-install-improvements.zip
124+
unzip cmake-install-improvements.zip
125+
cd glm-cmake-install-improvements
126+
mkdir build_mingw64
127+
cd build_mingw64
128+
cmake -DGLM_TEST_ENABLE=OFF -DCMAKE_TOOLCHAIN_FILE=/home/dov/git/dov-env/cmake/mingw-w64-x86_64.cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mingw64 ..
129+
make install
130+
```

NEWS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
Version 0.9.35:
2+
3+
* Fixed several windows problems with missing plugins etc
4+
* Giv now contains a -log flag for logging through spdlog. It is recommended to use for diagnostic all failures.
5+
* There is a rudamentary option to "keep" a measurement and to "clear kept measurements".
6+
17
Version 0.9.34:
28

39
* Giv now supports the display of Bezier Curves. See the examples/bezier.giv for an example of how to use it.

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ AM_CONFIG_HEADER(config.h)
55
PACKAGE=givwidget
66
GIVWIDGET_API_VERSION=2.0
77

8-
AM_INIT_AUTOMAKE(giv, 0.9.35)
8+
AM_INIT_AUTOMAKE(giv, 0.9.36)
99

1010
dnl Use libtool to get shared libraries
1111
LT_PREREQ

giv.nsi

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ File ${SYSROOT}\mingw\bin\libepoxy-0.dll
5353
File ${SYSROOT}\mingw\bin\libcairo*.dll
5454
File ${SYSROOT}\mingw\bin\libjasper*.dll
5555
File ${SYSROOT}\mingw\bin\zlib*.dll
56+
File ${SYSROOT}\mingw\bin\libzip*.dll
57+
File ${SYSROOT}\mingw\bin\libwebp*.dll
5658
File ${SYSROOT}\mingw\bin\libglib*.dll
5759
File ${SYSROOT}\mingw\bin\libatk*.dll
5860
File ${SYSROOT}\mingw\bin\libgobject*.dll
@@ -70,7 +72,9 @@ File ${SYSROOT}\mingw\bin\libwinpthread*.dll
7072
File ${SYSROOT}\mingw\bin\libssp-0.dll
7173
File ${SYSROOT}\mingw\bin\libfribidi-0.dll
7274
File ${SYSROOT}\mingw\bin\libharfbuzz-0.dll
75+
7376
#File \usr\local\mingw32\bin\libjson-glib-1.0-0.dll
77+
File \usr\local\mingw64\bin\libcfitsio.dll
7478
File ${SYSROOT}\mingw\bin\gdk-pixbuf-query-loaders.exe
7579

7680
# # Not sure that I need this. It doesn't seem to make any difference.

src/SConscript

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ def file2c(env, target, source):
3636
out.close()
3737
inp.close()
3838

39-
src_giv_image = ['givimage.cc',
39+
src_giv_image = ['givimagedll.cc',
40+
'givimage.cc',
4041
'givplugin.cc',
4142
]
4243

src/giv-win.gob

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ requires 2.0.0
1818

1919
%{
2020
#ifdef _WIN32
21-
#if 0
22-
#include <windows.h>
23-
#include <cairo-win32.h>
24-
#endif
2521
#endif
2622

2723
#include <gdk/gdkkeysyms.h>
@@ -3250,20 +3246,6 @@ cb_menu_about(GtkAction *action,
32503246
gtk_widget_destroy (about_window);
32513247
}
32523248

3253-
static void
3254-
cb_menu_manual(GtkAction *action,
3255-
gpointer data)
3256-
{
3257-
#ifdef WIN32
3258-
// Fix the path
3259-
ShellExecute(NULL, "open", "file:///c|/Progra~1/giv/doc/giv.html", NULL, NULL, SW_SHOWNORMAL);
3260-
#else
3261-
// Linux
3262-
system(slipprintf("xdg-open %s/giv.html",
3263-
PACKAGE_DOC_DIR));
3264-
#endif
3265-
}
3266-
32673249
static void
32683250
cb_menu_copyright(GtkAction *action,
32693251
gpointer data)
@@ -4642,5 +4624,23 @@ static void create_remote_commands(GivWin *self)
46424624
self);
46434625
}
46444626

4627+
#ifdef _WIN32
4628+
#include <shellapi.h>
4629+
#endif
4630+
4631+
static void
4632+
cb_menu_manual(GtkAction *action,
4633+
gpointer data)
4634+
{
4635+
#ifdef _WIN32
4636+
// Fix the path
4637+
ShellExecute(NULL, "open", "file:///c|/Progra~1/giv/doc/giv.html", NULL, NULL, SW_SHOWNORMAL);
4638+
#else
4639+
// Linux
4640+
system(slipprintf("xdg-open %s/giv.html",
4641+
PACKAGE_DOC_DIR));
4642+
#endif
4643+
}
4644+
46454645
%}
46464646

src/giv.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <string.h>
1111
#include "gtk/gtk.h"
1212
#include "giv-win.h"
13+
#include "givimagedll.h"
1314
#include "glib-jsonrpc/glib-jsonrpc-json.h"
1415
#include "glib-jsonrpc/glib-jsonrpc-client.h"
1516
#include "spdlog/sinks/basic_file_sink.h"
@@ -193,6 +194,9 @@ int main(int argc, char **argv)
193194
spdlog::info("CommitTime: {}", GIT_COMMIT_TIME);
194195
spdlog::info("Command line: {}", join(args," "));
195196

197+
spdlog::info("Calling to register logger in givimagedll");
198+
registerLogger(logger);
199+
196200
// Load an image into a remote instance of giv. If this fails,
197201
// then normal loading should take place.
198202
if (do_remote)

src/givimage.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
#include "givimage.h"
1111
#include "givplugin.h"
1212
#include <gdk-pixbuf/gdk-pixbuf.h>
13-
#include "spdlog/spdlog.h"
14-
13+
#include <spdlog/spdlog.h>
1514

1615
#define GIV_IMAGE_ERROR g_spawn_error_quark ()
1716

@@ -719,3 +718,5 @@ GivImageType giv_image_get_type(GivImage *img)
719718
{
720719
return img->img_type;
721720
}
721+
722+

src/givimagedll.cc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// A spdlog registration for the givimage dll
2+
3+
#include "givimagedll.h"
4+
5+
void registerLogger(std::shared_ptr<spdlog::logger> logger)
6+
{
7+
spdlog::register_logger(logger);
8+
spdlog::set_default_logger(logger);
9+
spdlog::info("Registering the logger in the givimage dll");
10+
}

0 commit comments

Comments
 (0)