-
-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automatically move stuff in lib64 to lib
- Loading branch information
Showing
3 changed files
with
23 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# This setup hook, for each output, moves everything in $output/lib64 | ||
# to $output/lib, and replaces $output/lib64 with a symlink to | ||
# $output/lib. The rationale is that lib64 directories are unnecessary | ||
# in Nix (since 32-bit and 64-bit builds of a package are in different | ||
# store paths anyway). | ||
|
||
fixupOutputHooks+=(_moveLib64) | ||
|
||
_moveLib64() { | ||
if [ "$dontMoveLib64" = 1 ]; then return; fi | ||
if [ ! -e "$prefix/lib64" -o -L "$prefix/lib64" ]; then return; fi | ||
echo "moving $prefix/lib64/* to $prefix/lib" | ||
mkdir -p $prefix/lib | ||
shopt -s dotglob | ||
for i in $prefix/lib64/*; do | ||
mv "$i" $prefix/lib | ||
done | ||
shopt -u dotglob | ||
rmdir $prefix/lib64 | ||
ln -s lib $prefix/lib64 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51f1b4e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This destroys
gcc_multi
, as it uses the same library names in two different dirs, and this hook silently overwrites one set by the other one. I fixedgcc_multi
in 4578503, but maybe we should consider this hook not overwriting libs, e.g. usemv -t $prefix/lib $prefix/lib64/* --no-clobber
, which would skip moving files that would cause overrides and make the followingrmdir
fail.51f1b4e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 for adding
--no-clobber
.51f1b4e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have that queued to push after merging staging to master.