#jq #json #build #link #compile #source #api

build jq-src

API for compiling and link libjq from source

5 releases (3 breaking)

Uses old Rust 2015

0.4.1 Jun 23, 2019
0.4.0 Jun 9, 2019
0.3.1 Jun 2, 2019
0.2.0 Feb 18, 2019
0.1.0 Jan 13, 2019

#407 in Build Utils

Download history 61/week @ 2024-03-14 72/week @ 2024-03-21 82/week @ 2024-03-28 69/week @ 2024-04-04 71/week @ 2024-04-11 76/week @ 2024-04-18 69/week @ 2024-04-25 56/week @ 2024-05-02 57/week @ 2024-05-09 67/week @ 2024-05-16 52/week @ 2024-05-23 87/week @ 2024-05-30 77/week @ 2024-06-06 278/week @ 2024-06-13 185/week @ 2024-06-20 155/week @ 2024-06-27

716 downloads per month
Used in 6 crates (via jq-sys)

Apache-2.0/MIT

3MB
113K SLoC

C 110K SLoC // 0.0% comments Happy 882 SLoC Python 753 SLoC // 0.1% comments jq 301 SLoC // 0.1% comments Automake 259 SLoC // 0.1% comments Liquid 237 SLoC // 0.0% comments M4 178 SLoC // 0.4% comments Shell 94 SLoC // 0.2% comments Rust 85 SLoC // 0.2% comments RPM Specfile 52 SLoC // 0.1% comments JavaScript 50 SLoC // 0.0% comments C++ 12 SLoC // 0.6% comments Batch 6 SLoC

Contains (obscure autoconf code, 10KB) modules/jq/configure.ac, (obscure autoconf code, 3KB) configure.ac

jq-src

crates.io crates.io docs.rs

This rust crate provides an api to compile libjq provided by the jq 1.6 release. Other versions of jq may work but haven't been tested.

The primary consumer of this crate is jq-sys which depends on this crate when the bundled feature is enabled.

Setting JQ_NO_STATIC will build a shared lib instead of static (the default). This is probably ill-advised since you'd then have to go out of your way to ensure you retain the libjq build results and install them on your system so they can be found at runtime. Still, the variable is there if you feel the need to set it.

As per the jq readme, the library is compiled using the built-in oniguruma library for regex support.

For this to succeed, you will have to have autotools (autoreconf, make, etc) and a gcc toolchain in your PATH.

Note that the jq sources are provided as git submodules. These will be fetched automatically when installing this crate from crates.io or using a git dependency, however if you want to hack on the crate locally, or list it as a path dependency, you'll have to fetch the submodules yourself, for example:

$ git submodule update --init --recursive

If building this crate fails because of missing files, it's likely the submodules were not initialized.

Changelog

v0.4.1 (2019-06-22)

  • Fixes issue where dependent crates can fail to build while linking on some systems (#3).

v0.4.0 (2019-06-09)

  • Upgrade to autotools 0.2, updating the usages to be compatible with the new public api.
  • (Hopefully) Fixes issue where the autotools build can intermittently fail (#1).

v0.3.1 (2019-06-01)

  • Downgrade to autotools 0.1 (newer versions cause breakage in jq build).

v0.3.0 (2019-06-01)

  • Removed Artifacts::print_cargo_metadata(), which was largely duplicate of Artifacts::print_link_info() (somehow I wrote this method twice).
  • Added some docs.

v0.2.0 (2019-02-18)

  • No longer build/link in build.rs - add wrapper API so jq-sys can do it itself.
  • Try improve build script reliability by cleaning jq src dir prior to each run (if it exists).

v0.1.0 (2019-01-12)

Initial release.

Dependencies