author | František Kučera <franta-hg@frantovo.cz> |
Wed, 30 Oct 2019 18:05:46 +0100 | |
branch | v_0 |
changeset 282 | ec02133045a3 |
parent 258 | 2868d772c27e |
permissions | -rw-r--r-- |
219 | 1 |
# Install dependencies as root: |
2 |
su -c "apt install g++ make cmake mercurial pkg-config" |
|
241 | 3 |
su -c "apt install libxerces-c-dev" # needed only for relpipe-in-xml module |
250 | 4 |
su -c "apt install guile-2.2-dev" # needed only for relpipe-tr-guile module; guile-2.0-dev also works but requires a patch (see below) |
258
2868d772c27e
Release v0.12 – AWK
František Kučera <franta-hg@frantovo.cz>
parents:
256
diff
changeset
|
5 |
su -c "apt install gawk" # needed only for relpipe-tr-awk module |
219 | 6 |
|
7 |
# Run rest of installation as a non-root user: |
|
258
2868d772c27e
Release v0.12 – AWK
František Kučera <franta-hg@frantovo.cz>
parents:
256
diff
changeset
|
8 |
export RELPIPE_VERSION="v0.12" |
219 | 9 |
export RELPIPE_SRC=~/src |
10 |
export RELPIPE_BUILD=~/build |
|
11 |
export RELPIPE_INSTALL=~/install |
|
12 |
export PKG_CONFIG_PATH="$RELPIPE_INSTALL/lib/pkgconfig/:$PKG_CONFIG_PATH" |
|
13 |
export PATH="$RELPIPE_INSTALL/bin:$PATH" |
|
14 |
||
241 | 15 |
rm -rf "$RELPIPE_BUILD"/relpipe-* |
16 |
mkdir -p "$RELPIPE_SRC" "$RELPIPE_BUILD" "$RELPIPE_INSTALL" |
|
219 | 17 |
|
18 |
# Helper functions: |
|
241 | 19 |
relpipe_download() { for m in "$@"; do cd "$RELPIPE_SRC" && ([[ -d "relpipe-$m.cpp" ]] && hg pull -R "relpipe-$m.cpp" && hg update -R "relpipe-$m.cpp" "$RELPIPE_VERSION" || hg clone -u "$RELPIPE_VERSION" https://hg.globalcode.info/relpipe/relpipe-$m.cpp) || break; done; } |
20 |
relpipe_install() { for m in "$@"; do cd "$RELPIPE_BUILD" && mkdir -p relpipe-$m.cpp && cd relpipe-$m.cpp && cmake -DCMAKE_INSTALL_PREFIX:PATH="$RELPIPE_INSTALL" "$RELPIPE_SRC/relpipe-$m.cpp" && make && make install || break; done; } |
|
219 | 21 |
|
22 |
# Download all sources: |
|
258
2868d772c27e
Release v0.12 – AWK
František Kučera <franta-hg@frantovo.cz>
parents:
256
diff
changeset
|
23 |
relpipe_download lib-protocol lib-reader lib-writer lib-cli lib-xmlwriter in-cli in-fstab in-xml in-csv in-filesystem in-recfile out-gui.qt out-nullbyte out-ods out-tabular out-xml out-csv out-asn1 out-recfile tr-cut tr-grep tr-python tr-sed tr-validator tr-guile tr-awk |
250 | 24 |
|
25 |
# Optional: At this point, we have all dependencies and sources downloaded, so we can disconnect this computer from the internet in order to verify that our build process is sane, deterministic and does not depend on any external resources. |
|
219 | 26 |
|
27 |
# Build and install libraries: |
|
241 | 28 |
relpipe_install lib-protocol lib-reader lib-writer lib-cli lib-xmlwriter |
219 | 29 |
|
30 |
# Build and install tools: |
|
258
2868d772c27e
Release v0.12 – AWK
František Kučera <franta-hg@frantovo.cz>
parents:
256
diff
changeset
|
31 |
relpipe_install in-fstab in-cli in-fstab in-xml in-csv in-recfile tr-cut tr-grep tr-sed tr-guile tr-awk out-nullbyte out-ods out-tabular out-xml out-csv out-asn1 out-recfile |
241 | 32 |
|
33 |
# relpipe_install in-filesystem # requires GCC 8 or patching (see below) |
|
219 | 34 |
|
35 |
# Clean-up: |
|
36 |
unset -f relpipe_install |
|
37 |
unset -f relpipe_download |
|
38 |
unset -v RELPIPE_VERSION |
|
39 |
unset -v RELPIPE_SRC |
|
40 |
unset -v RELPIPE_BUILD |
|
41 |
unset -v RELPIPE_INSTALL |
|
42 |
||
258
2868d772c27e
Release v0.12 – AWK
František Kučera <franta-hg@frantovo.cz>
parents:
256
diff
changeset
|
43 |
# Filter your your fstab using AWK and view it like on an 80s green screen terminal! |
2868d772c27e
Release v0.12 – AWK
František Kučera <franta-hg@frantovo.cz>
parents:
256
diff
changeset
|
44 |
relpipe-in-fstab | relpipe-tr-awk --relation 'fstab' --for-each '(pass == 1 || type == "swap")' | relpipe-out-tabular |