dxma / perl5-json-jq

JSON::JQ - jq (https://stedolan.github.io/jq/) library binding
MIT License
5 stars 5 forks source link

unable to install on AIX #14

Open XSven opened 2 years ago

XSven commented 2 years ago

I have tried to install JSON::JQ 0.09 on AIX 7.2 system. My perl version is 5.14.2.

Building and testing Alien-LibJQ-0.05 ... FAIL

/home/micsw/.cpanm/work/1659593899.23921106/Alien-LibJQ-0.05/_alien/build_ECX3/jq-1.6/src/builtin.c:1048:20: error: 'INFINITY' undeclared (first use in this function)
   return jv_number(INFINITY);
                    ^~~~~~~~
/home/micsw/.cpanm/work/1659593899.23921106/Alien-LibJQ-0.05/_alien/build_ECX3/jq-1.6/src/builtin.c:1053:20: error: 'NAN' undeclared (first use in this function)
   return jv_number(NAN);
                    ^~~

I am aware of the issue jq with AIX but we have installed a properly working jq AIX port as an rpm from AIX Toolbox for Open Source Software

/opt/freeware/bin/jq
/opt/freeware/bin/jq_32
/opt/freeware/bin/jq_64
/opt/freeware/doc/jq-1.6
/opt/freeware/doc/jq-1.6/AUTHORS
/opt/freeware/doc/jq-1.6/COPYING
/opt/freeware/doc/jq-1.6/ChangeLog
/opt/freeware/doc/jq-1.6/NEWS
/opt/freeware/doc/jq-1.6/README
/opt/freeware/doc/jq-1.6/README.md
/opt/freeware/lib/libjq.a
/opt/freeware/lib64/libjq.a
/opt/freeware/man/man1/jq.1
/opt/freeware/include/jq.h
/opt/freeware/include/jv.h

Why isn't that used to build the libjq.so?

dxma commented 2 years ago

hi, Thank you for reaching me on this.

The problem above occored because I didn't take any existing system jq library for making this perl binding. The underlying module Alien::LibJQ always tries to compile libjq.a from source code. I rely on cmake for system/compilier portability.

Looks like it still cannot work on AIX. Unfortunately I have no testing environment to try. The jq library from AIX Toolbox is missing the pkg-config file for compiling and linking, usually called something like jq.pc. It records the gcc (or other compiler) flags and linking options.

One way to resolve this, ask the maintainer of AIX Toolbox to add back the missing pkg-config files, they can be auto generated while making this package. Once the jq.pc file is available, I will instruct my package build to search for it and use the libjq.a inside instead.

XSven commented 2 years ago

Thx for the explanation. I will try to reach out the maintainer of AIX jq rpm package.

XSven commented 1 year ago

This is the comment made by the maintainer of the AIX jq rpm some time ago.

Unlike most other Opensource packages , jq is not providing a pkgconfig (.pc) file by itself. So we have to create it by ourself. We will try to do that in the next release. BTW, I don't see jq-devel (or dev) delivering .pc files in other distros as well.

I am unable to judge the response. Any comments (if necessary) are very much appreciated.

dxma commented 1 year ago

I guess what they said is true. Alternative option is to fix my own build on AIX, the cmake tool used will make a proper pkgconfig file together with the built binaries.