about summary refs log tree commit diff
path: root/pkgs/development/libraries/qt-5/qt-env.nix
blob: 11c6ac74d5f63394ee5cf8eb1d027ee358a3f739 (plain) (blame)
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
{ runCommand, lndir, qtbase }: name: paths:

runCommand name { inherit paths qtbase; } ''

mkdir -p "$out/bin" "$out/mkspecs" "$out/include" "$out/lib" "$out/share"

cp "$qtbase/bin/qmake" "$out/bin"
cat >"$out/bin/qt.conf" <<EOF
[Paths]
Prefix = $out
Plugins = lib/qt5/plugins
Imports = lib/qt5/imports
Qml2Imports = lib/qt5/qml
Documentation = share/doc/qt5
EOF

for pkg in $paths $qtbase; do
    if [[ -d "$pkg/mkspecs" ]]; then
        ${lndir}/bin/lndir -silent "$pkg/mkspecs" "$out/mkspecs"

        for dir in bin include lib share; do
            if [[ -d "$pkg/$dir" ]]; then
                ${lndir}/bin/lndir -silent "$pkg/$dir" "$out/$dir"
            fi
        done
    fi
done
''