summaryrefslogtreecommitdiffstats
path: root/Jenkinsfile
blob: 08d484c26af7d92491d046bd55eabaccebf11615 (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
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
import jenkins.model.*
import hudson.model.Result

def REPO = 'ssh://gerrit1.techsat.net:29418/external/Qt'

properties([
    parameters([
        gitParameter(branch: '',
                     branchFilter: 'origin/(.*)',
                     defaultValue: 'master',
                     description: '',
                     name: 'BRANCH',
                     quickFilterEnabled: false,
                     selectedValue: 'NONE',
                     sortMode: 'NONE',
                     tagFilter: '*',
                     type: 'PT_BRANCH_TAG')
    ])
])

stage('Build') {
    parallel linux: {
        node('bslp02-centos6-64') {
	deleteDir()
	checkout([$class: 'GitSCM', 
		branches: [[name: BRANCH]], 
		doGenerateSubmoduleConfigurations: false, 
		extensions: [], 
		submoduleCfg: [], 
		userRemoteConfigs: [[url: REPO]]])

	stage("Qt Build") {
	    sh '''#!/bin/bash
	    export PATH=$GCC_PATH/bin:$PATH
	    make GCC_PATH=/master/DEV-Tools/gcc-suite/1.6.0/x86-linux64/gcc -f Makefile all
	    '''
	}
	stage("Qt-Creator Build") {
	    sh '''#!/bin/bash
	    export PATH=/master/DEV-Tools/gcc-suite/1.6.0/x86-linux64/gcc/bin:$PATH
	    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$WORKSPACE/install.x86-linux64/qt-5.14.2-shared/lib
	    make ARCH=x86-linux64 GCC_PATH=/master/DEV-Tools/gcc-suite/1.6.0/x86-linux64/gcc/bin QTDIR=$WORKSPACE/install.x86-linux64/qt-5.14.2-shared -f Makefile.qtcreator all
	    '''
	}
        }
    },
    windows: {
        node('bslp05-win10-64') {
        	    deleteDir()
        	    checkout([$class: 'GitSCM', 
        		    branches: [[name: BRANCH]], 
        		    doGenerateSubmoduleConfigurations: false, 
        		    extensions: [], 
        		    submoduleCfg: [], 
        		    userRemoteConfigs: [[url: REPO]]])

                    stage ("MinGW Qt Build") {
                        sh '''#!/bin/bash
                            set -x
                            echo "Cleanup prev. builds ..."
                            WS=$(cygpath $WORKSPACE)
                            cp -Rvf /c/dev-tools/gcc-suite/1.6.0/x86-mingw64/gcc $WS/
                            cp $WS/gcc/bin/make.exe $WS/gcc/bin/mingw32-make.exe
                            export PATH=$WS/gcc/bin:/c/dev-tools/msys/x86/usr/bin:$PATH
                            export PATH=/c/dev-tools/Python/2.7/x86-windows:$PATH
                            export CC=$WS/gcc/bin/gcc 
                            export CXX=$WS/gcc/bin/g++ 
                            gcc -v
			    mkdir -p /c/tmp
                            make -f Makefile.mingw64 RESERVE_INSTDIR=1 all
                       '''
                    }
                    stage ("MinGW Qt-Creator Build") {
                        sh '''#!/bin/bash
                            set -x
                            echo "Cleanup prev. builds ..."
                            WS=$(cygpath $WORKSPACE)
                            cp -Rvf /c/dev-tools/gcc-suite/1.6.0/x86-mingw64/gcc $WS/
                            cp $WS/gcc/bin/make.exe $WS/gcc/bin/mingw32-make.exe
                            export PATH=$WS/gcc/bin:/c/dev-tools/msys/x86/usr/bin:$PATH
                            export PATH=/c/dev-tools/Python/2.7/x86-windows:$PATH
                            export CC=$WS/gcc/bin/gcc 
                            export CXX=$WS/gcc/bin/g++ 
                            gcc -v
                            make -f Makefile.qtcreator ARCH=x86-mingw64 GCC_PATH=$WS/gcc QTDIR=/c/tmp/qt clean all
                       '''
                    }
                    stage ("Cleanup") {
                        sh '''#!/bin/bash
                            set -x
                            rm -Rf /c/tmp/qt
                       '''
                    }

		    stage ("Windows 64 Bit MSVC Build") {
			sh '''#!/bin/bash
			    set -x
			    rm -f openssl-1.0.2r/NUL
			    rm -Rf openssl-1.0.2r
			'''
			bat '''@echo off
			    set SDKDIR=C:\\VS2019BT\\
			    set NASMDIR=C:\\nasm\\2.12.01_64\\
			    set MSYSDIR=C:\\msys\\x86\\
			    set PERLDIR=C:\\perl\\x86_64-msvc\\
			    set PATH=%PATH%;C:\\dev-tools\\Python\\2.7\\x86-windows\\
			    buildqt64.bat
			'''
		    }
                    stage ("Cleanup") {
                        sh '''#!/bin/bash
                            set -x
                            #rm -Rf /c/tmp/qt
			    #rm -Rf $(cygpath $WORKSPACE)/openssl-1.0.2r
                       '''
                    }
		    stash name: "qtwin", includes: "qt-*-msvc.zip,*qt-*-x86-mingw64.tgz,qtcreator-*-x86-mingw64.zip"
        }
    }
}
stage ("Post processing") {
    node('bslp02-centos6-64') {
	unstash name: 'qtwin'
	sh '''
	    QT_VER=5.14.2
	    # 
	    # cleanup temporary destination folder for final distribution ...
	    # unpack Linux archives ...

	    mkdir -p $WORKSPACE/INST/$QT_VER/x86-linux64-shared
	    tar -xzf $WORKSPACE/qt-$QT_VER-shared-x86-linux64.tgz -C $WORKSPACE/INST/$QT_VER/x86-linux64-shared
	    rm -f $WORKSPACE/qt-$QT_VER-shared-x86-linux64.tgz
	    cp -f $WORKSPACE/qt.conf $WORKSPACE/INST/$QT_VER/x86-linux64-shared/bin

	    mkdir -p $WORKSPACE/INST/$QT_VER/x86-linux64-static
	    tar -xzf $WORKSPACE/qt-$QT_VER-static-x86-linux64.tgz -C $WORKSPACE/INST/$QT_VER/x86-linux64-static
	    rm -f $WORKSPACE/qt-$QT_VER-static-x86-linux64.tgz
	    cp -f $WORKSPACE/qt.conf $WORKSPACE/INST/$QT_VER/x86-linux64-static/bin

	    mkdir -p $WORKSPACE/INST/$QT_VER/x86-mingw64
	    tar -xzf $WORKSPACE/qt-$QT_VER-x86-mingw64.tgz -C $WORKSPACE/INST/$QT_VER/x86-mingw64
	    rm -f $WORKSPACE/qt-$QT_VER-x86-mingw64.tgz
	    cp -f $WORKSPACE/qt.conf $WORKSPACE/INST/$QT_VER/x86-mingw64/bin
	    mkdir -p $WORKSPACE/INST/$QT_VER/x86-mingw64/xbin
	    cp -f $WORKSPACE/INST/$QT_VER/x86-linux64-static/bin/* $WORKSPACE/INST/$QT_VER/x86-mingw64/xbin
	    rm -f $WORKSPACE/INST/$QT_VER/x86-mingw64/xbin/linguist
	    rm -f $WORKSPACE/INST/$QT_VER/x86-mingw64/xbin/designer
	    rm -f $WORKSPACE/INST/$QT_VER/x86-mingw64/xbin/assistant

	    mkdir -p $WORKSPACE/INST/$QT_VER/x86_64-msvc
	    unzip -qo $WORKSPACE/qt-$QT_VER-x86_64-msvc.zip -d $WORKSPACE/INST/$QT_VER/x86_64-msvc
	    rm -f $WORKSPACE/qt-$QT_VER-x86_64-msvc.zip
	    cp -f $WORKSPACE/qt.conf $WORKSPACE/INST/$QT_VER/x86_64-msvc/bin

	    # 
	    # finally recreate packages ...
	    cd $WORKSPACE/INST/$QT_VER/x86-mingw64
	    zip -qr $WORKSPACE/qt-$QT_VER-$(BUILD_NUMBER)-x86-mingw64.zip .

	    cd $WORKSPACE/INST/$QT_VER/x86-linux64-shared
	    tar -zcf $WORKSPACE/qt-$QT_VER-$(BUILD_NUMBER)-x86-linux64-shared.tgz .

	    cd $WORKSPACE/INST/$QT_VER/x86-linux64-static
	    tar -zcf $WORKSPACE/qt-$QT_VER-$(BUILD_NUMBER)-x86-linux64-static.tgz .

	    cd $WORKSPACE/INST/$QT_VER/x86_64-msvc
	    zip -qr $WORKSPACE/qt-$QT_VER-$(BUILD_NUMBER)-x86_64-msvc.zip .

	    cd $WORKSPACE/
	    rm -Rf $WORKSPACE/INST
	'''
	archiveArtifacts artifacts: '*.tgz, *.zip'
    }
}