relpipe-data/examples/release-v0.10.sh
branchv_0
changeset 250 d16336d1c61f
parent 241 f71d300205b7
equal deleted inserted replaced
249:ce8a4be95632 250:d16336d1c61f
       
     1 # Install dependencies as root:
       
     2 su -c "apt install g++ make cmake mercurial pkg-config"
       
     3 su -c "apt install libxerces-c-dev" # needed only for relpipe-in-xml module
       
     4 su -c "apt install guile-2.2-dev"   # needed only for relpipe-tr-guile module; guile-2.0-dev also works but requires a patch (see below)
       
     5 
       
     6 # Run rest of installation as a non-root user:
       
     7 export RELPIPE_VERSION="v0.10"
       
     8 export RELPIPE_SRC=~/src
       
     9 export RELPIPE_BUILD=~/build
       
    10 export RELPIPE_INSTALL=~/install
       
    11 export PKG_CONFIG_PATH="$RELPIPE_INSTALL/lib/pkgconfig/:$PKG_CONFIG_PATH"
       
    12 export PATH="$RELPIPE_INSTALL/bin:$PATH"
       
    13 
       
    14 rm -rf "$RELPIPE_BUILD"/relpipe-*
       
    15 mkdir -p "$RELPIPE_SRC" "$RELPIPE_BUILD" "$RELPIPE_INSTALL"
       
    16 
       
    17 # Helper functions:
       
    18 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; }
       
    19 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; }
       
    20 
       
    21 # Download all sources:
       
    22 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 tr-guile
       
    23 
       
    24 # 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.
       
    25 
       
    26 # Build and install libraries:
       
    27 relpipe_install lib-protocol lib-reader lib-writer lib-cli lib-xmlwriter
       
    28 
       
    29 # Build and install tools:
       
    30 relpipe_install in-fstab in-cli in-fstab in-xml in-csv tr-cut tr-grep tr-sed tr-guile out-nullbyte out-ods out-tabular out-xml out-csv
       
    31 
       
    32 # relpipe_install in-filesystem # requires GCC 8 or patching (see below)
       
    33 
       
    34 # Clean-up:
       
    35 unset -f relpipe_install
       
    36 unset -f relpipe_download
       
    37 unset -v RELPIPE_VERSION
       
    38 unset -v RELPIPE_SRC
       
    39 unset -v RELPIPE_BUILD
       
    40 unset -v RELPIPE_INSTALL
       
    41 
       
    42 # Filter your your fstab using Guile Scheme and view it like on an 80s green screen terminal!
       
    43 relpipe-in-fstab | relpipe-tr-guile --relation 'fstab' --where '(or (= $pass 1) (string= $type "swap") )' | relpipe-out-tabular