From eed46887ca8b4b4f0fe473e32e042c0ee3a6eee5 Mon Sep 17 00:00:00 2001 From: Alexandria Corkwell Date: Wed, 8 Jul 2020 06:35:13 -0400 Subject: [PATCH] gcc: fix manpage symlinks when arch tuple is in the file name In some cases, such as when building cross compilers, the binaries and manpages contain the target architecture tuple, such as `i686-w64-mingw32-g++.1`. Ensure the symlink created to save space with the duplicated manpage (`g++.1 -> gcc.1`) properly handles such cases and generates symlinks such as `i686-w64-mingw32-g++.1 -> i686-w64-mingw32-gcc.1`. Previously in such cases, a broken `gcc.1` link would be created instead. --- pkgs/development/compilers/gcc/builder.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkgs/development/compilers/gcc/builder.sh b/pkgs/development/compilers/gcc/builder.sh index 4b14cdb94cdd..678cbf02995d 100644 --- a/pkgs/development/compilers/gcc/builder.sh +++ b/pkgs/development/compilers/gcc/builder.sh @@ -277,7 +277,12 @@ postInstall() { done # Two identical man pages are shipped (moving and compressing is done later) - ln -sf gcc.1 "$out"/share/man/man1/g++.1 + for i in "$out"/share/man/man1/*g++.1; do + if test -e "$i"; then + man_prefix=`echo "$i" | sed "s,.*/\(.*\)g++.1,\1,"` + ln -sf "$man_prefix"gcc.1 "$i" + fi + done } genericBuild