relpipe-data/examples/release-v0.18.sh
branchv_0
changeset 322 060d2590e77c
parent 319 2a5f26e69a76
child 323 e2d607e4a4f4
equal deleted inserted replaced
321:e32e2e308de4 322:060d2590e77c
       
     1 # Install dependencies as root:
       
     2 if [[ "$USER" == "root" ]]; then
       
     3 	apt install g++ make cmake mercurial pkg-config
       
     4 	apt install libxerces-c-dev                                                 # needed only for relpipe-in-xml module
       
     5 	apt install guile-2.2-dev                                                   # needed only for relpipe-tr-scheme module
       
     6 	apt install gawk                                                            # needed only for relpipe-tr-awk module
       
     7 	apt install libxml++2.6-dev                                                 # needed only for relpipe-in-xmltable module
       
     8 	apt install unixodbc-dev                                                    # needed only for relpipe-tr-sql module
       
     9 	apt install libsqliteodbc                                                   # needed only for relpipe-tr-sql module if used with SQLite
       
    10 	apt install odbc-postgresql                                                 # needed only for relpipe-tr-sql module if used with PostgreSQL
       
    11 	apt install libjack-jackd2-dev                                              # needed only for relpipe-in-jack and relpipe-out-jack modules; Jack1 should also work
       
    12 	apt install libxi-dev libxtst-dev                                           # needed only for relpipe-in-x11 and relpipe-out-x11
       
    13 	apt install libzbar-dev libmagick++-dev                                     # needed only for relpipe-in-barcode and the barcode-reader streamlet
       
    14 	apt install libgumbo-dev                                                    # needed only for relpipe-in-htmltable
       
    15 	apt install libyaml-dev                                                     # needed only for relpipe-in-yaml, relpipe-in-yamltable, relpipe-in-json and relpipe-in-jsontable
       
    16 	exit;
       
    17 fi
       
    18 
       
    19 # Run rest of installation as a non-root user:
       
    20 export RELPIPE_VERSION="v0.18"
       
    21 export RELPIPE_VERSION="tip" # FIXME: v0.18
       
    22 export RELPIPE_SRC=~/src
       
    23 export RELPIPE_BUILD=~/build
       
    24 export RELPIPE_INSTALL=~/install
       
    25 export PKG_CONFIG_PATH="$RELPIPE_INSTALL/lib/pkgconfig/:$PKG_CONFIG_PATH"
       
    26 export PATH="$RELPIPE_INSTALL/bin:$PATH"
       
    27 
       
    28 rm -rf "$RELPIPE_BUILD"/relpipe-*
       
    29 mkdir -p "$RELPIPE_SRC" "$RELPIPE_BUILD" "$RELPIPE_INSTALL"
       
    30 
       
    31 # Helper functions:
       
    32 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; }
       
    33 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; }
       
    34 
       
    35 RELPIPE_LIBS=(lib-common lib-reader lib-writer lib-cli lib-xmlwriter)
       
    36 RELPIPE_TOOLS=(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-scheme tr-awk tr-sql in-jack out-jack)
       
    37 RELPIPE_TOOLS+=(in-asn1table in-barcode in-htmltable in-ini in-initable in-json in-jsontable in-mimetable in-x11 in-yaml in-yamltable out-ini out-x11 out-xml out-yaml tr-xpath) # since v0.18
       
    38 
       
    39 
       
    40 # Download all sources:
       
    41 relpipe_download "${RELPIPE_LIBS[@]}" "${RELPIPE_TOOLS[@]}"
       
    42 
       
    43 # 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.
       
    44 
       
    45 # Build and install libraries:
       
    46 relpipe_install "${RELPIPE_LIBS[@]}"
       
    47 
       
    48 # Build and install tools:
       
    49 relpipe_install "${RELPIPE_TOOLS[@]}"
       
    50 
       
    51 # Load Bash completion scripts:
       
    52 for c in "$RELPIPE_SRC"/relpipe-*/bash-completion.sh ; do . "$c"; done
       
    53 
       
    54 # Enable streamlet examples:
       
    55 export RELPIPE_IN_FILESYSTEM_STREAMLET_PATH="$RELPIPE_SRC"/relpipe-in-filesystem.cpp/streamlet-examples/
       
    56 
       
    57 # Clean-up:
       
    58 unset -f relpipe_install
       
    59 unset -f relpipe_download
       
    60 unset -v RELPIPE_VERSION
       
    61 unset -v RELPIPE_SRC
       
    62 unset -v RELPIPE_BUILD
       
    63 unset -v RELPIPE_INSTALL
       
    64 
       
    65 # List available JACK ports (the JACK daemon should be running):
       
    66 relpipe-in-jack --list-ports true --list-midi-messages false | relpipe-out-tabular