]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Cleanup and sync win32 depkgs build script
authorEric Bollengier <eric@baculasystems.com>
Sat, 21 Nov 2020 09:39:22 +0000 (10:39 +0100)
committerEric Bollengier <eric@baculasystems.com>
Thu, 24 Mar 2022 08:03:27 +0000 (09:03 +0100)
bacula/src/win32/build-depkgs-mingw-w64
bacula/src/win32/build-depkgs-mingw32

index 892fd51a89330b14373ca6f5c8f5f8e5be40d0ea..e5e277f277658bc702878651f145fe950e6d1243 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# Copyright (C) 2000-2021 Kern Sibbald
+# Copyright (C) 2000-2022 Kern Sibbald
 # License: BSD 2-Clause; see file LICENSE-FOSS
 #
 #  This file may help you build the dependency packages that
@@ -65,6 +65,7 @@ fi
 [ ! -e ${TOP_DIR}/depkgs-mingw-w64 ] && mkdir ${TOP_DIR}/depkgs-mingw-w64
 cd ${TOP_DIR}/depkgs-mingw-w64
 DEPPKG_DIR=`pwd`
+DEPKGS_DIR=`pwd`
 
 export PATH=${BIN_DIR}:${PATH}
 
@@ -96,6 +97,7 @@ get_source()
    *.tar.bz2)      ARCHIVER="tar xjf";    [ -z "${SRC_DIR}" ] && SRC_DIR=`expr "${ARCHIVE}" : '\(.*\)\.tar\.bz2'`;;
    *.zip)          ARCHIVER="unzip -d .";   [ -z "${SRC_DIR}" ] && SRC_DIR=`expr "${ARCHIVE}" : '\(.*\)\.zip'`;;
    *.exe)          ARCHIVER="";           [ -z "${SRC_DIR}" ] && SRC_DIR=`expr "${ARCHIVE}" : '\(.*\)\.zip'`;;
+   *.xz)       ARCHIVER="tar xf";    [ -z "${SRC_DIR}" ] && SRC_DIR=`expr "${ARCHIVE}" : '\(.*\)\.tar\.xz'`;;
    *)              echo Unsupported archive type - $ARCHIVE; exit 1;;
    esac
    
@@ -173,15 +175,6 @@ do_make()
    fi | tee -a make.log | parse_output
 }
 
-process_rsync()
-{
-   get_source "${URL_RSYNC}" "${DIR_RSYNC}" "${MKD_RSYNC}"
-   ./configure --host=${BASE}
-   make -k # rdiff.exe has a problem
-   cp .libs/librsync.a ${DEPPKG_DIR}/lib
-   cp librsync*h ${DEPPKG_DIR}/include
-}
-
 process_zlib()
 {
    if get_source "${URL_ZLIB}" "${DIR_ZLIB}" "${MKD_ZLIB}"
@@ -238,7 +231,6 @@ process_pthreads()
       echo "No patch needed for this package"
    fi
    echo Building pthreads
-   cd pthreads.2
    > make.log
    do_make GNUmakefile CROSS=${BASE}- clean GCE-inlined
    echo Installing pthreads
@@ -260,6 +252,9 @@ process_openssl()
                        --with-zlib-include=${DEPPKG_DIR}/include \
                        mingw64 > make.log 2>&1
    fi
+   echo Patching openssl
+   sed -i "s;OPENSSLDIR_dev=C:;OPENSSLDIR_dev=;" Makefile
+   sed -i "s;OPENSSLDIR_dir=.*;OPENSSLDIR_dir=${DEPPKG_DIR}/openssl;" Makefile
    echo Building openssl
    do_make Makefile all
    echo Installing openssl
@@ -282,16 +277,18 @@ process_lzo()
    do_make Makefile -k PREFIX=${DEPPKG_DIR}/ install
 }
 
