relpipe-data/examples/release-v0.16.sh
author František Kučera <franta-hg@frantovo.cz>
Mon, 21 Feb 2022 01:21:22 +0100
branchv_0
changeset 330 70e7eb578cfa
parent 324 3cbce8bb28c3
permissions -rw-r--r--
Added tag relpipe-v0.18 for changeset 5bc2bb8b7946
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
219
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     1
# Install dependencies as root:
297
192b0059a6c4 Release v0.16 – ODBC in SQL + JACK MIDI
František Kučera <franta-hg@frantovo.cz>
parents: 294
diff changeset
     2
apt install g++ make cmake mercurial pkg-config
192b0059a6c4 Release v0.16 – ODBC in SQL + JACK MIDI
František Kučera <franta-hg@frantovo.cz>
parents: 294
diff changeset
     3
apt install libxerces-c-dev       # needed only for relpipe-in-xml module
192b0059a6c4 Release v0.16 – ODBC in SQL + JACK MIDI
František Kučera <franta-hg@frantovo.cz>
parents: 294
diff changeset
     4
apt install guile-2.2-dev         # needed only for relpipe-tr-guile module
192b0059a6c4 Release v0.16 – ODBC in SQL + JACK MIDI
František Kučera <franta-hg@frantovo.cz>
parents: 294
diff changeset
     5
apt install gawk                  # needed only for relpipe-tr-awk module
192b0059a6c4 Release v0.16 – ODBC in SQL + JACK MIDI
František Kučera <franta-hg@frantovo.cz>
parents: 294
diff changeset
     6
apt install libxml++2.6-dev       # needed only for relpipe-in-xmltable module
192b0059a6c4 Release v0.16 – ODBC in SQL + JACK MIDI
František Kučera <franta-hg@frantovo.cz>
parents: 294
diff changeset
     7
apt install unixodbc-dev          # needed only for relpipe-tr-sql module
192b0059a6c4 Release v0.16 – ODBC in SQL + JACK MIDI
František Kučera <franta-hg@frantovo.cz>
parents: 294
diff changeset
     8
apt install libsqliteodbc         # needed only for relpipe-tr-sql module if used with SQLite
192b0059a6c4 Release v0.16 – ODBC in SQL + JACK MIDI
František Kučera <franta-hg@frantovo.cz>
parents: 294
diff changeset
     9
apt install odbc-postgresql       # needed only for relpipe-tr-sql module if used with PostgreSQL
192b0059a6c4 Release v0.16 – ODBC in SQL + JACK MIDI
František Kučera <franta-hg@frantovo.cz>
parents: 294
diff changeset
    10
apt install libjack-jackd2-dev    # needed only for relpipe-in-jack module
219
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    11
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    12
# Run rest of installation as a non-root user:
297
192b0059a6c4 Release v0.16 – ODBC in SQL + JACK MIDI
František Kučera <franta-hg@frantovo.cz>
parents: 294
diff changeset
    13
export RELPIPE_VERSION="v0.16"
219
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    14
export RELPIPE_SRC=~/src
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    15
export RELPIPE_BUILD=~/build
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    16
export RELPIPE_INSTALL=~/install
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    17
export PKG_CONFIG_PATH="$RELPIPE_INSTALL/lib/pkgconfig/:$PKG_CONFIG_PATH"
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    18
export PATH="$RELPIPE_INSTALL/bin:$PATH"
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    19
241
f71d300205b7 Release v0.9
František Kučera <franta-hg@frantovo.cz>
parents: 221
diff changeset
    20
rm -rf "$RELPIPE_BUILD"/relpipe-*
f71d300205b7 Release v0.9
František Kučera <franta-hg@frantovo.cz>
parents: 221
diff changeset
    21
mkdir -p "$RELPIPE_SRC" "$RELPIPE_BUILD" "$RELPIPE_INSTALL"
219
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    22
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    23
# Helper functions:
241
f71d300205b7 Release v0.9
František Kučera <franta-hg@frantovo.cz>
parents: 221
diff changeset
    24
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; }
f71d300205b7 Release v0.9
František Kučera <franta-hg@frantovo.cz>
parents: 221
diff changeset
    25
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
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    26
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    27
# Download all sources:
297
192b0059a6c4 Release v0.16 – ODBC in SQL + JACK MIDI
František Kučera <franta-hg@frantovo.cz>
parents: 294
diff changeset
    28
relpipe_download lib-common lib-reader lib-writer lib-cli lib-xmlwriter in-cli in-fstab in-xml in-xmltable 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 tr-sql in-jack
250
d16336d1c61f Release v0.10
František Kučera <franta-hg@frantovo.cz>
parents: 241
diff changeset
    29
d16336d1c61f Release v0.10
František Kučera <franta-hg@frantovo.cz>
parents: 241
diff changeset
    30
# 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
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    31
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    32
# Build and install libraries:
294
abbc9bcfbcc4 Release v0.15 – streamlets, parallel processing
František Kučera <franta-hg@frantovo.cz>
parents: 282
diff changeset
    33
relpipe_install lib-common lib-reader lib-writer lib-cli lib-xmlwriter
219
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    34
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    35
# Build and install tools:
297
192b0059a6c4 Release v0.16 – ODBC in SQL + JACK MIDI
František Kučera <franta-hg@frantovo.cz>
parents: 294
diff changeset
    36
relpipe_install in-fstab in-cli in-fstab in-xml in-xmltable in-csv in-recfile tr-cut tr-grep tr-sed tr-guile tr-awk tr-sql out-nullbyte out-ods out-tabular out-xml out-csv out-asn1 out-recfile in-filesystem in-jack
219
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    37
282
ec02133045a3 Release v0.14 – SQL, AWK, Bash completion, GPLv3
František Kučera <franta-hg@frantovo.cz>
parents: 264
diff changeset
    38
# 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
    39
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
    40
294
abbc9bcfbcc4 Release v0.15 – streamlets, parallel processing
František Kučera <franta-hg@frantovo.cz>
parents: 282
diff changeset
    41
# Enable streamlet examples:
abbc9bcfbcc4 Release v0.15 – streamlets, parallel processing
František Kučera <franta-hg@frantovo.cz>
parents: 282
diff changeset
    42
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
    43
219
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    44
# Clean-up:
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    45
unset -f relpipe_install
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    46
unset -f relpipe_download
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    47
unset -v RELPIPE_VERSION
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    48
unset -v RELPIPE_SRC
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    49
unset -v RELPIPE_BUILD
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    50
unset -v RELPIPE_INSTALL
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    51
297
192b0059a6c4 Release v0.16 – ODBC in SQL + JACK MIDI
František Kučera <franta-hg@frantovo.cz>
parents: 294
diff changeset
    52
# List configured ODBC data sources:
192b0059a6c4 Release v0.16 – ODBC in SQL + JACK MIDI
František Kučera <franta-hg@frantovo.cz>
parents: 294
diff changeset
    53
relpipe-in-sql --list-data-sources | relpipe-out-tabular
324
3cbce8bb28c3 relpipe-tr-sql and relpipe-in-sql --list-data-sources option has boolean parameter since v0.18
František Kučera <franta-hg@frantovo.cz>
parents: 297
diff changeset
    54
# n.b. since v0.18 there is a boolean parameter i.e. --list-data-sources true