|
1 | | ---- |
2 | | -author: |
3 | | -- Cyan Ogilvie |
4 | | -title: json(n) 0.16 \| rl_json Tcl JSON Package |
5 | | ---- |
6 | | - |
7 | 1 | # NAME |
8 | 2 |
|
9 | 3 | json - Parse, manipulate and produce JSON documents |
@@ -732,6 +726,73 @@ Replacements are: |
732 | 726 | - `?size` - use **json length** *json_val* ?*key …*? |
733 | 727 | - `?keys` - use **json keys** *json_val* ?*key …*? |
734 | 728 |
|
| 729 | +## BUILDING |
| 730 | + |
| 731 | +The primary build system is `meson`. Use the `PKG_CONFIG_PATH` |
| 732 | +environment variable to point meson to Tcl if it is installed in a |
| 733 | +nonstandard location. The legacy autotools build system is also |
| 734 | +maintained. |
| 735 | + |
| 736 | +Tcl 8.6 and Tcl 9.0 are both supported. |
| 737 | + |
| 738 | +### From a Release Tarball |
| 739 | + |
| 740 | +Download and extract [the |
| 741 | +release](https://github.com/RubyLane/rl_json/releases), then build: |
| 742 | + |
| 743 | +``` sh |
| 744 | +# meson (recommended) |
| 745 | +meson setup builddir --buildtype=release |
| 746 | +meson test -C builddir |
| 747 | +meson install -C builddir |
| 748 | + |
| 749 | +# autotools |
| 750 | +./configure |
| 751 | +make |
| 752 | +make test |
| 753 | +sudo make install |
| 754 | +``` |
| 755 | + |
| 756 | +### From the Git Sources |
| 757 | + |
| 758 | +Fetch [the code](https://github.com/RubyLane/rl_json) and submodules |
| 759 | +recursively, then build: |
| 760 | + |
| 761 | +``` sh |
| 762 | +git clone --recurse-submodules https://github.com/RubyLane/rl_json |
| 763 | +cd rl_json |
| 764 | + |
| 765 | +# meson (recommended) |
| 766 | +meson setup builddir --buildtype=release |
| 767 | +meson test -C builddir |
| 768 | +meson install -C builddir |
| 769 | + |
| 770 | +# autotools |
| 771 | +autoconf |
| 772 | +./configure |
| 773 | +make |
| 774 | +make test |
| 775 | +sudo make install |
| 776 | +``` |
| 777 | + |
| 778 | +### In a Docker Build |
| 779 | + |
| 780 | +Build from a specified release version, minimising image size: |
| 781 | + |
| 782 | +``` dockerfile |
| 783 | +WORKDIR /tmp/rl_json |
| 784 | +RUN wget https://github.com/RubyLane/rl_json/releases/download/v0.16/rl_json-v0.16.tar.gz -O - | tar xz --strip-components=1 && \ |
| 785 | + meson setup builddir --buildtype=release && \ |
| 786 | + meson install -C builddir && \ |
| 787 | + strip /usr/local/lib/lib*rl_json*.so && \ |
| 788 | + cd .. && rm -rf rl_json |
| 789 | +``` |
| 790 | + |
| 791 | +For any of the build methods you may need to set |
| 792 | +`PKG_CONFIG_PATH=/path/to/tcl/lib/pkgconfig` (meson) or pass |
| 793 | +`--with-tcl /path/to/tcl/lib` to `configure` (autotools) if your Tcl |
| 794 | +install is somewhere nonstandard. |
| 795 | + |
735 | 796 | ## KEYWORDS |
736 | 797 |
|
737 | 798 | json, parsing, formatting |
|
0 commit comments