author | František Kučera <franta-hg@frantovo.cz> |
Mon, 21 Feb 2022 00:43:11 +0100 | |
branch | v_0 |
changeset 329 | 5bc2bb8b7946 |
parent 221 | fb8956bb44ec |
permissions | -rw-r--r-- |
219 | 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; } |
|
221
fb8956bb44ec
install script: use variable for ~/src
František Kučera <franta-hg@frantovo.cz>
parents:
219
diff
changeset
|
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" "$RELPIPE_SRC/relpipe-$m.cpp" && make && make install || break; done; } |
219 | 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 |