summary refs log tree commit diff
path: root/pkgs/development/libraries/qt-3/builder.sh
blob: 0af2669ba9b05d19b550a8d930636cf283f45eee (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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
. $stdenv/setup
. $substitute

ensureDir $out/nix-support
substitute "$hook" "$out/nix-support/setup-hook" --subst-var out


preConfigure=preConfigure
preConfigure() {

    # Patch some of the configure files a bit to get of global paths.
    # (Buildings using stuff in those paths will fail anyway, but it
    # will cause ./configure misdetections).
    for i in config.tests/unix/checkavail config.tests/*/*.test mkspecs/*/qmake.conf; do
        echo "patching $i..."
        substituteInPlace "$i" \
            --replace " /lib" " /FOO" \
            --replace "/usr" "/FOO"
    done
}


# !!! TODO: -system-libmng
configureFlags="-v -prefix $out -system-zlib -system-libpng -system-libjpeg"
dontAddPrefix=1

if test -n "$threadSupport"; then
    configureFlags="-thread $configureFlags";
else    
    configureFlags="-no-thread $configureFlags";
fi

if test -n "$xftSupport"; then
    configureFlags="-xft -L$libXft/lib -I$libXft/include \
      -L$freetype/lib -I$freetype/include \
      -L$fontconfig/lib -I$fontconfig/include \
      $configureFlags"
fi

if test -n "$mysqlSupport"; then
    configureFlags="-qt-sql-mysql -L$mysql/lib/mysql -I$mysql/include/mysql $configureFlags";
else    
    configureFlags="-no-thread $configureFlags";
fi

if test -n "$xrenderSupport"; then
    configureFlags="-xrender -L$libXrender/lib -I$libXrender/include $configureFlags"
fi

configureScript=configureScript
configureScript() {
    echo yes | ./configure $configureFlags
    export LD_LIBRARY_PATH=$(pwd)/lib
}


postInstall=postInstall
postInstall() {
    # Qt's `make install' is broken; it copies ./bin/qmake, which
    # is a symlink to ./qmake/qmake.  So we end up with a dangling
    # symlink.
    rm $out/bin/qmake
    cp -p qmake/qmake $out/bin
}


genericBuild