-process_qt4()
+process_qt5()
 {
-   if get_source "${URL_Qt4}" "${DIR_Qt4}" "${MKD_Qt4}"
+    # Required libz.dll.a, zlib.h and zconf.h for proper Qt build purpose
+   process_zlib
+   process_openssl
+
+   if get_source "${URL_Qt5}" "${DIR_Qt5}" "${MKD_Qt5}"
    then
-      echo Patching Qt4
-      >patch.log
-      patch -p1 < ${SCRIPT_DIR}/patches/qt4-intrinsics.patch
-      patch -p1 < ${SCRIPT_DIR}/patches/qt4-widget-ui.patch
-      patch -p1 < ${SCRIPT_DIR}/patches/qt4-compilation-see.patch
-      patch -p1 < ${SCRIPT_DIR}/patches/qt4-compilation.patch
+       echo Patching Qt5
+   fi
+   if [ -f done ]; then
+        return
    fi
    echo "Configuring Qt5"
    export OPENSSL_LIBS="-lssl -lcrypto"
@@ -332,17 +329,21 @@ process_qt4()
 process_mingw()
 {
    if test -f /usr/lib/gcc/${BASE}/*posix/libstdc++-6.dll; then
-      cp -f /usr/lib/gcc/${BASE}/*posix/libstdc++-6.dll ${DEPPKG_DIR}/bin
-      cp -f /usr/lib/gcc/${BASE}/*posix/libgcc*dll ${DEPPKG_DIR}/bin
+      cp /usr/lib/gcc/${BASE}/*posix/libstdc++-6.dll ${DEPPKG_DIR}/bin
+      cp /usr/lib/gcc/${BASE}/*posix/libgcc*dll ${DEPPKG_DIR}/bin
    elif test -f /usr/lib/gcc/${BASE}/*/libstdc++-6.dll; then
-      cp -f /usr/${BASE}/lib/libstdc++-6.dll ${DEPPKG_DIR}/bin
-      cp -f /usr/${BASE}/lib/libgcc*dll ${DEPPKG_DIR}/bin
+      cp /usr/lib/gcc/${BASE}/*/libstdc++-6.dll ${DEPPKG_DIR}/bin
+      cp /usr/lib/gcc/${BASE}/*/libgcc*dll ${DEPPKG_DIR}/bin
+   elif test -f /usr/${BASE}/lib/libstdc++-6.dll; then
+      cp /usr/${BASE}/lib/libstdc++-6.dll ${DEPPKG_DIR}/bin
+      cp /usr/${BASE}/lib/libgcc*dll ${DEPPKG_DIR}/bin
    else
       echo "ERROR: Unable to find ${BASE} on this system"
    fi
    if test -f /usr/$BASE/lib/libwinpthread-1.dll; then
-      cp -f /usr/$BASE/lib/libwinpthread-1.dll ${DEPPKG_DIR}/bin
+      cp /usr/$BASE/lib/libwinpthread-1.dll ${DEPPKG_DIR}/bin
    fi
+
 }
 
 process_mtx()
@@ -384,8 +385,7 @@ process_sed()
    then
            echo Patching sed
            >patch.log
-           # patch not needed for 4.2k which is already updated
-           # do_patch sed.patch
+           do_patch sed.patch
            echo Configuring sed
            ./configure --host=$BASE \
                        --prefix=${DEPPKG_DIR} \
@@ -416,29 +416,18 @@ process_cmd_utils()
    do_make Makefile install
 }
 
