From: Frank Stettner Date: Thu, 30 Mar 2023 17:51:02 +0000 (+0200) Subject: Move MXE CI scripts and contrib files X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=402d6f8fea10600eb0e8d434458439ae9942b186;p=sigrok-build.git Move MXE CI scripts and contrib files --- diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a324187..264fb02 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -60,7 +60,7 @@ jobs: - name: Build dependencies run: | - cd sigrok-build/ci + cd sigrok-build/ci/mxe source sigrok-mxe-init-toolchain.sh ./sigrok-mxe-build-dependencies.sh @@ -73,7 +73,7 @@ jobs: - name: Build PulseView run: | - source sigrok-build/ci/sigrok-mxe-init-toolchain.sh + source sigrok-build/ci/mxe/sigrok-mxe-init-toolchain.sh mkdir -p pulseview/build cd pulseview/build $CMAKE \ @@ -87,13 +87,13 @@ jobs: - name: Build NSIS installer run: | - source sigrok-build/ci/sigrok-mxe-init-toolchain.sh + source sigrok-build/ci/mxe/sigrok-mxe-init-toolchain.sh # Zadig (we ship this with frontends for easy driver switching). $WGET https://github.com/pbatard/libwdi/releases/download/b721/zadig-2.4.exe -O $INSTALL_DIR/zadig.exe $WGET https://github.com/pbatard/libwdi/releases/download/v1.2.5/zadig_xp-2.2.exe -O $INSTALL_DIR/zadig_xp.exe - cp sigrok-build/ci/contrib-mxe/FileAssociation.nsh pulseview/build/contrib + cp sigrok-build/ci/mxe/contrib-mxe/FileAssociation.nsh pulseview/build/contrib makensis ${{ matrix.target.nsis_param }} pulseview/build/contrib/pulseview_cross.nsi - name: Rename artifact @@ -135,7 +135,7 @@ jobs: - name: Build dependencies run: | - cd sigrok-build/ci + cd sigrok-build/ci/mxe source sigrok-mxe-init-toolchain.sh ./sigrok-mxe-build-dependencies.sh @@ -147,7 +147,7 @@ jobs: - name: Build sigrok-cli run: | - source sigrok-build/ci/sigrok-mxe-init-toolchain.sh + source sigrok-build/ci/mxe/sigrok-mxe-init-toolchain.sh cd sigrok-cli ./autogen.sh ./configure $C @@ -156,13 +156,13 @@ jobs: - name: Build NSIS installer run: | - source sigrok-build/ci/sigrok-mxe-init-toolchain.sh + source sigrok-build/ci/mxe/sigrok-mxe-init-toolchain.sh # Zadig (we ship this with frontends for easy driver switching). $WGET https://github.com/pbatard/libwdi/releases/download/b721/zadig-2.4.exe -O $INSTALL_DIR/zadig.exe $WGET https://github.com/pbatard/libwdi/releases/download/v1.2.5/zadig_xp-2.2.exe -O $INSTALL_DIR/zadig_xp.exe - cp sigrok-build/ci/contrib-mxe/FileAssociation.nsh sigrok-cli/contrib + cp sigrok-build/ci/mxe/contrib-mxe/FileAssociation.nsh sigrok-cli/contrib makensis ${{ matrix.target.nsis_param }} sigrok-cli/contrib/sigrok-cli_cross.nsi - name: Rename artifact diff --git a/ci/contrib-mxe/FileAssociation.nsh b/ci/contrib-mxe/FileAssociation.nsh deleted file mode 100644 index f824516..0000000 --- a/ci/contrib-mxe/FileAssociation.nsh +++ /dev/null @@ -1,190 +0,0 @@ -/* -_____________________________________________________________________________ - - File Association -_____________________________________________________________________________ - - Based on code taken from http://nsis.sourceforge.net/File_Association - - Usage in script: - 1. !include "FileAssociation.nsh" - 2. [Section|Function] - ${FileAssociationFunction} "Param1" "Param2" "..." $var - [SectionEnd|FunctionEnd] - - FileAssociationFunction=[RegisterExtension|UnRegisterExtension] - -_____________________________________________________________________________ - - ${RegisterExtension} "[executable]" "[extension]" "[description]" - -"[executable]" ; executable which opens the file format - ; -"[extension]" ; extension, which represents the file format to open - ; -"[description]" ; description for the extension. This will be display in Windows Explorer. - ; - - - ${UnRegisterExtension} "[extension]" "[description]" - -"[extension]" ; extension, which represents the file format to open - ; -"[description]" ; description for the extension. This will be display in Windows Explorer. - ; - -_____________________________________________________________________________ - - Macros -_____________________________________________________________________________ - - Change log window verbosity (default: 3=no script) - - Example: - !include "FileAssociation.nsh" - !insertmacro RegisterExtension - ${FileAssociation_VERBOSE} 4 # all verbosity - !insertmacro UnRegisterExtension - ${FileAssociation_VERBOSE} 3 # no script -*/ - - -!ifndef FileAssociation_INCLUDED -!define FileAssociation_INCLUDED - -!include Util.nsh - -!verbose push -!verbose 3 -!ifndef _FileAssociation_VERBOSE - !define _FileAssociation_VERBOSE 3 -!endif -!verbose ${_FileAssociation_VERBOSE} -!define FileAssociation_VERBOSE `!insertmacro FileAssociation_VERBOSE` -!verbose pop - -!macro FileAssociation_VERBOSE _VERBOSE - !verbose push - !verbose 3 - !undef _FileAssociation_VERBOSE - !define _FileAssociation_VERBOSE ${_VERBOSE} - !verbose pop -!macroend - - - -!macro RegisterExtensionCall _EXECUTABLE _EXTENSION _DESCRIPTION - !verbose push - !verbose ${_FileAssociation_VERBOSE} - Push `${_DESCRIPTION}` - Push `${_EXTENSION}` - Push `${_EXECUTABLE}` - ${CallArtificialFunction} RegisterExtension_ - !verbose pop -!macroend - -!macro UnRegisterExtensionCall _EXTENSION _DESCRIPTION - !verbose push - !verbose ${_FileAssociation_VERBOSE} - Push `${_EXTENSION}` - Push `${_DESCRIPTION}` - ${CallArtificialFunction} UnRegisterExtension_ - !verbose pop -!macroend - - - -!define RegisterExtension `!insertmacro RegisterExtensionCall` -!define un.RegisterExtension `!insertmacro RegisterExtensionCall` - -!macro RegisterExtension -!macroend - -!macro un.RegisterExtension -!macroend - -!macro RegisterExtension_ - !verbose push - !verbose ${_FileAssociation_VERBOSE} - - Exch $R2 ;exe - Exch - Exch $R1 ;ext - Exch - Exch 2 - Exch $R0 ;desc - Exch 2 - Push $0 - Push $1 - - ReadRegStr $1 HKCR $R1 "" ; read current file association - StrCmp "$1" "" NoBackup ; is it empty - StrCmp "$1" "$R0" NoBackup ; is it our own - WriteRegStr HKCR $R1 "backup_val" "$1" ; backup current value -NoBackup: - WriteRegStr HKCR $R1 "" "$R0" ; set our file association - - ReadRegStr $0 HKCR $R0 "" - StrCmp $0 "" 0 Skip - WriteRegStr HKCR "$R0" "" "$R0" - WriteRegStr HKCR "$R0\shell" "" "open" - WriteRegStr HKCR "$R0\DefaultIcon" "" "$R2,0" -Skip: - WriteRegStr HKCR "$R0\shell\open\command" "" '"$R2" "%1"' - WriteRegStr HKCR "$R0\shell\edit" "" "Edit $R0" - WriteRegStr HKCR "$R0\shell\edit\command" "" '"$R2" "%1"' - - Pop $1 - Pop $0 - Pop $R2 - Pop $R1 - Pop $R0 - - !verbose pop -!macroend - - - -!define UnRegisterExtension `!insertmacro UnRegisterExtensionCall` -!define un.UnRegisterExtension `!insertmacro UnRegisterExtensionCall` - -!macro UnRegisterExtension -!macroend - -!macro un.UnRegisterExtension -!macroend - -!macro UnRegisterExtension_ - !verbose push - !verbose ${_FileAssociation_VERBOSE} - - Exch $R1 ;desc - Exch - Exch $R0 ;ext - Exch - Push $0 - Push $1 - - ReadRegStr $1 HKCR $R0 "" - StrCmp $1 $R1 0 NoOwn ; only do this if we own it - ReadRegStr $1 HKCR $R0 "backup_val" - StrCmp $1 "" 0 Restore ; if backup="" then delete the whole key - DeleteRegKey HKCR $R0 - Goto NoOwn - -Restore: - WriteRegStr HKCR $R0 "" $1 - DeleteRegValue HKCR $R0 "backup_val" - DeleteRegKey HKCR $R1 ;Delete key with association name settings - -NoOwn: - - Pop $1 - Pop $0 - Pop $R1 - Pop $R0 - - !verbose pop -!macroend - -!endif # !FileAssociation_INCLUDED diff --git a/ci/contrib-mxe/Python34_i686.tar.gz b/ci/contrib-mxe/Python34_i686.tar.gz deleted file mode 100644 index 7008b90..0000000 Binary files a/ci/contrib-mxe/Python34_i686.tar.gz and /dev/null differ diff --git a/ci/contrib-mxe/Python34_x86_64.tar.gz b/ci/contrib-mxe/Python34_x86_64.tar.gz deleted file mode 100644 index 12b7de2..0000000 Binary files a/ci/contrib-mxe/Python34_x86_64.tar.gz and /dev/null differ diff --git a/ci/contrib-mxe/pyconfig.patch b/ci/contrib-mxe/pyconfig.patch deleted file mode 100644 index a5ffb1c..0000000 --- a/ci/contrib-mxe/pyconfig.patch +++ /dev/null @@ -1,37 +0,0 @@ -Fix for bug #1195. - -Patch taken from the MSYS2 MINGW-packages repo, filename -0110-MINGW-translate-gcc-internal-defines-to-python-platf.patch, -but applied to pyconfig.h instead of pyport.h. - -Without this, Py_ssize_t ends up being 4 on 64bit Windows (where it -should be 8) and all kinds of weird issues happen as a result, -including 4GB allocations for no apparent reason, and none of the -protocol decoders working (at all). - -The respective Py_ssize_t related code is in pyport.h. - ---- pyconfig.h.orig 2018-09-29 18:06:33.625204450 +0200 -+++ pyconfig.h 2018-09-29 18:34:09.165488139 +0200 -@@ -1,6 +1,21 @@ - #ifndef Py_CONFIG_H - #define Py_CONFIG_H - -+#ifdef __MINGW32__ -+/* Translate GCC[mingw*] platform specific defines to those -+ * used in python code. -+ */ -+#if !defined(MS_WIN64) && defined(_WIN64) -+# define MS_WIN64 -+#endif -+#if !defined(MS_WIN32) && defined(_WIN32) -+# define MS_WIN32 -+#endif -+#if !defined(MS_WINDOWS) && defined(MS_WIN32) -+# define MS_WINDOWS -+#endif -+#endif /* __MINGW32__*/ -+ - /* pyconfig.h. NOT Generated automatically by configure. - - This is a manually maintained version used for the Watcom, diff --git a/ci/contrib-mxe/python34_i686.dll b/ci/contrib-mxe/python34_i686.dll deleted file mode 100644 index bec0941..0000000 Binary files a/ci/contrib-mxe/python34_i686.dll and /dev/null differ diff --git a/ci/contrib-mxe/python34_i686.zip b/ci/contrib-mxe/python34_i686.zip deleted file mode 100644 index 7f7b0b0..0000000 Binary files a/ci/contrib-mxe/python34_i686.zip and /dev/null differ diff --git a/ci/contrib-mxe/python34_x86_64.dll b/ci/contrib-mxe/python34_x86_64.dll deleted file mode 100644 index 5eaa06f..0000000 Binary files a/ci/contrib-mxe/python34_x86_64.dll and /dev/null differ diff --git a/ci/contrib-mxe/python34_x86_64.zip b/ci/contrib-mxe/python34_x86_64.zip deleted file mode 100644 index 1459ee0..0000000 Binary files a/ci/contrib-mxe/python34_x86_64.zip and /dev/null differ diff --git a/ci/mxe/contrib-mxe/FileAssociation.nsh b/ci/mxe/contrib-mxe/FileAssociation.nsh new file mode 100644 index 0000000..f824516 --- /dev/null +++ b/ci/mxe/contrib-mxe/FileAssociation.nsh @@ -0,0 +1,190 @@ +/* +_____________________________________________________________________________ + + File Association +_____________________________________________________________________________ + + Based on code taken from http://nsis.sourceforge.net/File_Association + + Usage in script: + 1. !include "FileAssociation.nsh" + 2. [Section|Function] + ${FileAssociationFunction} "Param1" "Param2" "..." $var + [SectionEnd|FunctionEnd] + + FileAssociationFunction=[RegisterExtension|UnRegisterExtension] + +_____________________________________________________________________________ + + ${RegisterExtension} "[executable]" "[extension]" "[description]" + +"[executable]" ; executable which opens the file format + ; +"[extension]" ; extension, which represents the file format to open + ; +"[description]" ; description for the extension. This will be display in Windows Explorer. + ; + + + ${UnRegisterExtension} "[extension]" "[description]" + +"[extension]" ; extension, which represents the file format to open + ; +"[description]" ; description for the extension. This will be display in Windows Explorer. + ; + +_____________________________________________________________________________ + + Macros +_____________________________________________________________________________ + + Change log window verbosity (default: 3=no script) + + Example: + !include "FileAssociation.nsh" + !insertmacro RegisterExtension + ${FileAssociation_VERBOSE} 4 # all verbosity + !insertmacro UnRegisterExtension + ${FileAssociation_VERBOSE} 3 # no script +*/ + + +!ifndef FileAssociation_INCLUDED +!define FileAssociation_INCLUDED + +!include Util.nsh + +!verbose push +!verbose 3 +!ifndef _FileAssociation_VERBOSE + !define _FileAssociation_VERBOSE 3 +!endif +!verbose ${_FileAssociation_VERBOSE} +!define FileAssociation_VERBOSE `!insertmacro FileAssociation_VERBOSE` +!verbose pop + +!macro FileAssociation_VERBOSE _VERBOSE + !verbose push + !verbose 3 + !undef _FileAssociation_VERBOSE + !define _FileAssociation_VERBOSE ${_VERBOSE} + !verbose pop +!macroend + + + +!macro RegisterExtensionCall _EXECUTABLE _EXTENSION _DESCRIPTION + !verbose push + !verbose ${_FileAssociation_VERBOSE} + Push `${_DESCRIPTION}` + Push `${_EXTENSION}` + Push `${_EXECUTABLE}` + ${CallArtificialFunction} RegisterExtension_ + !verbose pop +!macroend + +!macro UnRegisterExtensionCall _EXTENSION _DESCRIPTION + !verbose push + !verbose ${_FileAssociation_VERBOSE} + Push `${_EXTENSION}` + Push `${_DESCRIPTION}` + ${CallArtificialFunction} UnRegisterExtension_ + !verbose pop +!macroend + + + +!define RegisterExtension `!insertmacro RegisterExtensionCall` +!define un.RegisterExtension `!insertmacro RegisterExtensionCall` + +!macro RegisterExtension +!macroend + +!macro un.RegisterExtension +!macroend + +!macro RegisterExtension_ + !verbose push + !verbose ${_FileAssociation_VERBOSE} + + Exch $R2 ;exe + Exch + Exch $R1 ;ext + Exch + Exch 2 + Exch $R0 ;desc + Exch 2 + Push $0 + Push $1 + + ReadRegStr $1 HKCR $R1 "" ; read current file association + StrCmp "$1" "" NoBackup ; is it empty + StrCmp "$1" "$R0" NoBackup ; is it our own + WriteRegStr HKCR $R1 "backup_val" "$1" ; backup current value +NoBackup: + WriteRegStr HKCR $R1 "" "$R0" ; set our file association + + ReadRegStr $0 HKCR $R0 "" + StrCmp $0 "" 0 Skip + WriteRegStr HKCR "$R0" "" "$R0" + WriteRegStr HKCR "$R0\shell" "" "open" + WriteRegStr HKCR "$R0\DefaultIcon" "" "$R2,0" +Skip: + WriteRegStr HKCR "$R0\shell\open\command" "" '"$R2" "%1"' + WriteRegStr HKCR "$R0\shell\edit" "" "Edit $R0" + WriteRegStr HKCR "$R0\shell\edit\command" "" '"$R2" "%1"' + + Pop $1 + Pop $0 + Pop $R2 + Pop $R1 + Pop $R0 + + !verbose pop +!macroend + + + +!define UnRegisterExtension `!insertmacro UnRegisterExtensionCall` +!define un.UnRegisterExtension `!insertmacro UnRegisterExtensionCall` + +!macro UnRegisterExtension +!macroend + +!macro un.UnRegisterExtension +!macroend + +!macro UnRegisterExtension_ + !verbose push + !verbose ${_FileAssociation_VERBOSE} + + Exch $R1 ;desc + Exch + Exch $R0 ;ext + Exch + Push $0 + Push $1 + + ReadRegStr $1 HKCR $R0 "" + StrCmp $1 $R1 0 NoOwn ; only do this if we own it + ReadRegStr $1 HKCR $R0 "backup_val" + StrCmp $1 "" 0 Restore ; if backup="" then delete the whole key + DeleteRegKey HKCR $R0 + Goto NoOwn + +Restore: + WriteRegStr HKCR $R0 "" $1 + DeleteRegValue HKCR $R0 "backup_val" + DeleteRegKey HKCR $R1 ;Delete key with association name settings + +NoOwn: + + Pop $1 + Pop $0 + Pop $R1 + Pop $R0 + + !verbose pop +!macroend + +!endif # !FileAssociation_INCLUDED diff --git a/ci/mxe/contrib-mxe/Python34_i686.tar.gz b/ci/mxe/contrib-mxe/Python34_i686.tar.gz new file mode 100644 index 0000000..7008b90 Binary files /dev/null and b/ci/mxe/contrib-mxe/Python34_i686.tar.gz differ diff --git a/ci/mxe/contrib-mxe/Python34_x86_64.tar.gz b/ci/mxe/contrib-mxe/Python34_x86_64.tar.gz new file mode 100644 index 0000000..12b7de2 Binary files /dev/null and b/ci/mxe/contrib-mxe/Python34_x86_64.tar.gz differ diff --git a/ci/mxe/contrib-mxe/pyconfig.patch b/ci/mxe/contrib-mxe/pyconfig.patch new file mode 100644 index 0000000..a5ffb1c --- /dev/null +++ b/ci/mxe/contrib-mxe/pyconfig.patch @@ -0,0 +1,37 @@ +Fix for bug #1195. + +Patch taken from the MSYS2 MINGW-packages repo, filename +0110-MINGW-translate-gcc-internal-defines-to-python-platf.patch, +but applied to pyconfig.h instead of pyport.h. + +Without this, Py_ssize_t ends up being 4 on 64bit Windows (where it +should be 8) and all kinds of weird issues happen as a result, +including 4GB allocations for no apparent reason, and none of the +protocol decoders working (at all). + +The respective Py_ssize_t related code is in pyport.h. + +--- pyconfig.h.orig 2018-09-29 18:06:33.625204450 +0200 ++++ pyconfig.h 2018-09-29 18:34:09.165488139 +0200 +@@ -1,6 +1,21 @@ + #ifndef Py_CONFIG_H + #define Py_CONFIG_H + ++#ifdef __MINGW32__ ++/* Translate GCC[mingw*] platform specific defines to those ++ * used in python code. ++ */ ++#if !defined(MS_WIN64) && defined(_WIN64) ++# define MS_WIN64 ++#endif ++#if !defined(MS_WIN32) && defined(_WIN32) ++# define MS_WIN32 ++#endif ++#if !defined(MS_WINDOWS) && defined(MS_WIN32) ++# define MS_WINDOWS ++#endif ++#endif /* __MINGW32__*/ ++ + /* pyconfig.h. NOT Generated automatically by configure. + + This is a manually maintained version used for the Watcom, diff --git a/ci/mxe/contrib-mxe/python34_i686.dll b/ci/mxe/contrib-mxe/python34_i686.dll new file mode 100644 index 0000000..bec0941 Binary files /dev/null and b/ci/mxe/contrib-mxe/python34_i686.dll differ diff --git a/ci/mxe/contrib-mxe/python34_i686.zip b/ci/mxe/contrib-mxe/python34_i686.zip new file mode 100644 index 0000000..7f7b0b0 Binary files /dev/null and b/ci/mxe/contrib-mxe/python34_i686.zip differ diff --git a/ci/mxe/contrib-mxe/python34_x86_64.dll b/ci/mxe/contrib-mxe/python34_x86_64.dll new file mode 100644 index 0000000..5eaa06f Binary files /dev/null and b/ci/mxe/contrib-mxe/python34_x86_64.dll differ diff --git a/ci/mxe/contrib-mxe/python34_x86_64.zip b/ci/mxe/contrib-mxe/python34_x86_64.zip new file mode 100644 index 0000000..1459ee0 Binary files /dev/null and b/ci/mxe/contrib-mxe/python34_x86_64.zip differ diff --git a/ci/mxe/sigrok-mxe-build-dependencies.sh b/ci/mxe/sigrok-mxe-build-dependencies.sh new file mode 100755 index 0000000..fce0cd0 --- /dev/null +++ b/ci/mxe/sigrok-mxe-build-dependencies.sh @@ -0,0 +1,137 @@ +#!/bin/sh +## +## This file is part of the sigrok-util project. +## +## Copyright (C) 2013-2018 Uwe Hermann +## Copyright (C) 2018-2023 Frank Stettner +## +## This program is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program; if not, see . +## + +set -e + +mkdir -p "$INSTALL_DIR" + +BUILD_DIR=./build +mkdir -p $BUILD_DIR +cd $BUILD_DIR + +# Cross-compiling Python is highly non-trivial, so we avoid it for now. +# The Python32.tar.gz file below is a repackaged tarball of the official +# Python 3.4.4 MSI installer for Windows: +# - https://www.python.org/ftp/python/3.4.4/python-3.4.4.msi +# - https://www.python.org/ftp/python/3.4.4/python-3.4.4.amd64.msi +# The MSI file has been installed on a Windows box and then c:\Python34\libs +# and c:\Python34\include have been stored in the Python34_*.tar.gz tarball. +cp ../contrib-mxe/Python34_$TARGET.tar.gz "$INSTALL_DIR"/Python34.tar.gz +tar xzf "$INSTALL_DIR"/Python34.tar.gz -C "$INSTALL_DIR" + +# Fix for bug #1195. +if [ "$TARGET" = "x86_64" ]; then + patch -p1 "$INSTALL_DIR"/Python34/include/pyconfig.h < ../contrib-mxe/pyconfig.patch +fi + +# Create a dummy python3.pc file so that pkg-config finds Python 3. +mkdir -p "$INSTALL_DIR"/lib/pkgconfig +cat > "$INSTALL_DIR"/lib/pkgconfig/python3.pc < +## Copyright (C) 2018-2021 Frank Stettner +## +## This program is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program; if not, see . +## + +set -e + +export PARALLEL="-j$(nproc)" + +# We need to find tools in the toolchain. +export PATH="$MXE_DIR/usr/bin":"$PATH" + +TOOLCHAIN_TRIPLET="$TARGET-w64-mingw32.static.posix" + +export CMAKE="$TOOLCHAIN_TRIPLET-cmake" + +P="$INSTALL_DIR/lib/pkgconfig" +P2="$MXE_DIR/usr/$TOOLCHAIN_TRIPLET/lib/pkgconfig" +export C="--host=$TOOLCHAIN_TRIPLET --prefix=$INSTALL_DIR CPPFLAGS=-D__printf__=__gnu_printf__" +export L="--disable-shared --enable-static" +#export V="V=1 VERBOSE=1" + +if [ "$TARGET" = "i686" ]; then + export PKG_CONFIG_PATH_i686_w64_mingw32_static_posix="$P:$P2" +else + export PKG_CONFIG_PATH_x86_64_w64_mingw32_static_posix="$P:$P2" +fi + diff --git a/ci/sigrok-mxe-build-dependencies.sh b/ci/sigrok-mxe-build-dependencies.sh deleted file mode 100755 index fce0cd0..0000000 --- a/ci/sigrok-mxe-build-dependencies.sh +++ /dev/null @@ -1,137 +0,0 @@ -#!/bin/sh -## -## This file is part of the sigrok-util project. -## -## Copyright (C) 2013-2018 Uwe Hermann -## Copyright (C) 2018-2023 Frank Stettner -## -## This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. -## -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with this program; if not, see . -## - -set -e - -mkdir -p "$INSTALL_DIR" - -BUILD_DIR=./build -mkdir -p $BUILD_DIR -cd $BUILD_DIR - -# Cross-compiling Python is highly non-trivial, so we avoid it for now. -# The Python32.tar.gz file below is a repackaged tarball of the official -# Python 3.4.4 MSI installer for Windows: -# - https://www.python.org/ftp/python/3.4.4/python-3.4.4.msi -# - https://www.python.org/ftp/python/3.4.4/python-3.4.4.amd64.msi -# The MSI file has been installed on a Windows box and then c:\Python34\libs -# and c:\Python34\include have been stored in the Python34_*.tar.gz tarball. -cp ../contrib-mxe/Python34_$TARGET.tar.gz "$INSTALL_DIR"/Python34.tar.gz -tar xzf "$INSTALL_DIR"/Python34.tar.gz -C "$INSTALL_DIR" - -# Fix for bug #1195. -if [ "$TARGET" = "x86_64" ]; then - patch -p1 "$INSTALL_DIR"/Python34/include/pyconfig.h < ../contrib-mxe/pyconfig.patch -fi - -# Create a dummy python3.pc file so that pkg-config finds Python 3. -mkdir -p "$INSTALL_DIR"/lib/pkgconfig -cat > "$INSTALL_DIR"/lib/pkgconfig/python3.pc < -## Copyright (C) 2018-2021 Frank Stettner -## -## This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. -## -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with this program; if not, see . -## - -set -e - -export PARALLEL="-j$(nproc)" - -# We need to find tools in the toolchain. -export PATH="$MXE_DIR/usr/bin":"$PATH" - -TOOLCHAIN_TRIPLET="$TARGET-w64-mingw32.static.posix" - -export CMAKE="$TOOLCHAIN_TRIPLET-cmake" - -P="$INSTALL_DIR/lib/pkgconfig" -P2="$MXE_DIR/usr/$TOOLCHAIN_TRIPLET/lib/pkgconfig" -export C="--host=$TOOLCHAIN_TRIPLET --prefix=$INSTALL_DIR CPPFLAGS=-D__printf__=__gnu_printf__" -export L="--disable-shared --enable-static" -#export V="V=1 VERBOSE=1" - -if [ "$TARGET" = "i686" ]; then - export PKG_CONFIG_PATH_i686_w64_mingw32_static_posix="$P:$P2" -else - export PKG_CONFIG_PATH_x86_64_w64_mingw32_static_posix="$P:$P2" -fi -