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
|
219
|
4 |
|
|
5 |
# Run rest of installation as a non-root user:
|
241
|
6 |
export RELPIPE_VERSION="v0.9"
|
219
|
7 |
export RELPIPE_SRC=~/src
|
|
8 |
export RELPIPE_BUILD=~/build
|
|
9 |
export RELPIPE_INSTALL=~/install
|
|
10 |
export PKG_CONFIG_PATH="$RELPIPE_INSTALL/lib/pkgconfig/:$PKG_CONFIG_PATH"
|
|
11 |
export PATH="$RELPIPE_INSTALL/bin:$PATH"
|
|
12 |
|
241
|
13 |
rm -rf "$RELPIPE_BUILD"/relpipe-*
|
|
14 |
mkdir -p "$RELPIPE_SRC" "$RELPIPE_BUILD" "$RELPIPE_INSTALL"
|
219
|
15 |
|
|
16 |
# Helper functions:
|
241
|
17 |
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; }
|
|
18 |
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
|
19 |
|
|
20 |
# Download all sources:
|
241
|
21 |
relpipe_download lib-protocol lib-reader lib-writer lib-cli lib-xmlwriter in-cli in-fstab in-xml in-csv in-filesystem out-gui.qt out-nullbyte out-ods out-tabular out-xml out-csv tr-cut tr-grep tr-python tr-sed tr-validator
|
219
|
22 |
|
|
23 |
# Build and install libraries:
|
241
|
24 |
relpipe_install lib-protocol lib-reader lib-writer lib-cli lib-xmlwriter
|
219
|
25 |
|
|
26 |
# Build and install tools:
|
241
|
27 |
relpipe_install in-fstab in-cli in-fstab in-xml in-csv tr-cut tr-grep tr-sed out-nullbyte out-ods out-tabular out-xml out-csv
|
|
28 |
|
|
29 |
# relpipe_install in-filesystem # requires GCC 8 or patching (see below)
|
219
|
30 |
|
|
31 |
# Clean-up:
|
|
32 |
unset -f relpipe_install
|
|
33 |
unset -f relpipe_download
|
|
34 |
unset -v RELPIPE_VERSION
|
|
35 |
unset -v RELPIPE_SRC
|
|
36 |
unset -v RELPIPE_BUILD
|
|
37 |
unset -v RELPIPE_INSTALL
|
|
38 |
|
|
39 |
# View your fstab like on an 80s green screen terminal!
|
|
40 |
relpipe-in-fstab | relpipe-out-tabular
|