-# MSSQL dlls are created from Visual Studio
-process_mssql()
-{
-   get_source "${URL_MSSQL}" "${DIR_MSSQL}" "${MKD_MSSQL}"
-   echo Installing MSSQL driver
-   cp include/*.h ${DEPPKG_DIR}/include
-   cp x64/mssql-driver.dll ${DEPPKG_DIR}/bin
-   cp x64/mssql-regression.exe ${DEPPKG_DIR}/bin
-}
 
 if [ "$#" -eq 0 ]
 then
    process_mingw
-   process_rsync
    process_lzo
    process_zlib
 #   process_pcre
 #   process_pthreads
    process_openssl
-   process_qt4
+   process_qt5
    process_sed
    process_cmd_utils
-   process_mssql
 #   process_mtx
 #   process_mt
 else
index b99e82eb8f90c6fcd8e32123d4b52f657b14cfdf..1d838218499060b2a464742a77cf5b3bc91ea028 100755 (executable)
@@ -105,6 +105,7 @@ get_source()
    *.tar.bz2)      ARCHIVER="tar xjf";    [ -z "${SRC_DIR}" ] && SRC_DIR=`expr "${ARCHIVE}" : '\(.*\)\.tar\.bz2'`;;
    *.zip)          ARCHIVER="unzip -q";   [ -z "${SRC_DIR}" ] && SRC_DIR=`expr "${ARCHIVE}" : '\(.*\)\.zip'`;;
    *.exe)          ARCHIVER="";           [ -z "${SRC_DIR}" ] && SRC_DIR=`expr "${ARCHIVE}" : '\(.*\)\.zip'`;;
+   *.xz)       ARCHIVER="tar xf";    [ -z "${SRC_DIR}" ] && SRC_DIR=`expr "${ARCHIVE}" : '\(.*\)\.tar\.xz'`;;
    *)              echo Unsupported archive type - $ARCHIVE; exit 1;;
    esac
    
@@ -209,17 +210,6 @@ process_zlib()
 }
 
 
-process_rsync()
-{
-   get_source "${URL_RSYNC}" "${DIR_RSYNC}" "${MKD_RSYNC}"
-   ./configure --host=$BASE --with-pic
-   echo Building librsync
-   do_make Makefile
-   echo Installing lib and headers
-   cp .libs/librsync.a ${DEPPKG_DIR}/lib
-   cp librsync*h ${DEPPKG_DIR}/include
-}
-
 process_pcre()
 {
    if get_source "${URL_PCRE}" "${DIR_PCRE}" "${MKD_PCRE}"
@@ -480,8 +470,7 @@ process_sed()
    then
            echo Patching sed
            >patch.log
-           # patch not needed for 4.2k which is already updated
-           # do_patch sed.patch
+           do_patch sed.patch
            echo Configuring sed
            ./configure --host=$BASE \
                        --prefix=${DEPPKG_DIR} \
@@ -557,6 +546,9 @@ process_qt5()
        echo Patching Qt5
        do_patch qt5-qaction.patch
     fi
+    if [ -f done ]; then
+        return
+    fi
     export OPENSSL_LIBS="-lssl -lcrypto"
     echo y | ./configure -xplatform win32-g++ -device-option CROSS_COMPILE=/usr/bin/i686-w64-mingw32- \
                 -prefix ${DEPPKG_DIR} -opensource  -no-compile-examples \
@@ -630,43 +622,35 @@ process_mingw()
 {
    if test -f /usr/lib/gcc/$BASE/*posix/libstdc++-6.dll; then
       echo "Installing MinGW libs"
-      cp -f /usr/lib/gcc/$BASE/*posix/libstdc++-6.dll ${DEPPKG_DIR}/bin
-      cp -f /usr/lib/gcc/$BASE/*posix/libgcc*dll ${DEPPKG_DIR}/bin
+      cp /usr/lib/gcc/$BASE/*posix/libstdc++-6.dll ${DEPPKG_DIR}/bin
+      cp /usr/lib/gcc/$BASE/*posix/libgcc*dll ${DEPPKG_DIR}/bin
    elif test -f /usr/lib/gcc/$BASE/*/libstdc++-6.dll; then
       echo "Installing MinGW libs"
-      cp -f /usr/$BASE/lib/libstdc++-6.dll ${DEPPKG_DIR}/bin
-      cp -f /usr/$BASE/lib/libgcc*dll ${DEPPKG_DIR}/bin
+      cp /usr/lib/gcc/$BASE/*/libstdc++-6.dll ${DEPPKG_DIR}/bin
+      cp /usr/lib/gcc/$BASE/*/libgcc*dll ${DEPPKG_DIR}/bin
+   elif test -f /usr/$BASE/lib/libstdc++-6.dll; then
+      echo "Installing MinGW libs"
+      cp /usr/$BASE/lib/libstdc++-6.dll ${DEPPKG_DIR}/bin
+      cp /usr/$BASE/lib/libgcc*dll ${DEPPKG_DIR}/bin
    else
       echo "ERROR: Unable to find $BASE on this system"
    fi
 
    if test -f /usr/$BASE/lib/libwinpthread-1.dll; then
-      cp -f /usr/$BASE/lib/libwinpthread-1.dll ${DEPPKG_DIR}/bin
+      cp /usr/$BASE/lib/libwinpthread-1.dll ${DEPPKG_DIR}/bin
    fi
 }
 
-# MSSQL dlls are created from Visual Studio
-process_mssql()
-{
-   get_source "${URL_MSSQL}" "${DIR_MSSQL}" "${MKD_MSSQL}"
-   echo Installing MSSQL driver
-   cp include/*.h ${DEPPKG_DIR}/include
-   cp x86/mssql-driver.dll ${DEPPKG_DIR}/bin
-   cp x86/mssql-regression.exe ${DEPPKG_DIR}/bin
-}
-
 if [ "$#" -eq 0 ]
 then
    process_mingw
    process_lzo
    process_zlib
-   process_rsync
    #process_pthreads
    process_openssl
    process_stab2cv
    process_sed
    process_cmd_utils
-   process_mssql
 #   process_pcre
 #   process_mysql
 #   process_sqlite