NickNaso / ghostscript4js

Ghostscript4JS binds the Ghostscript C API to the Node.JS world.
http://www.nacios.it
Apache License 2.0
68 stars 19 forks source link

GS4JS_LIB variable isn't used #23

Closed cbogwill closed 7 years ago

cbogwill commented 7 years ago

I'm installing into a docker image.

The installation of ghostscript does not have a 'libgs.so', it has:

root@c1a8e5e5f9f6:/usr/bin# find / -name libgs.so*
/usr/lib/libgs.so.9
/usr/lib/libgs.so.9.06

I tried overriding it but it did not work:

--GS4JS_LIB="libgs.so.9"

Looking at the code in binding.gyp, line 15, it is hard-coded, and not respecting the parameter provided. It should look like:

        ['OS=="linux"', {
          'variables': {
            "GS4JS_HOME%": "<!(echo $GS4JS_HOME)",
            "GS4JS_LIB%": "<!(echo $GS4JS_LIB)",
            "conditions": [
              ['"<!(echo $GS4JS_HOME)" == ""', {
                "GS4JS_HOME%": "/usr/lib/x86_64-linux-gnu"
              }],
              ['"<!(echo $GS4JS_LIB)" == ""', {
                "GS4JS_LIB%": "libgs.so"
              }]
            ]
          },
          "libraries": ["<(GS4JS_HOME)/<(GS4JS_LIB)"]
        }],
NickNaso commented 7 years ago

Hi @cbogwill , thanks for your reporting. I just provide to change the handling of **GS4JS_LIB** variable. I tested on Linux - Windows and macOs all seems to be fine. Please inform me in case you continue to experiment some kind of problem. I published a new version of the addon: v2.0.5 that solve the problem.