5 Configure WCT source to build against Nix-provided packages.
7 You must already have sourced
9 $HOME/.nix-profile/etc/profile.d/nix.sh
13 This script should be kept in the "waftools" git submodule of WCT.
14 But, it may be run from anywhwere:
16 ./waftools/wct-configure-for-nix.sh [<path-to-install>]
18 - <path-to-install> :: optional location for installing WCT. It
19 defaults to installing into the view.
21 Note: this assumes a Nix profile exists. New packages will be added.
27 topdir=$(dirname $(dirname $(readlink -f $BASH_SOURCE)))
28 inst="${1:-$topdir/install-nix}"
29 echo "Will 'wcb install' to $inst"
31 if [ -z "$NIX_PATH" ] ; then
32 echo "Nix not yet configured."
33 nixsh="$HOME/.nix-profile/etc/profile.d/nix.sh"
34 if [ -f "$nixsh"] ; then
37 echo "... and no nix profile even."
42 view="$(dirname $(dirname $(which root-config)))"
43 if [ -z "$view" -o ! -d "$view" ] ; then
44 echo "Fail to find nix profile directory: $view"
49 echo "Assuring packages. This may take some time"
50 # To get "dev" outputs from multi-ouput packages requires some hoop jumping
51 for devpkg in fftwFloat boost zlib
53 echo "Assuring dev package: $pkg"
55 nix-env -i -E '_: with import <nixpkgs> {}; let newmeta = ( '$devpkg'.meta // { outputsToInstall = ["out" "dev"]; } ); in '$devpkg' // { meta = newmeta; }' || exit 1
58 for pkg in gcc python jsonnet jsoncpp eigen root tbb
60 echo "Assuring package: $pkg"
62 nix-env -iA nixpkgs.$pkg
69 # fixme: would like to test clang too...
71 export CXX=`which g++`
73 # needed to shut up eigen 3.2.10
74 export CXXFLAGS='-Wno-misleading-indentation -Wno-int-in-bool-context -Wvla'
78 --with-jsoncpp="$view" \
79 --with-jsonnet="$view" \
80 --with-eigen-include="$view/include/eigen3" \
84 --boost-includes="$view/include" \
85 --boost-libs="$view/lib" \