author | František Kučera <franta-hg@frantovo.cz> |
Mon, 21 Feb 2022 00:43:11 +0100 | |
branch | v_0 |
changeset 329 | 5bc2bb8b7946 |
parent 323 | e2d607e4a4f4 |
permissions | -rw-r--r-- |
219 | 1 |
# Install dependencies as root: |
322
060d2590e77c
first version of release-v0.18.sh
František Kučera <franta-hg@frantovo.cz>
parents:
319
diff
changeset
|
2 |
if [[ "$USER" == "root" ]]; then |
323
e2d607e4a4f4
release-v0.18.sh: run apt install only once + small fixes and improvements
František Kučera <franta-hg@frantovo.cz>
parents:
322
diff
changeset
|
3 |
RELPIPE_DEPENDENCIES=(g++ make cmake mercurial pkg-config) |
e2d607e4a4f4
release-v0.18.sh: run apt install only once + small fixes and improvements
František Kučera <franta-hg@frantovo.cz>
parents:
322
diff
changeset
|
4 |
RELPIPE_DEPENDENCIES+=(libxerces-c-dev) # needed only for relpipe-in-xml module |
e2d607e4a4f4
release-v0.18.sh: run apt install only once + small fixes and improvements
František Kučera <franta-hg@frantovo.cz>
parents:
322
diff
changeset
|
5 |
RELPIPE_DEPENDENCIES+=(guile-2.2-dev) # needed only for relpipe-tr-scheme module |
e2d607e4a4f4
release-v0.18.sh: run apt install only once + small fixes and improvements
František Kučera <franta-hg@frantovo.cz>
parents:
322
diff
changeset
|
6 |
RELPIPE_DEPENDENCIES+=(gawk) # needed only for relpipe-tr-awk module |
e2d607e4a4f4
release-v0.18.sh: run apt install only once + small fixes and improvements
František Kučera <franta-hg@frantovo.cz>
parents:
322
diff
changeset
|
7 |
RELPIPE_DEPENDENCIES+=(libxml++2.6-dev) # needed only for relpipe-in-xmltable module |
e2d607e4a4f4
release-v0.18.sh: run apt install only once + small fixes and improvements
František Kučera <franta-hg@frantovo.cz>
parents:
322
diff
changeset
|
8 |
RELPIPE_DEPENDENCIES+=(unixodbc-dev) # needed only for relpipe-tr-sql module |
e2d607e4a4f4
release-v0.18.sh: run apt install only once + small fixes and improvements
František Kučera <franta-hg@frantovo.cz>
parents:
322
diff
changeset
|
9 |
RELPIPE_DEPENDENCIES+=(libsqliteodbc) # needed only for relpipe-tr-sql module if used with SQLite |
e2d607e4a4f4
release-v0.18.sh: run apt install only once + small fixes and improvements
František Kučera <franta-hg@frantovo.cz>
parents:
322
diff
changeset
|
10 |
RELPIPE_DEPENDENCIES+=(odbc-postgresql) # needed only for relpipe-tr-sql module if used with PostgreSQL |
e2d607e4a4f4
release-v0.18.sh: run apt install only once + small fixes and improvements
František Kučera <franta-hg@frantovo.cz>
parents:
322
diff
changeset
|
11 |
RELPIPE_DEPENDENCIES+=(libjack-jackd2-dev) # needed only for relpipe-in-jack and relpipe-out-jack modules; Jack1 should also work |
e2d607e4a4f4
release-v0.18.sh: run apt install only once + small fixes and improvements
František Kučera <franta-hg@frantovo.cz>
parents:
322
diff
changeset
|
12 |
RELPIPE_DEPENDENCIES+=(libxi-dev libxtst-dev) # needed only for relpipe-in-x11 and relpipe-out-x11 |
e2d607e4a4f4
release-v0.18.sh: run apt install only once + small fixes and improvements
František Kučera <franta-hg@frantovo.cz>
parents:
322
diff
changeset
|
13 |
RELPIPE_DEPENDENCIES+=(libzbar-dev libmagick++-dev) # needed only for relpipe-in-barcode and the barcode-reader streamlet |
e2d607e4a4f4
release-v0.18.sh: run apt install only once + small fixes and improvements
František Kučera <franta-hg@frantovo.cz>
parents:
322
diff
changeset
|
14 |
RELPIPE_DEPENDENCIES+=(libgumbo-dev) # needed only for relpipe-in-htmltable |
e2d607e4a4f4
release-v0.18.sh: run apt install only once + small fixes and improvements
František Kučera <franta-hg@frantovo.cz>
parents:
322
diff
changeset
|
15 |
RELPIPE_DEPENDENCIES+=(libyaml-dev) # needed only for relpipe-in-yaml, relpipe-in-yamltable, relpipe-in-json and relpipe-in-jsontable |
329 | 16 |
RELPIPE_DEPENDENCIES+=(libcbor-dev) # needed only for relpipe-in-cbortable |
323
e2d607e4a4f4
release-v0.18.sh: run apt install only once + small fixes and improvements
František Kučera <franta-hg@frantovo.cz>
parents:
322
diff
changeset
|
17 |
RELPIPE_DEPENDENCIES+=(libvmime-dev) # needed only for relpipe-in-mimetable |
e2d607e4a4f4
release-v0.18.sh: run apt install only once + small fixes and improvements
František Kučera <franta-hg@frantovo.cz>
parents:
322
diff
changeset
|
18 |
apt install "${RELPIPE_DEPENDENCIES[@]}" |
322
060d2590e77c
first version of release-v0.18.sh
František Kučera <franta-hg@frantovo.cz>
parents:
319
diff
changeset
|
19 |
exit; |
060d2590e77c
first version of release-v0.18.sh
František Kučera <franta-hg@frantovo.cz>
parents:
319
diff
changeset
|
20 |
fi |
219 | 21 |
|
22 |
# Run rest of installation as a non-root user: |
|
329 | 23 |
export RELPIPE_VERSION=${RELPIPE_VERSION:-"v0.18"} |
219 | 24 |
export RELPIPE_SRC=~/src |
25 |
export RELPIPE_BUILD=~/build |
|
26 |
export RELPIPE_INSTALL=~/install |
|
27 |
export PKG_CONFIG_PATH="$RELPIPE_INSTALL/lib/pkgconfig/:$PKG_CONFIG_PATH" |
|
28 |
export PATH="$RELPIPE_INSTALL/bin:$PATH" |
|
29 |
||
241 | 30 |
rm -rf "$RELPIPE_BUILD"/relpipe-* |
31 |
mkdir -p "$RELPIPE_SRC" "$RELPIPE_BUILD" "$RELPIPE_INSTALL" |
|
219 | 32 |
|
33 |
# Helper functions: |
|
241 | 34 |
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; } |
35 |
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 | 36 |
|
322
060d2590e77c
first version of release-v0.18.sh
František Kučera <franta-hg@frantovo.cz>
parents:
319
diff
changeset
|
37 |
RELPIPE_LIBS=(lib-common lib-reader lib-writer lib-cli lib-xmlwriter) |
323
e2d607e4a4f4
release-v0.18.sh: run apt install only once + small fixes and improvements
František Kučera <franta-hg@frantovo.cz>
parents:
322
diff
changeset
|
38 |
RELPIPE_TOOLS=(in-cli in-fstab in-xml in-xmltable in-csv in-filesystem in-recfile out-nullbyte out-ods out-tabular out-xml out-csv out-asn1 out-recfile tr-cut tr-grep tr-sed tr-validator tr-scheme tr-awk tr-sql in-jack out-jack) |
329 | 39 |
RELPIPE_TOOLS+=(in-asn1 in-asn1table in-barcode in-cbortable in-htmltable in-ini in-initable in-mimetable in-x11 in-yaml in-yamltable out-ini out-x11 out-yaml tr-infertypes tr-xpath) # since v0.18 |
323
e2d607e4a4f4
release-v0.18.sh: run apt install only once + small fixes and improvements
František Kučera <franta-hg@frantovo.cz>
parents:
322
diff
changeset
|
40 |
# RELPIPE_TOOLS+=(out-gui.qt tr-python) # not enabled by default |
322
060d2590e77c
first version of release-v0.18.sh
František Kučera <franta-hg@frantovo.cz>
parents:
319
diff
changeset
|
41 |
|
060d2590e77c
first version of release-v0.18.sh
František Kučera <franta-hg@frantovo.cz>
parents:
319
diff
changeset
|
42 |
|
219 | 43 |
# Download all sources: |
322
060d2590e77c
first version of release-v0.18.sh
František Kučera <franta-hg@frantovo.cz>
parents:
319
diff
changeset
|
44 |
relpipe_download "${RELPIPE_LIBS[@]}" "${RELPIPE_TOOLS[@]}" |
250 | 45 |
|
46 |
# 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 | 47 |
|
48 |
# Build and install libraries: |
|
322
060d2590e77c
first version of release-v0.18.sh
František Kučera <franta-hg@frantovo.cz>
parents:
319
diff
changeset
|
49 |
relpipe_install "${RELPIPE_LIBS[@]}" |
219 | 50 |
|
51 |
# Build and install tools: |
|
322
060d2590e77c
first version of release-v0.18.sh
František Kučera <franta-hg@frantovo.cz>
parents:
319
diff
changeset
|
52 |
relpipe_install "${RELPIPE_TOOLS[@]}" |
219 | 53 |
|
282
ec02133045a3
Release v0.14 – SQL, AWK, Bash completion, GPLv3
František Kučera <franta-hg@frantovo.cz>
parents:
264
diff
changeset
|
54 |
# Load Bash completion scripts: |
ec02133045a3
Release v0.14 – SQL, AWK, Bash completion, GPLv3
František Kučera <franta-hg@frantovo.cz>
parents:
264
diff
changeset
|
55 |
for c in "$RELPIPE_SRC"/relpipe-*/bash-completion.sh ; do . "$c"; done |
ec02133045a3
Release v0.14 – SQL, AWK, Bash completion, GPLv3
František Kučera <franta-hg@frantovo.cz>
parents:
264
diff
changeset
|
56 |
|
294
abbc9bcfbcc4
Release v0.15 – streamlets, parallel processing
František Kučera <franta-hg@frantovo.cz>
parents:
282
diff
changeset
|
57 |
# Enable streamlet examples: |
abbc9bcfbcc4
Release v0.15 – streamlets, parallel processing
František Kučera <franta-hg@frantovo.cz>
parents:
282
diff
changeset
|
58 |
export RELPIPE_IN_FILESYSTEM_STREAMLET_PATH="$RELPIPE_SRC"/relpipe-in-filesystem.cpp/streamlet-examples/ |
abbc9bcfbcc4
Release v0.15 – streamlets, parallel processing
František Kučera <franta-hg@frantovo.cz>
parents:
282
diff
changeset
|
59 |
|
219 | 60 |
# Clean-up: |
61 |
unset -f relpipe_install |
|
62 |
unset -f relpipe_download |
|
63 |
unset -v RELPIPE_VERSION |
|
64 |
unset -v RELPIPE_SRC |
|
65 |
unset -v RELPIPE_BUILD |
|
66 |
unset -v RELPIPE_INSTALL |
|
67 |
||
329 | 68 |
# List mice, keyboards and some fstab entries: |
69 |
(relpipe-in-fstab ; relpipe-in-x11 2>/dev/null) \ |
|
70 |
| relpipe-tr-xpath \ |
|
71 |
--relation 'fstab' --where 'pass > 1' \ |
|
72 |
--relation 'x11_input_device' --where 'type = "keyboard" or type = "mouse"' \ |
|
73 |
| relpipe-out-tabular |