|
1 # Install dependencies as root: |
|
2 su -c "apt install g++ make cmake mercurial pkg-config" |
|
3 |
|
4 # Run rest of installation as a non-root user: |
|
5 export RELPIPE_VERSION="v0.8" |
|
6 export RELPIPE_SRC=~/src |
|
7 export RELPIPE_BUILD=~/build |
|
8 export RELPIPE_INSTALL=~/install |
|
9 export PKG_CONFIG_PATH="$RELPIPE_INSTALL/lib/pkgconfig/:$PKG_CONFIG_PATH" |
|
10 export PATH="$RELPIPE_INSTALL/bin:$PATH" |
|
11 |
|
12 mkdir "$RELPIPE_SRC" "$RELPIPE_BUILD" "$RELPIPE_INSTALL" |
|
13 |
|
14 # Helper functions: |
|
15 relpipe_download() { for m in "$@"; do cd "$RELPIPE_SRC" && hg clone -u "$RELPIPE_VERSION" https://hg.globalcode.info/relpipe/relpipe-$m.cpp || break; done; } |
|
16 relpipe_install() { for m in "$@"; do cd "$RELPIPE_BUILD" && mkdir relpipe-$m.cpp && cd relpipe-$m.cpp && cmake -DCMAKE_INSTALL_PREFIX:PATH="$RELPIPE_INSTALL" ../../src/relpipe-$m.cpp && make && make install || break; done; } |
|
17 |
|
18 # Download all sources: |
|
19 relpipe_download lib-protocol lib-reader lib-writer lib-cli in-cli in-fstab out-gui.qt out-nullbyte out-ods out-tabular out-xml tr-cut tr-grep tr-python tr-sed tr-validator |
|
20 |
|
21 # Build and install libraries: |
|
22 relpipe_install lib-protocol lib-reader lib-writer lib-cli |
|
23 |
|
24 # Build and install tools: |
|
25 relpipe_install in-fstab in-cli tr-cut tr-grep tr-sed out-nullbyte out-ods out-tabular out-xml |
|
26 |
|
27 # Clean-up: |
|
28 unset -f relpipe_install |
|
29 unset -f relpipe_download |
|
30 unset -v RELPIPE_VERSION |
|
31 unset -v RELPIPE_SRC |
|
32 unset -v RELPIPE_BUILD |
|
33 unset -v RELPIPE_INSTALL |
|
34 |
|
35 # View your fstab like on an 80s green screen terminal! |
|
36 relpipe-in-fstab | relpipe-out-tabular |