aboutsummaryrefslogtreecommitdiff
path: root/debian/post-build-nx.sh
blob: 9a6143cb2eaf2ac81e95f35644b70bde6a8dd4d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash

set -ex

# create nx-X11/.build-exports
mkdir -p nx-X11/.build-exports/include
mkdir -p nx-X11/.build-exports/lib

# copy headers (libnx-x11-dev)
cp -aL nx-X11/exports/include/* nx-X11/.build-exports/include

# copy libs (libnx-x11)
find nx-X11/exports/lib/ | egrep "^.*\.so$" | while read libpath; do
    libfile=$(basename $libpath)
    libdir=$(dirname $libpath)

    mkdir -p ${libdir//exports/.build-exports}
    cp -L $libpath ${libdir//exports/.build-exports}

    find $libdir/$libfile.* | while read symlink; do
        ln -s $libfile ${libdir//exports/.build-exports}/$(basename $symlink)
    done

    # do not install libXinerama into default path...
    rm -f ${libdir//exports/.build-exports}/lib/libXinerama*

done

exit 0