diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..52049ee5 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*crlf.patch -text diff --git a/README.md b/README.md index 29670886..c731ba14 100644 --- a/README.md +++ b/README.md @@ -3,33 +3,34 @@ Experiment with building a libvips binary for Windows with [MXE](https://github.com/mxe/mxe). ## libvips-web dependencies -| Dependency | Version | Used under the terms of | -|-----------------|-----------|---------------------------------| -| [cairo] | 1.17.2 | Mozilla Public License 2.0 | -| [expat] | 2.2.9 | MIT Licence | -| [fontconfig] | 2.13.92 | [fontconfig Licence] (BSD-like) | -| [freetype] | 2.10.2 | [freetype Licence] (BSD-like) | -| [fribidi] | 1.0.10 | LGPLv3 | -| [gdk-pixbuf] | 2.40.0 | LGPLv3 | -| [giflib] | 5.1.4 | MIT Licence | -| [glib] | 2.65.3 | LGPLv3 | -| [harfbuzz] | 2.7.2 | MIT Licence | -| [lcms] | 2.11 | MIT Licence | -| [libexif] | 0.6.22 | LGPLv3 | -| [libffi] | 3.3 | MIT Licence | -| [libgsf] | 1.14.47 | LGPLv3 | -| [libjpeg-turbo] | 2.0.5 | [zlib License, IJG License] | -| [libpng] | 1.6.37 | [libpng License version 2] | -| [librsvg] | 2.49.5 | LGPLv3 | -| [libspng] | 0.6.0 | [BSD 2-Clause, libpng License] | -| [libtiff] | 4.1.0 | [libtiff License] (BSD-like) | -| [libvips] | 8.10.1 | LGPLv3 | -| [libwebp] | 1.1.0 | New BSD License | -| [libxml2] | 2.9.10 | MIT Licence | -| [orc] | 0.4.31 | [orc License] (BSD-like) | -| [pango] | 1.46.1 | LGPLv3 | -| [pixman] | 0.40.0 | MIT Licence | -| [zlib] | 1.2.11 | [zlib Licence] | + +| Dependency | Version | Used under the terms of | +|-----------------|-----------|--------------------------------------------------------------| +| [cairo] | 1.17.2 | Mozilla Public License 2.0 | +| [expat] | 2.2.9 | MIT Licence | +| [fontconfig] | 2.13.92 | [fontconfig Licence] (BSD-like) | +| [freetype] | 2.10.2 | [freetype Licence] (BSD-like) | +| [fribidi] | 1.0.10 | LGPLv3 | +| [gdk-pixbuf] | 2.40.0 | LGPLv3 | +| [giflib] | 5.1.4 | MIT Licence | +| [glib] | 2.66.0 | LGPLv3 | +| [harfbuzz] | 2.7.2 | MIT Licence | +| [lcms] | 2.11 | MIT Licence | +| [libexif] | 0.6.22 | LGPLv3 | +| [libffi] | 3.3 | MIT Licence | +| [libgsf] | 1.14.47 | LGPLv3 | +| [libjpeg-turbo] | 2.0.5 | [zlib License, IJG License] | +| [libpng] | 1.6.37 | [libpng License version 2] | +| [librsvg] | 2.50.0 | LGPLv3 | +| [libspng] | 0.6.1 | BSD 2-Clause | +| [libtiff] | 4.1.0 | [libtiff License] (BSD-like) | +| [libvips] | 8.10.1 | LGPLv3 | +| [libwebp] | 1.1.0 | New BSD License | +| [libxml2] | 2.9.10 | MIT Licence | +| [orc] | 0.4.32 | [orc License] (BSD-like) | +| [pango] | 1.46.2 | LGPLv3 | +| [pixman] | 0.40.0 | MIT Licence | +| [zlib] | 1.2.11 | [zlib Licence] | [cairo]: https://gitlab.freedesktop.org/cairo/cairo [expat]: https://github.com/libexpat/libexpat @@ -52,7 +53,6 @@ Experiment with building a libvips binary for Windows with [MXE](https://github. [libpng License version 2]: https://github.com/glennrp/libpng/blob/master/LICENSE [librsvg]: https://gitlab.gnome.org/GNOME/librsvg [libspng]: https://github.com/randy408/libspng -[BSD 2-Clause, libpng License]: https://github.com/randy408/libspng/blob/master/LICENSE [libtiff]: https://gitlab.com/libtiff/libtiff [libtiff License]: https://libtiff.gitlab.io/libtiff/misc.html [libvips]: https://github.com/libvips/libvips @@ -66,27 +66,29 @@ Experiment with building a libvips binary for Windows with [MXE](https://github. [zlib Licence]: https://github.com/madler/zlib/blob/master/zlib.h ## libvips-all dependencies + Same as libvips-web + these extra dependencies: -| Dependency | Version | Used under the terms of | -|-----------------|-----------|----------------------------------| -| [aom] | 2.0.0 | BSD 2-Clause | -| [cfitsio] | 3.49 | BSD-like | -| [fftw] | 3.3.8 | GPLv2 | -| [hdf5] | 1.10.6 | BSD-like | -| [imagemagick] | 6.9.11-29 | [ImageMagick License] (GPL-like) | -| [libde265] | 1.0.6 | LGPLv3 | -| [libheif] | 1.8.0 | LGPLv3 | -| [matio] | 1.5.17 | BSD 2-Clause | -| [nifticlib] | 2.0.0 | Public domain | -| [openexr] | 2.5.3 | BSD 3-Clause | -| [openjpeg] | 2.3.1 | BSD 2-Clause | -| [openslide] | 3.4.1 | LGPLv3 | -| [poppler] | 20.09.0 | GPLv2 | -| [sqlite] | 3.33.0 | Public domain | -| [x265] | 3.4 | GPLv2 | +| Dependency | Version | Used under the terms of | +|-----------------|-----------|--------------------------------------------------------------| +| [aom] | 2.0.0 | BSD 2-Clause + [Alliance for Open Media Patent License 1.0] | +| [cfitsio] | 3.49 | BSD-like | +| [fftw] | 3.3.8 | GPLv2 | +| [hdf5] | 1.12.0 | BSD-like | +| [imagemagick] | 6.9.11-30 | [ImageMagick License] (GPL-like) | +| [libde265] | 1.0.7 | LGPLv3 | +| [libheif] | 1.9.1 | LGPLv3 | +| [matio] | 1.5.18 | BSD 2-Clause | +| [nifticlib] | 2.0.0 | Public domain | +| [openexr] | 2.5.3 | BSD 3-Clause | +| [openjpeg] | 2.3.1 | BSD 2-Clause | +| [openslide] | 3.4.1 | LGPLv3 | +| [poppler] | 20.09.0 | GPLv2 | +| [sqlite] | 3.33.0 | Public domain | +| [x265] | 3.4 | GPLv2 | [aom]: https://aomedia.googlesource.com/aom/ +[Alliance for Open Media Patent License 1.0]: https://aomedia.org/license/patent-license/ [cfitsio]: https://heasarc.gsfc.nasa.gov/fitsio/ [hdf5]: https://www.hdfgroup.org/solutions/hdf5/ [fftw]: https://github.com/FFTW/fftw3 @@ -101,9 +103,10 @@ Same as libvips-web + these extra dependencies: [openslide]: https://github.com/openslide/openslide [poppler]: https://gitlab.freedesktop.org/poppler/poppler [sqlite]: https://www.sqlite.org/ -[x265]: https://bitbucket.org/multicoreware/x265/wiki/Home +[x265]: https://bitbucket.org/multicoreware/x265_git/wiki/Home ## MozJPEG + MozJPEG is a libjpeg-turbo fork that provides increased compression for JPEG images (at the expense of compression performance). The above variants can optionally be built with MozJPEG instead of libjpeg-turbo. This can be turned on with the `--with-mozjpeg` @@ -113,10 +116,11 @@ argument. For example: ./build.sh --with-mozjpeg ``` -| Dependency | Version | Used under the terms of | -|-----------------|-----------|----------------------------------| -| [mozjpeg] | 8fb32c0¹ | [zlib License, IJG License] | +| Dependency | Version | Used under the terms of | +|-----------------|-----------|--------------------------------------------------------------| +| [mozjpeg] | 8fb32c0¹ | [zlib License, IJG License] | -¹ MozJPEG is built from the [`master`](https://github.com/mozilla/mozjpeg/tree/master) branch to maintain binary compatibility with libjpeg-turbo. +¹ MozJPEG is built from the [`master`](https://github.com/mozilla/mozjpeg/tree/master) branch + to maintain binary compatibility with libjpeg-turbo. [mozjpeg]: https://github.com/mozilla/mozjpeg diff --git a/TODO.md b/TODO.md index 850b5377..7f36a2ec 100644 --- a/TODO.md +++ b/TODO.md @@ -6,8 +6,8 @@ - [x] Not sure about `librsvg`, because v2.42.0+ requires the Rust toolchain. - [ ] Try to test the binaries with the Python test suite on Wine. - [ ] Incorporate the llvm-mingw toolchain plugin into MXE (see [mxe/mxe#2330](https://github.com/mxe/mxe/issues/2330)). - - [x] Test the `armv7-w64-mingw32` target on a Raspberry Pi 3 with Windows 10 IoT. - - [ ] Test the `aarch64-w64-mingw32` target. Perhaps we could install Windows 10 ARM64 on a Raspberry Pi 4B? + - [x] Test the `armv7-w64-mingw32` target on a Raspberry Pi 3B with Windows 10 IoT. + - [ ] Test the `aarch64-w64-mingw32` target on a Raspberry Pi 4B with Windows 10 ARM64. - [ ] The VIPS test suite should be able to run successfully on ARM/ARM64. - - [ ] [`libffi`](build/patches/libffi-3-fixes.patch), [`openslide`](build/patches/openslide-3-fixes.patch) ([mstorsjo/llvm-mingw#67](https://github.com/mstorsjo/llvm-mingw/issues/67)), [`hdf5`](build/patches/hdf5-1-fixes.patch) and [`glib`](build/patches/glib-2-fixes.patch) needs llvm-mingw specific patches. Fix them upstream or within LLVM. + - [ ] Fix the llvm-mingw specific patches upstream or within LLVM. - [ ] The Rust MinGW-w64 ARM/ARM64 targets are not yet supported, is there an alternative way to build librsvg for these architectures? diff --git a/build.sh b/build.sh index a28ad712..3573ecc6 100755 --- a/build.sh +++ b/build.sh @@ -77,7 +77,7 @@ else fi if [ "$type" = "static" ] && [ "$deps" = "all" ]; then - echo "WARNING: Distributing a statically linked library against GPL libraries, without releasing the code as GPL, violates the GPL license." + echo "ERROR: Distributing a statically linked library against GPL libraries, without releasing the code as GPL, violates the GPL license." exit 1 fi diff --git a/build/build.sh b/build/build.sh index cf40f58c..416007ed 100755 --- a/build/build.sh +++ b/build/build.sh @@ -51,7 +51,7 @@ fi # Always checkout a particular revision which will successfully build. # This ensures that it will not suddenly break a build. # Note: Must be regularly updated. -revision="8366dfc732abd3762493984ccda67004411a4238" +revision="0f091d76f4c21348dbfe5c952df2d9216d5edc37" initialize=false if [ -f "$mxe_dir/Makefile" ]; then @@ -75,22 +75,20 @@ if [ "$initialize" = true ]; then git apply $work_dir/patches/mxe-fixes.patch fi -# The 'plugins' variable controls which plugins are in use. if [ "$LLVM" = "true" ]; then - plugins="$work_dir/plugins/llvm-mingw" - # Copy LLVM settings cp -f $work_dir/settings/llvm.mk $mxe_dir/settings.mk else - # Build with GCC 10.1 - plugins="plugins/gcc10" - # Copy GCC settings cp -f $work_dir/settings/gcc.mk $mxe_dir/settings.mk fi -# Use the meson-wrapper and our custom overrides -plugins+=" plugins/meson-wrapper $work_dir" +# The 'plugins' variable controls which plugins are in use +plugins="plugins/gcc10 plugins/meson-wrapper $work_dir" + +if [ "$LLVM" = "true" ]; then + plugins+=" $work_dir/plugins/llvm-mingw" +fi if [ "$MOZJPEG" = "true" ]; then plugins+=" $work_dir/plugins/mozjpeg" @@ -110,7 +108,7 @@ make pe-util \ IGNORE_SETTINGS=yes \ MXE_TARGETS=`$mxe_dir/ext/config.guess` -# Build MXE's meson-wrapper (needed by pango, GDK-PixBuf, GLib and Orc), +# Build MXE's meson-wrapper (needed by pango, GDK-PixBuf, GLib and Orc), # gendef (a tool for generating def files from DLLs) # and libvips (+ dependencies). make meson-wrapper gendef vips-$deps \ diff --git a/build/libde265.mk b/build/libde265.mk index 64b83eeb..846dfdb6 100644 --- a/build/libde265.mk +++ b/build/libde265.mk @@ -2,8 +2,8 @@ PKG := libde265 $(PKG)_WEBSITE := https://www.libde265.org/ $(PKG)_DESCR := Open h.265 video codec implementation. $(PKG)_IGNORE := -$(PKG)_VERSION := 1.0.6 -$(PKG)_CHECKSUM := e2a34ca3934a826d0893e966ee93bc2d207f505253be94ad38fb40ca98cceb5f +$(PKG)_VERSION := 1.0.7 +$(PKG)_CHECKSUM := eac6b56fcda95b0fe0123849c96c8759d832ec9baded2c9c0a5b5faeffb59005 $(PKG)_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/$(PKG)-[0-9]*.patch))) $(PKG)_GH_CONF := strukturag/libde265/releases,v $(PKG)_DEPS := cc mingw-std-threads diff --git a/build/libheif.mk b/build/libheif.mk index 882c0c04..8f3db6d7 100644 --- a/build/libheif.mk +++ b/build/libheif.mk @@ -2,15 +2,28 @@ PKG := libheif $(PKG)_WEBSITE := http://www.libheif.org/ $(PKG)_DESCR := libheif is a ISO/IEC 23008-12:2017 HEIF file format decoder and encoder. $(PKG)_IGNORE := -$(PKG)_VERSION := 1.8.0 -$(PKG)_CHECKSUM := e43ef91a5ad41de4471a2fd484279d0793b419009a7d102965739da8f7b75d96 +$(PKG)_VERSION := 1.9.1 +$(PKG)_CHECKSUM := 5f65ca2bd2510eed4e13bdca123131c64067e9dd809213d7aef4dc5e37948bca $(PKG)_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/$(PKG)-[0-9]*.patch))) $(PKG)_GH_CONF := strukturag/libheif/releases,v $(PKG)_DEPS := cc aom libde265 x265 define $(PKG)_BUILD - cd '$(BUILD_DIR)' && $(TARGET)-cmake '$(SOURCE_DIR)' \ - $(if $(IS_LLVM),,-DCMAKE_CXX_FLAGS='-Wno-error=maybe-uninitialized') + # Disable multithreading when building with Win32 threads to + # avoid a dependency on mingw-std-threads (which we only use + # in the "all" variant). Disabling multithreading only affects + # decoding tiled HEIF images, so it should be fine. + cd '$(BUILD_DIR)' && $(SOURCE_DIR)/configure \ + $(MXE_CONFIGURE_OPTS) \ + --disable-gdk-pixbuf \ + --disable-go \ + --disable-examples \ + $(if $(WIN32_THREADS), --disable-multithreading) + + # remove -nostdlib from linker commandline options + # https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27866 + $(if $(IS_LLVM), \ + $(SED) -i '/^archive_cmds=/s/\-nostdlib//g' '$(BUILD_DIR)/libtool') $(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)' $(MAKE) -C '$(BUILD_DIR)' -j 1 install diff --git a/build/libspng.mk b/build/libspng.mk index 29c117fd..a79dc585 100644 --- a/build/libspng.mk +++ b/build/libspng.mk @@ -2,8 +2,8 @@ PKG := libspng $(PKG)_WEBSITE := https://libspng.org/ $(PKG)_DESCR := Simple, modern libpng alternative. $(PKG)_IGNORE := -$(PKG)_VERSION := 0.6.0 -$(PKG)_CHECKSUM := 81fea8d8a2e0c8aa51769605ad0e49a682e88697c6b5b60105f5c3806efaa3a3 +$(PKG)_VERSION := 0.6.1 +$(PKG)_CHECKSUM := 336856bea0216fe0ddc6cc584be5823cfd3a142e9d90d8e1635d2d2a5241f584 $(PKG)_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/$(PKG)-[0-9]*.patch))) $(PKG)_GH_CONF := randy408/libspng/tags,v $(PKG)_DEPS := cc zlib diff --git a/build/orc.mk b/build/orc.mk index 0892ef86..fe8865ea 100644 --- a/build/orc.mk +++ b/build/orc.mk @@ -2,8 +2,8 @@ PKG := orc $(PKG)_WEBSITE := https://gstreamer.freedesktop.org/modules/orc.html $(PKG)_DESCR := Library and set of tools for compiling and executing SIMD assembly language-like programs that operate on arrays of data. $(PKG)_IGNORE := -$(PKG)_VERSION := 0.4.31 -$(PKG)_CHECKSUM := a0ab5f10a6a9ae7c3a6b4218246564c3bf00d657cbdf587e6d34ec3ef0616075 +$(PKG)_VERSION := 0.4.32 +$(PKG)_CHECKSUM := a66e3d8f2b7e65178d786a01ef61f2a0a0b4d0b8370de7ce134ba73da4af18f0 $(PKG)_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/$(PKG)-[0-9]*.patch))) $(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION) $(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.xz diff --git a/build/overrides.mk b/build/overrides.mk index d6eb112c..c3539d87 100644 --- a/build/overrides.mk +++ b/build/overrides.mk @@ -35,16 +35,16 @@ gdk-pixbuf_URL := https://download.gnome.org/sources/gdk-pixbuf/$(call SHOR # upstream version is 1.5.2 # cannot use GH_CONF: # matio_GH_CONF := tbeu/matio/releases,v -matio_VERSION := 1.5.17 -matio_CHECKSUM := 5e455527d370ab297c4abe5a2ab4d599c93ac7c1a0c85d841cc5c22f8221c400 +matio_VERSION := 1.5.18 +matio_CHECKSUM := 5fad71a63a854d821cc6f4e8c84da837149dd5fb57e1e2baeffd85fa0f28fe25 matio_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/matio-[0-9]*.patch))) matio_SUBDIR := matio-$(matio_VERSION) matio_FILE := matio-$(matio_VERSION).tar.gz matio_URL := https://github.com/tbeu/matio/releases/download/v$(matio_VERSION)/$(matio_FILE) # upstream version is 7, we want ImageMagick 6 -imagemagick_VERSION := 6.9.11-29 -imagemagick_CHECKSUM := f425e31f64cb481a1416a037d88d04eb44236bef83334e55b7ad692f71c61270 +imagemagick_VERSION := 6.9.11-30 +imagemagick_CHECKSUM := 581e861341ec577daec8d0e2e5d69d8cb09b7fbda1e730169f4a0e20b348f6fe imagemagick_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/imagemagick-[0-9]*.patch))) imagemagick_GH_CONF := ImageMagick/ImageMagick6/tags @@ -54,21 +54,22 @@ x265_CHECKSUM := c2047f23a6b729e5c70280d23223cb61b57bfe4ad4e8f1471eeee2a61d14867 x265_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/x265-[0-9]*.patch))) x265_SUBDIR := x265_$(x265_VERSION) x265_FILE := x265_$(x265_VERSION).tar.gz +# https://bitbucket.org/multicoreware/x265_git/issues/553/tarball-for-34-release-not-in-x265_git x265_URL := https://bitbucket.org/multicoreware/x265/downloads/$(x265_FILE) #x265_URL_2 := https://download.videolan.org/pub/videolan/x265/$(x265_FILE) x265_URL_2 := https://ftp.osuosl.org/pub/blfs/conglomeration/x265/$(x265_FILE) # upstream version is 2.40.5 -librsvg_VERSION := 2.49.5 -librsvg_CHECKSUM := daa64941bb4732bdf51b902a72c6e04063235cfce6986d910ba0759c76917795 +librsvg_VERSION := 2.50.0 +librsvg_CHECKSUM := b3fadba240f09b9c9898ab20cb7311467243e607cf8f928b7c5f842474ee3df4 librsvg_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/librsvg-[0-9]*.patch))) librsvg_SUBDIR := librsvg-$(librsvg_VERSION) librsvg_FILE := librsvg-$(librsvg_VERSION).tar.xz librsvg_URL := https://download.gnome.org/sources/librsvg/$(call SHORT_PKG_VERSION,librsvg)/$(librsvg_FILE) # upstream version is 1.37.4 -pango_VERSION := 1.46.1 -pango_CHECKSUM := fe516b10711bbb6fd75011d66dd08fabfce18f7931aed7415136d53c4aadf1c5 +pango_VERSION := 1.46.2 +pango_CHECKSUM := d89fab5f26767261b493279b65cfb9eb0955cd44c07c5628d36094609fc51841 pango_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/pango-[0-9]*.patch))) pango_SUBDIR := pango-$(pango_VERSION) pango_FILE := pango-$(pango_VERSION).tar.xz @@ -93,8 +94,8 @@ libwebp_FILE := libwebp-$(libwebp_VERSION).tar.gz libwebp_URL := http://downloads.webmproject.org/releases/webp/$(libwebp_FILE) # upstream version is 2.50.2 -glib_VERSION := 2.65.3 -glib_CHECKSUM := efd894e4693068bca945cb20d168b088510fa24d48a577f5edaf3d55912c60c2 +glib_VERSION := 2.66.0 +glib_CHECKSUM := c5a66bf143065648c135da4c943d2ac23cce15690fc91c358013b2889111156c glib_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/glib-[0-9]*.patch))) glib_SUBDIR := glib-$(glib_VERSION) glib_FILE := glib-$(glib_VERSION).tar.xz @@ -162,13 +163,21 @@ fontconfig_FILE := fontconfig-$(fontconfig_VERSION).tar.xz fontconfig_URL := https://www.freedesktop.org/software/fontconfig/release/$(fontconfig_FILE) # upstream version is 1.8.12 -hdf5_VERSION := 1.10.6 -hdf5_CHECKSUM := 09d6301901685201bb272a73e21c98f2bf7e044765107200b01089104a47c3bd +hdf5_VERSION := 1.12.0 +hdf5_CHECKSUM := 97906268640a6e9ce0cde703d5a71c9ac3092eded729591279bf2e3ca9765f61 hdf5_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/hdf5-[0-9]*.patch))) hdf5_SUBDIR := hdf5-$(hdf5_VERSION) hdf5_FILE := hdf5-$(hdf5_VERSION).tar.bz2 hdf5_URL := https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-$(call SHORT_PKG_VERSION,hdf5)/hdf5-$(hdf5_VERSION)/src/$(hdf5_FILE) +# upstream version is 2.14.02 +nasm_VERSION := 2.15.05 +nasm_CHECKSUM := 3caf6729c1073bf96629b57cee31eeb54f4f8129b01902c73428836550b30a3f +nasm_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/nasm-[0-9]*.patch))) +nasm_SUBDIR := nasm-$(nasm_VERSION) +nasm_FILE := nasm-$(nasm_VERSION).tar.xz +nasm_URL := https://www.nasm.us/pub/nasm/releasebuilds/$(nasm_VERSION)/$(nasm_FILE) + ## Patches that we override with our own libjpeg-turbo_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/libjpeg-turbo-[0-9]*.patch))) @@ -260,8 +269,8 @@ cfitsio_DEPS := cc zlib # --with-default-win32-winnt=0x601 \ # Install the headers in $(PREFIX)/$(TARGET)/mingw since # we need to distribute the /include and /lib directories -# Note: Building with --with-default-msvcrt=ucrt breaks -# compatibility with the prebuilt Rust binaries that +# Note: Building with --with-default-msvcrt=ucrt breaks +# compatibility with the prebuilt Rust binaries that # is built in msvcrt mode. define gcc_BUILD_mingw-w64 # install mingw-w64 headers @@ -361,7 +370,6 @@ define harfbuzz_BUILD -Dintrospection=disabled \ -Ddocs=disabled \ -Dbenchmark=disabled \ - $(if $(IS_LLVM), -Dcpp_args='-Wno-incompatible-ms-struct') \ '$(SOURCE_DIR)' \ '$(BUILD_DIR)' @@ -551,7 +559,7 @@ endef # compile with the Rust toolchain define librsvg_BUILD - # Update expected Cargo SHA256 hashes for the + # Update expected Cargo SHA256 hashes for the # files we have patched in $(librsvg_PATCHES) # Note: These replacements can be removed when # the patches have been accepted upstream. @@ -599,7 +607,6 @@ define poppler_BUILD -DBUILD_QT5_TESTS=OFF \ -DBUILD_CPP_TESTS=OFF \ -DENABLE_GTK_DOC=OFF \ - $(if $(IS_LLVM), -DCMAKE_CXX_FLAGS='$(CXXFLAGS) -Wno-incompatible-ms-struct') \ $(if $(WIN32_THREADS), -DCMAKE_CXX_FLAGS='$(CXXFLAGS) -I$(PREFIX)/$(TARGET)/include/mingw-std-threads') \ '$(SOURCE_DIR)' @@ -858,12 +865,19 @@ endef define x265_BUILD cd '$(BUILD_DIR)' && mkdir -p 10bit 12bit + # Fix ARM NEON includes when building the 10/12bit libraries + # https://bitbucket.org/multicoreware/x265_git/issues/549/fail-to-build-for-aarch64-and-armhf + $(if $(IS_ARM), \ + $(foreach ARCH,aarch64 arm, \ + $(SED) -i 's/PFX(\(.*\))/x265_\1/g' '$(SOURCE_DIR)/source/common/$(ARCH)/asm-primitives.cpp';) \ + $(SED) -i 's/PFX(\(.*_neon\))/x265_\1/g' '$(SOURCE_DIR)/source/common/arm/dct8.h';) + # 12 bit cd '$(BUILD_DIR)/12bit' && $(TARGET)-cmake '$(SOURCE_DIR)/source' \ -DHIGH_BIT_DEPTH=ON \ -DEXPORT_C_API=OFF \ -DENABLE_SHARED=OFF \ - -DENABLE_ASSEMBLY=$(if $(findstring x86_64,$(TARGET)),ON,OFF) \ + -DENABLE_ASSEMBLY=$(if $(call seq,64,$(BITS)),ON,OFF) \ -DENABLE_CLI=OFF \ -DENABLE_HDR10_PLUS=ON \ -DMAIN12=ON \ @@ -877,7 +891,7 @@ define x265_BUILD -DHIGH_BIT_DEPTH=ON \ -DEXPORT_C_API=OFF \ -DENABLE_SHARED=OFF \ - -DENABLE_ASSEMBLY=$(if $(findstring x86_64,$(TARGET)),ON,OFF) \ + -DENABLE_ASSEMBLY=$(if $(call seq,64,$(BITS)),ON,OFF) \ -DENABLE_CLI=OFF \ -DENABLE_HDR10_PLUS=ON \ $(if $(IS_ARM), -DCROSS_COMPILE_ARM=ON) @@ -890,7 +904,7 @@ define x265_BUILD -DHIGH_BIT_DEPTH=OFF \ -DEXPORT_C_API=ON \ -DENABLE_SHARED=$(CMAKE_SHARED_BOOL) \ - -DENABLE_ASSEMBLY=$(if $(findstring x86_64,$(TARGET)),ON,OFF) \ + -DENABLE_ASSEMBLY=$(if $(call seq,64,$(BITS)),ON,OFF) \ -DENABLE_CLI=OFF \ -DENABLE_HDR10_PLUS=ON \ -DEXTRA_LIB='x265_main10.a;x265_main12.a' \ @@ -900,7 +914,11 @@ define x265_BUILD $(if $(IS_ARM), -DCROSS_COMPILE_ARM=ON) $(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)' install - $(if $(BUILD_SHARED),rm -f '$(PREFIX)/$(TARGET)/lib/libx265.a',\ + + $(if $(BUILD_SHARED), \ + rm -f '$(PREFIX)/$(TARGET)/lib/libx265.a' && \ + $(SED) -i 's/^\(Cflags:.* \)/\1-DX265_API_IMPORTS=1 /g' '$(PREFIX)/$(TARGET)/lib/pkgconfig/x265.pc' \ + $(else), \ $(INSTALL) '$(BUILD_DIR)/libx265_main12.a' '$(PREFIX)/$(TARGET)/lib/libx265_main12.a' && \ $(INSTALL) '$(BUILD_DIR)/libx265_main10.a' '$(PREFIX)/$(TARGET)/lib/libx265_main10.a' && \ $(SED) -i 's|-lx265|-lx265 -lx265_main10 -lx265_main12|' '$(PREFIX)/$(TARGET)/lib/pkgconfig/x265.pc') diff --git a/build/patches/glib-static.patch b/build/patches/glib-static.patch index a953baf2..511e3aa3 100644 --- a/build/patches/glib-static.patch +++ b/build/patches/glib-static.patch @@ -12,7 +12,7 @@ diff --git a/gio/giomodule.c b/gio/giomodule.c index 1111111..2222222 100644 --- a/gio/giomodule.c +++ b/gio/giomodule.c -@@ -1051,25 +1051,6 @@ extern GType _g_win32_network_monitor_get_type (void); +@@ -1056,25 +1056,6 @@ extern GType _g_win32_network_monitor_get_type (void); static HMODULE gio_dll = NULL; @@ -42,7 +42,7 @@ diff --git a/gio/meson.build b/gio/meson.build index 1111111..2222222 100644 --- a/gio/meson.build +++ b/gio/meson.build -@@ -786,7 +786,7 @@ else +@@ -779,7 +779,7 @@ else gio_dtrace_hdr = [] endif diff --git a/build/patches/hdf5-1-fixes.patch b/build/patches/hdf5-1-fixes.patch index 10caec19..ef24df7c 100644 --- a/build/patches/hdf5-1-fixes.patch +++ b/build/patches/hdf5-1-fixes.patch @@ -12,7 +12,7 @@ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1111111..2222222 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt -@@ -1025,38 +1025,61 @@ else () +@@ -1087,38 +1087,61 @@ else () endif () endif () @@ -113,15 +113,14 @@ diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacr index 1111111..2222222 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake -@@ -153,16 +153,6 @@ macro (HDF_SET_LIB_OPTIONS libtarget libname libtype) +@@ -142,15 +142,6 @@ macro (HDF_SET_LIB_OPTIONS libtarget libname libtype) ) endif () endif () - - #----- Use MSVC Naming conventions for Shared Libraries - if (MINGW AND ${libtype} MATCHES "SHARED") -- set_target_properties (${libtarget} -- PROPERTIES +- set_target_properties (${libtarget} PROPERTIES - IMPORT_SUFFIX ".lib" - IMPORT_PREFIX "" - PREFIX "" @@ -130,7 +129,7 @@ index 1111111..2222222 100644 endmacro () #------------------------------------------------------------------------------- -@@ -182,7 +172,7 @@ macro (HDF_IMPORT_SET_LIB_OPTIONS libtarget libname libtype libversion) +@@ -170,7 +161,7 @@ macro (HDF_IMPORT_SET_LIB_OPTIONS libtarget libname libtype libversion) if (WIN32) if (MINGW) set_target_properties (${libtarget} PROPERTIES @@ -143,7 +142,7 @@ diff --git a/src/H5system.c b/src/H5system.c index 1111111..2222222 100644 --- a/src/H5system.c +++ b/src/H5system.c -@@ -809,6 +809,10 @@ Wgettimeofday(struct timeval *tv, struct timezone *tz) +@@ -838,6 +838,10 @@ Wgettimeofday(struct timeval *tv, struct timezone *tz) * *------------------------------------------------------------------------- */ diff --git a/build/patches/libheif-1-fixes.patch b/build/patches/libheif-1-fixes.patch deleted file mode 100644 index b424de80..00000000 --- a/build/patches/libheif-1-fixes.patch +++ /dev/null @@ -1,306 +0,0 @@ -This file is part of MXE. See LICENSE.md for licensing information. - -Contains ad hoc patches for cross building. - -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Kleis Auke Wolthuizen -Date: Wed, 10 Jun 2020 13:50:00 +0200 -Subject: [PATCH 1/2] Ensure have_aom is exposed as a pkg-config variable - -Corresponds with the autotools build. - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 1111111..2222222 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -98,6 +98,11 @@ if (X265_FOUND) - else() - set(have_x265 no) - endif() -+if (AOM_FOUND) -+ set(have_aom yes) -+else() -+ set(have_aom no) -+endif() - set(VERSION ${PROJECT_VERSION}) - - configure_file(libheif.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libheif.pc @ONLY) - -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Kleis Auke Wolthuizen -Date: Sun, 6 Sep 2020 17:00:00 +0200 -Subject: [PATCH 2/3] Ensure we link against a shared library version of libx265 - - -diff --git a/libheif/heif_encoder_x265.cc b/libheif/heif_encoder_x265.cc -index 1111111..2222222 100644 ---- a/libheif/heif_encoder_x265.cc -+++ b/libheif/heif_encoder_x265.cc -@@ -33,6 +33,10 @@ - #include - #include - -+#if defined(_WIN32) -+#define X265_API_IMPORTS 1 -+#endif -+ - extern "C" { - #include - } - -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Kleis Auke Wolthuizen -Date: Sun, 6 Sep 2020 20:00:00 +0200 -Subject: [PATCH 3/3] Fix CMake build - - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 1111111..2222222 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -53,12 +53,12 @@ if (has_potentially_evaluated_expression) - add_definitions(-Wno-error=potentially-evaluated-expression) - endif() - --LIST (APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules") --find_package(Libde265 REQUIRED) --find_package(X265) --find_package(LibAOM) -+include(FindPkgConfig) -+pkg_check_modules(DE265 REQUIRED libde265) -+pkg_check_modules(X265 x265) -+pkg_check_modules(AOM aom) - --if (LIBDE265_FOUND) -+if (DE265_FOUND) - message("HEIF decoder, libde265: found") - else () - message("HEIF decoder, libde265: not found") -@@ -88,7 +88,7 @@ set(prefix ${CMAKE_INSTALL_PREFIX}) - set(exec_prefix ${CMAKE_INSTALL_PREFIX}) - set(libdir ${CMAKE_INSTALL_FULL_LIBDIR}) - set(includedir ${CMAKE_INSTALL_FULL_INCLUDEDIR}) --if (LIBDE265_FOUND) -+if (DE265_FOUND) - set(have_libde265 yes) - else() - set(have_libde265 no) -diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt -index 1111111..2222222 100644 ---- a/examples/CMakeLists.txt -+++ b/examples/CMakeLists.txt -@@ -13,53 +13,51 @@ set (additional_link_directories) - set (additional_libraries) - set (additional_includes) - --include (${CMAKE_ROOT}/Modules/FindJPEG.cmake) -- -+pkg_check_modules(JPEG libjpeg) - if(JPEG_FOUND) --add_definitions(-DHAVE_LIBJPEG=1) --include_directories(SYSTEM ${JPEG_INCLUDE_DIR}) -+ add_definitions(-DHAVE_LIBJPEG=1) - --include (${CMAKE_ROOT}/Modules/CheckCXXSourceCompiles.cmake) -+ include(CheckCXXSourceCompiles) - --set(CMAKE_REQUIRED_LIBRARIES ${JPEG_LIBRARIES}) -+ set(CMAKE_REQUIRED_LIBRARIES ${JPEG_LIBRARIES}) -+ set(CMAKE_REQUIRED_INCLUDES ${JPEG_INCLUDE_DIRS}) - --# while the docs say JPEG_INCLUDE_DIRS, my FindJPEG.cmake script returns it in JPEG_INCLUDE_DIR --set(CMAKE_REQUIRED_INCLUDES ${JPEG_INCLUDE_DIRS} ${JPEG_INCLUDE_DIR}) -+ check_cxx_source_compiles(" -+ #include -+ #include -+ #include - --check_cxx_source_compiles(" --#include --#include --#include -+ int main() { -+ jpeg_write_icc_profile(NULL, NULL, 0); -+ return 0; -+ } -+ " HAVE_JPEG_WRITE_ICC_PROFILE) - --int main() { -- jpeg_write_icc_profile(NULL, NULL, 0); -- return 0; --} --" HAVE_JPEG_WRITE_ICC_PROFILE) --if(HAVE_JPEG_WRITE_ICC_PROFILE) -- add_definitions(-DHAVE_JPEG_WRITE_ICC_PROFILE=1) --endif() -+ if(HAVE_JPEG_WRITE_ICC_PROFILE) -+ add_definitions(-DHAVE_JPEG_WRITE_ICC_PROFILE=1) -+ endif() - --set (heif_convert_sources -- ${heif_convert_sources} -- encoder_jpeg.cc -- encoder_jpeg.h --) --set (additional_libraries -- ${additional_libraries} -- ${JPEG_LIBRARIES} --) --set (additional_includes -- ${additional_includes} -- ${JPEG_INCLUDE_DIRS} -- ${JPEG_INCLUDE_DIR} --) -+ set (heif_convert_sources -+ ${heif_convert_sources} -+ encoder_jpeg.cc -+ encoder_jpeg.h -+ ) -+ set (additional_link_directories -+ ${additional_link_directories} -+ ${JPEG_LIBRARY_DIRS} -+ ) -+ set (additional_libraries -+ ${additional_libraries} -+ ${JPEG_LIBRARIES} -+ ) -+ set (additional_includes -+ ${additional_includes} -+ ${JPEG_INCLUDE_DIRS} -+ ) - endif() - --if(UNIX) -- include (${CMAKE_ROOT}/Modules/FindPkgConfig.cmake) -- pkg_check_modules (LIBPNG libpng) -- if(LIBPNG_FOUND) -+pkg_check_modules(PNG libpng) -+if(PNG_FOUND) - add_definitions(-DHAVE_LIBPNG=1) - set (heif_convert_sources - ${heif_convert_sources} -@@ -68,17 +66,16 @@ if(UNIX) - ) - set (additional_link_directories - ${additional_link_directories} -- ${LIBPNG_LIBRARY_DIRS} -+ ${PNG_LIBRARY_DIRS} - ) - set (additional_libraries - ${additional_libraries} -- ${LIBPNG_LINK_LIBRARIES} ${LIBPNG_LIBRARIES} -+ ${PNG_LIBRARIES} - ) - set (additional_includes - ${additional_includes} -- ${LIBPNG_INCLUDE_DIRS} -+ ${PNG_INCLUDE_DIRS} - ) -- endif() - endif() - - set (heif_info_sources -@@ -118,8 +115,11 @@ target_include_directories(heif-enc PRIVATE ${additional_includes}) - add_executable (heif-test ${heif_test_sources} ${getopt_sources}) - target_link_libraries (heif-test heif) - -+install(TARGETS heif-convert heif-info heif-enc heif-test -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -+) - --if(LIBPNG_FOUND) -+if(PNG_FOUND) - set (heif_thumbnailer_sources - encoder.cc - encoder.h -@@ -129,7 +129,11 @@ if(LIBPNG_FOUND) - ) - - add_executable (heif-thumbnailer ${heif_thumbnailer_sources}) -- target_link_directories (heif-thumbnailer PRIVATE ${LIBPNG_LIBRARY_DIRS}) -- target_link_libraries (heif-thumbnailer heif ${LIBPNG_LINK_LIBRARIES} ${LIBPNG_LIBRARIES}) -- target_include_directories(heif-thumbnailer PRIVATE ${LIBPNG_INCLUDE_DIRS}) -+ target_link_directories (heif-thumbnailer PRIVATE ${PNG_LIBRARY_DIRS}) -+ target_link_libraries (heif-thumbnailer heif ${PNG_LIBRARIES}) -+ target_include_directories(heif-thumbnailer PRIVATE ${PNG_INCLUDE_DIRS}) -+ -+ install(TARGETS heif-thumbnailer -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -+ ) - endif() -diff --git a/libheif/CMakeLists.txt b/libheif/CMakeLists.txt -index 1111111..2222222 100644 ---- a/libheif/CMakeLists.txt -+++ b/libheif/CMakeLists.txt -@@ -59,21 +59,15 @@ target_compile_definitions(heif - LIBHEIF_EXPORTS - HAVE_VISIBILITY) - --if(LIBDE265_FOUND) -+if(DE265_FOUND) - target_compile_definitions(heif PRIVATE HAVE_LIBDE265=1) - target_sources(heif - PRIVATE - heif_decoder_libde265.cc - heif_decoder_libde265.h) - -- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LIBDE265_CFLAGS}") -- -- if (NOT "${LIBDE265_LIBRARY_DIRS}" STREQUAL "") -- set(LIBDE265_LINKDIR "-L${LIBDE265_LIBRARY_DIRS}") -- endif() -- -- include_directories(SYSTEM ${LIBDE265_INCLUDE_DIR}) -- target_link_libraries(heif PRIVATE ${LIBDE265_LIBRARIES} ${LIBDE265_LINKDIR}) -+ target_include_directories(heif PRIVATE ${DE265_INCLUDE_DIRS}) -+ target_link_libraries(heif PRIVATE ${DE265_LIBRARIES}) - - install(FILES heif_decoder_libde265.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}) - endif() -@@ -85,34 +79,23 @@ if(X265_FOUND) - heif_encoder_x265.h - ) - -- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${X265_CFLAGS}") -- -- if (NOT "${X265_LIBRARY_DIRS}" STREQUAL "") -- set(X265_LINKDIR "-L${X265_LIBRARY_DIRS}") -- endif() -- -- include_directories(SYSTEM ${X265_INCLUDE_DIR}) -- target_link_libraries(heif PRIVATE ${X265_LIBRARIES} ${X265_LINKDIR}) -+ target_include_directories(heif PRIVATE ${X265_INCLUDE_DIRS}) -+ target_link_libraries(heif PRIVATE ${X265_LIBRARIES}) - - install(FILES heif_encoder_x265.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}) - endif() - - if(AOM_FOUND) -- target_compile_definitions(heif PRIVATE HAVE_AOM=1) -- target_sources(heif PRIVATE -- heif_decoder_aom.cc -- heif_decoder_aom.h -- heif_encoder_aom.cc -- heif_encoder_aom.h -- ) -- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${AOM_CFLAGS}") -- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${AOM_CFLAGS}") -- -- if (NOT "${AOM_LIBRARY_DIRS}" STREQUAL "") -- set(AOM_LINKDIR "-L${AOM_LIBRARY_DIRS}") -- endif() -- -- target_link_libraries(heif PRIVATE ${AOM_LIBRARIES} ${AOM_LINKDIR}) -+ target_compile_definitions(heif PRIVATE HAVE_AOM=1) -+ target_sources(heif PRIVATE -+ heif_decoder_aom.cc -+ heif_decoder_aom.h -+ heif_encoder_aom.cc -+ heif_encoder_aom.h -+ ) -+ -+ target_include_directories(heif PRIVATE ${AOM_INCLUDE_DIRS}) -+ target_link_libraries(heif PRIVATE ${AOM_LIBRARIES}) - endif() - - if(USE_LOCAL_RAV1E) diff --git a/build/patches/libjpeg-turbo-2-fixes.patch b/build/patches/libjpeg-turbo-2-fixes.patch index e1288869..7986021e 100644 --- a/build/patches/libjpeg-turbo-2-fixes.patch +++ b/build/patches/libjpeg-turbo-2-fixes.patch @@ -5,7 +5,7 @@ Contains ad hoc patches for cross building. From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Alexpux Date: Sun, 18 Jan 2015 16:49:05 +0300 -Subject: [PATCH 1/2] Fix compatibility with "basestd.h" header +Subject: [PATCH 1/3] Fix compatibility with "basestd.h" header Taken from: https://github.com/Alexpux/MINGW-packages/blob/master/mingw-w64-libjpeg-turbo/0001-header-compat.mingw.patch @@ -51,36 +51,45 @@ index 1111111..2222222 100644 /* Datatype used for image dimensions. The JPEG standard only supports * images up to 64K*64K due to 16-bit fields in SOF markers. Therefore +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: DRC +Date: Tue, 28 Jul 2020 18:06:20 -0500 +Subject: [PATCH 2/3] ARMv8 NEON: Support Windows builds w/AArch64 MinGW + +Based on: +https://github.com/mstorsjo/libjpeg-turbo/commit/c5ef6659285a7d5bc74c679aa87ad187186cf7e1 + +Closes #438 + +diff --git a/simd/arm64/jsimd_neon.S b/simd/arm64/jsimd_neon.S +index 1111111..2222222 100644 +--- a/simd/arm64/jsimd_neon.S ++++ b/simd/arm64/jsimd_neon.S +@@ -33,6 +33,8 @@ + + #if defined(__APPLE__) + .section __DATA, __const ++#elif defined(_WIN32) ++.section .rdata + #else + .section .rodata, "a", %progbits + #endif + From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Kleis Auke Wolthuizen Date: Sat, 15 Feb 2020 20:00:00 +0100 -Subject: [PATCH 2/2] Fixes for the llvm-mingw ARM/ARM64 build +Subject: [PATCH 3/3] Fixes for the llvm-mingw ARM build diff --git a/simd/CMakeLists.txt b/simd/CMakeLists.txt index 1111111..2222222 100644 --- a/simd/CMakeLists.txt +++ b/simd/CMakeLists.txt -@@ -212,6 +212,14 @@ elseif(CPU_TYPE STREQUAL "arm64" OR CPU_TYPE STREQUAL "arm") - - enable_language(ASM) - -+if(WIN32) -+ if(CPU_TYPE STREQUAL "arm64") -+ set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -DARM_WIN64") -+ elseif(CPU_TYPE STREQUAL "arm") -+ set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -DARM_WIN32") -+ endif() -+endif() -+ - set(CMAKE_ASM_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_ASM_FLAGS}") - - string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_UC) @@ -225,7 +233,11 @@ if(CPU_TYPE STREQUAL "arm") .fpu neon .arch armv7a .object_arch armv4 -+#ifdef ARM_WIN32 ++#ifdef _WIN32 + .thumb +#else .arm @@ -116,7 +125,7 @@ index 1111111..2222222 100644 strb \TMP, [\BUFFER, #1]! cmp \TMP, #0xff - /*it eq*/ -+#ifdef ARM_WIN32 ++#ifdef _WIN32 + IT EQ +#endif strbeq \ZERO, [\BUFFER, #1]! @@ -124,12 +133,12 @@ index 1111111..2222222 100644 .macro put_bits PUT_BUFFER, PUT_BITS, CODE, SIZE - /*lsl \PUT_BUFFER, \PUT_BUFFER, \SIZE*/ -+#ifdef ARM_WIN32 ++#ifdef _WIN32 + lsl \PUT_BUFFER, \PUT_BUFFER, \SIZE +#endif add \PUT_BITS, \SIZE - /*orr \PUT_BUFFER, \PUT_BUFFER, \CODE*/ -+#ifdef ARM_WIN32 ++#ifdef _WIN32 + orr \PUT_BUFFER, \PUT_BUFFER, \CODE +#else orr \PUT_BUFFER, \CODE, \PUT_BUFFER, lsl \SIZE @@ -137,16 +146,3 @@ index 1111111..2222222 100644 .endm .macro checkbuf15 BUFFER, PUT_BUFFER, PUT_BITS, ZERO, TMP -diff --git a/simd/arm64/jsimd_neon.S b/simd/arm64/jsimd_neon.S -index 1111111..2222222 100644 ---- a/simd/arm64/jsimd_neon.S -+++ b/simd/arm64/jsimd_neon.S -@@ -33,6 +33,8 @@ - - #if defined(__APPLE__) - .section __DATA, __const -+#elif defined(ARM_WIN64) -+.section .rodata, "a" - #else - .section .rodata, "a", %progbits - #endif diff --git a/build/patches/libspng-0.6-fixes.patch b/build/patches/libspng-0.6-fixes.patch deleted file mode 100644 index af93b202..00000000 --- a/build/patches/libspng-0.6-fixes.patch +++ /dev/null @@ -1,62 +0,0 @@ -This file is part of MXE. See LICENSE.md for licensing information. - -Contains ad hoc patches for cross building. - -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Randy -Date: Wed, 29 Jul 2020 15:31:50 +0200 -Subject: [PATCH 1/2] Ignore spec violation for tRNS chunks (fixes #118) - - -diff --git a/spng/spng.c b/spng/spng.c -index 1111111..2222222 100644 ---- a/spng/spng.c -+++ b/spng/spng.c -@@ -208,6 +208,7 @@ struct spng_ctx - unsigned streaming: 1; - - unsigned encode_only: 1; -+ unsigned strict : 1; - - /* input file contains this chunk */ - struct spng_chunk_bitfield file; -@@ -1884,7 +1885,14 @@ static int read_non_idat_chunks(spng_ctx *ctx) - } - ctx->trns.n_type3_entries = chunk.length; - } -- else return SPNG_ETRNS_COLOR_TYPE; -+ -+ /* The standard explicitly forbids tRNS chunks for grayscale alpha, -+ truecolor alpha images but libpng only emits a warning by default. */ -+ if(ctx->ihdr.color_type == 4 || ctx->ihdr.color_type == 6) -+ { -+ if(ctx->strict) return SPNG_ETRNS_COLOR_TYPE; -+ else continue; -+ } - - ctx->file.trns = 1; - ctx->stored.trns = 1; - -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Randy -Date: Fri, 14 Aug 2020 13:55:56 +0200 -Subject: [PATCH 2/2] dont check tEXt, zTXt chunk text fields in default mode - - -diff --git a/spng/spng.c b/spng/spng.c -index 1111111..2222222 100644 ---- a/spng/spng.c -+++ b/spng/spng.c -@@ -2195,7 +2195,11 @@ static int read_non_idat_chunks(spng_ctx *ctx) - language_tag_offset = keyword_len; - translated_keyword_offset = keyword_len; - -- if(check_png_text(text->text, text->text_length)) return SPNG_ETEXT; -+ if(ctx->strict && check_png_text(text->text, text->text_length)) -+ { -+ if(text->type == SPNG_ZTXT) return SPNG_EZTXT; -+ else return SPNG_ETEXT; -+ } - } - - text->language_tag = text->keyword + language_tag_offset; diff --git a/build/patches/matio-1-fixes.patch b/build/patches/matio-1-fixes.patch index 8d1cc1be..ca147b6e 100644 --- a/build/patches/matio-1-fixes.patch +++ b/build/patches/matio-1-fixes.patch @@ -12,7 +12,7 @@ diff --git a/src/matio_private.h b/src/matio_private.h index 1111111..2222222 100644 --- a/src/matio_private.h +++ b/src/matio_private.h -@@ -56,7 +56,7 @@ +@@ -63,7 +63,7 @@ * @endif */ struct _mat_t { diff --git a/build/patches/orc-0.4-fixes.patch b/build/patches/orc-0.4-fixes.patch index 613f068e..d8a79c14 100644 --- a/build/patches/orc-0.4-fixes.patch +++ b/build/patches/orc-0.4-fixes.patch @@ -5,7 +5,7 @@ Contains ad hoc patches for cross building. From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Kleis Auke Wolthuizen Date: Thu, 18 Apr 2019 16:00:00 +0200 -Subject: [PATCH 1/2] Fix symbol visibility with MinGW-w64 / static library +Subject: [PATCH 1/1] Fix symbol visibility with MinGW-w64 / static library diff --git a/meson.build b/meson.build @@ -20,7 +20,7 @@ index 1111111..2222222 100644 cc = meson.get_compiler('c') cdata = configuration_data() # config.h -@@ -32,13 +33,19 @@ if meson.version().version_compare('>= 0.46.0') +@@ -33,13 +34,19 @@ if meson.version().version_compare('>= 0.46.0') endif # Symbol visibility @@ -47,7 +47,7 @@ index 1111111..2222222 100644 endif # Passing this through the command line would be too messy cdata.set('ORC_API_EXPORT', export_define) -@@ -87,7 +94,6 @@ if cc.has_header_symbol('android/log.h', '__android_log_print') +@@ -88,7 +95,6 @@ if cc.has_header_symbol('android/log.h', '__android_log_print') liblog = [cc.find_library('log', required : true)] endif @@ -68,40 +68,3 @@ index 1111111..2222222 100644 #define ORC_API_IMPORT __declspec(dllimport) extern #else #define ORC_API_IMPORT extern - -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Kleis Auke Wolthuizen -Date: Wed, 13 May 2020 13:30:16 +0200 -Subject: [PATCH 2/2] Don't misdetect posix_memalign on windows platforms on gcc - -See https://github.com/mesonbuild/meson/issues/3672 and -https://github.com/mesonbuild/meson/issues/5628 for explanations -of cases where meson misdetects functions due to gcc builtins (that -always are available, regardless of whether the platform actually -provides them). - -diff --git a/meson.build b/meson.build -index 1111111..2222222 100644 ---- a/meson.build -+++ b/meson.build -@@ -124,7 +124,19 @@ int main() { - ''' - cdata.set('HAVE_MONOTONIC_CLOCK', cc.compiles(monotonic_test)) - cdata.set('HAVE_GETTIMEOFDAY', cc.has_function('gettimeofday')) --cdata.set('HAVE_POSIX_MEMALIGN', cc.has_function('posix_memalign', prefix : '#include ')) -+ -+# Check that posix_memalign() is usable; must use header. -+# cc.has_function() in some cases (clang, gcc 10+) assumes that if the -+# compiler provides a builtin of the same name that the function exists, while -+# it's in fact not provided by any header or library. This is true for -+# posix_memalign() on Windows using gcc as well as stpcpy() using clang -+# on Windows. Skip these checks on Windows for now to avoid false positives. -+# See https://github.com/mesonbuild/meson/pull/7116, -+# https://github.com/mesonbuild/meson/issues/3672 and -+# https://github.com/mesonbuild/meson/issues/5628. -+# FIXME: Once meson no longer returns success for posix_memalign() -+# on Windows using GCC we can remove this. -+cdata.set('HAVE_POSIX_MEMALIGN', host_os != 'windows' and cc.has_function('posix_memalign', prefix : '#include ')) - cdata.set('HAVE_MMAP', cc.has_function('mmap')) - - cdata.set('HAVE_SYS_TIME_H', cc.has_header('sys/time.h')) diff --git a/build/patches/x265-3-fixes-crlf.patch b/build/patches/x265-3-fixes-crlf.patch new file mode 100644 index 00000000..b58d314a --- /dev/null +++ b/build/patches/x265-3-fixes-crlf.patch @@ -0,0 +1,28 @@ +This file is part of MXE. See LICENSE.md for licensing information. + +Contains ad hoc patches for cross building. + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Kleis Auke Wolthuizen +Date: Sun, 27 Sep 2020 14:00:00 +0200 +Subject: [PATCH 2/2] Correctly annotate data symbols within module-definition + +Helps llvm-mingw. + +diff --git a/source/x265.def.in b/source/x265.def.in +index 1111111..2222222 100644 +--- a/source/x265.def.in ++++ b/source/x265.def.in +@@ -9,9 +9,9 @@ x265_picture_init + x265_picture_alloc + x265_picture_free + x265_param_apply_profile +-x265_max_bit_depth +-x265_version_str +-x265_build_info_str ++x265_max_bit_depth DATA ++x265_version_str DATA ++x265_build_info_str DATA + x265_encoder_headers + x265_encoder_parameters + x265_encoder_reconfig diff --git a/build/patches/x265-3-fixes.patch b/build/patches/x265-3-fixes.patch index 15ff3ec8..90e76d41 100644 --- a/build/patches/x265-3-fixes.patch +++ b/build/patches/x265-3-fixes.patch @@ -5,13 +5,22 @@ Contains ad hoc patches for cross building. From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Kleis Auke Wolthuizen Date: Fri, 12 Jun 2020 11:20:00 +0200 -Subject: [PATCH 1/1] Fixes for the llvm-mingw ARM64 build +Subject: [PATCH 1/2] Fixes for the llvm-mingw ARM/ARM64 build diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 1111111..2222222 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt +@@ -40,7 +40,7 @@ SET(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" "${CMAKE_MODULE_PATH}") + # System architecture detection + string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" SYSPROC) + set(X86_ALIASES x86 i386 i686 x86_64 amd64) +-set(ARM_ALIASES armv6l armv7l aarch64) ++set(ARM_ALIASES armv6l armv7l armv7 aarch64) + list(FIND X86_ALIASES "${SYSPROC}" X86MATCH) + list(FIND ARM_ALIASES "${SYSPROC}" ARMMATCH) + set(POWER_ALIASES ppc64 ppc64le) @@ -239,11 +239,12 @@ if(GCC) endif() endif() @@ -29,25 +38,57 @@ index 1111111..2222222 100644 message(STATUS "cross compile arm") elseif(ARM) if(ARM64) +diff --git a/source/common/aarch64/asm.S b/source/common/aarch64/asm.S +index 1111111..2222222 100644 +--- a/source/common/aarch64/asm.S ++++ b/source/common/aarch64/asm.S +@@ -32,15 +32,13 @@ + #ifdef __ELF__ + #define ELF + #else +-#define ELF @ ++#define ELF # + #endif + +-#define HAVE_AS_FUNC 1 +- + #if HAVE_AS_FUNC + #define FUNC + #else +-#define FUNC @ ++#define FUNC # + #endif + + .macro function name, export=1 diff --git a/source/common/cpu.cpp b/source/common/cpu.cpp index 1111111..2222222 100644 --- a/source/common/cpu.cpp +++ b/source/common/cpu.cpp -@@ -42,6 +42,14 @@ +@@ -42,6 +42,15 @@ #if X265_ARCH_ARM && !defined(HAVE_NEON) #include #include + +#ifdef __MINGW32__ -+// Windows does not have sigjmp_buf and siglongjmp, its -+// functionality is provided by plain jmp_buf and longjmp. ++// Windows does not have sigjmp_buf, sigsetjmp and siglongjmp its ++// functionality is provided by plain jmp_buf, setjmp and longjmp. +#define sigjmp_buf jmp_buf ++#define sigsetjmp(env, savemask) setjmp(env) +#define siglongjmp(env, val) longjmp(env, val) +#endif + static sigjmp_buf jmpbuf; static volatile sig_atomic_t canjump = 0; +@@ -325,7 +334,7 @@ uint32_t cpu_detect(bool benableavx512 ) + return cpu; + } + +-#elif X265_ARCH_ARM ++#elif ENABLE_ASSEMBLY && X265_ARCH_ARM + + extern "C" { + void PFX(cpu_neon_test)(void); diff --git a/source/dynamicHDR10/CMakeLists.txt b/source/dynamicHDR10/CMakeLists.txt index 1111111..2222222 100644 --- a/source/dynamicHDR10/CMakeLists.txt diff --git a/build/plugins/llvm-mingw/clang.mk b/build/plugins/llvm-mingw/clang.mk index 10a51531..91cf4d9e 100644 --- a/build/plugins/llvm-mingw/clang.mk +++ b/build/plugins/llvm-mingw/clang.mk @@ -3,8 +3,8 @@ PKG := clang $(PKG)_WEBSITE := https://clang.llvm.org/ $(PKG)_IGNORE := -$(PKG)_VERSION := 11.0.0-rc2 -$(PKG)_CHECKSUM := 28ddf2caf2a66d3eaea56366bc1fbeed65c58426fff4183f99cf1130bb2d3ba3 +$(PKG)_VERSION := 11.0.0-rc3 +$(PKG)_CHECKSUM := 8d7b47cca01d1bc07e8d47c0fd1ab7a6d386681631ae8667d056bd9bec269d03 $(PKG)_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/clang-[0-9]*.patch))) $(PKG)_GH_CONF := llvm/llvm-project/releases,llvmorg-,,,,.tar.xz $(PKG)_SUBDIR := $(PKG)-$(subst -,,$($(PKG)_VERSION)).src diff --git a/build/plugins/llvm-mingw/compiler-rt-builtins.mk b/build/plugins/llvm-mingw/compiler-rt-builtins.mk index 30a5c0df..6c776608 100644 --- a/build/plugins/llvm-mingw/compiler-rt-builtins.mk +++ b/build/plugins/llvm-mingw/compiler-rt-builtins.mk @@ -2,7 +2,7 @@ PKG := compiler-rt-builtins $(PKG)_WEBSITE := https://compiler-rt.llvm.org/ -$(PKG)_VERSION := 11.0.0-rc2 +$(PKG)_VERSION := 11.0.0-rc3 $(PKG)_DEPS := compiler-rt $(PKG)_TYPE := meta @@ -24,7 +24,9 @@ define $(PKG)_BUILD -DCMAKE_C_COMPILER_WORKS=TRUE \ -DCMAKE_CXX_COMPILER_WORKS=TRUE \ -DCMAKE_C_COMPILER_TARGET='$(BUILD_ARCH_NAME)-windows-gnu' \ - -DCOMPILER_RT_DEFAULT_TARGET_ONLY=TRUE + -DCOMPILER_RT_DEFAULT_TARGET_ONLY=TRUE \ + -DCOMPILER_RT_USE_BUILTINS_LIBRARY=TRUE \ + -DLLVM_CONFIG_PATH:FILEPATH='' $(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)' $(INSTALL) -d '$(PREFIX)/$(BUILD)/lib/clang/$(CLANG_VERSION)/lib/windows' diff --git a/build/plugins/llvm-mingw/compiler-rt-sanitizers.mk b/build/plugins/llvm-mingw/compiler-rt-sanitizers.mk index 9946c612..c0cfe7e9 100644 --- a/build/plugins/llvm-mingw/compiler-rt-sanitizers.mk +++ b/build/plugins/llvm-mingw/compiler-rt-sanitizers.mk @@ -2,7 +2,7 @@ PKG := compiler-rt-sanitizers $(PKG)_WEBSITE := https://compiler-rt.llvm.org/ -$(PKG)_VERSION := 11.0.0-rc2 +$(PKG)_VERSION := 11.0.0-rc3 $(PKG)_DEPS := compiler-rt $(PKG)_TYPE := meta diff --git a/build/plugins/llvm-mingw/compiler-rt.mk b/build/plugins/llvm-mingw/compiler-rt.mk index e2d4e3b3..0e573dd9 100644 --- a/build/plugins/llvm-mingw/compiler-rt.mk +++ b/build/plugins/llvm-mingw/compiler-rt.mk @@ -3,8 +3,8 @@ PKG := compiler-rt $(PKG)_WEBSITE := https://compiler-rt.llvm.org/ $(PKG)_IGNORE := -$(PKG)_VERSION := 11.0.0-rc2 -$(PKG)_CHECKSUM := 6f6f590228cd1d87c16f611490a68e8329847fbd68cc0f03a8ce75a6cc55cf61 +$(PKG)_VERSION := 11.0.0-rc3 +$(PKG)_CHECKSUM := 49d112bce22727a86f4fbb7dc05aa71651202f82cd2462957d166d480ac1284d $(PKG)_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/compiler-rt-[0-9]*.patch))) $(PKG)_GH_CONF := llvm/llvm-project/releases,llvmorg-,,,,.tar.xz $(PKG)_SUBDIR := $(PKG)-$(subst -,,$($(PKG)_VERSION)).src diff --git a/build/plugins/llvm-mingw/libcxx.mk b/build/plugins/llvm-mingw/libcxx.mk index 3616d9b2..6cf7fea1 100644 --- a/build/plugins/llvm-mingw/libcxx.mk +++ b/build/plugins/llvm-mingw/libcxx.mk @@ -3,8 +3,8 @@ PKG := libcxx $(PKG)_WEBSITE := https://libcxx.llvm.org/ $(PKG)_IGNORE := -$(PKG)_VERSION := 11.0.0-rc2 -$(PKG)_CHECKSUM := a4add18505d17e517bdd516e3a4f379d65d63fcff20bb164d89f39bae2894c29 +$(PKG)_VERSION := 11.0.0-rc3 +$(PKG)_CHECKSUM := 27a7f12aed0688a0724ca1859a7b85f43742ad5b4fd89ea64e94fd9dac799fa6 $(PKG)_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/libcxx-[0-9]*.patch))) $(PKG)_GH_CONF := llvm/llvm-project/releases,llvmorg-,,,,.tar.xz $(PKG)_SUBDIR := $(PKG)-$(subst -,,$($(PKG)_VERSION)).src diff --git a/build/plugins/llvm-mingw/libcxxabi.mk b/build/plugins/llvm-mingw/libcxxabi.mk index 50ef9a93..c6d0e94a 100644 --- a/build/plugins/llvm-mingw/libcxxabi.mk +++ b/build/plugins/llvm-mingw/libcxxabi.mk @@ -3,8 +3,8 @@ PKG := libcxxabi $(PKG)_WEBSITE := https://libcxxabi.llvm.org/ $(PKG)_IGNORE := -$(PKG)_VERSION := 11.0.0-rc2 -$(PKG)_CHECKSUM := 1d5b7a3270fbe56712a82c139ace0c2eb51352a9bf4003d47187eb11f46ff811 +$(PKG)_VERSION := 11.0.0-rc3 +$(PKG)_CHECKSUM := 2f92be064997fdb001cc4d00888ca93a1f553327b38919defa1565d1d732a606 $(PKG)_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/libcxxabi-[0-9]*.patch))) $(PKG)_GH_CONF := llvm/llvm-project/releases,llvmorg-,,,,.tar.xz $(PKG)_SUBDIR := $(PKG)-$(subst -,,$($(PKG)_VERSION)).src diff --git a/build/plugins/llvm-mingw/libunwind.mk b/build/plugins/llvm-mingw/libunwind.mk index 6d49bdf2..ab870001 100644 --- a/build/plugins/llvm-mingw/libunwind.mk +++ b/build/plugins/llvm-mingw/libunwind.mk @@ -3,8 +3,8 @@ PKG := libunwind $(PKG)_WEBSITE := https://clang.llvm.org/docs/Toolchain.html $(PKG)_IGNORE := -$(PKG)_VERSION := 11.0.0-rc2 -$(PKG)_CHECKSUM := 1e8c6d7f217a5258c0c3ba08c887cdd33ac1ed7128a104fb7f340874bd5004b2 +$(PKG)_VERSION := 11.0.0-rc3 +$(PKG)_CHECKSUM := ce81f9d0c9a075fa64dadd8b1f8037815555419b4c59f89b52e030fa9e5f40b3 $(PKG)_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/libunwind-[0-9]*.patch))) $(PKG)_GH_CONF := llvm/llvm-project/releases,llvmorg-,,,,.tar.xz $(PKG)_SUBDIR := $(PKG)-$(subst -,,$($(PKG)_VERSION)).src diff --git a/build/plugins/llvm-mingw/lld.mk b/build/plugins/llvm-mingw/lld.mk index fce3945f..7a68014c 100644 --- a/build/plugins/llvm-mingw/lld.mk +++ b/build/plugins/llvm-mingw/lld.mk @@ -3,8 +3,8 @@ PKG := lld $(PKG)_WEBSITE := https://lld.llvm.org/ $(PKG)_IGNORE := -$(PKG)_VERSION := 11.0.0-rc2 -$(PKG)_CHECKSUM := 28abba61ab3aae21b7178abf92935233a28b822e18832b00cd19e8161d2b1f53 +$(PKG)_VERSION := 11.0.0-rc3 +$(PKG)_CHECKSUM := c8950ad0c4d45d965ce91ed230ea9777c02245a1d6a7703cec7025932df2e734 $(PKG)_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/lld-[0-9]*.patch))) $(PKG)_GH_CONF := llvm/llvm-project/releases,llvmorg-,,,,.tar.xz $(PKG)_SUBDIR := $(PKG)-$(subst -,,$($(PKG)_VERSION)).src diff --git a/build/plugins/llvm-mingw/lldb.mk b/build/plugins/llvm-mingw/lldb.mk index 3b7facab..7069333f 100644 --- a/build/plugins/llvm-mingw/lldb.mk +++ b/build/plugins/llvm-mingw/lldb.mk @@ -3,8 +3,8 @@ PKG := lldb $(PKG)_WEBSITE := https://lldb.llvm.org/ $(PKG)_IGNORE := -$(PKG)_VERSION := 11.0.0-rc2 -$(PKG)_CHECKSUM := 030be3597d9b445fbdeb42fc04be6a5f4fa061cc359e3f199be376b8a7406541 +$(PKG)_VERSION := 11.0.0-rc3 +$(PKG)_CHECKSUM := 3a16bbbbdf4efc1f69835b502d493b3dfc9841c46645eb89bd982b94ed71a648 $(PKG)_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/lldb-[0-9]*.patch))) $(PKG)_GH_CONF := llvm/llvm-project/releases,llvmorg-,,,,.tar.xz $(PKG)_SUBDIR := $(PKG)-$(subst -,,$($(PKG)_VERSION)).src diff --git a/build/plugins/llvm-mingw/llvm-mingw.mk b/build/plugins/llvm-mingw/llvm-mingw.mk index c4e1f477..0bf7c278 100644 --- a/build/plugins/llvm-mingw/llvm-mingw.mk +++ b/build/plugins/llvm-mingw/llvm-mingw.mk @@ -4,9 +4,9 @@ PKG := llvm-mingw $(PKG)_WEBSITE := https://github.com/mstorsjo/llvm-mingw $(PKG)_DESCR := An LLVM/Clang/LLD based mingw-w64 toolchain $(PKG)_IGNORE := -# https://github.com/mstorsjo/llvm-mingw/tarball/41f4f3fac6e8c1e797eee5fcba5a4f0820131325 -$(PKG)_VERSION := 41f4f3f -$(PKG)_CHECKSUM := 89a88d499f272c02e069e83c0d6af65a59883b10159faa17ea36824cee00a45a +# https://github.com/mstorsjo/llvm-mingw/tarball/4176511d2448da0a5c5b23fc5609cee892d1b6b7 +$(PKG)_VERSION := 4176511 +$(PKG)_CHECKSUM := 2ca94aec76b285bd3ee59ff789eba3bed03bb4bf8104688778e5f6eb56ac094c $(PKG)_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/llvm-mingw-[0-9]*.patch))) $(PKG)_GH_CONF := mstorsjo/llvm-mingw/branches/master $(PKG)_DEPS := mingw-w64 @@ -17,8 +17,8 @@ $(PKG)_DEPS := mingw-w64 # https://github.com/mstorsjo/llvm-mingw/blob/master/build-mingw-w64.sh#L5-L6 # Install the headers in $(PREFIX)/$(TARGET)/mingw since # we need to distribute the /include and /lib directories -# Note: Building with --with-default-msvcrt=ucrt breaks -# compatibility with the prebuilt Rust binaries that +# Note: Building with --with-default-msvcrt=ucrt breaks +# compatibility with the prebuilt Rust binaries that # is built in msvcrt mode. define $(PKG)_BUILD_mingw-w64 # install the usual wrappers diff --git a/build/plugins/llvm-mingw/llvm.mk b/build/plugins/llvm-mingw/llvm.mk index 5812fdf7..1d7b8237 100644 --- a/build/plugins/llvm-mingw/llvm.mk +++ b/build/plugins/llvm-mingw/llvm.mk @@ -5,15 +5,15 @@ $(PKG)_WEBSITE := https://llvm.org/ $(PKG)_DESCR := A collection of modular and reusable compiler and toolchain technologies $(PKG)_IGNORE := # This version needs to be in-sync with the clang, lld, lldb, compiler-rt, libunwind, libcxxabi and libcxx packages -$(PKG)_VERSION := 11.0.0-rc2 -$(PKG)_CHECKSUM := 5003eb42bc301f279b11ee458b96be2970241b36d7774f00670d050baf3d2c94 +$(PKG)_VERSION := 11.0.0-rc3 +$(PKG)_CHECKSUM := 86f6261a62ea9e7fa2f410a86f292f55f36437e66c9cbc30ef56e4bb67ea31b9 $(PKG)_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/llvm-[0-9]*.patch))) $(PKG)_GH_CONF := llvm/llvm-project/releases/latest,llvmorg-,,,,.tar.xz $(PKG)_SUBDIR := $(PKG)-$(subst -,,$($(PKG)_VERSION)).src $(PKG)_FILE := $($(PKG)_SUBDIR).tar.xz # This is needed to properly override: https://github.com/mxe/mxe/blob/master/src/llvm.mk#L11 $(PKG)_URL := https://github.com/llvm/llvm-project/releases/download/llvmorg-$($(PKG)_VERSION)/$($(PKG)_FILE) -$(PKG)_DEPS := $(BUILD)~$(PKG) llvm-mingw compiler-rt-builtins libunwind libcxxabi libcxx +$(PKG)_DEPS := $(BUILD)~$(PKG) llvm-mingw compiler-rt-builtins libunwind libcxxabi libcxx $(PKG)_TARGETS := $(BUILD) $(MXE_TARGETS) $(PKG)_DEPS_$(BUILD) := cmake clang lld lldb @@ -28,8 +28,7 @@ define $(PKG)_BUILD_$(BUILD) -DCMAKE_BUILD_TYPE=Release \ -DLLVM_ENABLE_ASSERTIONS=OFF \ -DLLVM_TARGETS_TO_BUILD='ARM;AArch64;X86' \ - -DLLVM_INSTALL_TOOLCHAIN_ONLY=ON \ - -DLLVM_TOOLCHAIN_TOOLS='llvm-ar;llvm-ranlib;llvm-objdump;llvm-rc;llvm-cvtres;llvm-nm;llvm-strings;llvm-readobj;llvm-dlltool;llvm-pdbutil;llvm-objcopy;llvm-strip;llvm-cov;llvm-profdata;llvm-addr2line;llvm-symbolizer' \ + -DLLVM_TOOLCHAIN_TOOLS='llvm-ar;llvm-config;llvm-ranlib;llvm-objdump;llvm-rc;llvm-cvtres;llvm-nm;llvm-strings;llvm-readobj;llvm-dlltool;llvm-pdbutil;llvm-objcopy;llvm-strip;llvm-cov;llvm-profdata;llvm-addr2line;llvm-symbolizer' \ -DLLVM_EXTERNAL_CLANG_SOURCE_DIR='$(BUILD_DIR)/$(clang_SUBDIR)' \ -DLLVM_EXTERNAL_LLD_SOURCE_DIR='$(BUILD_DIR)/$(lld_SUBDIR)' \ -DLLVM_EXTERNAL_LLDB_SOURCE_DIR='$(BUILD_DIR)/$(lldb_SUBDIR)' \ @@ -55,7 +54,7 @@ define $(PKG)_BUILD_$(BUILD) $(MAKE) -C '$(BUILD_DIR)' -j 1 install/strip endef -# llvm requires being built in a monorepo layout with +# llvm requires being built in a monorepo layout with # libunwind, libcxxabi and libcxx available define $(PKG)_PRE_CONFIGURE $(call PREPARE_PKG_SOURCE,libunwind,$(BUILD_DIR)) diff --git a/build/plugins/llvm-mingw/overrides.mk b/build/plugins/llvm-mingw/overrides.mk index ffe0d705..90590ffc 100644 --- a/build/plugins/llvm-mingw/overrides.mk +++ b/build/plugins/llvm-mingw/overrides.mk @@ -15,16 +15,16 @@ rust_BUILD_armv7-w64-mingw32 = gcc_BUILD_aarch64-w64-mingw32 = gcc_BUILD_armv7-w64-mingw32 = -# Update MinGW-w64 to a25dc93 -# https://github.com/mirror/mingw-w64/tarball/a25dc933f3d3ed6c8529fb24b7ae393f8792ca69 -mingw-w64_VERSION := a25dc93 -mingw-w64_CHECKSUM := cd3ebd8b2644e06453c538d8cf7f22b0329c259a934efce6ddd489c48a8acd64 +# Update MinGW-w64 to 8.0.0 +mingw-w64_VERSION := 8.0.0 +mingw-w64_CHECKSUM := 44c740ea6ab3924bc3aa169bad11ad3c5766c5c8459e3126d44eabb8735a5762 mingw-w64_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/mingw-w64-[0-9]*.patch))) -mingw-w64_SUBDIR := mirror-mingw-w64-$(mingw-w64_VERSION) -mingw-w64_FILE := mirror-mingw-w64-$(mingw-w64_VERSION).tar.gz -mingw-w64_URL := https://github.com/mirror/mingw-w64/tarball/$(mingw-w64_VERSION)/$($(PKG)_FILE) +mingw-w64_SUBDIR := mingw-w64-v$(mingw-w64_VERSION) +mingw-w64_FILE := mingw-w64-v$(mingw-w64_VERSION).tar.bz2 +mingw-w64_URL := https://$(SOURCEFORGE_MIRROR)/project/mingw-w64/mingw-w64/mingw-w64-release/$(mingw-w64_FILE) -# Do not build pthreads +# libc++ uses Win32 threads to implement the internal +# threading API, so we do not need to build pthreads. define pthreads_BUILD $(info $(PKG) is not built when the llvm-mingw plugin is used) endef diff --git a/build/plugins/llvm-mingw/test-llvm-mingw.mk b/build/plugins/llvm-mingw/test-llvm-mingw.mk index c8fdb2c7..8010dc79 100644 --- a/build/plugins/llvm-mingw/test-llvm-mingw.mk +++ b/build/plugins/llvm-mingw/test-llvm-mingw.mk @@ -12,7 +12,7 @@ $(PKG)_TESTS_C_DLL := autoimport-lib $(PKG)_TESTS_C_LINK_DLL := autoimport-main $(PKG)_TESTS_C_NO_BUILTIN := crt-test $(PKG)_TESTS_C_ANSI_STDIO := crt-test -$(PKG)_TESTS_CPP := hello-cpp +$(PKG)_TESTS_CPP := hello-cpp global-terminate $(PKG)_TESTS_CPP_LOAD_DLL := tlstest-main $(PKG)_TESTS_CPP_EXCEPTIONS := hello-exception exception-locale exception-reduced $(PKG)_TESTS_CPP_DLL := tlstest-lib diff --git a/build/plugins/mozjpeg/mozjpeg.mk b/build/plugins/mozjpeg/mozjpeg.mk index 79aa5032..044b4712 100644 --- a/build/plugins/mozjpeg/mozjpeg.mk +++ b/build/plugins/mozjpeg/mozjpeg.mk @@ -10,7 +10,7 @@ $(PKG)_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST $(PKG)_GH_CONF := mozilla/mozjpeg/branches/master $(PKG)_DEPS := cc $(BUILD)~nasm -# WITH_TURBOJPEG=OFF turns off a library we don't use (we just use the +# WITH_TURBOJPEG=OFF turns off a library we don't use (we just use the # libjpeg API) define $(PKG)_BUILD cd '$(BUILD_DIR)' && $(TARGET)-cmake \ diff --git a/build/plugins/mozjpeg/overrides.mk b/build/plugins/mozjpeg/overrides.mk index 80167d6a..4e3e6fd2 100644 --- a/build/plugins/mozjpeg/overrides.mk +++ b/build/plugins/mozjpeg/overrides.mk @@ -1,8 +1,6 @@ $(PLUGIN_HEADER) -# Override libjpeg-turbo version for the versions.json file -# TODO: Wait for https://github.com/mozilla/mozjpeg/issues/321 -libjpeg-turbo_VERSION := 4.0.0-git +IS_MOZJPEG := $(true) # Override sub-dependencies gdk-pixbuf_DEPS := $(subst libjpeg-turbo,mozjpeg,$(gdk-pixbuf_DEPS)) diff --git a/build/rust.mk b/build/rust.mk index 3d9780d1..a8996299 100644 --- a/build/rust.mk +++ b/build/rust.mk @@ -17,7 +17,7 @@ define $(PKG)_BUILD cd '$(BUILD_DIR)' && $(SOURCE_DIR)/install.sh \ --prefix='$(PREFIX)/$(TARGET)' \ --components='rustc,cargo,rust-std-x86_64-unknown-linux-gnu,rust-std-$(PROCESSOR)-pc-windows-gnu' - + # install prefixed wrappers $(INSTALL) -d '$(PREFIX)/$(TARGET)/.cargo' (echo '#!/usr/bin/env bash'; \ diff --git a/build/settings/llvm.mk b/build/settings/llvm.mk index 50cad408..6b8b6fd0 100644 --- a/build/settings/llvm.mk +++ b/build/settings/llvm.mk @@ -13,8 +13,8 @@ # (see: https://github.com/mstorsjo/llvm-mingw/blob/master/README.md#pdb-support) # Special flags for compiler. -export CFLAGS := -s -O3 -export CXXFLAGS := -s -O3 +export CFLAGS := -O3 +export CXXFLAGS := -O3 export LDFLAGS := -Wl,-s # Special flags for Rust. diff --git a/build/vips-all.mk b/build/vips-all.mk index dcbd7670..9efb82eb 100644 --- a/build/vips-all.mk +++ b/build/vips-all.mk @@ -37,9 +37,10 @@ define $(PKG)_PRE_CONFIGURE printf ' "hdf5": "$(hdf5_VERSION)",\n'; \ printf ' "heif": "$(libheif_VERSION)",\n'; \ printf ' "imagemagick": "$(imagemagick_VERSION)",\n'; \ - printf ' "jpeg": "$(libjpeg-turbo_VERSION)",\n'; \ + $(if $(IS_MOZJPEG),,printf ' "jpeg": "$(libjpeg-turbo_VERSION)"$(comma)\n';) \ printf ' "lcms": "$(lcms_VERSION)",\n'; \ printf ' "matio": "$(matio_VERSION)",\n'; \ + $(if $(IS_MOZJPEG),printf ' "mozjpeg": "$(mozjpeg_VERSION)"$(comma)\n';) \ printf ' "nifti": "$(nifticlib_VERSION)",\n'; \ printf ' "openexr": "$(openexr_VERSION)",\n'; \ printf ' "openjpeg": "$(openjpeg_VERSION)",\n'; \ @@ -71,8 +72,7 @@ define $(PKG)_BUILD --without-pdfium \ --without-imagequant \ --disable-introspection \ - --disable-deprecated \ - $(if $(IS_LLVM), CXXFLAGS="$(CXXFLAGS) -Wno-incompatible-ms-struct") + --disable-deprecated # remove -nostdlib from linker commandline options # https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27866 diff --git a/build/vips-web.mk b/build/vips-web.mk index db099bf7..cf37260c 100644 --- a/build/vips-web.mk +++ b/build/vips-web.mk @@ -29,8 +29,9 @@ define $(PKG)_PRE_CONFIGURE printf ' "glib": "$(glib_VERSION)",\n'; \ printf ' "gsf": "$(libgsf_VERSION)",\n'; \ printf ' "harfbuzz": "$(harfbuzz_VERSION)",\n'; \ - printf ' "jpeg": "$(libjpeg-turbo_VERSION)",\n'; \ + $(if $(IS_MOZJPEG),,printf ' "jpeg": "$(libjpeg-turbo_VERSION)"$(comma)\n';) \ printf ' "lcms": "$(lcms_VERSION)",\n'; \ + $(if $(IS_MOZJPEG),printf ' "mozjpeg": "$(mozjpeg_VERSION)"$(comma)\n';) \ printf ' "orc": "$(orc_VERSION)",\n'; \ printf ' "pango": "$(pango_VERSION)",\n'; \ printf ' "pixman": "$(pixman_VERSION)",\n'; \ @@ -75,7 +76,6 @@ define $(PKG)_BUILD --without-imagequant \ --disable-introspection \ --disable-deprecated \ - $(if $(IS_LLVM), CXXFLAGS="$(CXXFLAGS) -Wno-incompatible-ms-struct") \ $(if $(BUILD_STATIC), lt_cv_deplibs_check_method="pass_all") # libtool should automatically generate a list diff --git a/container/Dockerfile b/container/Dockerfile index d169668a..0bf90520 100644 --- a/container/Dockerfile +++ b/container/Dockerfile @@ -3,7 +3,7 @@ FROM buildpack-deps:buster RUN apt-get update \ && apt-get install -y \ # http://mxe.cc/#requirements-debian - autopoint bison flex gettext gperf intltool \ + autopoint bison flex gettext gperf intltool \ libtool-bin libxml-parser-perl lzip p7zip-full \ ruby g++-multilib libc6-dev-i386 \ # needed when building libvips from git