Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / games / steam / build-wrapped.sh
blobddf974671a03825c3bc391b62ea45e8c73beff16
1 source $stdenv/setup
3 outp=$out/lib/steam-runtime
5 buildDir() {
6 paths="$1"
7 pkgs="$2"
9 for pkg in $pkgs; do
10 echo "adding package $pkg"
11 for path in $paths; do
12 if [ -d $pkg/$path ]; then
13 cd $pkg/$path
14 for file in *; do
15 found=""
16 for i in $paths; do
17 if [ -e "$outp/$i/$file" ]; then
18 found=1
19 break
21 done
22 if [ -z "$found" ]; then
23 mkdir -p $outp/$path
24 ln -s "$pkg/$path/$file" $outp/$path
25 sovers=$(echo $file | perl -ne 'print if s/.*?\.so\.(.*)/\1/')
26 if [ ! -z "$sovers" ]; then
27 fname=''${file%.''${sovers}}
28 for ver in ''${sovers//./ }; do
29 found=""
30 for i in $paths; do
31 if [ -e "$outp/$i/$fname" ]; then
32 found=1
33 break
35 done
36 [ -n "$found" ] || ln -s "$pkg/$path/$file" "$outp/$path/$fname"
37 fname="$fname.$ver"
38 done
41 done
43 done
44 done
47 eval "$installPhase"