unset PATH for p in $baseInputs $buildInputs; do export PATH=$p/bin${PATH:+:}$PATH done function unpackPhase() { tar -xzf $src for d in *; do if [ -d "$d" ]; then cd "$d" break fi done } function configurePhase() { ./configure --prefix=$out } function buildPhase() { make } function installPhase() { make install } function fixupPhase() { find $out -type f -exec patchelf --shrink-rpath '{}' \; -exec strip '{}' \; 2>/dev/null } function genericBuild() { unpackPhase configurePhase buildPhase installPhase fixupPhase }