Skip to content

Commit

Permalink
Fix windows pacman repo build. (#968)
Browse files Browse the repository at this point in the history
Msys2 updated gcc in the last few days which has caused the package
repo build to fail. Here are some minor fixes to make the build work
again.

- Add fmt to openimageio's dependency list since the version included
  with the openimageio source now appears to cause an internal compiler
  error.

- Added an include for math.h to in a libsox test file to make the
  compiler stop generating an error about fabs() not being defined.

- Fix type mismatch and missing declaration errors in ImageMagick.

- Updated mingw-w64-dump_syms gitcommit to point to a version that
  fixes a missing header build error.
  • Loading branch information
acolwell committed Jul 2, 2024
1 parent 1fe5e52 commit c7767b1
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 5 deletions.
4 changes: 2 additions & 2 deletions tools/MINGW-packages/mingw-w64-dump_syms/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
_realname=breakpad
pkgbase=mingw-w64-natron_dump_syms
pkgname="${MINGW_PACKAGE_PREFIX}-natron_dump_syms"
gitcommit=1a92fe4a44c954577dd678e22252848e5fc714c2
pkgver=2156.1a92fe4a
gitcommit=aa833ca824b1cd5915995bf1fb6bc377c421bd07
pkgver=2159.aa833ca8
pkgrel=1
pkgdesc="Dump win32 dwarf symbols"
arch=('any')
Expand Down
4 changes: 4 additions & 0 deletions tools/MINGW-packages/mingw-w64-imagemagick/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ source=(
ImageMagick-6-mingw.patch
ImageMagick-6.9.11-disable-ltdl.diff
ImageMagick-6.9.10-gimp210.diff
fix-compiler-errors.patch
)
sha256sums=(
'SKIP'
Expand All @@ -50,6 +51,7 @@ sha256sums=(
'c5066995e3cc5fe81cc36b194a4a70fb2bc6ff6e5808062a09d6e767e4bd23eb'
'eb83e383f720c109b3ef7fb8c774cf108aec6ac6e71722ac5292b60feaaf3dd6'
'98f5da106e24f49fff16020ceae375c4f46108ad9a786002c1895b1c17f3dbeb'
'775b28eb46c81a243ce2eff450e3339433c993e6acf6c0340b23aac62e836dd1'
)

prepare() {
Expand All @@ -70,6 +72,8 @@ prepare() {
patch -p0 -i ${srcdir}/ImageMagick-6.9.10-gimp210.diff
fi

patch -p1 -i ${srcdir}/fix-compiler-errors.patch

# fix linker
sed -i 's#$(MAGICK_DEP_LIBS)#$(MAGICK_DEP_LIBS) -lws2_32#g' ${MCORE}/MakeFile.am

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
diff -ru a/magick/utility-private.h b/magick/utility-private.h
--- a/magick/utility-private.h 2024-05-16 16:18:24.863994300 -0700
+++ b/magick/utility-private.h 2024-05-16 16:18:57.352206600 -0700
@@ -273,7 +273,7 @@
path_wide=create_wchar_path(path);
if (path_wide == (WCHAR *) NULL)
return(-1);
- status=wstat(path_wide,attributes);
+ status=_wstati64(path_wide,attributes);
path_wide=(WCHAR *) RelinquishMagickMemory(path_wide);
return(status);
#endif

diff -ru a/magick/utility.c b/magick/utility.c
--- a/magick/utility.c 2020-05-31 09:04:03.000000000 -0700
+++ b/magick/utility.c 2024-05-17 08:05:06.523764900 -0700
@@ -67,6 +67,9 @@
#if defined(MAGICKCORE_HAVE_PROCESS_H)
#include <process.h>
#endif
+#if defined(MAGICKCORE_HAVE_GETPAGESIZE)
+int getpagesize();
+#endif
#if defined(MAGICKCORE_HAVE_MACH_O_DYLD_H)
#include <mach-o/dyld.h>
#end

diff -ru a/wand/mogrify.c b/wand/mogrify.c
--- a/wand/mogrify.c 2020-05-31 09:04:03.000000000 -0700
+++ b/wand/mogrify.c 2024-05-17 08:33:23.368934800 -0700
@@ -3983,7 +3983,7 @@
"preserve-timestamp"));
if (preserve_timestamp != MagickFalse)
{
- struct utimbuf
+ struct _utimbuf
timestamp;

timestamp.actime=properties.st_atime;
1 change: 1 addition & 0 deletions tools/MINGW-packages/mingw-w64-openimageio/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ url="http://www.openimageio.org/"
license=("BSD-3")
depends=("${MINGW_PACKAGE_PREFIX}-boost"
"${MINGW_PACKAGE_PREFIX}-freetype"
"${MINGW_PACKAGE_PREFIX}-fmt"
"${MINGW_PACKAGE_PREFIX}-jasper"
"${MINGW_PACKAGE_PREFIX}-giflib"
"${MINGW_PACKAGE_PREFIX}-libjpeg"
Expand Down
7 changes: 5 additions & 2 deletions tools/MINGW-packages/mingw-w64-sox/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,17 @@ makedepends=("${MINGW_PACKAGE_PREFIX}-gcc"
)
depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs" "${MINGW_PACKAGE_PREFIX}-libmad")
source=("https://downloads.sourceforge.net/sourceforge/${_realname}/${_realname}-$pkgver.tar.bz2"
"remove-libssp-detection.patch")
"remove-libssp-detection.patch"
"include-math-header.patch")
sha256sums=('81a6956d4330e75b5827316e44ae381e6f1e8928003c6aa45896da9041ea149c'
'57d8fe423a97b554d4f34a9952a9827974ecc5f706ac602c4dd77d32bae2afd6')
'57d8fe423a97b554d4f34a9952a9827974ecc5f706ac602c4dd77d32bae2afd6'
'2a1612b9755147cab4f3113bc804d485cf51d032f05c5da2496e99382d9b3681')

prepare() {
cd "${srcdir}/${_realname}-${pkgver}"

patch -Np1 -i "${srcdir}/remove-libssp-detection.patch"
patch -Np1 -i "${srcdir}/include-math-header.patch"

autoreconf -fiv
}
Expand Down
11 changes: 11 additions & 0 deletions tools/MINGW-packages/mingw-w64-sox/include-math-header.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
diff -ur a/src/sox_sample_test.h b/src/sox_sample_test.h
--- a/src/sox_sample_test.h 2012-01-23 14:27:33.000000000 -0800
+++ b/src/sox_sample_test.h 2024-05-16 14:11:33.908971100 -0700
@@ -19,6 +19,7 @@
#undef NDEBUG /* Must undef above assert.h or other that might include it. */
#endif
#include <assert.h>
+#include <math.h>
#include "sox.h"

#define TEST_UINT(bits) \
2 changes: 1 addition & 1 deletion tools/MINGW-packages/windows_pacman_repo_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20240201-1
20240516-1

0 comments on commit c7767b1

Please sign in to comment.