#!/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
[ ! -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}
*.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
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}"
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
--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
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"
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()
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} \
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
*.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
}
-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}"
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} \
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 \
{
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