@@ -301,6 +301,13 @@ try_cd() {
301
301
cd "$1 "||exit 1
302
302
}
303
303
304
+ get_lib_dst_dir_pth() {
305
+ local dst_dir_pth="$1 " lib_dir="$2 " lib_src_dirname_pth="$3 "
306
+ echo "${dst_dir_pth} / ${lib_dir} $(sed - E \
307
+ "s|$dst_dir ||;s|/shared||;s|^/usr||;s|^/opt||;s|^/lib(64 \|32 )?||;s|^/[^/]*-linux-gnu||"\
308
+ <<<"$lib_src_dirname_pth ")"
309
+ }
310
+
304
311
get_relative_path() {
305
312
local start_dir="$1 "
306
313
local target_dir="$2 "
@@ -843,8 +850,7 @@ if [[ ! -d "$WRAPPE_DIR" || "$WITH_PYTHON" == 1 ]]
843
850
lib_src_name=" $( basename " $lib_src_pth " ) "
844
851
grep -qE ' /lib32|/i386-linux-gnu|/arm-linux-gnu' <<< " $lib_src_dirname_pth" && \
845
852
lib_dir=" lib32" || lib_dir=" lib"
846
- lib_dst_dir_pth=" ${dst_dir_pth} /${lib_dir} $( sed \
847
- " s|$dst_dir ||;s|/shared||;s|^/usr||;s|^/opt||;s|^/lib64||;s|^/lib32||;s|^/lib||;s|^/.*-linux-gnu||" <<< " $lib_src_dirname_pth" ) "
853
+ lib_dst_dir_pth=" $( get_lib_dst_dir_pth " $dst_dir_pth " " $lib_dir " " $lib_src_dirname_pth " ) "
848
854
[ -n " $lib_src_real_name " ] && \
849
855
lib_dst_pth=" $lib_dst_dir_pth /$lib_src_real_name " || \
850
856
lib_dst_pth=" $lib_dst_dir_pth /$lib_src_name "
@@ -866,8 +872,19 @@ if [[ ! -d "$WRAPPE_DIR" || "$WITH_PYTHON" == 1 ]]
866
872
try_cp_exe " $lib_src_pth " " $lib_dst_pth "
867
873
if [[ -n " $lib_src_real_name " && " $lib_src_name " != " $lib_src_real_name " ]]
868
874
then
869
- (try_cd " $lib_dst_dir_pth "
870
- try_ln " $lib_src_real_name " " $lib_src_name " )|| exit 1
875
+ lib_src_rel_pth=" $( readlink " $lib_src_pth " ) "
876
+ (if [[ " $( dirname " $lib_src_rel_pth " ) " =~ ^\. ]]
877
+ then
878
+ lib_dst_dir_rel_pth=" $( get_lib_dst_dir_pth " $dst_dir_pth " " $lib_dir " \
879
+ " $( readlink -f " $( dirname " $lib_src_pth " ) " ) " ) "
880
+ try_mkdir " $lib_dst_dir_rel_pth "
881
+ try_cd " $lib_dst_dir_rel_pth "
882
+ try_ln " $lib_src_rel_pth " " $lib_src_name "
883
+ else
884
+ try_cd " $lib_dst_dir_pth "
885
+ try_ln " $lib_src_real_name " " $lib_src_name "
886
+ fi)|| exit 1
887
+
871
888
fi
872
889
if [[ " ${LIBRARIES["$lib_dst_pth"]} " != 1 ]]
873
890
then
0 commit comments