Blame docker-builder-data/build/script/packet/qt-5.9.2.sh

b765f7
DEPS="png-1.6.26 glib-2.50.0"
b765f7
b765f7
PK_DIRNAME="qt-everywhere-opensource-src-5.9.2"
b765f7
PK_ARCHIVE="$PK_DIRNAME.tar.xz"
b765f7
PK_URL="http://download.qt.io/official_releases/qt/5.9/5.9.2/single/$PK_ARCHIVE"
b765f7
PK_LICENSE_FILES="LICENSE.LGPLv21"
b765f7
b765f7
source $INCLUDE_SCRIPT_DIR/inc-pkall-default.sh
b765f7
b765f7
if [ "$PLATFORM" = "linux" ]; then
b765f7
    DEPS="$DEPS xcbfull-1.12"
b765f7
fi
b765f7
b765f7
b765f7
pkbuild() {
b765f7
    cd "$BUILD_PACKET_DIR/$PK_DIRNAME"
64ee37
b765f7
    if ! check_packet_function $NAME build.configure; then
b765f7
        local LOCAL_OPTIONS=
b765f7
        if [ "$PLATFORM" = "win" ]; then
31c087
            rm -f "qtbase/mkspecs/win32-g++/qmake.conf" || return 1
64ee37
            patch "$UNPACK_PACKET_DIR/$PK_DIRNAME/qtbase/mkspecs/win32-g++/qmake.conf" \
64ee37
             -i "$FILES_PACKET_DIR/qmake.conf.patch" -o - \
64ee37
             > "qtbase/mkspecs/win32-g++/qmake.conf"
64ee37
31c087
            rm -f "qtactiveqt/src/tools/idc/idc.pro" || return 1
64ee37
            patch "$UNPACK_PACKET_DIR/$PK_DIRNAME/qtactiveqt/src/tools/idc/idc.pro" \
64ee37
             -i "$FILES_PACKET_DIR/idc.pro.patch" -o - \
64ee37
             > "qtactiveqt/src/tools/idc/idc.pro"
64ee37
31c087
            rm -f "qtbase/src/plugins/platforms/direct2d/direct2d.pro" || return 1
64ee37
            patch "$UNPACK_PACKET_DIR/$PK_DIRNAME/qtbase/src/plugins/platforms/direct2d/direct2d.pro" \
64ee37
             -i "$FILES_PACKET_DIR/direct2d.pro.patch" -o - \
64ee37
             > "qtbase/src/plugins/platforms/direct2d/direct2d.pro"
b765f7
31c087
            #rm -f "qtlocation/src/3rdparty/mapbox-gl-native/src/mbgl/gl/gl.hpp" || return 1
31c087
            #patch "$UNPACK_PACKET_DIR/$PK_DIRNAME/qtlocation/src/3rdparty/mapbox-gl-native/src/mbgl/gl/gl.hpp" \
31c087
            # -i "$FILES_PACKET_DIR/gl.hpp.patch" -o - \
31c087
            # > "qtlocation/src/3rdparty/mapbox-gl-native/src/mbgl/gl/gl.hpp"
b765f7
31c087
            LOCAL_OPTIONS=" \
31c087
                -xplatform win32-g++ \
31c087
                -device-option CROSS_COMPILE=$HOST- \
31c087
                -opengl desktop \
31c087
                -no-feature-geoservices_mapboxgl "
b765f7
        fi
b765f7
31c087
        rm -f "qtserialbus/src/plugins/canbus/socketcan/socketcanbackend.cpp" || return 1
b765f7
        patch "$UNPACK_PACKET_DIR/$PK_DIRNAME/qtserialbus/src/plugins/canbus/socketcan/socketcanbackend.cpp" \
b765f7
         -i "$FILES_PACKET_DIR/socketcanbackend.cpp.patch" -o - \
b765f7
         > "qtserialbus/src/plugins/canbus/socketcan/socketcanbackend.cpp"
b765f7
31c087
        native_at_place with_envvar PATH "$PATH" \
b765f7
           ./configure \
b765f7
           -prefix "$INSTALL_PACKET_DIR" \
b765f7
           $LOCAL_OPTIONS \
b765f7
           -release \
64ee37
           -shared \
b765f7
           -opensource -confirm-license \
b765f7
           -nomake examples \
b765f7
         || return 1
b765f7
b765f7
        set_done $NAME build.configure
b765f7
    fi
64ee37
31c087
    native_at_place with_envvar PATH "$PATH" make -j${THREADS} || \
31c087
    native_at_place with_envvar PATH "$PATH" make || return 1
b765f7
}
b765f7
b765f7
pkinstall() {
b765f7
    cd "$BUILD_PACKET_DIR/$PK_DIRNAME"
31c087
    native_at_place with_envvar PATH "$PATH" make install || return 1
b765f7
    
b765f7
cat << EOF > "$INSTALL_PACKET_DIR/bin/qt.conf"
b765f7
[Paths]
b765f7
Prefix=..
b765f7
EOF
b765f7
b765f7
    if [ ! $? -eq 0 ]; then
b765f7
        return 1
b765f7
    fi
b765f7
}
b765f7
b765f7
pkhook_postinstall_release() {
b765f7
    cd "$INSTALL_RELEASE_PACKET_DIR" || return 1
b765f7
    rm -rf "examples" || return 1
b765f7
    rm -rf "mkspecs" || return 1
b765f7
    rm -rf "doc" || return 1
b765f7
}