1# This setup hook, for each output, moves everything in $output/lib64
2# to $output/lib, and replaces $output/lib64 with a symlink to
3# $output/lib. The rationale is that lib64 directories are unnecessary
4# in Nix (since 32-bit and 64-bit builds of a package are in different
5# store paths anyway).
6# If the move would overwrite anything, it should fail on rmdir.
7
8fixupOutputHooks+=(_moveLib64)
9
10_moveLib64() {
11 if [ "${dontMoveLib64-}" = 1 ]; then return; fi
12 if [ ! -e "$prefix/lib64" -o -L "$prefix/lib64" ]; then return; fi
13 echo "moving $prefix/lib64/* to $prefix/lib"
14 mkdir -p $prefix/lib
15 shopt -s dotglob
16 for i in $prefix/lib64/*; do
17 mv --no-clobber "$i" $prefix/lib
18 done
19 shopt -u dotglob
20 rmdir $prefix/lib64
21 ln -s lib $prefix/lib64
22}