SAOImageDS9 / SAOImageDS9

SAOImage DS9 is an astronomical imaging and data visualization application.
GNU General Public License v3.0
96 stars 13 forks source link

hard-coded build assumptions: libxml2/xslt and ssl #104

Closed DougBurke closed 3 years ago

DougBurke commented 5 years ago

I tried to build DS9 using Nix, and managed to get something to build, although I'm not 100% convinced there's not a problem lurking somewhere (in large part because I am not a nix expert). The necessary code is in https://github.com/DougBurke/nix-astro-experiments/tree/master/ds9 but if you don't speak nix this won't be that helpful!

The main issue is that nix doesn't have things in /usr/ or /lib/ or /bin/ or ..., so it's a good way of finding out where some hard-coded assumptions are (e.g. by accidentally using a package in /usr/lib/ that you weren't expecting)

The changes I made include the following - I don't expect these are the best or sensible ways to do it, rather that they point to areas that we can possibly improve:

a) libxml2/xslt

It looks like tclxml isn't using pkg-config to find libxml/xslt

https://github.com/DougBurke/nix-astro-experiments/blob/master/ds9/nix-build.patch

I also had to replace /usr/include/libxml2 by the path to the libxml2 include directory (so probably pkg-config libxml2 --cflags or whatever it is) in tksao/configure

b) SSL

Somewhere there's a fall through that assumes the ssl directory is in one of the "standard" locations, which isn't the case here, so I had to set TLSFLAGS before the configure phase - e.g.

export TLSFLAGS="--with-ssl-dir=${openssl_1_0_2.dev}"

when ideally this would be picked up from pkg-config or a top-level configuration option (I forget now where this caused a problem)

wjoye commented 5 years ago

Thanks, I’ll take a look.

Bill

Sent from my iPad

On Apr 12, 2019, at 3:07 PM, Doug Burke notifications@github.com wrote:

I tried to build DS9 using Nix, and managed to get something to build, although I'm not 100% convinced there's not a problem lurking somewhere (in large part because I am not a nix expert). The necessary code is in https://github.com/DougBurke/nix-astro-experiments/tree/master/ds9 but if you don't speak nix this won't be that helpful!

The main issue is that nix doesn't have things in /usr/ or /lib/ or /bin/ or ..., so it's a good way of finding out where some hard-coded assumptions are (e.g. by accidentally using a package in /usr/lib/ that you weren't expecting)

The changes I made include the following - I don't expect these are the best or sensible ways to do it, rather that they point to areas that we can possibly improve:

a) libxml2/xslt

It looks like tclxml isn't using pkg-config to find libxml/xslt

https://github.com/DougBurke/nix-astro-experiments/blob/master/ds9/nix-build.patch

I also had to replace /usr/include/libxml2 by the path to the libxml2 include directory (so probably pkg-config libxml2 --cflags or whatever it is) in tksao/configure

b) SSL

Somewhere there's a fall through that assumes the ssl directory is in one of the "standard" locations, which isn't the case here, so I had to set TLSFLAGS before the configure phase - e.g.

export TLSFLAGS="--with-ssl-dir=${openssl_1_0_2.dev}"

when ideally this would be picked up from pkg-config or a top-level configuration option (I forget now where this caused a problem)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

wjoye commented 3 years ago

Ok, using xml2-config script for compile flags and libs. For darwin, MacOS, and linux, 'which xml2-config'. for Windows, hardcode for MINGW target.

OPENSSL is compiled and static linked, with TLS hardcoded.