├── .gitattributes ├── .github └── workflows │ └── oci-publish.yml ├── .gitignore ├── README.md ├── TODO.md ├── build.sh ├── build ├── aom.mk ├── cgif.mk ├── highway.mk ├── imath.mk ├── libdicom.mk ├── libheif.mk ├── libimagequant.mk ├── libjxl.mk ├── libspng.mk ├── nifticlib.mk ├── nip4.mk ├── openslide.mk ├── overrides.mk ├── patches │ ├── aom-3-fixes.patch │ ├── cairo-1-fixes.patch │ ├── cairo-1-nanoserver-compat.patch │ ├── fftw-3-fixes.patch │ ├── fontconfig-2-fixes.patch │ ├── freetype-2-fixes.patch │ ├── gdk-pixbuf-2-fixes.patch │ ├── glib-2-dllexport-static.patch │ ├── glib-2-fixes.patch │ ├── glib-2-without-gregex.patch │ ├── glib-2-without-win32appinfo.patch │ ├── glib-static.patch │ ├── imagemagick-6-disable-network.patch │ ├── imath-3-fixes.patch │ ├── libheif-1-fixes.patch │ ├── libjpeg-turbo-2-fixes.patch │ ├── librsvg-2-fixes.patch │ ├── matio-1-fixes.patch │ ├── nifticlib-3-fixes.patch │ ├── openexr-2-fixes.patch │ ├── poppler-24-fixes.patch │ ├── sqlite-3-fixes.patch │ ├── vips-8-dlldir-as-libdir.patch │ ├── vips-8-heifsave-disable-hbr-support.patch │ └── zlib-1-fixes.patch ├── plugins │ ├── gtk4 │ │ ├── graphene.mk │ │ ├── gtk4.mk │ │ ├── overrides.mk │ │ └── patches │ │ │ └── gtk-4-fixes.patch │ ├── hevc │ │ ├── libde265.mk │ │ ├── overrides.mk │ │ ├── patches │ │ │ ├── libde265-1-fixes.patch │ │ │ └── x265-3-fixes-crlf.patch │ │ └── x265.mk │ ├── jpegli │ │ ├── jpegli.mk │ │ ├── overrides.mk │ │ └── patches │ │ │ └── jpegli-0.11-fixes.patch │ ├── mozjpeg │ │ ├── mozjpeg.mk │ │ ├── overrides.mk │ │ └── patches │ │ │ └── mozjpeg-4-fixes.patch │ ├── nightly │ │ └── overrides.mk │ ├── proxy-libintl │ │ ├── overrides.mk │ │ ├── patches │ │ │ └── proxy-libintl-1-fixes.patch │ │ └── proxy-libintl.mk │ └── zlib-ng │ │ ├── overrides.mk │ │ ├── patches │ │ └── zlib-ng-2-fixes.patch │ │ └── zlib-ng.mk ├── settings │ ├── debug.mk │ └── release.mk ├── vips-all.mk ├── vips-web.mk └── vipsdisp.mk ├── container ├── Dockerfile └── base.Dockerfile └── packaging ├── gendeflibs.sh ├── package-gtk.sh ├── package-vips.sh ├── package.sh └── variables.sh /.gitattributes: -------------------------------------------------------------------------------- 1 | *crlf.patch -text 2 | -------------------------------------------------------------------------------- /.github/workflows/oci-publish.yml: -------------------------------------------------------------------------------- 1 | name: Publish OCI image to ghcr.io 2 | 3 | on: workflow_dispatch 4 | 5 | permissions: {} 6 | 7 | jobs: 8 | publish: 9 | runs-on: ubuntu-24.04 10 | permissions: 11 | contents: read 12 | packages: write 13 | 14 | steps: 15 | - name: Checkout repository 16 | uses: actions/checkout@v4 17 | 18 | - name: OCI metadata 19 | id: meta 20 | uses: docker/metadata-action@v5 21 | with: 22 | images: ghcr.io/${{ github.repository }} 23 | tags: | 24 | # Add short SHA as OCI tag 25 | type=sha 26 | # Set latest tag for default branch 27 | type=raw,value=latest,enable={{is_default_branch}} 28 | # Overwrite some generated OCI labels 29 | labels: | 30 | org.opencontainers.image.authors=libvips team and contributors 31 | org.opencontainers.image.url=https://libvips.org 32 | org.opencontainers.image.documentation=https://github.com/${{ github.repository }} 33 | org.opencontainers.image.source=https://github.com/${{ github.repository }} 34 | org.opencontainers.image.vendor=libvips 35 | org.opencontainers.image.title=OCI image for ${{ github.repository }} 36 | org.opencontainers.image.description=OCI image for cross-compiling Windows binaries 37 | 38 | - name: Login to GitHub Container Registry 39 | if: github.event_name != 'pull_request' 40 | uses: docker/login-action@v3 41 | with: 42 | registry: ghcr.io 43 | username: ${{ github.actor }} 44 | password: ${{ secrets.GITHUB_TOKEN }} 45 | 46 | - name: Build and push 47 | uses: docker/build-push-action@v6 48 | with: 49 | context: . 50 | file: ./container/base.Dockerfile 51 | push: ${{ github.event_name != 'pull_request' }} 52 | tags: ${{ steps.meta.outputs.tags }} 53 | labels: ${{ steps.meta.outputs.labels }} 54 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Build output 2 | *.zip 3 | 4 | # VIM swap files 5 | .*.swp 6 | 7 | # Wine 8 | .update-timestamp 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # build-win64-mxe 2 | 3 | libvips and its dependencies cross-compiled for all supported Windows architectures (`x86_64`, 4 | `i686` and `aarch64`). 5 | 6 | Uses [MXE](https://github.com/mxe/mxe) as base environment. A custom plugin based upon the 7 | [llvm-mingw](https://github.com/mstorsjo/llvm-mingw) repository is used to swap GCC and binutils 8 | with Clang and other LLVM-based tools. 9 | 10 | ## Creating a zipball 11 | 12 | Most people will not need to do this; proceed with caution. 13 | 14 | Run the top-level [build script](build.sh) with the `--help` parameter for help. 15 | 16 | ## libvips-web dependencies 17 | 18 | | Dependency | Version | Used under the terms of | 19 | |-----------------|-----------|--------------------------------------------------------------| 20 | | [aom] | 3.12.1 | BSD 2-Clause + [Alliance for Open Media Patent License 1.0] | 21 | | [cairo] | 1.18.4 | Mozilla Public License 2.0 | 22 | | [cgif] | 0.5.0 | MIT Licence | 23 | | [expat] | 2.7.1 | MIT Licence | 24 | | [fontconfig] | 2.16.2 | [fontconfig Licence] (BSD-like) | 25 | | [freetype] | 2.13.3 | [freetype Licence] (BSD-like) | 26 | | [fribidi] | 1.0.16 | LGPLv3 | 27 | | [glib] | 2.85.0 | LGPLv3 | 28 | | [harfbuzz] | 11.2.1 | MIT Licence | 29 | | [highway] | 1.2.0 | Apache-2.0 License, BSD 3-Clause | 30 | | [lcms] | 2.17 | MIT Licence | 31 | | [libarchive] | 3.8.1 | BSD 2-Clause | 32 | | [libexif] | 0.6.25 | LGPLv3 | 33 | | [libffi] | 3.4.8 | MIT Licence | 34 | | [libheif] | 1.19.8 | LGPLv3 | 35 | | [libimagequant] | 2.4.1¹ | BSD 2-Clause | 36 | | [libpng] | 1.6.48 | [libpng License version 2] | 37 | | [librsvg] | 2.60.0 | LGPLv3 | 38 | | [libspng] | 0.7.4 | BSD 2-Clause | 39 | | [libtiff] | 4.7.0 | [libtiff License] (BSD-like) | 40 | | [libvips] | 8.17.0 | LGPLv3 | 41 | | [libwebp] | 1.5.0 | New BSD License | 42 | | [libxml2] | 2.14.3 | MIT Licence | 43 | | [mozjpeg] | 4.1.5 | [zlib License, IJG License, BSD-3-Clause] | 44 | | [pango] | 1.56.3 | LGPLv3 | 45 | | [pixman] | 0.46.0 | MIT Licence | 46 | | [proxy-libintl] | 0.4 | LGPLv3 | 47 | | [zlib-ng] | 2.2.4 | [zlib-ng Licence] | 48 | 49 | ¹ [A fork](https://github.com/lovell/libimagequant) of the BSD 2-Clause licensed libimagequant v2.4.1 is used. 50 | 51 | [aom]: https://aomedia.googlesource.com/aom/ 52 | [Alliance for Open Media Patent License 1.0]: https://aomedia.org/license/patent-license/ 53 | [cairo]: https://gitlab.freedesktop.org/cairo/cairo 54 | [cgif]: https://github.com/dloebl/cgif 55 | [expat]: https://github.com/libexpat/libexpat 56 | [fontconfig]: https://gitlab.freedesktop.org/fontconfig/fontconfig 57 | [fontconfig Licence]: https://gitlab.freedesktop.org/fontconfig/fontconfig/blob/main/COPYING 58 | [freetype]: https://gitlab.freedesktop.org/freetype/freetype 59 | [freetype Licence]: https://gitlab.freedesktop.org/freetype/freetype/blob/master/docs/FTL.TXT 60 | [fribidi]: https://github.com/fribidi/fribidi 61 | [glib]: https://gitlab.gnome.org/GNOME/glib 62 | [harfbuzz]: https://github.com/harfbuzz/harfbuzz 63 | [highway]: https://github.com/google/highway 64 | [lcms]: https://github.com/mm2/Little-CMS 65 | [libarchive]: https://github.com/libarchive/libarchive 66 | [libexif]: https://github.com/libexif/libexif 67 | [libffi]: https://github.com/libffi/libffi 68 | [libheif]: https://github.com/strukturag/libheif 69 | [libimagequant]: https://github.com/lovell/libimagequant 70 | [libpng]: https://github.com/pnggroup/libpng 71 | [libpng License version 2]: https://github.com/pnggroup/libpng/blob/master/LICENSE 72 | [librsvg]: https://gitlab.gnome.org/GNOME/librsvg 73 | [libspng]: https://github.com/randy408/libspng 74 | [libtiff]: https://gitlab.com/libtiff/libtiff 75 | [libtiff License]: https://gitlab.com/libtiff/libtiff/blob/master/LICENSE.md 76 | [libvips]: https://github.com/libvips/libvips 77 | [libwebp]: https://github.com/webmproject/libwebp 78 | [libxml2]: https://gitlab.gnome.org/GNOME/libxml2 79 | [mozjpeg]: https://github.com/mozilla/mozjpeg 80 | [zlib License, IJG License, BSD-3-Clause]: https://github.com/mozilla/mozjpeg/blob/master/LICENSE.md 81 | [pango]: https://gitlab.gnome.org/GNOME/pango 82 | [pixman]: https://gitlab.freedesktop.org/pixman/pixman 83 | [proxy-libintl]: https://github.com/frida/proxy-libintl 84 | [zlib-ng]: https://github.com/zlib-ng/zlib-ng 85 | [zlib-ng Licence]: https://github.com/zlib-ng/zlib-ng/blob/develop/LICENSE.md 86 | 87 | ## libvips-all dependencies 88 | 89 | Same as libvips-web + these extra dependencies: 90 | 91 | | Dependency | Version | Used under the terms of | 92 | |-----------------|-----------|--------------------------------------------------------------| 93 | | [brotli] | 1.1.0 | MIT Licence | 94 | | [cfitsio] | 4.6.2 | BSD-like | 95 | | [fftw] | 3.3.10 | GPLv2 | 96 | | [gdk-pixbuf] | 2.42.12 | LGPLv3 | 97 | | [imagemagick] | 6.9.13-25 | [ImageMagick License] (Apache-2.0-like) | 98 | | [imath] | 3.1.9 | BSD 3-Clause | 99 | | [libdicom] | 1.2.0 | MIT Licence | 100 | | [libjxl] | 0.11.1 | BSD 3-Clause | 101 | | [matio] | 1.5.28 | BSD 2-Clause | 102 | | [nifticlib] | 3.0.1 | Public domain | 103 | | [openexr] | 3.1.11 | BSD 3-Clause | 104 | | [openjpeg] | 2.5.3 | BSD 2-Clause | 105 | | [openslide] | 4.0.0 | LGPLv3 | 106 | | [poppler] | 25.06.0 | GPLv2 | 107 | | [sqlite] | 3.49.2 | Public domain | 108 | 109 | [brotli]: https://github.com/google/brotli 110 | [cfitsio]: https://github.com/HEASARC/cfitsio 111 | [fftw]: https://github.com/FFTW/fftw3 112 | [gdk-pixbuf]: https://gitlab.gnome.org/GNOME/gdk-pixbuf 113 | [imagemagick]: https://github.com/ImageMagick/ImageMagick6 114 | [ImageMagick License]: https://github.com/ImageMagick/ImageMagick6/blob/main/LICENSE 115 | [imath]: https://github.com/AcademySoftwareFoundation/Imath 116 | [libdicom]: https://github.com/ImagingDataCommons/libdicom 117 | [libjxl]: https://github.com/libjxl/libjxl 118 | [matio]: https://github.com/tbeu/matio 119 | [nifticlib]: https://github.com/NIFTI-Imaging/nifti_clib 120 | [openexr]: https://github.com/AcademySoftwareFoundation/openexr 121 | [openjpeg]: https://github.com/uclouvain/openjpeg 122 | [openslide]: https://github.com/openslide/openslide 123 | [poppler]: https://gitlab.freedesktop.org/poppler/poppler 124 | [sqlite]: https://sqlite.org/ 125 | 126 | ## libjpeg-turbo 127 | 128 | libvips does not use any of MozJPEG's improvements by default unless explicitly set, 129 | yet one can still choose to build the above variants with [libjpeg-turbo] instead of 130 | [MozJPEG][mozjpeg]. This can be accomplished with the `--with-jpeg-turbo` argument. 131 | For example: 132 | 133 | ```bash 134 | ./build.sh --with-jpeg-turbo 135 | ``` 136 | 137 | In that case, the following version of libjpeg-turbo is built: 138 | 139 | | Dependency | Version | Used under the terms of | 140 | |-----------------|-----------|--------------------------------------------------------------| 141 | | [libjpeg-turbo] | 3.1.0 | [zlib License, IJG License] | 142 | 143 | [libjpeg-turbo]: https://github.com/libjpeg-turbo/libjpeg-turbo 144 | [zlib License, IJG License]: https://github.com/libjpeg-turbo/libjpeg-turbo/blob/main/LICENSE.md 145 | 146 | ## jpegli 147 | 148 | [jpegli] is an improved JPEG encoder and decoder implementation, fully compatible with 149 | the API/ABI of libjpeg62. It leverages many of the insights from related projects like 150 | [guetzli](https://github.com/google/guetzli), [butteraugli]( 151 | https://github.com/google/butteraugli), and [JPEG XL][libjxl] to achieve a higher 152 | quality-per-byte for JPEG images. To enable this, use the `--with-jpegli` argument when 153 | building. For example: 154 | 155 | ```bash 156 | ./build.sh --with-jpegli 157 | ``` 158 | 159 | In that case, the following version of jpegli is built: 160 | 161 | | Dependency | Version | Used under the terms of | 162 | |-----------------|-----------|--------------------------------------------------------------| 163 | | [jpegli] | [5126d62] | BSD 3-Clause | 164 | 165 | [5126d62]: https://github.com/google/jpegli/commit/5126d62d24d368f0ceadd53454653edeb9086386 166 | 167 | [jpegli]: https://github.com/google/jpegli 168 | 169 | ## zlib 170 | 171 | By default [zlib-ng] is built. This is a zlib replacement with optimizations for 172 | "next generation" systems. You can use the `--without-zlib-ng` argument during the 173 | build when (vanilla-)[zlib] is preferred. For example: 174 | 175 | ```bash 176 | ./build.sh --without-zlib-ng 177 | ``` 178 | 179 | In that case, the following version of zlib is built: 180 | 181 | | Dependency | Version | Used under the terms of | 182 | |-----------------|-----------|--------------------------------------------------------------| 183 | | [zlib] | 1.3.1 | [zlib Licence] | 184 | 185 | [zlib]: https://github.com/madler/zlib 186 | [zlib Licence]: https://github.com/madler/zlib/blob/develop/LICENSE 187 | 188 | ## HEVC-related dependencies 189 | 190 | The above variants can optionally be built with [libde265] and [x265] to process 191 | HEIC images. This can be turned on with the `--with-hevc` argument. For example: 192 | 193 | ```bash 194 | ./build.sh --with-hevc 195 | ``` 196 | 197 | These dependencies include HEVC-related logic and are therefore not included in the 198 | prebuilt binaries while it is patent-encumbered. 199 | 200 | | Dependency | Version | Used under the terms of | 201 | |-----------------|-----------|--------------------------------------------------------------| 202 | | [libde265] | 1.0.16 | LGPLv3 | 203 | | [x265] | 4.1 | GPLv2 | 204 | 205 | [libde265]: https://github.com/strukturag/libde265 206 | [x265]: https://bitbucket.org/multicoreware/x265_git/wiki/Home 207 | -------------------------------------------------------------------------------- /TODO.md: -------------------------------------------------------------------------------- 1 | ## TODO 2 | - [ ] Add CI that builds libvips with pre-compiled dependencies. 3 | - [ ] Incorporate all new dependencies and patches into [MXE](https://github.com/mxe/mxe). 4 | - [ ] Should we also add vips-web? 5 | - [ ] Incorporate the llvm-mingw toolchain plugin into MXE (see [mxe/mxe#2330](https://github.com/mxe/mxe/issues/2330)). 6 | -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # exit on error 4 | set -e 5 | 6 | function usage() 7 | { 8 | cat < The binary target (this can be specified multiple times) 15 | -c, --commit The commit to build libvips from 16 | -r, --ref The branch or tag to build libvips from 17 | --nightly Build libvips from tip-of-tree (alias of -r master) 18 | --with-ffi-compat Ensure compatibility with the FFI-bindings when building static binaries 19 | --with-hevc Build libheif with the HEVC-related dependencies 20 | --with-debug Build binaries without optimizations to improve debuggability 21 | --with-jpegli Build binaries with jpegli instead of mozjpeg 22 | --with-jpeg-turbo Build binaries with libjpeg-turbo instead of mozjpeg 23 | --without-prebuilt Avoid using a prebuilt OCI image from GitHub Container Registry 24 | --without-zlib-ng Build binaries with vanilla zlib 25 | 26 | PKGS: 27 | The packages and their dependencies to build, 28 | defaults to 'vips-web' 29 | 30 | TARGET: 31 | The binary target, 32 | defaults to building for all possible targets 33 | Possible values are: 34 | - x86_64-w64-mingw32.shared 35 | - x86_64-w64-mingw32.static 36 | - i686-w64-mingw32.shared 37 | - i686-w64-mingw32.static 38 | - aarch64-w64-mingw32.shared 39 | - aarch64-w64-mingw32.static 40 | EOF 41 | 42 | if [ -n "$1" ]; then 43 | exit "$1" 44 | fi 45 | } 46 | 47 | # Default arguments 48 | mxe_targets=() 49 | git_commit="" 50 | git_ref="" 51 | jpeg_impl="mozjpeg" 52 | with_ffi_compat=false 53 | with_hevc=false 54 | with_debug=false 55 | with_prebuilt=true 56 | with_zlib_ng=true 57 | 58 | # Parse arguments 59 | POSITIONAL=() 60 | 61 | while [ $# -gt 0 ]; do 62 | case $1 in 63 | -h|--help) usage 0 ;; 64 | -t|--target) mxe_targets+=("$2"); shift ;; 65 | -c|--commit) git_commit="$2"; shift ;; 66 | -r|--ref) git_ref="$2"; shift ;; 67 | --nightly) git_ref="master" ;; 68 | --with-ffi-compat) with_ffi_compat=true ;; 69 | --with-hevc) with_hevc=true ;; 70 | --with-debug) with_debug=true ;; 71 | --with-jpegli) jpeg_impl="jpegli" ;; 72 | --with-jpeg-turbo) jpeg_impl="libjpeg-turbo" ;; 73 | --without-mozjpeg) jpeg_impl="libjpeg-turbo" ;; # For compat 74 | --without-prebuilt) with_prebuilt=false ;; 75 | --without-zlib-ng) with_zlib_ng=false ;; 76 | -*) 77 | echo "ERROR: Unknown option $1" >&2 78 | usage 1 79 | ;; 80 | *) POSITIONAL+=("$1") ;; 81 | esac 82 | shift 83 | done 84 | 85 | # Restore positional parameters 86 | set -- "${POSITIONAL[@]}" 87 | 88 | pkgs=("$@") 89 | 90 | if [ ${#pkgs[@]} -eq 0 ]; then 91 | pkgs=(vips-web) 92 | fi 93 | 94 | # Note: GTK apps depends on vips-all 95 | { [[ ${pkgs[*]} =~ "nip4" ]] || [[ ${pkgs[*]} =~ "vipsdisp" ]]; } && build_gtk=true || build_gtk=false 96 | [[ ${pkgs[*]} =~ "vips-all" ]] && build_all_variant=true || build_all_variant=$build_gtk 97 | [[ ${pkgs[*]} =~ "vips-web" ]] && build_web_variant=true || build_web_variant=false 98 | [ "$with_hevc" = true ] && contains_gpl_libs=true || contains_gpl_libs=$build_all_variant 99 | 100 | if [ ${#mxe_targets[@]} -eq 0 ]; then 101 | if [ "$contains_gpl_libs" = true ]; then 102 | # Omit static builds by default when building GPL-licensed libraries 103 | mxe_targets=({x86_64,i686,aarch64}-w64-mingw32.shared) 104 | elif [ "$with_ffi_compat" = true ]; then 105 | # Omit shared builds by default for the --with-ffi-compat option 106 | mxe_targets=({x86_64,i686,aarch64}-w64-mingw32.static) 107 | else 108 | # Default to all possible targets otherwise 109 | mxe_targets=({x86_64,i686,aarch64}-w64-mingw32.{shared,static}) 110 | fi 111 | fi 112 | 113 | [[ ${mxe_targets[*]} =~ ".static" ]] && targets_static=true || targets_static=false 114 | [[ ${mxe_targets[*]} =~ ".shared" ]] && targets_shared=true || targets_shared=false 115 | 116 | if [ "$build_web_variant" = true ] && [ "$build_all_variant" = true ]; then 117 | echo "ERROR: Cannot build both vips-web and vips-all simultaneously." >&2 118 | exit 1 119 | fi 120 | 121 | if [ "$targets_static" = true ] && [ "$contains_gpl_libs" = true ]; then 122 | echo "ERROR: Distributing a statically linked library against GPL libraries, without releasing the code as GPL, violates the GPL license." >&2 123 | exit 1 124 | fi 125 | 126 | if [ "$targets_shared" = true ] && [ "$with_ffi_compat" = true ]; then 127 | echo "WARNING: The --with-ffi-compat option makes only sense when building static binaries." >&2 128 | with_ffi_compat=false 129 | fi 130 | 131 | if [ -n "$git_commit" ] && [ -n "$git_ref" ]; then 132 | echo "ERROR: The --commit and --ref options are mutually exclusive." >&2 133 | exit 1 134 | fi 135 | 136 | if [ -n "$git_ref" ]; then 137 | git_commit=$(git ls-remote --heads --tags --refs https://github.com/libvips/libvips.git $git_ref | awk '{print $1}') 138 | if [ -z "$git_commit" ]; then 139 | echo "ERROR: Couldn't find remote ref $git_ref in the libvips repository." >&2 140 | exit 1 141 | fi 142 | fi 143 | 144 | # GitHub's tarball API requires the short SHA commit as the directory name 145 | git_commit="${git_commit:0:7}" 146 | 147 | # Ensure separate build targets 148 | if [ "$build_all_variant" = true ]; then 149 | mxe_targets=("${mxe_targets[@]/%/.all}") 150 | fi 151 | 152 | if [ "$with_ffi_compat" = true ]; then 153 | mxe_targets=("${mxe_targets[@]/%/.ffi}") 154 | fi 155 | 156 | if [ "$with_debug" = true ]; then 157 | mxe_targets=("${mxe_targets[@]/%/.debug}") 158 | fi 159 | 160 | # Check whether we can build and run OCI-compliant containers 161 | if [ -x "$(command -v podman)" ]; then 162 | oci_runtime=podman 163 | elif [ -x "$(command -v docker)" ]; then 164 | oci_runtime=docker 165 | else 166 | echo "ERROR: OCI-compliant container runtime not found. Please install Podman or Docker." >&2 167 | exit 1 168 | fi 169 | 170 | if [ "$with_prebuilt" = true ]; then 171 | image="ghcr.io/libvips/build-win64-mxe:latest" 172 | 173 | # Ensure latest prebuilt base image 174 | $oci_runtime pull $image 175 | else 176 | image="libvips-build-win-mxe-base" 177 | 178 | # Ensure latest Debian stable base image 179 | $oci_runtime pull docker.io/library/buildpack-deps:bookworm 180 | 181 | # Bootstrap the compilers and utilities 182 | $oci_runtime build -t $image -f container/base.Dockerfile . 183 | fi 184 | 185 | # The 'plugin_dirs' variable controls which plugins are in use 186 | plugin_dirs="plugins/llvm-mingw /data" 187 | 188 | if [ -n "$git_commit" ]; then 189 | plugin_dirs+=" /data/plugins/nightly" 190 | fi 191 | 192 | if [ "$jpeg_impl" != "libjpeg-turbo" ]; then 193 | plugin_dirs+=" /data/plugins/$jpeg_impl" 194 | fi 195 | 196 | if [ "$build_gtk" = true ]; then 197 | plugin_dirs+=" /data/plugins/gtk4" 198 | fi 199 | 200 | if [ "$with_hevc" = true ]; then 201 | plugin_dirs+=" /data/plugins/hevc" 202 | fi 203 | 204 | if [ "$with_zlib_ng" = true ]; then 205 | plugin_dirs+=" /data/plugins/zlib-ng" 206 | fi 207 | 208 | # Avoid shipping the gettext DLL (libintl-8.dll), 209 | # use a statically build dummy implementation instead. 210 | # This intentionally disables the i18n features of (GNU) 211 | # gettext, which are probably not needed within Windows. 212 | # See: 213 | # https://github.com/frida/proxy-libintl 214 | # https://github.com/libvips/libvips/issues/1637 215 | plugin_dirs+=" /data/plugins/proxy-libintl" 216 | 217 | # Build requested packages 218 | $oci_runtime build \ 219 | -t libvips-build-win-mxe \ 220 | -f container/Dockerfile \ 221 | --build-arg BASE_IMAGE="$image" \ 222 | --build-arg PKGS="${pkgs[*]}" \ 223 | --build-arg MXE_TARGETS="${mxe_targets[*]}" \ 224 | --build-arg DEBUG="$with_debug" \ 225 | --build-arg PLUGIN_DIRS="$plugin_dirs" \ 226 | --build-arg GIT_COMMIT="$git_commit" \ 227 | build 228 | 229 | # Debug logs 230 | # docker run --rm -it --entrypoint "/bin/bash" libvips-build-win-mxe 231 | # grep -r "with fuzz" /usr/local/mxe/log 232 | # grep -r "(offset" /usr/local/mxe/log 233 | # cat /usr/local/mxe/log/vips-* 234 | 235 | # Run packaging script inside a container with the 236 | # packaging dir mounted at /data/packaging. 237 | $oci_runtime run --rm -t \ 238 | -v $PWD/packaging:/data/packaging \ 239 | -e PKGS="${pkgs[*]}" \ 240 | -e MXE_TARGETS="${mxe_targets[*]}" \ 241 | -e FFI_COMPAT="$with_ffi_compat" \ 242 | -e JPEG_IMPL="$jpeg_impl" \ 243 | -e HEVC="$with_hevc" \ 244 | -e DEBUG="$with_debug" \ 245 | -e ZLIB_NG="$with_zlib_ng" \ 246 | libvips-build-win-mxe 247 | -------------------------------------------------------------------------------- /build/aom.mk: -------------------------------------------------------------------------------- 1 | PKG := aom 2 | $(PKG)_WEBSITE := https://aomedia.googlesource.com/aom/ 3 | $(PKG)_DESCR := AV1 Codec Library 4 | $(PKG)_IGNORE := 5 | $(PKG)_VERSION := 3.12.1 6 | $(PKG)_CHECKSUM := 9e9775180dec7dfd61a79e00bda3809d43891aee6b2e331ff7f26986207ea22e 7 | $(PKG)_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/$(PKG)-[0-9]*.patch))) 8 | $(PKG)_SUBDIR := libaom-$($(PKG)_VERSION) 9 | $(PKG)_FILE := libaom-$($(PKG)_VERSION).tar.gz 10 | $(PKG)_URL := https://storage.googleapis.com/aom-releases/$($(PKG)_FILE) 11 | $(PKG)_DEPS := cc $(BUILD)~nasm 12 | 13 | define $(PKG)_BUILD 14 | cd '$(BUILD_DIR)' && NASM_PATH='$(PREFIX)/$(BUILD)/bin' $(TARGET)-cmake \ 15 | -DENABLE_NASM=ON \ 16 | -DENABLE_DOCS=OFF \ 17 | -DENABLE_TESTS=OFF \ 18 | -DENABLE_TESTDATA=OFF \ 19 | -DENABLE_TOOLS=OFF \ 20 | -DENABLE_EXAMPLES=OFF \ 21 | -DCONFIG_AV1_HIGHBITDEPTH=0 \ 22 | -DCONFIG_WEBM_IO=0 \ 23 | $(if $(call seq,i686,$(PROCESSOR)), -DAOM_TARGET_CPU='x86') \ 24 | $(if $(call seq,aarch64,$(PROCESSOR)), -DCONFIG_RUNTIME_CPU_DETECT=0) \ 25 | '$(SOURCE_DIR)' 26 | 27 | # parallel build sometimes doesn't work; fallback to -j 1. 28 | $(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)' || $(MAKE) -C '$(BUILD_DIR)' -j 1 29 | $(MAKE) -C '$(BUILD_DIR)' -j 1 $(subst -,/,$(INSTALL_STRIP_LIB)) 30 | endef 31 | -------------------------------------------------------------------------------- /build/cgif.mk: -------------------------------------------------------------------------------- 1 | PKG := cgif 2 | $(PKG)_WEBSITE := https://github.com/dloebl/cgif 3 | $(PKG)_DESCR := A fast and lightweight GIF encoder 4 | $(PKG)_IGNORE := 5 | $(PKG)_VERSION := 0.5.0 6 | $(PKG)_CHECKSUM := d6cb312c7da2c6c9f310811aa3658120c0316ba130c48a012e7baf3698920fe9 7 | $(PKG)_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/$(PKG)-[0-9]*.patch))) 8 | $(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION) 9 | $(PKG)_GH_CONF := dloebl/cgif/tags,v 10 | $(PKG)_DEPS := cc meson-wrapper 11 | 12 | define $(PKG)_BUILD 13 | $(eval export CFLAGS += -O3) 14 | 15 | $(MXE_MESON_WRAPPER) \ 16 | -Dexamples=false \ 17 | -Dtests=false \ 18 | '$(SOURCE_DIR)' \ 19 | '$(BUILD_DIR)' 20 | 21 | $(MXE_NINJA) -C '$(BUILD_DIR)' -j '$(JOBS)' install 22 | endef 23 | -------------------------------------------------------------------------------- /build/highway.mk: -------------------------------------------------------------------------------- 1 | PKG := highway 2 | $(PKG)_WEBSITE := https://github.com/google/highway 3 | $(PKG)_DESCR := Performance-portable, length-agnostic SIMD with runtime dispatch 4 | $(PKG)_IGNORE := 5 | $(PKG)_VERSION := 1.2.0 6 | $(PKG)_CHECKSUM := 58e9d5d41d6573ad15245ad76aec53a69499ca7480c092d899c4424812ed906f 7 | $(PKG)_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/$(PKG)-[0-9]*.patch))) 8 | $(PKG)_GH_CONF := google/highway/releases 9 | $(PKG)_DEPS := cc 10 | 11 | # Dynamic dispatch requires Linux to detect CPU capabilities on AArch64. 12 | define $(PKG)_BUILD 13 | $(eval export CFLAGS += -O3) 14 | $(eval export CXXFLAGS += -O3) 15 | 16 | cd '$(BUILD_DIR)' && $(TARGET)-cmake \ 17 | -DBUILD_TESTING=OFF \ 18 | -DHWY_ENABLE_CONTRIB=OFF \ 19 | -DHWY_ENABLE_EXAMPLES=OFF \ 20 | -DHWY_ENABLE_TESTS=OFF \ 21 | '$(SOURCE_DIR)' 22 | $(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)' 23 | $(MAKE) -C '$(BUILD_DIR)' -j 1 $(subst -,/,$(INSTALL_STRIP_LIB)) 24 | endef 25 | -------------------------------------------------------------------------------- /build/imath.mk: -------------------------------------------------------------------------------- 1 | PKG := imath 2 | $(PKG)_WEBSITE := https://github.com/AcademySoftwareFoundation/Imath 3 | $(PKG)_DESCR := A C++ and python library of 2D and 3D vector, matrix, and math operations for computer graphics. 4 | $(PKG)_IGNORE := 5 | $(PKG)_VERSION := 3.1.9 6 | $(PKG)_CHECKSUM := f1d8aacd46afed958babfced3190d2d3c8209b66da451f556abd6da94c165cf3 7 | $(PKG)_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/$(PKG)-[0-9]*.patch))) 8 | $(PKG)_GH_CONF := AcademySoftwareFoundation/Imath/tags,v 9 | $(PKG)_DEPS := cc 10 | 11 | define $(PKG)_BUILD 12 | cd '$(BUILD_DIR)' && '$(TARGET)-cmake' \ 13 | -DIMATH_INSTALL_PKG_CONFIG=ON \ 14 | -DBUILD_TESTING=OFF \ 15 | -DBUILD_SHARED_LIBS=OFF \ 16 | '$(SOURCE_DIR)' 17 | 18 | $(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)' 19 | $(MAKE) -C '$(BUILD_DIR)' -j 1 $(subst -,/,$(INSTALL_STRIP_LIB)) 20 | endef 21 | -------------------------------------------------------------------------------- /build/libdicom.mk: -------------------------------------------------------------------------------- 1 | PKG := libdicom 2 | $(PKG)_WEBSITE := https://github.com/ImagingDataCommons/libdicom 3 | $(PKG)_DESCR := C library for reading DICOM files. 4 | $(PKG)_IGNORE := 5 | $(PKG)_VERSION := 1.2.0 6 | $(PKG)_CHECKSUM := 3b8c05ceb6bf667fed997f23b476dd32c3dc6380eee1998185c211d86a7b4918 7 | $(PKG)_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/$(PKG)-[0-9]*.patch))) 8 | $(PKG)_GH_CONF := ImagingDataCommons/libdicom/releases,v,,,,.tar.xz 9 | $(PKG)_DEPS := cc meson-wrapper 10 | 11 | define $(PKG)_BUILD 12 | # Enable networking to allow uthash to be downloaded from WrapDB 13 | MXE_ENABLE_NETWORK=1 $(MXE_MESON_WRAPPER) \ 14 | -Dtests=false \ 15 | --force-fallback-for=uthash \ 16 | '$(SOURCE_DIR)' \ 17 | '$(BUILD_DIR)' 18 | 19 | $(MXE_NINJA) -C '$(BUILD_DIR)' -j '$(JOBS)' install 20 | endef 21 | -------------------------------------------------------------------------------- /build/libheif.mk: -------------------------------------------------------------------------------- 1 | PKG := libheif 2 | $(PKG)_WEBSITE := http://www.libheif.org/ 3 | $(PKG)_DESCR := libheif is a ISO/IEC 23008-12:2017 HEIF file format decoder and encoder. 4 | $(PKG)_IGNORE := 5 | $(PKG)_VERSION := 1.19.8 6 | $(PKG)_CHECKSUM := 6c4a5b08e6eae66d199977468859dea3b5e059081db8928f7c7c16e53836c906 7 | $(PKG)_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/$(PKG)-[0-9]*.patch))) 8 | $(PKG)_GH_CONF := strukturag/libheif/releases,v 9 | $(PKG)_DEPS := cc aom 10 | 11 | define $(PKG)_BUILD 12 | $(eval export CFLAGS += -O3) 13 | $(eval export CXXFLAGS += -O3) 14 | 15 | cd '$(BUILD_DIR)' && $(TARGET)-cmake \ 16 | -DENABLE_PLUGIN_LOADING=0 \ 17 | -DBUILD_TESTING=0 \ 18 | -DWITH_EXAMPLES=0 \ 19 | $(if $(IS_HEVC),, \ 20 | -DWITH_LIBDE265=0 \ 21 | -DWITH_X265=0) \ 22 | $(if $(and $(IS_JPEGLI),$(BUILD_STATIC)), -DCMAKE_CXX_FLAGS='$(CXXFLAGS) -DHAVE_JPEG_WRITE_ICC_PROFILE') \ 23 | '$(SOURCE_DIR)' 24 | $(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)' 25 | $(MAKE) -C '$(BUILD_DIR)' -j 1 $(subst -,/,$(INSTALL_STRIP_LIB)) 26 | endef 27 | -------------------------------------------------------------------------------- /build/libimagequant.mk: -------------------------------------------------------------------------------- 1 | PKG := libimagequant 2 | $(PKG)_WEBSITE := https://github.com/lovell/libimagequant 3 | $(PKG)_DESCR := libimagequant v2.4.1 fork (BSD 2-Clause) 4 | $(PKG)_IGNORE := 5 | $(PKG)_VERSION := 2.4.1 6 | $(PKG)_CHECKSUM := da531249038e17f0674cef6e5d4100e43bf8cdfb4f330bc2a590bff50cd91913 7 | $(PKG)_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/$(PKG)-[0-9]*.patch))) 8 | $(PKG)_GH_CONF := lovell/libimagequant/tags,v 9 | $(PKG)_DEPS := cc meson-wrapper 10 | 11 | define $(PKG)_BUILD 12 | $(eval export CFLAGS += -O3) 13 | 14 | $(MXE_MESON_WRAPPER) '$(SOURCE_DIR)' '$(BUILD_DIR)' 15 | 16 | $(MXE_NINJA) -C '$(BUILD_DIR)' -j '$(JOBS)' install 17 | endef 18 | -------------------------------------------------------------------------------- /build/libjxl.mk: -------------------------------------------------------------------------------- 1 | PKG := libjxl 2 | $(PKG)_WEBSITE := https://github.com/libjxl/libjxl 3 | $(PKG)_DESCR := JPEG XL image format reference implementation 4 | $(PKG)_IGNORE := 5 | $(PKG)_VERSION := 0.11.1 6 | $(PKG)_CHECKSUM := 1492dfef8dd6c3036446ac3b340005d92ab92f7d48ee3271b5dac1d36945d3d9 7 | $(PKG)_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/$(PKG)-[0-9]*.patch))) 8 | $(PKG)_GH_CONF := libjxl/libjxl/tags,v 9 | $(PKG)_DEPS := cc brotli highway lcms libpng 10 | 11 | define $(PKG)_BUILD 12 | cd '$(BUILD_DIR)' && $(TARGET)-cmake \ 13 | -DBUILD_TESTING=OFF \ 14 | -DJPEGXL_ENABLE_TOOLS=OFF \ 15 | -DJPEGXL_ENABLE_DOXYGEN=OFF \ 16 | -DJPEGXL_ENABLE_MANPAGES=OFF \ 17 | -DJPEGXL_ENABLE_BENCHMARK=OFF \ 18 | -DJPEGXL_ENABLE_EXAMPLES=OFF \ 19 | -DJPEGXL_ENABLE_SJPEG=OFF \ 20 | -DJPEGXL_ENABLE_OPENEXR=OFF \ 21 | -DJPEGXL_ENABLE_SKCMS=OFF \ 22 | -DJPEGXL_ENABLE_TRANSCODE_JPEG=OFF \ 23 | -DJPEGXL_FORCE_SYSTEM_BROTLI=ON \ 24 | -DJPEGXL_FORCE_SYSTEM_LCMS2=ON \ 25 | -DJPEGXL_FORCE_SYSTEM_HWY=ON \ 26 | '$(SOURCE_DIR)' 27 | $(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)' 28 | $(MAKE) -C '$(BUILD_DIR)' -j 1 $(subst -,/,$(INSTALL_STRIP_LIB)) 29 | endef 30 | -------------------------------------------------------------------------------- /build/libspng.mk: -------------------------------------------------------------------------------- 1 | PKG := libspng 2 | $(PKG)_WEBSITE := https://libspng.org/ 3 | $(PKG)_DESCR := Simple, modern libpng alternative. 4 | $(PKG)_IGNORE := 5 | $(PKG)_VERSION := 0.7.4 6 | $(PKG)_CHECKSUM := 47ec02be6c0a6323044600a9221b049f63e1953faf816903e7383d4dc4234487 7 | $(PKG)_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/$(PKG)-[0-9]*.patch))) 8 | $(PKG)_GH_CONF := randy408/libspng/tags,v 9 | $(PKG)_DEPS := cc meson-wrapper zlib 10 | 11 | define $(PKG)_BUILD 12 | $(eval export CFLAGS += -O3) 13 | 14 | $(MXE_MESON_WRAPPER) \ 15 | -Dbuild_examples=false \ 16 | -Dstatic_zlib=$(if $(BUILD_STATIC),true,false) \ 17 | '$(SOURCE_DIR)' \ 18 | '$(BUILD_DIR)' 19 | 20 | $(MXE_NINJA) -C '$(BUILD_DIR)' -j '$(JOBS)' install 21 | endef 22 | -------------------------------------------------------------------------------- /build/nifticlib.mk: -------------------------------------------------------------------------------- 1 | PKG := nifticlib 2 | $(PKG)_WEBSITE := https://github.com/NIFTI-Imaging/nifti_clib 3 | $(PKG)_DESCR := A set of i/o libraries for reading and writing files in the nifti-1 data format 4 | $(PKG)_IGNORE := 5 | $(PKG)_VERSION := 3.0.1 6 | $(PKG)_CHECKSUM := 868b611b5f8a3a73809436c9072db50db4975615905f0bd5fb7b1432e6d24b37 7 | $(PKG)_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/$(PKG)-[0-9]*.patch))) 8 | $(PKG)_GH_CONF := NIFTI-Imaging/nifti_clib/tags,v 9 | $(PKG)_DEPS := cc zlib 10 | 11 | # build without NIFTI-2 support, as that's still experimental 12 | # nifticdf library is not used by libvips, so don't build that either 13 | define $(PKG)_BUILD 14 | cd '$(BUILD_DIR)' && '$(TARGET)-cmake' \ 15 | -DUSE_NIFTI2_CODE=OFF \ 16 | -DUSE_NIFTICDF_CODE=OFF \ 17 | -DNIFTI_BUILD_TESTING=OFF \ 18 | -DNIFTI_INSTALL_NO_DOCS=ON \ 19 | '$(SOURCE_DIR)' 20 | $(MAKE) -C '$(BUILD_DIR)' -j $(JOBS) 21 | $(MAKE) -C '$(BUILD_DIR)' -j 1 $(subst -,/,$(INSTALL_STRIP_LIB)) 22 | endef 23 | -------------------------------------------------------------------------------- /build/nip4.mk: -------------------------------------------------------------------------------- 1 | PKG := nip4 2 | $(PKG)_WEBSITE := https://github.com/jcupitt/nip4 3 | $(PKG)_DESCR := Image processing spreadsheet 4 | $(PKG)_IGNORE := 5 | $(PKG)_VERSION := 9.0.9-2 6 | $(PKG)_CHECKSUM := ed3cc21ae581b1b0725c68632ca6a97c21c5cd5169c24c71119daa0b8b026e38 7 | $(PKG)_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/$(PKG)-[0-9]*.patch))) 8 | $(PKG)_GH_CONF := jcupitt/nip4/releases,v,,,,.tar.xz 9 | $(PKG)_DEPS := cc meson-wrapper gtk4 gsl vips-all 10 | 11 | define $(PKG)_PRE_CONFIGURE 12 | (printf '{\n'; \ 13 | printf ' "epoxy": "$(libepoxy_VERSION)",\n'; \ 14 | printf ' "graphene": "$(graphene_VERSION)",\n'; \ 15 | printf ' "gsl": "$(gsl_VERSION)",\n'; \ 16 | printf ' "gtk": "$(gtk4_VERSION)",\n'; \ 17 | printf ' "nip4": "$(nip4_VERSION)"\n'; \ 18 | printf '}';) \ 19 | > '$(PREFIX)/$(TARGET)/vips-packaging/versions-nip4.json' 20 | endef 21 | 22 | define $(PKG)_BUILD 23 | $($(PKG)_PRE_CONFIGURE) 24 | 25 | $(eval export CFLAGS += -O3) 26 | 27 | # Increase the stack size to 16MiB, as 1MiB is too small for nip4 28 | $(eval export LDFLAGS += -Wl,--stack,16777216) 29 | 30 | $(MXE_MESON_WRAPPER) '$(SOURCE_DIR)' '$(BUILD_DIR)' 31 | 32 | $(MXE_NINJA) -C '$(BUILD_DIR)' -j '$(JOBS)' install 33 | endef 34 | -------------------------------------------------------------------------------- /build/openslide.mk: -------------------------------------------------------------------------------- 1 | PKG := openslide 2 | $(PKG)_WEBSITE := https://openslide.org/ 3 | $(PKG)_DESCR := C library for reading virtual slide images. 4 | $(PKG)_IGNORE := 5 | $(PKG)_VERSION := 4.0.0 6 | $(PKG)_CHECKSUM := cc227c44316abb65fb28f1c967706eb7254f91dbfab31e9ae6a48db6cf4ae562 7 | $(PKG)_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/$(PKG)-[0-9]*.patch))) 8 | $(PKG)_GH_CONF := openslide/openslide/releases,v,,,,.tar.xz 9 | $(PKG)_DEPS := cc zlib glib libxml2 cairo gdk-pixbuf libjpeg-turbo tiff openjpeg sqlite libdicom 10 | 11 | define $(PKG)_BUILD 12 | $(MXE_MESON_WRAPPER) \ 13 | -Dtest=disabled \ 14 | -Ddoc=disabled \ 15 | '$(SOURCE_DIR)' \ 16 | '$(BUILD_DIR)' 17 | 18 | $(MXE_NINJA) -C '$(BUILD_DIR)' -j '$(JOBS)' install 19 | endef 20 | -------------------------------------------------------------------------------- /build/overrides.mk: -------------------------------------------------------------------------------- 1 | $(info [overrides] $(lastword $(MAKEFILE_LIST))) 2 | 3 | ## Update dependencies 4 | 5 | # upstream version is 1.5.23 6 | # cannot use GH_CONF: 7 | # matio_GH_CONF := tbeu/matio/releases,v 8 | matio_VERSION := 1.5.28 9 | matio_CHECKSUM := 9da698934a21569af058e6348564666f45029e6c2b0878ca0d8f9609bf77b8d8 10 | matio_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/matio-[0-9]*.patch))) 11 | matio_SUBDIR := matio-$(matio_VERSION) 12 | matio_FILE := matio-$(matio_VERSION).tar.gz 13 | matio_URL := https://github.com/tbeu/matio/releases/download/v$(matio_VERSION)/$(matio_FILE) 14 | 15 | # upstream version is 3.4.0 16 | libarchive_VERSION := 3.8.1 17 | libarchive_CHECKSUM := 19f917d42d530f98815ac824d90c7eaf648e9d9a50e4f309c812457ffa5496b5 18 | libarchive_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/libarchive-[0-9]*.patch))) 19 | libarchive_SUBDIR := libarchive-$(libarchive_VERSION) 20 | libarchive_FILE := libarchive-$(libarchive_VERSION).tar.xz 21 | libarchive_URL := https://github.com/libarchive/libarchive/releases/download/v$(libarchive_VERSION)/$(libarchive_FILE) 22 | 23 | # upstream version is 7, we want ImageMagick 6 24 | imagemagick_VERSION := 6.9.13-25 25 | imagemagick_CHECKSUM := 182872ab0a7dbb9b40b676f13a4f45d7931d313a66b3c983dfb2be40997b4041 26 | imagemagick_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/imagemagick-[0-9]*.patch))) 27 | imagemagick_GH_CONF := ImageMagick/ImageMagick6/tags 28 | 29 | # alternatively, one could build libvips with GraphicsMagick 30 | # upstream version is 1.3.38 31 | graphicsmagick_VERSION := 1.3.45 32 | graphicsmagick_CHECKSUM := dcea5167414f7c805557de2d7a47a9b3147bcbf617b91f5f0f4afe5e6543026b 33 | graphicsmagick_SUBDIR := GraphicsMagick-$(graphicsmagick_VERSION) 34 | graphicsmagick_FILE := GraphicsMagick-$(graphicsmagick_VERSION).tar.xz 35 | graphicsmagick_URL := https://$(SOURCEFORGE_MIRROR)/project/graphicsmagick/graphicsmagick/$(graphicsmagick_VERSION)/$(graphicsmagick_FILE) 36 | 37 | # upstream version is 2.40.21 38 | librsvg_VERSION := 2.60.0 39 | librsvg_CHECKSUM := 0b6ffccdf6e70afc9876882f5d2ce9ffcf2c713cbaaf1ad90170daa752e1eec3 40 | librsvg_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/librsvg-[0-9]*.patch))) 41 | librsvg_SUBDIR := librsvg-$(librsvg_VERSION) 42 | librsvg_FILE := librsvg-$(librsvg_VERSION).tar.xz 43 | librsvg_URL := https://download.gnome.org/sources/librsvg/$(call SHORT_PKG_VERSION,librsvg)/$(librsvg_FILE) 44 | 45 | # upstream version is 1.51.0 46 | pango_VERSION := 1.56.3 47 | pango_CHECKSUM := 2606252bc25cd8d24e1b7f7e92c3a272b37acd6734347b73b47a482834ba2491 48 | pango_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/pango-[0-9]*.patch))) 49 | pango_SUBDIR := pango-$(pango_VERSION) 50 | pango_FILE := pango-$(pango_VERSION).tar.xz 51 | pango_URL := https://download.gnome.org/sources/pango/$(call SHORT_PKG_VERSION,pango)/$(pango_FILE) 52 | 53 | # upstream version is 1.0.13 54 | # cannot use GH_CONF: 55 | # fribidi_GH_CONF := fribidi/fribidi/releases,v 56 | fribidi_VERSION := 1.0.16 57 | fribidi_CHECKSUM := 1b1cde5b235d40479e91be2f0e88a309e3214c8ab470ec8a2744d82a5a9ea05c 58 | fribidi_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/fribidi-[0-9]*.patch))) 59 | fribidi_SUBDIR := fribidi-$(fribidi_VERSION) 60 | fribidi_FILE := fribidi-$(fribidi_VERSION).tar.xz 61 | fribidi_URL := https://github.com/fribidi/fribidi/releases/download/v$(fribidi_VERSION)/$(fribidi_FILE) 62 | 63 | # upstream version is 0.6.22 64 | libexif_VERSION := 0.6.25 65 | libexif_CHECKSUM := 62f74cf3bf673a6e24d2de68f6741643718541f83aca5947e76e3978c25dce83 66 | libexif_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/libexif-[0-9]*.patch))) 67 | libexif_GH_CONF := libexif/libexif/releases,v,,,,.tar.xz 68 | 69 | # upstream version is 4.5.0 70 | cfitsio_VERSION := 4.6.2 71 | cfitsio_CHECKSUM := 66fd078cc0bea896b0d44b120d46d6805421a5361d3a5ad84d9f397b1b5de2cb 72 | cfitsio_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/cfitsio-[0-9]*.patch))) 73 | cfitsio_SUBDIR := cfitsio-$(cfitsio_VERSION) 74 | cfitsio_FILE := cfitsio-$(cfitsio_VERSION).tar.gz 75 | cfitsio_URL := https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/$(cfitsio_FILE) 76 | 77 | # upstream version is 2.16.0 78 | fontconfig_VERSION := 2.16.2 79 | fontconfig_CHECKSUM := 165b8fd2a119864c87464b233986c4a1bc09efb09c65de1ca40cc1e85ffb77e2 80 | fontconfig_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/fontconfig-[0-9]*.patch))) 81 | fontconfig_SUBDIR := fontconfig-$(fontconfig_VERSION) 82 | fontconfig_FILE := fontconfig-$(fontconfig_VERSION).tar.xz 83 | fontconfig_URL := https://gitlab.freedesktop.org/api/v4/projects/890/packages/generic/fontconfig/$(fontconfig_VERSION)/$(fontconfig_FILE) 84 | 85 | # upstream version is 2.2.0 86 | # cannot use GH_CONF: 87 | # openexr_GH_CONF := AcademySoftwareFoundation/openexr/tags 88 | # 3.2.0 requires libdeflate instead of zlib 89 | openexr_VERSION := 3.1.11 90 | openexr_CHECKSUM := 06b4a20d0791b5ec0f804c855d320a0615ce8445124f293616a086e093f1f1e1 91 | openexr_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/openexr-[0-9]*.patch))) 92 | openexr_SUBDIR := openexr-$(openexr_VERSION) 93 | openexr_FILE := openexr-$(openexr_VERSION).tar.gz 94 | openexr_URL := https://github.com/AcademySoftwareFoundation/openexr/archive/v$(openexr_VERSION).tar.gz 95 | 96 | # upstream version is 3.0.1 97 | libjpeg-turbo_VERSION := 3.1.0 98 | libjpeg-turbo_CHECKSUM := 9564c72b1dfd1d6fe6274c5f95a8d989b59854575d4bbee44ade7bc17aa9bc93 99 | libjpeg-turbo_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/libjpeg-turbo-[0-9]*.patch))) 100 | libjpeg-turbo_SUBDIR := libjpeg-turbo-$(libjpeg-turbo_VERSION) 101 | libjpeg-turbo_FILE := libjpeg-turbo-$(libjpeg-turbo_VERSION).tar.gz 102 | libjpeg-turbo_URL := https://github.com/libjpeg-turbo/libjpeg-turbo/releases/download/$(libjpeg-turbo_VERSION)/$(libjpeg-turbo_FILE) 103 | 104 | # upstream version is 23.09.0 105 | poppler_VERSION := 25.06.0 106 | poppler_CHECKSUM := 8199532d38984fab46dbd0020ec9c40f20e928e33e9b4cc6043572603a821d83 107 | poppler_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/poppler-[0-9]*.patch))) 108 | poppler_SUBDIR := poppler-$(poppler_VERSION) 109 | poppler_FILE := poppler-$(poppler_VERSION).tar.xz 110 | poppler_URL := https://poppler.freedesktop.org/$(poppler_FILE) 111 | 112 | # upstream version is 2.7.1 113 | # needed by nip4 114 | gsl_VERSION := 2.8 115 | gsl_CHECKSUM := 6a99eeed15632c6354895b1dd542ed5a855c0f15d9ad1326c6fe2b2c9e423190 116 | gsl_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/gsl-[0-9]*.patch))) 117 | gsl_SUBDIR := gsl-$(gsl_VERSION) 118 | gsl_FILE := gsl-$(gsl_VERSION).tar.gz 119 | gsl_URL := https://ftp.gnu.org/gnu/gsl/$(gsl_FILE) 120 | gsl_URL_2 := https://ftp.snt.utwente.nl/pub/software/gnu/gsl/$(gsl_FILE) 121 | 122 | ## Patches that we override with our own 123 | 124 | cairo_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/cairo-[0-9]*.patch))) 125 | cfitsio_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/cfitsio-[0-9]*.patch))) 126 | fftw_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/fftw-[0-9]*.patch))) 127 | fontconfig_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/fontconfig-[0-9]*.patch))) 128 | freetype_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/freetype-[0-9]*.patch))) 129 | freetype-bootstrap_PATCHES := $(freetype_PATCHES) 130 | gdk-pixbuf_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/gdk-pixbuf-[0-9]*.patch))) 131 | glib_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/glib-[0-9]*.patch))) 132 | harfbuzz_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/harfbuzz-[0-9]*.patch))) 133 | lcms_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/lcms-[0-9]*.patch))) 134 | libjpeg-turbo_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/libjpeg-turbo-[0-9]*.patch))) 135 | libxml2_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/libxml2-[0-9]*.patch))) 136 | meson_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/meson-[0-9]*.patch))) 137 | mingw-w64_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/mingw-w64-[0-9]*.patch))) 138 | pixman_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/pixman-[0-9]*.patch))) 139 | poppler_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/poppler-[0-9]*.patch))) 140 | sqlite_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/sqlite-[0-9]*.patch))) 141 | tiff_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/tiff-[0-9]*.patch))) 142 | 143 | # zlib will make libzlib.dll, but we want libz.dll so we must 144 | # patch CMakeLists.txt 145 | zlib_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/zlib-[0-9]*.patch))) 146 | 147 | ## Override sub-dependencies 148 | # freetype: 149 | # Added: meson-wrapper 150 | # Removed: brotli, bzip2 151 | # freetype-bootstrap: 152 | # Added: meson-wrapper 153 | # Removed: bzip2 154 | # GLib: 155 | # Removed: dbus, libiconv, pcre2 156 | # GDK-PixBuf: 157 | # Removed: jasper, libiconv 158 | # Replaced: jpeg with libjpeg-turbo 159 | # lcms: 160 | # Removed: jpeg, tiff 161 | # libtiff: 162 | # Replaced: jpeg with libjpeg-turbo 163 | # Removed: xz, zstd 164 | # ImageMagick / GraphicsMagick: 165 | # Added: libxml2, openjpeg 166 | # Removed: bzip2, ffmpeg, fftw, freetype, jasper, liblqr-1, libltdl, libpng, libraw, openexr, pthreads, tiff, zlib 167 | # Replaced: jpeg with libjpeg-turbo 168 | # OpenEXR: 169 | # Removed: pthreads 170 | # Poppler: 171 | # Added: libjpeg-turbo, lcms 172 | # Removed: boost, curl, qt6-qtbase, libwebp 173 | # librsvg: 174 | # Added: libxml2, rust, $(BUILD)~cargo-c 175 | # Removed: gdk-pixbuf, libcroco, libgsf 176 | # Cairo: 177 | # Removed: lzo 178 | # matio: 179 | # Removed: hdf5 180 | # libjpeg-turbo: 181 | # Replaced: yasm with $(BUILD)~nasm 182 | # libxml2: 183 | # Removed: libiconv, xz, zlib 184 | # Fontconfig: 185 | # Added: meson-wrapper 186 | # Removed: gettext 187 | # libexif: 188 | # Removed: gettext 189 | # HarfBuzz: 190 | # Removed: brotli, icu4c 191 | # libarchive: 192 | # Removed: bzip2, libiconv, libxml2, nettle, openssl, xz 193 | # SQLite: 194 | # Added: zlib 195 | # Removed: dlfcn-win32 196 | 197 | freetype_DEPS := $(subst brotli bzip2,meson-wrapper,$(freetype_DEPS)) 198 | freetype-bootstrap_DEPS := $(subst brotli bzip2,meson-wrapper,$(freetype-bootstrap_DEPS)) 199 | glib_DEPS := cc meson-wrapper gettext libffi zlib 200 | gdk-pixbuf_DEPS := cc meson-wrapper glib libjpeg-turbo libpng tiff 201 | lcms_DEPS := $(filter-out jpeg tiff ,$(lcms_DEPS)) 202 | tiff_DEPS := cc libjpeg-turbo libwebp zlib 203 | imagemagick_DEPS := cc libxml2 openjpeg lcms libjpeg-turbo 204 | graphicsmagick_DEPS := $(imagemagick_DEPS) 205 | openexr_DEPS := cc imath zlib 206 | poppler_DEPS := cc cairo libjpeg-turbo freetype glib openjpeg lcms libpng tiff zlib 207 | librsvg_DEPS := cc cairo glib pango libxml2 rust $(BUILD)~cargo-c 208 | cairo_DEPS := $(filter-out lzo ,$(cairo_DEPS)) 209 | matio_DEPS := $(filter-out hdf5 ,$(matio_DEPS)) 210 | libjpeg-turbo_DEPS := $(subst yasm,$(BUILD)~nasm,$(libjpeg-turbo_DEPS)) 211 | libxml2_DEPS := cc 212 | fontconfig_DEPS := cc meson-wrapper expat freetype-bootstrap 213 | libexif_DEPS := $(filter-out gettext,$(libexif_DEPS)) 214 | harfbuzz_DEPS := cc meson-wrapper cairo freetype-bootstrap glib 215 | libarchive_DEPS := cc zlib 216 | sqlite_DEPS := cc zlib 217 | 218 | ## Override build scripts 219 | 220 | # libasprintf isn't needed, so build with --disable-libasprintf 221 | # this definition is for reference purposes only, we use the 222 | # proxy-libintl plugin instead. 223 | define gettext_BUILD 224 | cd '$(SOURCE_DIR)' && autoreconf -fi 225 | cd '$(BUILD_DIR)' && '$(SOURCE_DIR)/gettext-runtime/configure' \ 226 | $(MXE_CONFIGURE_OPTS) \ 227 | --disable-java \ 228 | --disable-native-java \ 229 | --disable-csharp \ 230 | --enable-threads=win32 \ 231 | --without-libexpat-prefix \ 232 | --without-libxml2-prefix \ 233 | --disable-libasprintf \ 234 | --disable-nls \ 235 | CONFIG_SHELL=$(SHELL) 236 | $(MAKE) -C '$(BUILD_DIR)/intl' -j '$(JOBS)' 237 | $(MAKE) -C '$(BUILD_DIR)/intl' -j 1 $(INSTALL_STRIP_LIB) 238 | endef 239 | 240 | # disable version script on llvm-mingw 241 | # disable struct support and make the raw api unavailable when 242 | # building a statically linked binary 243 | define libffi_BUILD 244 | # build and install the library 245 | cd '$(BUILD_DIR)' && $(SOURCE_DIR)/configure \ 246 | $(MXE_CONFIGURE_OPTS) \ 247 | --disable-multi-os-directory \ 248 | $(if $(BUILD_STATIC), \ 249 | --disable-structs \ 250 | --disable-raw-api) \ 251 | --disable-symvers 252 | 253 | $(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)' 254 | $(MAKE) -C '$(BUILD_DIR)' -j 1 $(INSTALL_STRIP_LIB) 255 | 256 | '$(TARGET)-gcc' \ 257 | -W -Wall -Werror -std=c99 -pedantic \ 258 | '$(TEST_FILE)' -o '$(PREFIX)/$(TARGET)/bin/test-libffi.exe' \ 259 | `'$(TARGET)-pkg-config' libffi --cflags --libs` 260 | endef 261 | 262 | # disable programs 263 | # build with --disable-nls 264 | define libexif_BUILD 265 | cd '$(BUILD_DIR)' && $(SOURCE_DIR)/configure \ 266 | $(MXE_CONFIGURE_OPTS) \ 267 | --disable-nls \ 268 | --without-libiconv-prefix \ 269 | --without-libintl-prefix 270 | $(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)' $(MXE_DISABLE_PROGRAMS) 271 | $(MAKE) -C '$(BUILD_DIR)' -j 1 $(INSTALL_STRIP_LIB) $(MXE_DISABLE_PROGRAMS) 272 | endef 273 | 274 | # icu will pull in standard linux headers, which we don't want, 275 | # build with Meson. 276 | define harfbuzz_BUILD 277 | $(MXE_MESON_WRAPPER) \ 278 | -Dicu=disabled \ 279 | -Dtests=disabled \ 280 | -Dintrospection=disabled \ 281 | -Ddocs=disabled \ 282 | -Dbenchmark=disabled \ 283 | '$(SOURCE_DIR)' \ 284 | '$(BUILD_DIR)' 285 | 286 | $(MXE_NINJA) -C '$(BUILD_DIR)' -j '$(JOBS)' install 287 | endef 288 | 289 | # build with the Meson build system 290 | # build without bzip2 and brotli 291 | define freetype_BUILD_COMMON 292 | $(MXE_MESON_WRAPPER) \ 293 | -Dharfbuzz=enabled \ 294 | -Dpng=enabled \ 295 | -Dzlib=enabled \ 296 | -Dbrotli=disabled \ 297 | -Dbzip2=disabled \ 298 | '$(SOURCE_DIR)' \ 299 | '$(BUILD_DIR)' 300 | 301 | $(MXE_NINJA) -C '$(BUILD_DIR)' -j '$(JOBS)' install 302 | endef 303 | 304 | define freetype_BUILD 305 | $($(PKG)_BUILD_COMMON) 306 | endef 307 | 308 | define freetype-bootstrap_BUILD 309 | $(subst harfbuzz=enabled,harfbuzz=disabled,$(freetype_BUILD_COMMON)) 310 | endef 311 | 312 | # build with the Meson build system 313 | define gdk-pixbuf_BUILD 314 | $(MXE_MESON_WRAPPER) \ 315 | -Dtiff=disabled \ 316 | -Dgif=disabled \ 317 | -Dothers=disabled \ 318 | -Dintrospection=disabled \ 319 | -Dtests=false \ 320 | -Dinstalled_tests=false \ 321 | -Dman=false \ 322 | -Dbuiltin_loaders='png,jpeg' \ 323 | '$(SOURCE_DIR)' \ 324 | '$(BUILD_DIR)' 325 | 326 | $(MXE_NINJA) -C '$(BUILD_DIR)' -j '$(JOBS)' install 327 | endef 328 | 329 | # build pixman with the Meson build system 330 | define pixman_BUILD 331 | $(MXE_MESON_WRAPPER) \ 332 | -Dopenmp=disabled \ 333 | -Dgtk=disabled \ 334 | -Dtests=disabled \ 335 | -Ddemos=disabled \ 336 | '$(SOURCE_DIR)' \ 337 | '$(BUILD_DIR)' 338 | 339 | $(MXE_NINJA) -C '$(BUILD_DIR)' -j '$(JOBS)' install 340 | endef 341 | 342 | # build fribidi with the Meson build system 343 | define fribidi_BUILD 344 | $(MXE_MESON_WRAPPER) \ 345 | -Dtests=false \ 346 | -Ddocs=false \ 347 | '$(SOURCE_DIR)' \ 348 | '$(BUILD_DIR)' 349 | 350 | $(MXE_NINJA) -C '$(BUILD_DIR)' -j '$(JOBS)' install 351 | endef 352 | 353 | # build with the Meson build system 354 | # exclude jpeg, tiff dependencies 355 | # build with -DCMS_RELY_ON_WINDOWS_STATIC_MUTEX_INIT to avoid a 356 | # horrible hack (we don't target pre-Windows XP, so it should be safe) 357 | define lcms_BUILD 358 | $(eval export CFLAGS += -O3) 359 | 360 | $(MXE_MESON_WRAPPER) \ 361 | -Dtests=disabled \ 362 | -Djpeg=disabled \ 363 | -Dtiff=disabled \ 364 | -Dc_args='$(CFLAGS) -DCMS_RELY_ON_WINDOWS_STATIC_MUTEX_INIT' \ 365 | '$(SOURCE_DIR)' \ 366 | '$(BUILD_DIR)' 367 | 368 | $(MXE_NINJA) -C '$(BUILD_DIR)' -j '$(JOBS)' install 369 | endef 370 | 371 | # disable largefile support, we rely on vips for that and ImageMagick's 372 | # detection does not work when cross-compiling 373 | # build with jpeg-turbo and without lzma 374 | # disable POSIX threads with --without-threads, use Win32 threads instead 375 | # avoid linking against -lgdi32, see: https://github.com/kleisauke/net-vips/issues/61 376 | # exclude deprecated methods in MagickCore API 377 | define imagemagick_BUILD 378 | cd '$(BUILD_DIR)' && $(SOURCE_DIR)/configure \ 379 | $(MXE_CONFIGURE_OPTS) \ 380 | --without-fftw \ 381 | --without-fontconfig \ 382 | --without-gdi32 \ 383 | --without-gvc \ 384 | --without-heic \ 385 | --without-heif \ 386 | --without-jxl \ 387 | --without-ltdl \ 388 | --without-lqr \ 389 | --without-lzma \ 390 | --without-magick-plus-plus \ 391 | --without-modules \ 392 | --without-openexr \ 393 | --without-pango \ 394 | --without-png \ 395 | --without-rsvg \ 396 | --without-tiff \ 397 | --without-webp \ 398 | --without-x \ 399 | --without-zlib \ 400 | --without-threads \ 401 | --disable-largefile \ 402 | --disable-opencl \ 403 | --disable-openmp \ 404 | --disable-deprecated 405 | $(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)' $(MXE_DISABLE_CRUFT) 406 | $(MAKE) -C '$(BUILD_DIR)' -j 1 $(INSTALL_STRIP_LIB) $(MXE_DISABLE_CRUFT) 407 | endef 408 | 409 | # Alias GraphicsMagick build with ImageMagick 410 | define graphicsmagick_BUILD 411 | $(imagemagick_BUILD) 412 | endef 413 | 414 | # WITH_TURBOJPEG=OFF turns off a library we don't use (we just use the 415 | # libjpeg API) 416 | # Switch to NASM because YASM has been unmaintained for a few years, while NASM is actively maintained. 417 | define libjpeg-turbo_BUILD 418 | cd '$(BUILD_DIR)' && $(TARGET)-cmake \ 419 | -DWITH_TURBOJPEG=OFF \ 420 | -DPNG_SUPPORTED=OFF \ 421 | -DENABLE_SHARED=$(CMAKE_SHARED_BOOL) \ 422 | -DENABLE_STATIC=$(CMAKE_STATIC_BOOL) \ 423 | -DCMAKE_ASM_NASM_COMPILER='$(PREFIX)/$(BUILD)/bin/nasm' \ 424 | '$(SOURCE_DIR)' 425 | $(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)' 426 | $(MAKE) -C '$(BUILD_DIR)' -j 1 $(subst -,/,$(INSTALL_STRIP_LIB)) 427 | endef 428 | 429 | # build with the Meson build system 430 | # build with -Dnls=disabled 431 | define fontconfig_BUILD 432 | $(MXE_MESON_WRAPPER) \ 433 | -Ddoc=disabled \ 434 | -Dnls=disabled \ 435 | -Dtests=disabled \ 436 | -Dtools=disabled \ 437 | '$(SOURCE_DIR)' \ 438 | '$(BUILD_DIR)' 439 | 440 | $(MXE_NINJA) -C '$(BUILD_DIR)' -j '$(JOBS)' install 441 | endef 442 | 443 | # disable GObject introspection 444 | # build with the Meson build system 445 | # force FontConfig since the Win32 font backend within Cairo is disabled 446 | define pango_BUILD 447 | # Disable utils and tools 448 | $(SED) -i "/subdir('utils')/{N;d;}" '$(SOURCE_DIR)/meson.build' 449 | 450 | $(MXE_MESON_WRAPPER) \ 451 | -Ddocumentation=false \ 452 | -Dbuild-testsuite=false \ 453 | -Dbuild-examples=false \ 454 | -Dintrospection=disabled \ 455 | -Dfontconfig=enabled \ 456 | '$(SOURCE_DIR)' \ 457 | '$(BUILD_DIR)' 458 | 459 | $(MXE_NINJA) -C '$(BUILD_DIR)' -j '$(JOBS)' install 460 | endef 461 | 462 | # compile with the Rust toolchain 463 | define librsvg_BUILD 464 | $(eval export CARGO_HOME := $(PREFIX)/$(TARGET)/.cargo) 465 | 466 | # Enable networking while we build librsvg 467 | $(eval export MXE_ENABLE_NETWORK := 1) 468 | 469 | # Disable tools 470 | $(SED) -i "/subdir('rsvg_convert')/d" '$(SOURCE_DIR)/meson.build' 471 | 472 | $(MXE_MESON_WRAPPER) \ 473 | -Dintrospection=disabled \ 474 | -Dpixbuf=disabled \ 475 | -Dpixbuf-loader=disabled \ 476 | -Ddocs=disabled \ 477 | -Dvala=disabled \ 478 | -Dtests=false \ 479 | -Dtriplet='$(PROCESSOR)-pc-windows-gnullvm' \ 480 | -Dc_link_args='$(LDFLAGS) -lntdll -luserenv' \ 481 | '$(SOURCE_DIR)' \ 482 | '$(BUILD_DIR)' 483 | 484 | $(MXE_NINJA) -C '$(BUILD_DIR)' -j '$(JOBS)' install 485 | 486 | # Add native libraries needed for static linking to .pc file. 487 | # We cannot use rustc --print native-static-libs due to -Zbuild-std. 488 | # See: https://gitlab.gnome.org/GNOME/librsvg/-/issues/968 489 | $(SED) -i "/^Libs.private:/s/$$/ -lntdll -luserenv/" '$(PREFIX)/$(TARGET)/lib/pkgconfig/librsvg-2.0.pc' 490 | endef 491 | 492 | # compile with CMake 493 | define poppler_BUILD 494 | cd '$(BUILD_DIR)' && '$(TARGET)-cmake' \ 495 | -DENABLE_LIBTIFF=ON \ 496 | -DENABLE_LIBPNG=ON \ 497 | -DENABLE_GLIB=ON \ 498 | -DENABLE_LCMS=ON \ 499 | -DENABLE_LIBOPENJPEG='openjpeg2' \ 500 | -DENABLE_DCTDECODER='libjpeg' \ 501 | -DFONT_CONFIGURATION=win32 \ 502 | -DENABLE_UNSTABLE_API_ABI_HEADERS=OFF \ 503 | -DENABLE_NSS3=OFF \ 504 | -DENABLE_GPGME=OFF \ 505 | -DENABLE_BOOST=OFF \ 506 | -DENABLE_CPP=OFF \ 507 | -DBUILD_GTK_TESTS=OFF \ 508 | -DENABLE_UTILS=OFF \ 509 | -DENABLE_QT5=OFF \ 510 | -DENABLE_QT6=OFF \ 511 | -DENABLE_LIBCURL=OFF \ 512 | -DBUILD_QT5_TESTS=OFF \ 513 | -DBUILD_QT6_TESTS=OFF \ 514 | -DBUILD_CPP_TESTS=OFF \ 515 | -DBUILD_MANUAL_TESTS=OFF \ 516 | -DENABLE_GTK_DOC=OFF \ 517 | '$(SOURCE_DIR)' 518 | 519 | $(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)' 520 | $(MAKE) -C '$(BUILD_DIR)' -j 1 $(subst -,/,$(INSTALL_STRIP_LIB)) 521 | endef 522 | 523 | # the zlib configure is a bit basic, so we'll use cmake 524 | define zlib_BUILD 525 | cd '$(BUILD_DIR)' && '$(TARGET)-cmake' \ 526 | -DZLIB_BUILD_EXAMPLES=OFF \ 527 | -DINSTALL_PKGCONFIG_DIR='$(PREFIX)/$(TARGET)/lib/pkgconfig' \ 528 | '$(SOURCE_DIR)' 529 | 530 | $(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)' 531 | $(MAKE) -C '$(BUILD_DIR)' -j 1 $(subst -,/,$(INSTALL_STRIP_LIB)) 532 | endef 533 | 534 | define zlib_BUILD_SHARED 535 | $($(PKG)_BUILD) 536 | endef 537 | 538 | # avoid building unnecessary things 539 | # disable the C++ API for now, we don't use it anyway 540 | # build without lzma and zstd 541 | # disable old-style JPEG in TIFF images, see: 542 | # https://github.com/libvips/libvips/issues/1328#issuecomment-572020749 543 | define tiff_BUILD 544 | cd '$(BUILD_DIR)' && $(SOURCE_DIR)/configure \ 545 | $(MXE_CONFIGURE_OPTS) \ 546 | --disable-tools \ 547 | --disable-tests \ 548 | --disable-contrib \ 549 | --disable-docs \ 550 | --disable-mdi \ 551 | --disable-pixarlog \ 552 | --disable-old-jpeg \ 553 | --disable-cxx \ 554 | --disable-lzma \ 555 | --disable-zstd \ 556 | $(if $(and $(IS_JPEGLI),$(BUILD_STATIC)), LIBS="`'$(TARGET)-pkg-config' --libs libjpeg`") 557 | $(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)' $(MXE_DISABLE_CRUFT) 558 | $(MAKE) -C '$(BUILD_DIR)' -j 1 $(INSTALL_STRIP_LIB) $(MXE_DISABLE_CRUFT) 559 | endef 560 | 561 | # disable unneeded loaders 562 | define libwebp_BUILD 563 | cd '$(BUILD_DIR)' && $(SOURCE_DIR)/configure \ 564 | $(MXE_CONFIGURE_OPTS) \ 565 | --disable-gl \ 566 | --disable-sdl \ 567 | --disable-png \ 568 | --disable-jpeg \ 569 | --disable-tiff \ 570 | --disable-gif \ 571 | --enable-libwebpmux \ 572 | --enable-libwebpdemux 573 | $(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)' $(MXE_DISABLE_PROGRAMS) 574 | $(MAKE) -C '$(BUILD_DIR)' -j 1 $(INSTALL_STRIP_LIB) $(MXE_DISABLE_PROGRAMS) 575 | endef 576 | 577 | # Disable the DWrite font backend to ensure compat with Windows Nano Server 578 | # node-canvas needs a Cairo with SVG support, so compile with -Dpng=enabled 579 | # ensure the FontConfig backend is enabled 580 | # build with -Dzlib=disabled to disable the script, PostScript and PDF surfaces 581 | define cairo_BUILD 582 | $(MXE_MESON_WRAPPER) \ 583 | -Ddwrite=disabled \ 584 | -Dfontconfig=enabled \ 585 | -Dfreetype=enabled \ 586 | -Dpng=enabled \ 587 | -Dquartz=disabled \ 588 | -Dtee=disabled \ 589 | -Dxcb=disabled \ 590 | -Dxlib=disabled \ 591 | -Dxlib-xcb=disabled \ 592 | -Dzlib=disabled \ 593 | -Dtests=disabled \ 594 | -Dgtk2-utils=disabled \ 595 | -Dglib=enabled \ 596 | -Dspectre=disabled \ 597 | -Dsymbol-lookup=disabled \ 598 | -Dgtk_doc=false \ 599 | $(cairo_CONFIGURE_OPTS) \ 600 | '$(SOURCE_DIR)' \ 601 | '$(BUILD_DIR)' 602 | 603 | $(MXE_NINJA) -C '$(BUILD_DIR)' -j '$(JOBS)' install 604 | endef 605 | 606 | define matio_BUILD 607 | # https://github.com/tbeu/matio/issues/78 for ac_cv_va_copy 608 | cd '$(BUILD_DIR)' && $(SOURCE_DIR)/configure \ 609 | $(MXE_CONFIGURE_OPTS) \ 610 | ac_cv_va_copy=C99 611 | $(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)' $(MXE_DISABLE_CRUFT) 612 | $(MAKE) -C '$(BUILD_DIR)' -j 1 $(INSTALL_STRIP_LIB) $(MXE_DISABLE_CRUFT) 613 | endef 614 | 615 | define matio_BUILD_SHARED 616 | $($(PKG)_BUILD) 617 | endef 618 | 619 | # build with the Meson build system 620 | # build a minimal libxml2, see: https://github.com/lovell/sharp-libvips/pull/92 621 | # OpenSlide needs -Dxpath=enabled 622 | # ImageMagick's internal MSVG parser needs -Dpush=enabled -Dsax1=enabled 623 | define libxml2_BUILD 624 | $(MXE_MESON_WRAPPER) \ 625 | -Dminimum=true \ 626 | $(if $(findstring .all,$(TARGET)), \ 627 | -Dxpath=enabled \ 628 | -Dpush=enabled \ 629 | -Dsax1=enabled) \ 630 | $(libxml2_MESON_OPTS) \ 631 | '$(SOURCE_DIR)' \ 632 | '$(BUILD_DIR)' 633 | 634 | $(MXE_NINJA) -C '$(BUILD_DIR)' -j '$(JOBS)' install 635 | endef 636 | 637 | # Only build libarchive with zlib support 638 | define libarchive_BUILD 639 | cd '$(BUILD_DIR)' && $(SOURCE_DIR)/configure \ 640 | $(MXE_CONFIGURE_OPTS) \ 641 | --without-bz2lib \ 642 | --without-libb2 \ 643 | --without-iconv \ 644 | --without-lz4 \ 645 | --without-zstd \ 646 | --without-lzma \ 647 | --without-cng \ 648 | --without-openssl \ 649 | --without-xml2 \ 650 | --without-expat \ 651 | --disable-acl \ 652 | --disable-xattr \ 653 | --disable-bsdtar \ 654 | --disable-bsdcat \ 655 | --disable-bsdcpio \ 656 | --disable-posix-regex-lib \ 657 | $(if $(BUILD_STATIC), CFLAGS='$(CFLAGS) -DLIBARCHIVE_STATIC') 658 | $(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)' $(MXE_DISABLE_CRUFT) 659 | $(MAKE) -C '$(BUILD_DIR)' -j 1 $(INSTALL_STRIP_LIB) $(MXE_DISABLE_CRUFT) 660 | endef 661 | 662 | # build with the Meson build system 663 | # compile with the internal PCRE library 664 | define glib_BUILD 665 | $(if $(findstring .ffi,$(TARGET)), \ 666 | (cd '$(SOURCE_DIR)' && $(PATCH) -p1 -u) < $(realpath $(dir $(lastword $(glib_PATCHES))))/glib-static.patch) 667 | 668 | # Build as shared library when `--with-ffi-compat` is passed, since we 669 | # need `libgobject-2.0-0.dll` and `libglib-2.0-0.dll` for these bindings. 670 | # Enable networking to allow gvdb to be downloaded from WrapDB 671 | MXE_ENABLE_NETWORK=1 $(MXE_MESON_WRAPPER) \ 672 | $(if $(findstring .ffi,$(TARGET)), --default-library=shared) \ 673 | --force-fallback-for=gvdb \ 674 | -Dsysprof=disabled \ 675 | -Dtests=false \ 676 | -Dnls=disabled \ 677 | -Dglib_debug=disabled \ 678 | -Dglib_assert=false \ 679 | -Dglib_checks=false \ 680 | $(glib_CONFIGURE_OPTS) \ 681 | '$(SOURCE_DIR)' \ 682 | '$(BUILD_DIR)' 683 | 684 | $(MXE_NINJA) -C '$(BUILD_DIR)' -j '$(JOBS)' install 685 | endef 686 | 687 | # build with CMake. 688 | define openexr_BUILD 689 | cd '$(BUILD_DIR)' && $(TARGET)-cmake \ 690 | -DOPENEXR_INSTALL_PKG_CONFIG=ON \ 691 | -DOPENEXR_INSTALL_TOOLS=OFF \ 692 | -DOPENEXR_BUILD_TOOLS=OFF \ 693 | -DBUILD_TESTING=OFF \ 694 | '$(SOURCE_DIR)' 695 | $(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)' 696 | $(MAKE) -C '$(BUILD_DIR)' -j 1 $(subst -,/,$(INSTALL_STRIP_LIB)) 697 | endef 698 | 699 | define cfitsio_BUILD 700 | cd '$(BUILD_DIR)' && $(TARGET)-cmake \ 701 | -DUSE_CURL=OFF \ 702 | -DTESTS=OFF \ 703 | -DUTILS=OFF \ 704 | '$(SOURCE_DIR)' 705 | 706 | $(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)' 707 | $(MAKE) -C '$(BUILD_DIR)' -j 1 $(subst -,/,$(INSTALL_STRIP_LIB)) 708 | 709 | '$(TARGET)-gcc' \ 710 | -W -Wall -Werror -ansi \ 711 | '$(TEST_FILE)' -o '$(PREFIX)/$(TARGET)/bin/test-cfitsio.exe' \ 712 | `'$(TARGET)-pkg-config' cfitsio --cflags --libs` 713 | endef 714 | 715 | # Disable tests 716 | # Strip during install if needed 717 | define brotli_BUILD 718 | cd '$(BUILD_DIR)' && $(TARGET)-cmake \ 719 | -DBROTLI_DISABLE_TESTS=ON \ 720 | '$(SOURCE_DIR)' 721 | $(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)' 722 | $(MAKE) -C '$(BUILD_DIR)' -j 1 $(subst -,/,$(INSTALL_STRIP_LIB)) 723 | endef 724 | 725 | # build with --disable-load-extension 726 | define sqlite_BUILD 727 | cd '$(BUILD_DIR)' && $(SOURCE_DIR)/configure \ 728 | --host='$(TARGET)' \ 729 | --build='$(BUILD)' \ 730 | --prefix='$(PREFIX)/$(TARGET)' \ 731 | $(if $(BUILD_SHARED), \ 732 | --out-implib \ 733 | --enable-shared \ 734 | --disable-static \ 735 | $(else), \ 736 | --enable-static \ 737 | --disable-shared) \ 738 | --disable-readline \ 739 | --disable-load-extension 740 | $(MAKE) -C '$(BUILD_DIR)' -j 1 install 741 | endef 742 | -------------------------------------------------------------------------------- /build/patches/aom-3-fixes.patch: -------------------------------------------------------------------------------- 1 | This file is part of MXE. See LICENSE.md for licensing information. 2 | 3 | Contains ad hoc patches for cross building. 4 | 5 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 6 | From: Kleis Auke Wolthuizen 7 | Date: Tue, 6 Oct 2020 19:40:00 +0200 8 | Subject: [PATCH 1/2] aom_pthread: switch win32 mutex API entirely to SWR 9 | 10 | Incorporates the changes from: 11 | https://code.videolan.org/videolan/dav1d/-/merge_requests/107 12 | 13 | diff --git a/aom_util/aom_pthread.h b/aom_util/aom_pthread.h 14 | index 1111111..2222222 100644 15 | --- a/aom_util/aom_pthread.h 16 | +++ b/aom_util/aom_pthread.h 17 | @@ -34,7 +34,9 @@ extern "C" { 18 | #include // NOLINT 19 | typedef HANDLE pthread_t; 20 | typedef int pthread_attr_t; 21 | -typedef CRITICAL_SECTION pthread_mutex_t; 22 | + 23 | +// use lightweight mutex/condition variable API for Windows Vista and later 24 | +typedef SRWLOCK pthread_mutex_t; 25 | 26 | #if _WIN32_WINNT < 0x0600 27 | #error _WIN32_WINNT must target Windows Vista / Server 2008 or newer. 28 | @@ -118,26 +120,27 @@ static inline int pthread_join(pthread_t thread, void **value_ptr) { 29 | static inline int pthread_mutex_init(pthread_mutex_t *const mutex, 30 | void *mutexattr) { 31 | (void)mutexattr; 32 | - InitializeCriticalSectionEx(mutex, 0 /*dwSpinCount*/, 0 /*Flags*/); 33 | + InitializeSRWLock(mutex); 34 | return 0; 35 | } 36 | 37 | static inline int pthread_mutex_trylock(pthread_mutex_t *const mutex) { 38 | - return TryEnterCriticalSection(mutex) ? 0 : EBUSY; 39 | + return TryAcquireSRWLockExclusive(mutex) ? 0 : EBUSY; 40 | } 41 | 42 | static inline int pthread_mutex_lock(pthread_mutex_t *const mutex) { 43 | - EnterCriticalSection(mutex); 44 | + AcquireSRWLockExclusive(mutex); 45 | return 0; 46 | } 47 | 48 | static inline int pthread_mutex_unlock(pthread_mutex_t *const mutex) { 49 | - LeaveCriticalSection(mutex); 50 | + ReleaseSRWLockExclusive(mutex); 51 | return 0; 52 | } 53 | 54 | static inline int pthread_mutex_destroy(pthread_mutex_t *const mutex) { 55 | - DeleteCriticalSection(mutex); 56 | + (void)mutex; 57 | + // Unlocked SWR locks does not use resources 58 | return 0; 59 | } 60 | 61 | @@ -167,7 +170,7 @@ static inline int pthread_cond_broadcast(pthread_cond_t *const condition) { 62 | static inline int pthread_cond_wait(pthread_cond_t *const condition, 63 | pthread_mutex_t *const mutex) { 64 | int ok; 65 | - ok = SleepConditionVariableCS(condition, mutex, INFINITE); 66 | + ok = SleepConditionVariableSRW(condition, mutex, INFINITE, 0); 67 | return !ok; 68 | } 69 | #else // _WIN32 70 | 71 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 72 | From: Kleis Auke Wolthuizen 73 | Date: Wed, 7 Oct 2020 18:43:50 +0200 74 | Subject: [PATCH 2/2] aom_thread: fix potentially bad call to execute 75 | 76 | Incorporates the changes from: 77 | https://chromium.googlesource.com/webm/libwebp/+/fde2782ecbb95043c9640f53682d128713542c49 78 | 79 | diff --git a/aom_util/aom_thread.c b/aom_util/aom_thread.c 80 | index 1111111..2222222 100644 81 | --- a/aom_util/aom_thread.c 82 | +++ b/aom_util/aom_thread.c 83 | @@ -40,10 +40,9 @@ struct AVxWorkerImpl { 84 | 85 | //------------------------------------------------------------------------------ 86 | 87 | -static void execute(AVxWorker *const worker); // Forward declaration. 88 | - 89 | static THREADFN thread_loop(void *ptr) { 90 | AVxWorker *const worker = (AVxWorker *)ptr; 91 | + const AVxWorkerInterface *const winterface = aom_get_worker_interface(); 92 | #ifdef __APPLE__ 93 | if (worker->thread_name != NULL) { 94 | // Apple's version of pthread_setname_np takes one argument and operates on 95 | @@ -79,7 +78,7 @@ static THREADFN thread_loop(void *ptr) { 96 | // When the worker reacquires worker->impl_->mutex_, worker->status_ must 97 | // still be AVX_WORKER_STATUS_WORKING. 98 | pthread_mutex_unlock(&worker->impl_->mutex_); 99 | - execute(worker); 100 | + winterface->execute(worker); 101 | pthread_mutex_lock(&worker->impl_->mutex_); 102 | assert(worker->status_ == AVX_WORKER_STATUS_WORKING); 103 | worker->status_ = AVX_WORKER_STATUS_OK; 104 | -------------------------------------------------------------------------------- /build/patches/cairo-1-fixes.patch: -------------------------------------------------------------------------------- 1 | This file is part of MXE. See LICENSE.md for licensing information. 2 | 3 | Contains ad hoc patches for cross building. 4 | 5 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 6 | From: Kleis Auke Wolthuizen 7 | Date: Mon, 25 Nov 2019 15:30:00 +0100 8 | Subject: [PATCH 1/3] Remove -D_FORTIFY_SOURCE=2 flag 9 | 10 | See: 11 | https://github.com/msys2/MINGW-packages/issues/5803 12 | https://sourceforge.net/p/mingw-w64/bugs/818/ 13 | 14 | diff --git a/meson.build b/meson.build 15 | index 1111111..2222222 100644 16 | --- a/meson.build 17 | +++ b/meson.build 18 | @@ -71,10 +71,6 @@ if cc.get_id() != 'msvc' 19 | '-fno-common' 20 | ] 21 | 22 | - if get_option('optimization') in ['1', '2', '3'] 23 | - cflags += '-Wp,-D_FORTIFY_SOURCE=2' 24 | - endif 25 | - 26 | supported_cflags = cc.get_supported_arguments(cflags) 27 | add_project_arguments(supported_cflags, language: 'c') 28 | 29 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 30 | From: Kleis Auke Wolthuizen 31 | Date: Fri, 20 Mar 2020 13:00:00 +0100 32 | Subject: [PATCH 2/3] Avoid mapping platform-specific functions on MinGW 33 | 34 | 35 | diff --git a/src/cairo-compiler-private.h b/src/cairo-compiler-private.h 36 | index 1111111..2222222 100644 37 | --- a/src/cairo-compiler-private.h 38 | +++ b/src/cairo-compiler-private.h 39 | @@ -149,7 +149,7 @@ 40 | #define __attribute__(x) 41 | #endif 42 | 43 | -#if (defined(__WIN32__) && !defined(__WINE__)) || defined(_MSC_VER) 44 | +#if (defined(__WIN32__) && !defined(__WINE__) && !defined(__MINGW32__)) || defined(_MSC_VER) 45 | #define access _access 46 | #ifndef R_OK 47 | #define R_OK 4 48 | 49 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 50 | From: Kleis Auke Wolthuizen 51 | Date: Mon, 25 Sep 2023 09:01:52 +0200 52 | Subject: [PATCH 3/3] Expose `-DCAIRO_WIN32_STATIC_BUILD` in the .pc file 53 | 54 | 55 | diff --git a/src/meson.build b/src/meson.build 56 | index 1111111..2222222 100644 57 | --- a/src/meson.build 58 | +++ b/src/meson.build 59 | @@ -263,6 +263,7 @@ libcairo_dep = declare_dependency(link_with: libcairo, 60 | 61 | pkgmod.generate(libcairo, 62 | description: 'Multi-platform 2D graphics library', 63 | + extra_cflags: cairo_static_args, 64 | subdirs: [meson.project_name()], 65 | ) 66 | 67 | -------------------------------------------------------------------------------- /build/patches/cairo-1-nanoserver-compat.patch: -------------------------------------------------------------------------------- 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 2 | From: Kleis Auke Wolthuizen 3 | Date: Sun, 20 Mar 2022 12:32:56 +0100 4 | Subject: [PATCH 1/1] Disable the Win32 surface and font backend 5 | 6 | To avoid having to link against -lgdi32 and -lmsimg32, see: 7 | https://github.com/kleisauke/net-vips/issues/61 8 | 9 | diff --git a/meson.build b/meson.build 10 | index 1111111..2222222 100644 11 | --- a/meson.build 12 | +++ b/meson.build 13 | @@ -485,29 +485,6 @@ if host_machine.system() == 'windows' 14 | 15 | add_project_arguments('-DWIN32_LEAN_AND_MEAN', '-DNOMINMAX', language: ['c', 'cpp']) 16 | 17 | - win32_extra_deps = [ 18 | - cc.find_library('gdi32'), 19 | - cc.find_library('msimg32'), 20 | - ] 21 | - 22 | - deps += win32_extra_deps 23 | - 24 | - feature_conf.set('CAIRO_HAS_WIN32_SURFACE', 1) 25 | - feature_conf.set('CAIRO_HAS_WIN32_FONT', 1) 26 | - 27 | - built_features += [ 28 | - { 29 | - 'name': 'cairo-win32', 30 | - 'description': 'Microsoft Windows surface backend', 31 | - 'deps': win32_extra_deps, 32 | - }, 33 | - { 34 | - 'name': 'cairo-win32-font', 35 | - 'description': 'Microsoft Windows font backend', 36 | - 'deps': win32_extra_deps, 37 | - } 38 | - ] 39 | - 40 | cpp_compiler = meson.get_compiler('cpp') 41 | d2d_dep = cpp_compiler.find_library('d2d1', required: get_option('dwrite')) 42 | dwrite_dep = cpp_compiler.find_library('dwrite', required: get_option('dwrite')) 43 | -------------------------------------------------------------------------------- /build/patches/fftw-3-fixes.patch: -------------------------------------------------------------------------------- 1 | This file is part of MXE. See LICENSE.md for licensing information. 2 | 3 | Contains ad hoc patches for cross building. 4 | 5 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 6 | From: Kleis Auke Wolthuizen 7 | Date: Sun, 16 Feb 2020 19:20:00 +0100 8 | Subject: [PATCH 1/3] Fixes for the llvm-mingw build 9 | 10 | 11 | diff --git a/threads/threads.c b/threads/threads.c 12 | index 1111111..2222222 100644 13 | --- a/threads/threads.c 14 | +++ b/threads/threads.c 15 | @@ -236,7 +236,15 @@ typedef volatile LONG os_static_mutex_t; 16 | static void os_static_mutex_lock(os_static_mutex_t *s) 17 | { 18 | while (InterlockedExchange(s, 1) == 1) { 19 | +#if defined(_MSC_VER) 20 | YieldProcessor(); 21 | +#elif defined(__i386__) || defined(__x86_64__) 22 | + __asm__ __volatile__("pause"); 23 | +#elif defined(__ia64__) || defined(__ia64) 24 | + __asm__ __volatile__ ("hint @pause"); 25 | +#elif defined(__arm__) || defined(__aarch64__) 26 | + __asm__ __volatile__ ("yield"); 27 | +#endif 28 | Sleep(0); 29 | } 30 | } 31 | 32 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 33 | From: Kleis Auke Wolthuizen 34 | Date: Tue, 2 Aug 2022 22:01:33 +0200 35 | Subject: [PATCH 2/3] Fix build with LLVM 15 36 | 37 | 38 | diff --git a/configure.ac b/configure.ac 39 | index 1111111..2222222 100644 40 | --- a/configure.ac 41 | +++ b/configure.ac 42 | @@ -698,11 +698,8 @@ THREADLIBS="" 43 | if test "$enable_threads" = "yes"; then 44 | # Win32 threads are the default on Windows: 45 | if test -z "$THREADLIBS"; then 46 | - AC_MSG_CHECKING([for Win32 threads]) 47 | - AC_TRY_LINK([#include ], 48 | - [_beginthreadex(0,0,0,0,0,0);], 49 | - [THREADLIBS=" "; AC_MSG_RESULT(yes)], 50 | - [AC_MSG_RESULT(no)]) 51 | + AC_CHECK_FUNC([_beginthreadex], 52 | + [THREADLIBS=" ";]) 53 | fi 54 | 55 | # POSIX threads, the default choice everywhere else: 56 | 57 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 58 | From: Kleis Auke Wolthuizen 59 | Date: Tue, 2 Aug 2022 22:02:32 +0200 60 | Subject: [PATCH 3/3] Regenerate configure 61 | 62 | 63 | diff --git a/configure b/configure 64 | index 1111111..2222222 100755 65 | --- a/configure 66 | +++ b/configure 67 | @@ -21520,36 +21520,11 @@ THREADLIBS="" 68 | if test "$enable_threads" = "yes"; then 69 | # Win32 threads are the default on Windows: 70 | if test -z "$THREADLIBS"; then 71 | - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Win32 threads" >&5 72 | -$as_echo_n "checking for Win32 threads... " >&6; } 73 | - cat confdefs.h - <<_ACEOF >conftest.$ac_ext 74 | -/* end confdefs.h. */ 75 | -#include 76 | -#ifdef F77_DUMMY_MAIN 77 | - 78 | -# ifdef __cplusplus 79 | - extern "C" 80 | -# endif 81 | - int F77_DUMMY_MAIN() { return 1; } 82 | - 83 | -#endif 84 | -int 85 | -main () 86 | -{ 87 | -_beginthreadex(0,0,0,0,0,0); 88 | - ; 89 | - return 0; 90 | -} 91 | -_ACEOF 92 | -if ac_fn_c_try_link "$LINENO"; then : 93 | - THREADLIBS=" "; { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 94 | -$as_echo "yes" >&6; } 95 | -else 96 | - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 97 | -$as_echo "no" >&6; } 98 | + ac_fn_c_check_func "$LINENO" "_beginthreadex" "ac_cv_func__beginthreadex" 99 | +if test "x$ac_cv_func__beginthreadex" = xyes; then : 100 | + THREADLIBS=" "; 101 | fi 102 | -rm -f core conftest.err conftest.$ac_objext \ 103 | - conftest$ac_exeext conftest.$ac_ext 104 | + 105 | fi 106 | 107 | # POSIX threads, the default choice everywhere else: 108 | -------------------------------------------------------------------------------- /build/patches/fontconfig-2-fixes.patch: -------------------------------------------------------------------------------- 1 | This file is part of MXE. See LICENSE.md for licensing information. 2 | 3 | Contains ad hoc patches for cross building. 4 | 5 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 6 | From: Kleis Auke Wolthuizen 7 | Date: Thu, 13 Feb 2020 16:00:00 +0100 8 | Subject: [PATCH 1/1] Win32: ignore an error when loading the default config 9 | file 10 | 11 | Windows simply does not have a default `fonts.conf` file and we 12 | cannot assume that the `FONTCONFIG_FILE` or `FONTCONFIG_PATH` 13 | environment variables are set. The default fallback configuration 14 | file loaded from memory is usually sufficient. 15 | 16 | diff --git a/src/fcxml.c b/src/fcxml.c 17 | index 1111111..2222222 100644 18 | --- a/src/fcxml.c 19 | +++ b/src/fcxml.c 20 | @@ -3444,8 +3444,10 @@ bail0: 21 | if (!ret && complain_again) { 22 | if (name) 23 | FcConfigMessage (0, FcSevereError, "Cannot %s config file \"%s\": %s", load ? "load" : "scan", name, FcStrBufDoneStatic (&reason)); 24 | +#ifndef _WIN32 25 | else 26 | FcConfigMessage (0, FcSevereError, "Cannot %s default config file: %s", load ? "load" : "scan", FcStrBufDoneStatic (&reason)); 27 | +#endif 28 | FcStrBufDestroy (&reason); 29 | return FcFalse; 30 | } 31 | 32 | -------------------------------------------------------------------------------- /build/patches/freetype-2-fixes.patch: -------------------------------------------------------------------------------- 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 2 | From: Kleis Auke Wolthuizen 3 | Date: Fri, 3 Sep 2021 15:50:00 +0200 4 | Subject: [PATCH 1/1] Don't use __declspec(dllexport) for static builds 5 | 6 | 7 | diff --git a/meson.build b/meson.build 8 | index 1111111..2222222 100644 9 | --- a/meson.build 10 | +++ b/meson.build 11 | @@ -373,7 +373,7 @@ ftoption_h = custom_target('ftoption.h', 12 | ft2_sources += ftoption_h 13 | ft2_defines += ['-DFT_CONFIG_OPTIONS_H='] 14 | 15 | -if host_machine.system() == 'windows' 16 | +if get_option('default_library') != 'static' and host_machine.system() == 'windows' 17 | ft2_defines += ['-DDLL_EXPORT=1'] 18 | endif 19 | 20 | -------------------------------------------------------------------------------- /build/patches/gdk-pixbuf-2-fixes.patch: -------------------------------------------------------------------------------- 1 | This file is part of MXE. See LICENSE.md for licensing information. 2 | 3 | Contains ad hoc patches for cross building. 4 | 5 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 6 | From: Kleis Auke Wolthuizen 7 | Date: Tue, 13 Oct 2020 16:40:45 +0200 8 | Subject: [PATCH 1/2] Don't force relocation support on Windows 9 | 10 | We don't use loadable modules for gdk-pixbuf. 11 | 12 | diff --git a/meson.build b/meson.build 13 | index 1111111..2222222 100644 14 | --- a/meson.build 15 | +++ b/meson.build 16 | @@ -356,15 +356,8 @@ if not tiff_opt.disabled() and not native_windows_loaders 17 | endif 18 | endif 19 | 20 | -# Determine whether we enable application bundle relocation support, and we use 21 | -# this always on Windows 22 | -if host_system == 'windows' 23 | - relocatable = (get_option('default_library') != 'static') 24 | -else 25 | - relocatable = get_option('relocatable') 26 | -endif 27 | - 28 | -if relocatable 29 | +# Determine whether we enable application bundle relocation support 30 | +if get_option('relocatable') 31 | add_project_arguments([ '-DGDK_PIXBUF_RELOCATABLE' ], language: 'c') 32 | endif 33 | 34 | @@ -424,7 +417,7 @@ summary('MediaLib', use_medialib, section: 'Build') 35 | summary('Introspection', build_gir, section: 'Build') 36 | summary('Documentation', build_docs, section: 'Build') 37 | summary('Manual pages', get_option('man'), section: 'Build') 38 | -summary('Relocatable', relocatable, section: 'Build') 39 | +summary('Relocatable', get_option('relocatable'), section: 'Build') 40 | summary('Build tests', get_option('tests'), section: 'Build') 41 | summary('Installed tests', get_option('installed_tests'), section: 'Build') 42 | 43 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 44 | From: Kleis Auke Wolthuizen 45 | Date: Mon, 7 Oct 2019 11:30:00 +0200 46 | Subject: [PATCH 2/2] Fix pkg-config file when using built-in loader(s) 47 | 48 | See: https://gitlab.gnome.org/GNOME/gdk-pixbuf/merge_requests/50 49 | 50 | diff --git a/meson.build b/meson.build 51 | index 1111111..2222222 100644 52 | --- a/meson.build 53 | +++ b/meson.build 54 | @@ -272,6 +272,9 @@ if not png_opt.disabled() 55 | if png_dep.found() 56 | enabled_loaders += 'png' 57 | loaders_deps += png_dep 58 | + if builtin_loaders.contains('png') or builtin_all_loaders 59 | + gdk_pixbuf_deps += png_dep 60 | + endif 61 | endif 62 | endif 63 | 64 | @@ -307,9 +310,13 @@ else 65 | endif 66 | 67 | if native_windows_loaders 68 | - loaders_deps += cc.find_library('gdiplus') 69 | - loaders_deps += cc.find_library('ole32') 70 | + gdip_lib = cc.find_library('gdiplus') 71 | + ole32_lib = cc.find_library('ole32') 72 | + loaders_deps += [gdip_lib, ole32_lib] 73 | enabled_loaders += 'gdiplus' 74 | + if builtin_loaders.contains('gdiplus') or builtin_all_loaders 75 | + gdk_pixbuf_deps += [gdip_lib, ole32_lib] 76 | + endif 77 | endif 78 | 79 | # Don't check and build the jpeg loader if native_windows_loaders is true 80 | @@ -340,6 +347,9 @@ if not jpeg_opt.disabled() and not native_windows_loaders 81 | if has_destroy_decompress and has_simple_progression 82 | gdk_pixbuf_conf.set('HAVE_PROGRESSIVE_JPEG', has_simple_progression) 83 | endif 84 | + if builtin_loaders.contains('jpeg') or builtin_all_loaders 85 | + gdk_pixbuf_deps += jpeg_dep 86 | + endif 87 | endif 88 | endif 89 | 90 | @@ -353,6 +363,9 @@ if not tiff_opt.disabled() and not native_windows_loaders 91 | if tiff_dep.found() 92 | enabled_loaders += 'tiff' 93 | loaders_deps += tiff_dep 94 | + if builtin_loaders.contains('tiff') or builtin_all_loaders 95 | + gdk_pixbuf_deps += tiff_dep 96 | + endif 97 | endif 98 | endif 99 | 100 | -------------------------------------------------------------------------------- /build/patches/glib-2-dllexport-static.patch: -------------------------------------------------------------------------------- 1 | This file is part of MXE. See LICENSE.md for licensing information. 2 | 3 | Contains ad hoc patches for cross building. 4 | 5 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 6 | From: Kleis Auke Wolthuizen 7 | Date: Sun, 9 Jul 2023 13:30:00 +0200 8 | Subject: [PATCH 1/1] Ensure symbols from GLib and GObject are exposed 9 | 10 | i.e. when libvips is build as a single shared library. 11 | 12 | Upstream-Status: Inappropriate [libvips specific] 13 | This is specific to libvips. 14 | 15 | diff --git a/tools/gen-visibility-macros.py b/tools/gen-visibility-macros.py 16 | index 1111111..2222222 100755 17 | --- a/tools/gen-visibility-macros.py 18 | +++ b/tools/gen-visibility-macros.py 19 | @@ -95,7 +95,7 @@ def gen_visibility_macros(args, current_minor_version): 20 | # define _{ns}_EXPORT __declspec(dllexport) 21 | # define _{ns}_IMPORT __declspec(dllimport) 22 | #elif __GNUC__ >= 4 23 | - # define _{ns}_EXPORT __attribute__((visibility("default"))) 24 | + # define _{ns}_EXPORT __attribute__((visibility("default"))){" __declspec(dllexport)" if ns == "GLIB" or ns == "GOBJECT" else ""} 25 | # define _{ns}_IMPORT 26 | #else 27 | # define _{ns}_EXPORT 28 | -------------------------------------------------------------------------------- /build/patches/glib-2-fixes.patch: -------------------------------------------------------------------------------- 1 | This file is part of MXE. See LICENSE.md for licensing information. 2 | 3 | Contains ad hoc patches for cross building. 4 | 5 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 6 | From: Kleis Auke Wolthuizen 7 | Date: Sat, 12 Nov 2022 14:49:04 +0100 8 | Subject: [PATCH 1/1] giomodule: allow to be statically linked against GLib 9 | 10 | i.e. when GLib and/or GObject is build as a shared library. 11 | 12 | Upstream-Status: Pending 13 | 14 | diff --git a/gio/giomodule.c b/gio/giomodule.c 15 | index 1111111..2222222 100644 16 | --- a/gio/giomodule.c 17 | +++ b/gio/giomodule.c 18 | @@ -1106,7 +1106,7 @@ extern GType _g_win32_network_monitor_get_type (void); 19 | 20 | static HMODULE gio_dll = NULL; 21 | 22 | -#ifndef GLIB_STATIC_COMPILATION 23 | +#ifndef GIO_STATIC_COMPILATION 24 | 25 | BOOL WINAPI DllMain (HINSTANCE hinstDLL, 26 | DWORD fdwReason, 27 | @@ -1126,9 +1126,13 @@ DllMain (HINSTANCE hinstDLL, 28 | return TRUE; 29 | } 30 | 31 | -#elif defined(G_HAS_CONSTRUCTORS) /* && G_PLATFORM_WIN32 && GLIB_STATIC_COMPILATION */ 32 | +#elif defined(G_HAS_CONSTRUCTORS) /* && G_PLATFORM_WIN32 && GIO_STATIC_COMPILATION */ 33 | +#ifdef GLIB_STATIC_COMPILATION 34 | extern void glib_win32_init (void); 35 | +#endif /* GLIB_STATIC_COMPILATION */ 36 | +#ifdef GOBJECT_STATIC_COMPILATION 37 | extern void gobject_win32_init (void); 38 | +#endif /* GOBJECT_STATIC_COMPILATION */ 39 | 40 | #ifdef G_DEFINE_CONSTRUCTOR_NEEDS_PRAGMA 41 | #pragma G_DEFINE_CONSTRUCTOR_PRAGMA_ARGS(giomodule_init_ctor) 42 | @@ -1151,14 +1155,18 @@ giomodule_init_ctor (void) 43 | * In this case, we must ensure explicitly that glib and gobject are always 44 | * well initialized BEFORE gio. 45 | */ 46 | +#ifdef GLIB_STATIC_COMPILATION 47 | glib_win32_init (); 48 | +#endif /* GLIB_STATIC_COMPILATION */ 49 | +#ifdef GOBJECT_STATIC_COMPILATION 50 | gobject_win32_init (); 51 | +#endif /* GOBJECT_STATIC_COMPILATION */ 52 | gio_win32_appinfo_init (FALSE); 53 | } 54 | 55 | -#else /* G_PLATFORM_WIN32 && GLIB_STATIC_COMPILATION && !G_HAS_CONSTRUCTORS */ 56 | +#else /* G_PLATFORM_WIN32 && GIO_STATIC_COMPILATION && !G_HAS_CONSTRUCTORS */ 57 | #error Your platform/compiler is missing constructor support 58 | -#endif /* GLIB_STATIC_COMPILATION */ 59 | +#endif /* GIO_STATIC_COMPILATION */ 60 | 61 | void * 62 | _g_io_win32_get_module (void) 63 | 64 | -------------------------------------------------------------------------------- /build/patches/glib-2-without-gregex.patch: -------------------------------------------------------------------------------- 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 2 | From: Kleis Auke Wolthuizen 3 | Date: Wed, 13 Jul 2022 09:44:36 +0200 4 | Subject: [PATCH 1/1] Remove GRegex pre-emptively 5 | 6 | Unused by libvips or any of the libraries it relies on. 7 | 8 | Upstream-Status: Inappropriate [disable feature] 9 | Upstream may still depend on GRegex. 10 | 11 | diff --git a/gio/gsettingsschema.c b/gio/gsettingsschema.c 12 | index 1111111..2222222 100644 13 | --- a/gio/gsettingsschema.c 14 | +++ b/gio/gsettingsschema.c 15 | @@ -548,62 +548,7 @@ start_element (GMarkupParseContext *context, 16 | static gchar * 17 | normalise_whitespace (const gchar *orig) 18 | { 19 | - /* We normalise by the same rules as in intltool: 20 | - * 21 | - * sub cleanup { 22 | - * s/^\s+//; 23 | - * s/\s+$//; 24 | - * s/\s+/ /g; 25 | - * return $_; 26 | - * } 27 | - * 28 | - * $message = join "\n\n", map &cleanup, split/\n\s*\n+/, $message; 29 | - * 30 | - * Where \s is an ascii space character. 31 | - * 32 | - * We aim for ease of implementation over efficiency -- this code is 33 | - * not run in normal applications. 34 | - */ 35 | - static GRegex *cleanup[3]; 36 | - static GRegex *splitter; 37 | - gchar **lines; 38 | - gchar *result; 39 | - gint i; 40 | - 41 | - if (g_once_init_enter_pointer (&splitter)) 42 | - { 43 | - GRegex *s; 44 | - 45 | - cleanup[0] = g_regex_new ("^\\s+", G_REGEX_DEFAULT, 46 | - G_REGEX_MATCH_DEFAULT, NULL); 47 | - cleanup[1] = g_regex_new ("\\s+$", G_REGEX_DEFAULT, 48 | - G_REGEX_MATCH_DEFAULT, NULL); 49 | - cleanup[2] = g_regex_new ("\\s+", G_REGEX_DEFAULT, 50 | - G_REGEX_MATCH_DEFAULT, NULL); 51 | - s = g_regex_new ("\\n\\s*\\n+", G_REGEX_DEFAULT, 52 | - G_REGEX_MATCH_DEFAULT, NULL); 53 | - 54 | - g_once_init_leave_pointer (&splitter, s); 55 | - } 56 | - 57 | - lines = g_regex_split (splitter, orig, 0); 58 | - for (i = 0; lines[i]; i++) 59 | - { 60 | - gchar *a, *b, *c; 61 | - 62 | - a = g_regex_replace_literal (cleanup[0], lines[i], -1, 0, "", 0, 0); 63 | - b = g_regex_replace_literal (cleanup[1], a, -1, 0, "", 0, 0); 64 | - c = g_regex_replace_literal (cleanup[2], b, -1, 0, " ", 0, 0); 65 | - g_free (lines[i]); 66 | - g_free (a); 67 | - g_free (b); 68 | - lines[i] = c; 69 | - } 70 | - 71 | - result = g_strjoinv ("\n\n", lines); 72 | - g_strfreev (lines); 73 | - 74 | - return result; 75 | + return orig; 76 | } 77 | 78 | static void 79 | diff --git a/glib/glib-autocleanups.h b/glib/glib-autocleanups.h 80 | index 1111111..2222222 100644 81 | --- a/glib/glib-autocleanups.h 82 | +++ b/glib/glib-autocleanups.h 83 | @@ -75,8 +75,6 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(GPatternSpec, g_pattern_spec_free) 84 | G_DEFINE_AUTOPTR_CLEANUP_FUNC(GQueue, g_queue_free) 85 | G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(GQueue, g_queue_clear) 86 | G_DEFINE_AUTOPTR_CLEANUP_FUNC(GRand, g_rand_free) 87 | -G_DEFINE_AUTOPTR_CLEANUP_FUNC(GRegex, g_regex_unref) 88 | -G_DEFINE_AUTOPTR_CLEANUP_FUNC(GMatchInfo, g_match_info_unref) 89 | G_DEFINE_AUTOPTR_CLEANUP_FUNC(GScanner, g_scanner_destroy) 90 | G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSequence, g_sequence_free) 91 | G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSList, g_slist_free) 92 | diff --git a/glib/glib.h b/glib/glib.h 93 | index 1111111..2222222 100644 94 | --- a/glib/glib.h 95 | +++ b/glib/glib.h 96 | @@ -75,7 +75,6 @@ 97 | #include 98 | #include 99 | #include 100 | -#include 101 | #include 102 | #include 103 | #include 104 | diff --git a/glib/meson.build b/glib/meson.build 105 | index 1111111..2222222 100644 106 | --- a/glib/meson.build 107 | +++ b/glib/meson.build 108 | @@ -216,7 +216,6 @@ glib_sub_headers = files( 109 | 'grcbox.h', 110 | 'grefcount.h', 111 | 'grefstring.h', 112 | - 'gregex.h', 113 | 'gscanner.h', 114 | 'gsequence.h', 115 | 'gshell.h', 116 | @@ -310,7 +309,6 @@ glib_sources += files( 117 | 'grcbox.c', 118 | 'grefcount.c', 119 | 'grefstring.c', 120 | - 'gregex.c', 121 | 'gscanner.c', 122 | 'gsequence.c', 123 | 'gshell.c', 124 | @@ -395,13 +393,7 @@ else 125 | glib_dtrace_hdr = [] 126 | endif 127 | 128 | -pcre2_static_args = [] 129 | - 130 | -if use_pcre2_static_flag 131 | - pcre2_static_args = ['-DPCRE2_STATIC'] 132 | -endif 133 | - 134 | -glib_c_args = ['-DG_LOG_DOMAIN="GLib"'] + glib_c_args_internal + pcre2_static_args 135 | +glib_c_args = ['-DG_LOG_DOMAIN="GLib"'] + glib_c_args_internal 136 | libglib = library('glib-2.0', 137 | glib_dtrace_obj, glib_dtrace_hdr, 138 | sources : [glib_deprecated_sources, glib_sources], 139 | @@ -421,7 +413,6 @@ libglib = library('glib-2.0', 140 | libm, 141 | librt, 142 | libsysprof_capture_dep, 143 | - pcre2, 144 | platform_deps, 145 | thread_dep, 146 | ], 147 | diff --git a/gobject/gboxed.c b/gobject/gboxed.c 148 | index 1111111..2222222 100644 149 | --- a/gobject/gboxed.c 150 | +++ b/gobject/gboxed.c 151 | @@ -115,9 +115,6 @@ G_DEFINE_BOXED_TYPE (GByteArray, g_byte_array, g_byte_array_ref, g_byte_array_un 152 | G_DEFINE_BOXED_TYPE (GBytes, g_bytes, g_bytes_ref, g_bytes_unref) 153 | G_DEFINE_BOXED_TYPE (GTree, g_tree, g_tree_ref, g_tree_unref) 154 | 155 | -G_DEFINE_BOXED_TYPE (GRegex, g_regex, g_regex_ref, g_regex_unref) 156 | -G_DEFINE_BOXED_TYPE (GMatchInfo, g_match_info, g_match_info_ref, g_match_info_unref) 157 | - 158 | #define g_variant_type_get_type g_variant_type_get_gtype 159 | G_DEFINE_BOXED_TYPE (GVariantType, g_variant_type, g_variant_type_copy, g_variant_type_free) 160 | #undef g_variant_type_get_type 161 | diff --git a/gobject/glib-types.h b/gobject/glib-types.h 162 | index 1111111..2222222 100644 163 | --- a/gobject/glib-types.h 164 | +++ b/gobject/glib-types.h 165 | @@ -88,15 +88,6 @@ typedef gsize GType; 166 | */ 167 | #define G_TYPE_HASH_TABLE (g_hash_table_get_type ()) 168 | 169 | -/** 170 | - * G_TYPE_REGEX: 171 | - * 172 | - * The #GType for a boxed type holding a #GRegex reference. 173 | - * 174 | - * Since: 2.14 175 | - */ 176 | -#define G_TYPE_REGEX (g_regex_get_type ()) 177 | - 178 | /** 179 | * G_TYPE_MATCH_INFO: 180 | * 181 | diff --git a/meson.build b/meson.build 182 | index 1111111..2222222 100644 183 | --- a/meson.build 184 | +++ b/meson.build 185 | @@ -2234,50 +2234,6 @@ else 186 | libiconv = dependency('iconv') 187 | endif 188 | 189 | -pcre2_req = '>=10.32' 190 | -pcre2_options = [ 191 | - 'default_library=static', 192 | - 'test=false', 193 | -] 194 | - 195 | -# Pick up pcre from the system, or if "--force-fallback-for libpcre2-8" was specified 196 | -pcre2 = dependency('libpcre2-8', version: pcre2_req, required: false, default_options: pcre2_options) 197 | -if not pcre2.found() 198 | - if cc.get_id() == 'msvc' or cc.get_id() == 'clang-cl' 199 | - # MSVC: Search for the PCRE2 library by the configuration, which corresponds 200 | - # to the output of CMake builds of PCRE2. Note that debugoptimized 201 | - # is really a Release build with .PDB files. 202 | - if vs_crt == 'debug' 203 | - pcre2 = cc.find_library('pcre2d-8', required : false) 204 | - else 205 | - pcre2 = cc.find_library('pcre2-8', required : false) 206 | - endif 207 | - endif 208 | -endif 209 | - 210 | -# Try again with the fallback 211 | -if not pcre2.found() 212 | - pcre2 = dependency('libpcre2-8', version: pcre2_req, allow_fallback: true, default_options: pcre2_options) 213 | - assert(pcre2.type_name() == 'internal') 214 | - # static flags are automatically enabled by the subproject if it's built 215 | - # with default_library=static 216 | - use_pcre2_static_flag = false 217 | -elif host_system == 'windows' and pcre2.type_name() != 'internal' 218 | - pcre2_static = cc.links('''#define PCRE2_STATIC 219 | - #define PCRE2_CODE_UNIT_WIDTH 8 220 | - #include 221 | - int main() { 222 | - void *p = NULL; 223 | - pcre2_code_free(p); 224 | - return 0; 225 | - }''', 226 | - dependencies: pcre2, 227 | - name : 'Windows system PCRE2 is a static build') 228 | - use_pcre2_static_flag = pcre2_static 229 | -else 230 | - use_pcre2_static_flag = false 231 | -endif 232 | - 233 | # Import the gvdb sources as a subproject to avoid having the copylib in-tree 234 | subproject('gvdb', default_options: {'tests': false}) 235 | gvdb_dep = dependency('gvdb') 236 | -------------------------------------------------------------------------------- /build/patches/glib-2-without-win32appinfo.patch: -------------------------------------------------------------------------------- 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 2 | From: Kleis Auke Wolthuizen 3 | Date: Sat, 12 Nov 2022 14:56:20 +0100 4 | Subject: [PATCH 1/1] Avoid calling gio_win32_appinfo_init during DLL load 5 | 6 | Since it scans all XML manifests of UWP apps, which is expensive in terms 7 | of performance. Also, the whole win32appinfo API is unused by libvips or 8 | any of the libraries it relies on. 9 | 10 | See: https://gitlab.gnome.org/GNOME/glib/-/issues/2640 11 | 12 | Upstream-Status: Inappropriate [disable feature] 13 | Upstream may still depend on win32appinfo. 14 | 15 | diff --git a/gio/giomodule.c b/gio/giomodule.c 16 | index 1111111..2222222 100644 17 | --- a/gio/giomodule.c 18 | +++ b/gio/giomodule.c 19 | @@ -1120,7 +1120,6 @@ DllMain (HINSTANCE hinstDLL, 20 | if (fdwReason == DLL_PROCESS_ATTACH) 21 | { 22 | gio_dll = hinstDLL; 23 | - gio_win32_appinfo_init (FALSE); 24 | } 25 | 26 | return TRUE; 27 | @@ -1161,7 +1160,6 @@ giomodule_init_ctor (void) 28 | #ifdef GOBJECT_STATIC_COMPILATION 29 | gobject_win32_init (); 30 | #endif /* GOBJECT_STATIC_COMPILATION */ 31 | - gio_win32_appinfo_init (FALSE); 32 | } 33 | 34 | #else /* G_PLATFORM_WIN32 && GIO_STATIC_COMPILATION && !G_HAS_CONSTRUCTORS */ 35 | -------------------------------------------------------------------------------- /build/patches/glib-static.patch: -------------------------------------------------------------------------------- 1 | This file is part of MXE. See LICENSE.md for licensing information. 2 | 3 | Contains ad hoc patches for cross building. 4 | 5 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 6 | From: Kleis Auke Wolthuizen 7 | Date: Mon, 13 May 2019 17:00:00 +0200 8 | Subject: [PATCH 1/1] Build gio and gmodule static 9 | 10 | 11 | diff --git a/gio/meson.build b/gio/meson.build 12 | index 1111111..2222222 100644 13 | --- a/gio/meson.build 14 | +++ b/gio/meson.build 15 | @@ -858,12 +858,9 @@ else 16 | gio_dtrace_hdr = [] 17 | endif 18 | 19 | -libgio = library('gio-2.0', 20 | +libgio = static_library('gio-2.0', 21 | gioenumtypes_h, gioenumtypes_c, gnetworking_h, gio_sources, 22 | gio_dtrace_hdr, gio_dtrace_obj, 23 | - version : library_version, 24 | - soversion : soversion, 25 | - darwin_versions : darwin_versions, 26 | install : true, 27 | include_directories : [configinc, gioinc], 28 | # '$(gio_win32_res_ldflag)', 29 | diff --git a/gmodule/meson.build b/gmodule/meson.build 30 | index 1111111..2222222 100644 31 | --- a/gmodule/meson.build 32 | +++ b/gmodule/meson.build 33 | @@ -88,11 +88,8 @@ if host_system == 'windows' 34 | gmodule_sources += [gmodule_win_res] 35 | endif 36 | 37 | -libgmodule = library('gmodule-2.0', 38 | +libgmodule = static_library('gmodule-2.0', 39 | sources : gmodule_sources, 40 | - version : library_version, 41 | - soversion : soversion, 42 | - darwin_versions : darwin_versions, 43 | install : true, 44 | include_directories : [configinc, gmoduleinc], 45 | dependencies : [libdl_dep, libglib_dep], 46 | diff --git a/meson.build b/meson.build 47 | index 1111111..2222222 100644 48 | --- a/meson.build 49 | +++ b/meson.build 50 | @@ -335,13 +335,14 @@ endif 51 | if glib_build_static_only 52 | glibconfig_conf.set('GLIB_STATIC_COMPILATION', '1') 53 | glibconfig_conf.set('GOBJECT_STATIC_COMPILATION', '1') 54 | - glibconfig_conf.set('GIO_STATIC_COMPILATION', '1') 55 | - glibconfig_conf.set('GMODULE_STATIC_COMPILATION', '1') 56 | glibconfig_conf.set('GI_STATIC_COMPILATION', '1') 57 | glibconfig_conf.set('G_INTL_STATIC_COMPILATION', '1') 58 | glibconfig_conf.set('FFI_STATIC_BUILD', '1') 59 | endif 60 | 61 | +glibconfig_conf.set('GIO_STATIC_COMPILATION', '1') 62 | +glibconfig_conf.set('GMODULE_STATIC_COMPILATION', '1') 63 | + 64 | # Cygwin glib port maintainers made it clear 65 | # (via the patches they apply) that they want no 66 | # part of glib W32 code, therefore we do not define 67 | -------------------------------------------------------------------------------- /build/patches/imagemagick-6-disable-network.patch: -------------------------------------------------------------------------------- 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 2 | From: Kleis Auke Wolthuizen 3 | Date: Sat, 12 Nov 2022 17:00:56 +0100 4 | Subject: [PATCH 1/1] Revert "coders: Enable opening https files in mingw (#201)" 5 | 6 | This reverts commit 81bbfb20beda814a6c597445e896f18a997f49fb. 7 | 8 | diff --git a/Makefile.in b/Makefile.in 9 | index 1111111..2222222 100644 10 | --- a/Makefile.in 11 | +++ b/Makefile.in 12 | @@ -258,11 +258,10 @@ bin_PROGRAMS = $(am__EXEEXT_1) 13 | TESTS = $(TESTS_TESTS) $(am__EXEEXT_5) 14 | XFAIL_TESTS = $(am__EXEEXT_6) $(am__EXEEXT_6) 15 | check_PROGRAMS = $(am__EXEEXT_2) $(am__EXEEXT_4) 16 | -@WIN32_NATIVE_BUILD_TRUE@am__append_1 = -lurlmon 17 | -@WIN32_NATIVE_BUILD_TRUE@am__append_2 = -lws2_32 18 | -@WIN32_NATIVE_BUILD_TRUE@@WITH_MODULES_FALSE@am__append_3 = -lws2_32 -lurlmon 19 | +@WIN32_NATIVE_BUILD_TRUE@am__append_1 = -lws2_32 20 | +@WIN32_NATIVE_BUILD_TRUE@@WITH_MODULES_FALSE@am__append_2 = -lws2_32 -lurlmon 21 | +@MAGICKCORE_ZERO_CONFIGURATION_SUPPORT_TRUE@am__append_3 = magick/threshold-map.h 22 | @MAGICKCORE_ZERO_CONFIGURATION_SUPPORT_TRUE@am__append_4 = magick/threshold-map.h 23 | -@MAGICKCORE_ZERO_CONFIGURATION_SUPPORT_TRUE@am__append_5 = magick/threshold-map.h 24 | subdir = . 25 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 26 | am__aclocal_m4_deps = $(top_srcdir)/m4/ax_c___attribute__.m4 \ 27 | @@ -1270,7 +1269,7 @@ coders_uil_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ 28 | @WITH_MODULES_TRUE@am_coders_uil_la_rpath = -rpath $(codersdir) 29 | coders_url_la_DEPENDENCIES = $(MAGICKCORE_LIBS) $(am__DEPENDENCIES_1) \ 30 | $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ 31 | - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) 32 | + $(am__DEPENDENCIES_1) 33 | am_coders_url_la_OBJECTS = coders/url_la-url.lo 34 | coders_url_la_OBJECTS = $(am_coders_url_la_OBJECTS) 35 | coders_url_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ 36 | @@ -3409,7 +3408,7 @@ MODULECOMMONCPPFLAGS = $(AM_CPPFLAGS) 37 | DISTCHECK_CONFIGURE_FLAGS = $(DISTCHECK_CONFIG_FLAGS) 38 | DISTCLEANFILES = _configs.sed magick/magick-baseconfig.h 39 | CLEANFILES = $(WAND_CLEANFILES) $(MAGICKPP_CLEANFILES) \ 40 | - $(UTILITIES_CLEANFILES) $(TESTS_CLEANFILES) $(am__append_5) 41 | + $(UTILITIES_CLEANFILES) $(TESTS_CLEANFILES) $(am__append_4) 42 | 43 | # Binary scripts 44 | bin_SCRIPTS = \ 45 | @@ -4520,8 +4519,7 @@ coders_uil_la_LIBADD = $(MAGICKCORE_LIBS) 46 | coders_url_la_SOURCES = coders/url.c 47 | coders_url_la_CPPFLAGS = $(MAGICK_CODER_CPPFLAGS) 48 | coders_url_la_LDFLAGS = $(MODULECOMMONFLAGS) 49 | -coders_url_la_LIBADD = $(MAGICKCORE_LIBS) $(XML_LIBS) $(LZMA_LIBS) \ 50 | - $(ZLIB_LIBS) $(MATH_LIBS) $(am__append_1) 51 | +coders_url_la_LIBADD = $(MAGICKCORE_LIBS) $(XML_LIBS) $(LZMA_LIBS) $(ZLIB_LIBS) $(MATH_LIBS) 52 | 53 | # UYVY coder module 54 | coders_uyvy_la_SOURCES = coders/uyvy.c 55 | @@ -4664,13 +4662,13 @@ MAGICKCORE_LIBS = magick/libMagickCore-@MAGICK_MAJOR_VERSION@.@MAGICK_ABI_SUFFIX 56 | @WITH_MODULES_FALSE@magick_libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la_SOURCES = $(MAGICK_BASE_SRCS) $(MAGICK_PLATFORM_SRCS) $(MAGICK_CODER_SRCS) $(MAGICK_FILTER_SRCS) 57 | @WITH_MODULES_TRUE@magick_libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la_SOURCES = $(MAGICK_BASE_SRCS) $(MAGICK_PLATFORM_SRCS) 58 | @WITH_MODULES_FALSE@magick_libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la_LIBADD = \ 59 | -@WITH_MODULES_FALSE@ $(MAGICK_DEP_LIBS) $(am__append_2) \ 60 | -@WITH_MODULES_FALSE@ $(am__append_3) 61 | +@WITH_MODULES_FALSE@ $(MAGICK_DEP_LIBS) $(am__append_1) \ 62 | +@WITH_MODULES_FALSE@ $(am__append_2) 63 | @WITH_MODULES_TRUE@magick_libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la_LIBADD = \ 64 | -@WITH_MODULES_TRUE@ $(MAGICK_DEP_LIBS) $(am__append_2) \ 65 | -@WITH_MODULES_TRUE@ $(am__append_3) 66 | +@WITH_MODULES_TRUE@ $(MAGICK_DEP_LIBS) $(am__append_1) \ 67 | +@WITH_MODULES_TRUE@ $(am__append_2) 68 | nodist_magick_libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la_SOURCES = \ 69 | - $(am__append_4) 70 | + $(am__append_3) 71 | magick_libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBRARY_EXTRA_CPPFLAGS) 72 | @HAVE_LD_VERSION_SCRIPT_FALSE@magick_libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la_LDFLAGS_VERSION = -export-symbols-regex ".*" 73 | @HAVE_LD_VERSION_SCRIPT_TRUE@magick_libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la_LDFLAGS_VERSION = -Wl,--version-script=$(top_srcdir)/magick/libMagickCore.map 74 | diff --git a/coders/Makefile.am b/coders/Makefile.am 75 | index 1111111..2222222 100644 76 | --- a/coders/Makefile.am 77 | +++ b/coders/Makefile.am 78 | @@ -1009,9 +1009,6 @@ coders_url_la_SOURCES = coders/url.c 79 | coders_url_la_CPPFLAGS = $(MAGICK_CODER_CPPFLAGS) 80 | coders_url_la_LDFLAGS = $(MODULECOMMONFLAGS) 81 | coders_url_la_LIBADD = $(MAGICKCORE_LIBS) $(XML_LIBS) $(LZMA_LIBS) $(ZLIB_LIBS) $(MATH_LIBS) 82 | -if WIN32_NATIVE_BUILD 83 | -coders_url_la_LIBADD += -lurlmon 84 | -endif 85 | 86 | # UYVY coder module 87 | coders_uyvy_la_SOURCES = coders/uyvy.c 88 | diff --git a/coders/url.c b/coders/url.c 89 | index 1111111..2222222 100644 90 | --- a/coders/url.c 91 | +++ b/coders/url.c 92 | @@ -74,7 +74,8 @@ 93 | # include 94 | #endif 95 | #endif 96 | -#if defined(MAGICKCORE_WINDOWS_SUPPORT) 97 | +#if defined(MAGICKCORE_WINDOWS_SUPPORT) && \ 98 | + !defined(__MINGW32__) 99 | # include 100 | # pragma comment(lib, "urlmon.lib") 101 | #endif 102 | @@ -158,7 +159,7 @@ static Image *ReadURLImage(const ImageInfo *image_info,ExceptionInfo *exception) 103 | image=AcquireImage(image_info); 104 | read_info=CloneImageInfo(image_info); 105 | SetImageInfoBlob(read_info,(void *) NULL,0); 106 | -#if !defined(MAGICKCORE_WINDOWS_SUPPORT) 107 | +#if !defined(MAGICKCORE_WINDOWS_SUPPORT) || defined(__MINGW32__) 108 | if (LocaleCompare(read_info->magick,"https") == 0) 109 | { 110 | MagickBooleanType 111 | @@ -212,7 +213,7 @@ static Image *ReadURLImage(const ImageInfo *image_info,ExceptionInfo *exception) 112 | (void) ConcatenateMagickString(filename,":",MaxTextExtent); 113 | LocaleLower(filename); 114 | (void) ConcatenateMagickString(filename,image_info->filename,MaxTextExtent); 115 | -#if defined(MAGICKCORE_WINDOWS_SUPPORT) 116 | +#if defined(MAGICKCORE_WINDOWS_SUPPORT) && !defined(__MINGW32__) 117 | (void) fclose(file); 118 | if (URLDownloadToFile(NULL,filename,read_info->filename,0,NULL) != S_OK) 119 | { 120 | @@ -321,7 +322,8 @@ ModuleExport size_t RegisterURLImage(void) 121 | *entry; 122 | 123 | entry=SetMagickInfo("HTTP"); 124 | -#if defined(MAGICKCORE_WINDOWS_SUPPORT) || \ 125 | +#if (defined(MAGICKCORE_WINDOWS_SUPPORT) && \ 126 | + !defined(__MINGW32__)) || \ 127 | (defined(MAGICKCORE_XML_DELEGATE) && defined(LIBXML_HTTP_ENABLED)) 128 | entry->decoder=(DecodeImageHandler *) ReadURLImage; 129 | #endif 130 | @@ -336,7 +338,8 @@ ModuleExport size_t RegisterURLImage(void) 131 | entry->format_type=ImplicitFormatType; 132 | (void) RegisterMagickInfo(entry); 133 | entry=SetMagickInfo("FTP"); 134 | -#if defined(MAGICKCORE_WINDOWS_SUPPORT) || \ 135 | +#if (defined(MAGICKCORE_WINDOWS_SUPPORT) && \ 136 | + !defined(__MINGW32__)) || \ 137 | (defined(MAGICKCORE_XML_DELEGATE) && defined(LIBXML_FTP_ENABLED)) 138 | entry->decoder=(DecodeImageHandler *) ReadURLImage; 139 | #endif 140 | -------------------------------------------------------------------------------- /build/patches/imath-3-fixes.patch: -------------------------------------------------------------------------------- 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 2 | From: Kleis Auke Wolthuizen 3 | Date: Wed, 24 Mar 2021 15:00:00 +0100 4 | Subject: [PATCH 1/1] Make libraries private within the pkg-config file 5 | 6 | Assuming that Imath is built statically, this ensures that the 7 | libraries are not exposed during linking. 8 | 9 | Upstream-Status: Inappropriate [other] 10 | Upstream may still build it as a shared library. 11 | 12 | diff --git a/config/Imath.pc.in b/config/Imath.pc.in 13 | index 1111111..2222222 100644 14 | --- a/config/Imath.pc.in 15 | +++ b/config/Imath.pc.in 16 | @@ -13,5 +13,5 @@ Description: Imath library: vector/matrix and math operations, plus the half typ 17 | Version: @IMATH_VERSION@ 18 | Requires: 19 | Conflicts: 20 | -Libs: -L${libdir} -lImath${libsuffix} 21 | +Libs.private: -L${libdir} -lImath${libsuffix} 22 | Cflags: -I${includedir} -I${includedir}/Imath 23 | -------------------------------------------------------------------------------- /build/patches/libheif-1-fixes.patch: -------------------------------------------------------------------------------- 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 2 | From: Kleis Auke Wolthuizen 3 | Date: Sat, 9 Nov 2024 13:29:41 +0100 4 | Subject: [PATCH 1/1] Only use `dllexport`/`dllimport` on MSVC 5 | 6 | This reverts commit fefce85ca9057a31167d16d17aea9fee9bf95869 and 7 | 26050190264a1c70d27963712a083ac284267c06. 8 | 9 | Whereas GCC exports all symbols when the `dllexport`/`dllimport` 10 | attributes are not specified, Clang natively supports 11 | `-fvisibility=hidden` for Windows targets. 12 | 13 | This ensures that nothing is exported for static builds, see: 14 | https://github.com/strukturag/libheif/issues/513 15 | https://github.com/strukturag/libheif/issues/902 16 | 17 | Upstream-Status: Inappropriate [other] 18 | Upstream may still use GCC. 19 | 20 | diff --git a/libheif/api/libheif/heif.h b/libheif/api/libheif/heif.h 21 | index 1111111..2222222 100644 22 | --- a/libheif/api/libheif/heif.h 23 | +++ b/libheif/api/libheif/heif.h 24 | @@ -55,7 +55,7 @@ extern "C" { 25 | // 1.18 5 7 1 1 1 1 26 | // 1.19 6 7 2 1 1 1 27 | 28 | -#if (defined(_WIN32) || defined __CYGWIN__) && !defined(LIBHEIF_STATIC_BUILD) 29 | +#if defined(_MSC_VER) && !defined(LIBHEIF_STATIC_BUILD) 30 | #ifdef LIBHEIF_EXPORTS 31 | #define LIBHEIF_API __declspec(dllexport) 32 | #else 33 | -------------------------------------------------------------------------------- /build/patches/libjpeg-turbo-2-fixes.patch: -------------------------------------------------------------------------------- 1 | This file is part of MXE. See LICENSE.md for licensing information. 2 | 3 | Contains ad hoc patches for cross building. 4 | 5 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 6 | From: Alexpux 7 | Date: Sun, 18 Jan 2015 16:49:05 +0300 8 | Subject: [PATCH 1/1] Fix compatibility with "basestd.h" header 9 | 10 | Taken from: 11 | https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-libjpeg-turbo/0001-header-compat.mingw.patch 12 | 13 | diff --git a/src/jmorecfg.h b/src/jmorecfg.h 14 | index 1111111..2222222 100644 15 | --- a/src/jmorecfg.h 16 | +++ b/src/jmorecfg.h 17 | @@ -16,6 +16,12 @@ 18 | * optimizations. Most users will not need to touch this file. 19 | */ 20 | 21 | +/* prevents conflicts */ 22 | +#if defined(__MINGW32__) 23 | +#include /* typedefs INT16 and INT32 */ 24 | + 25 | +#define HAVE_BOOLEAN 26 | +#endif 27 | 28 | /* 29 | * Maximum number of components (color channels) allowed in JPEG image. 30 | @@ -87,6 +93,7 @@ typedef unsigned char JOCTET; 31 | #define GETJOCTET(value) (value) 32 | 33 | 34 | +#ifndef _BASETSD_H_ /* basestd.h from mingw-w64 defines UINT8, UINT16, INT16, INT32 */ 35 | /* These typedefs are used for various table entries and so forth. 36 | * They must be at least as wide as specified; but making them too big 37 | * won't cost a huge amount of memory, so we don't provide special 38 | @@ -134,14 +141,11 @@ typedef short INT16; 39 | */ 40 | 41 | #ifndef XMD_H /* X11/xmd.h correctly defines INT32 */ 42 | -#ifndef _BASETSD_H_ /* Microsoft defines it in basetsd.h */ 43 | -#ifndef _BASETSD_H /* MinGW is slightly different */ 44 | #ifndef QGLOBAL_H /* Qt defines it in qglobal.h */ 45 | typedef long INT32; 46 | #endif 47 | #endif 48 | #endif 49 | -#endif 50 | 51 | /* Datatype used for image dimensions. The JPEG standard only supports 52 | * images up to 64K*64K due to 16-bit fields in SOF markers. Therefore 53 | -------------------------------------------------------------------------------- /build/patches/librsvg-2-fixes.patch: -------------------------------------------------------------------------------- 1 | This file is part of MXE. See LICENSE.md for licensing information. 2 | 3 | Contains ad hoc patches for cross building. 4 | 5 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 6 | From: Kleis Auke Wolthuizen 7 | Date: Thu, 28 Mar 2024 18:29:25 +0100 8 | Subject: [PATCH 1/4] Ignore any errors from native-static-libs query 9 | 10 | It will not properly work with `-Zbuild-std`. 11 | 12 | diff --git a/meson.build b/meson.build 13 | index 1111111..2222222 100644 14 | --- a/meson.build 15 | +++ b/meson.build 16 | @@ -350,13 +350,9 @@ if host_system in ['windows', 'linux'] 17 | native_libs = run_command( 18 | rustc_query_native_static_libs_args, 19 | capture: true, 20 | - check: true 21 | + check: false 22 | ) 23 | 24 | - if native_libs.stderr() != '' 25 | - error(native_libs.stderr()) 26 | - endif 27 | - 28 | foreach i: native_libs.stdout().split() 29 | if 'msvcrt' in i 30 | if i.endswith('.lib') # pre Rust 1.83 31 | 32 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 33 | From: Kleis Auke Wolthuizen 34 | Date: Fri, 7 Jul 2023 18:41:29 +0200 35 | Subject: [PATCH 2/4] Disable PDF/PostScript features in cairo-rs 36 | 37 | We build Cairo with `-Dzlib=disabled`, which implicitly disables 38 | these surface backends. 39 | 40 | diff --git a/librsvg-c/Cargo.toml b/librsvg-c/Cargo.toml 41 | index 1111111..2222222 100644 42 | --- a/librsvg-c/Cargo.toml 43 | +++ b/librsvg-c/Cargo.toml 44 | @@ -10,7 +10,7 @@ edition.workspace = true 45 | rust-version.workspace = true 46 | 47 | [dependencies] 48 | -cairo-rs = { workspace = true, features = ["v1_16", "png", "pdf", "ps", "svg"] } 49 | +cairo-rs = { workspace = true, features = ["v1_16", "png", "svg"] } 50 | cast.workspace = true 51 | float-cmp.workspace = true 52 | gdk-pixbuf = { workspace = true, optional = true } 53 | diff --git a/rsvg/Cargo.toml b/rsvg/Cargo.toml 54 | index 1111111..2222222 100644 55 | --- a/rsvg/Cargo.toml 56 | +++ b/rsvg/Cargo.toml 57 | @@ -48,7 +48,7 @@ name = "rsvg" 58 | [dependencies] 59 | # Keep these in sync with respect to the cairo-rs version: 60 | # src/lib.rs - toplevel example in the docs 61 | -cairo-rs = { workspace = true, features = ["v1_16", "png", "pdf", "ps", "svg"] } 62 | +cairo-rs = { workspace = true, features = ["v1_16", "png", "svg"] } 63 | cast.workspace = true 64 | cssparser.workspace = true 65 | data-url.workspace = true 66 | 67 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 68 | From: Kleis Auke Wolthuizen 69 | Date: Sun, 21 Apr 2024 12:01:02 +0200 70 | Subject: [PATCH 3/4] Disallow GIF and WebP embedded in SVG images 71 | 72 | Upstream-Status: Inappropriate [disable feature] 73 | This is specific to libvips' prebuilt binaries. 74 | 75 | diff --git a/Cargo.lock b/Cargo.lock 76 | index 1111111..2222222 100644 77 | --- a/Cargo.lock 78 | +++ b/Cargo.lock 79 | @@ -399,12 +399,6 @@ version = "0.7.4" 80 | source = "registry+https://github.com/rust-lang/crates.io-index" 81 | checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" 82 | 83 | -[[package]] 84 | -name = "color_quant" 85 | -version = "1.1.0" 86 | -source = "registry+https://github.com/rust-lang/crates.io-index" 87 | -checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" 88 | - 89 | [[package]] 90 | name = "colorchoice" 91 | version = "1.0.3" 92 | @@ -848,16 +842,6 @@ dependencies = [ 93 | "wasi", 94 | ] 95 | 96 | -[[package]] 97 | -name = "gif" 98 | -version = "0.13.1" 99 | -source = "registry+https://github.com/rust-lang/crates.io-index" 100 | -checksum = "3fb2d69b19215e18bb912fa30f7ce15846e301408695e44e0ef719f1da9e19f2" 101 | -dependencies = [ 102 | - "color_quant", 103 | - "weezl", 104 | -] 105 | - 106 | [[package]] 107 | name = "gio" 108 | version = "0.20.6" 109 | @@ -1150,10 +1134,7 @@ checksum = "cd6f44aed642f18953a158afeb30206f4d50da59fbc66ecb53c66488de73563b" 110 | dependencies = [ 111 | "bytemuck", 112 | "byteorder-lite", 113 | - "color_quant", 114 | "dav1d", 115 | - "gif", 116 | - "image-webp", 117 | "mp4parse", 118 | "num-traits", 119 | "png", 120 | @@ -1161,16 +1142,6 @@ dependencies = [ 121 | "zune-jpeg", 122 | ] 123 | 124 | -[[package]] 125 | -name = "image-webp" 126 | -version = "0.2.0" 127 | -source = "registry+https://github.com/rust-lang/crates.io-index" 128 | -checksum = "e031e8e3d94711a9ccb5d6ea357439ef3dcbed361798bd4071dc4d9793fbe22f" 129 | -dependencies = [ 130 | - "byteorder-lite", 131 | - "quick-error 2.0.1", 132 | -] 133 | - 134 | [[package]] 135 | name = "indexmap" 136 | version = "2.7.0" 137 | diff --git a/rsvg/Cargo.toml b/rsvg/Cargo.toml 138 | index 1111111..2222222 100644 139 | --- a/rsvg/Cargo.toml 140 | +++ b/rsvg/Cargo.toml 141 | @@ -56,7 +56,7 @@ encoding_rs.workspace = true 142 | float-cmp.workspace = true 143 | gio.workspace = true 144 | glib.workspace = true 145 | -image = { workspace = true, features = ["jpeg", "png", "gif", "webp"] } 146 | +image = { workspace = true, features = ["jpeg", "png"] } 147 | itertools.workspace = true 148 | language-tags.workspace = true 149 | libc.workspace = true 150 | 151 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 152 | From: Lovell Fuller 153 | Date: Sat, 17 May 2025 14:43:53 +0100 154 | Subject: [PATCH 4/4] text: verify pango/fontconfig found a suitable font 155 | 156 | Helps prevent panic when no fonts are installed 157 | 158 | Upstream-Status: Submitted [https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/1106] 159 | 160 | diff --git a/rsvg/src/text.rs b/rsvg/src/text.rs 161 | index 1111111..2222222 100644 162 | --- a/rsvg/src/text.rs 163 | +++ b/rsvg/src/text.rs 164 | @@ -297,6 +297,12 @@ fn compute_baseline_offset( 165 | 166 | if run.is_some() { 167 | let item = run.unwrap().item(); 168 | + unsafe { 169 | + let analysis = (*item.as_ptr()).analysis; 170 | + if analysis.font.is_null() { 171 | + break; 172 | + } 173 | + } 174 | let font = item.analysis().font(); 175 | 176 | let metrics = font.metrics(None); 177 | -------------------------------------------------------------------------------- /build/patches/matio-1-fixes.patch: -------------------------------------------------------------------------------- 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 2 | From: Kleis Auke Wolthuizen 3 | Date: Sun, 28 Apr 2024 11:46:31 +0200 4 | Subject: [PATCH 1/1] Fix building on case sensitive mingw platforms 5 | 6 | Mingw headers are all lowercase, and can be used for cross compilation 7 | from case sensitive file systems. 8 | 9 | The official Windows SDK headers aren't self-consistent wrt upper/lower 10 | case, so those headers can't be used on case sensitive systems without 11 | a layer providing case insensitivity anyway. 12 | 13 | Upstream-Status: Pending 14 | 15 | diff --git a/src/io.c b/src/io.c 16 | index 1111111..2222222 100644 17 | --- a/src/io.c 18 | +++ b/src/io.c 19 | @@ -32,7 +32,7 @@ 20 | #if defined(_WIN32) 21 | #define WIN32_LEAN_AND_MEAN 22 | #define NOGDI 23 | -#include 24 | +#include 25 | #endif 26 | #include 27 | #include 28 | -------------------------------------------------------------------------------- /build/patches/nifticlib-3-fixes.patch: -------------------------------------------------------------------------------- 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 2 | From: Kleis Auke Wolthuizen 3 | Date: Tue, 28 Jun 2022 15:45:17 +0200 4 | Subject: [PATCH 1/2] Set PROJECT_VERSION manually 5 | 6 | Upstream-Status: Pending 7 | 8 | diff --git a/CMakeLists.txt b/CMakeLists.txt 9 | index 1111111..2222222 100644 10 | --- a/CMakeLists.txt 11 | +++ b/CMakeLists.txt 12 | @@ -11,24 +11,8 @@ endif() 13 | cmake_policy(VERSION ${NIFTI_CMAKE_POLICY_VERSION}) 14 | 15 | set(NIFTI_HOMEPAGE_URL "https://nifti-imaging.github.io") 16 | -execute_process(COMMAND git "describe" "--tags" 17 | - OUTPUT_VARIABLE GIT_REPO_VERSION_UNCLEANED 18 | - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) 19 | - 20 | -#Extract the GIT_REPO_VERSION as composed of non-negative integer components, 21 | -# i.e. [.[.[.]]] 22 | -string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+((beta.*)?(alpha.*)?\\.[0-9]+(\\.g[0-9a-f]+)?)?" 23 | - GIT_REPO_VERSION "${GIT_REPO_VERSION_UNCLEANED}") 24 | - 25 | -if( NOT GIT_REPO_VERSION ) 26 | - message(NOTE "Invalid git tag does not match required regular expression, " 27 | - "can not extract version information from '${GIT_REPO_VERSION_UNCLEANED}'") 28 | - # NOTE: cmake -DGIT_REPO_VERSION:STRING=[.[.[.]]] can be used 29 | - # to set the repo string for non-git repos. 30 | - set(GIT_REPO_VERSION "0.0.0.0") #Manually set the version string for testing purposes 31 | -endif() 32 | project(NIFTI 33 | - VERSION ${GIT_REPO_VERSION} 34 | + VERSION 3.0.1 35 | DESCRIPTION "Niftilib is a set of i/o libraries for reading and writing files in the nifti-1 data format. nifti-1 is a binary file format for storing medical image data, e.g. magnetic resonance image (MRI) and functional MRI (fMRI) brain images." 36 | LANGUAGES C) 37 | 38 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 39 | From: =?UTF-8?q?Corentin=20No=C3=ABl?= 40 | Date: Wed, 2 Feb 2022 18:00:39 +0100 41 | Subject: [PATCH 2/2] Generate pkgconfig files 42 | 43 | This allow to easily include the libraries in other projects. 44 | 45 | See https://www.freedesktop.org/wiki/Software/pkg-config/ for more information 46 | about what pkg-config is. 47 | 48 | Upstream-Status: Submitted [https://github.com/NIFTI-Imaging/nifti_clib/pull/140] 49 | 50 | diff --git a/CMakeLists.txt b/CMakeLists.txt 51 | index 1111111..2222222 100644 52 | --- a/CMakeLists.txt 53 | +++ b/CMakeLists.txt 54 | @@ -56,6 +56,7 @@ set_if_not_defined(NIFTI_INSTALL_RUNTIME_DIR bin) 55 | set_if_not_defined(NIFTI_INSTALL_LIBRARY_DIR lib) 56 | set_if_not_defined(NIFTI_INSTALL_ARCHIVE_DIR ${NIFTI_INSTALL_LIBRARY_DIR}) 57 | set_if_not_defined(NIFTI_INSTALL_INCLUDE_DIR include/nifti) 58 | +set_if_not_defined(NIFTI_INSTALL_PKGCONFIG_DIR ${NIFTI_INSTALL_LIBRARY_DIR}/pkgconfig) 59 | set_if_not_defined(NIFTI_INSTALL_MAN_DIR share/man/man1) 60 | set_if_not_defined(NIFTI_INSTALL_DOC_DIR share/doc/${PROJECT_NAME}) 61 | set_if_not_defined(NIFTI_ZLIB_LIBRARIES "") 62 | diff --git a/cmake/nifti_macros.cmake b/cmake/nifti_macros.cmake 63 | index 1111111..2222222 100644 64 | --- a/cmake/nifti_macros.cmake 65 | +++ b/cmake/nifti_macros.cmake 66 | @@ -135,6 +135,10 @@ function(install_nifti_target target_name) 67 | COMPONENT Development 68 | INCLUDES DESTINATION ${NIFTI_INSTALL_INCLUDE_DIR} 69 | ) 70 | + 71 | + install(FILES $ 72 | + COMPONENT Development 73 | + DESTINATION ${NIFTI_INSTALL_PKGCONFIG_DIR}) 74 | endfunction() 75 | 76 | function(get_lib_version_var ver_header_text ver_type version_out) 77 | diff --git a/nifti2/CMakeLists.txt b/nifti2/CMakeLists.txt 78 | index 1111111..2222222 100644 79 | --- a/nifti2/CMakeLists.txt 80 | +++ b/nifti2/CMakeLists.txt 81 | @@ -2,11 +2,13 @@ set(NIFTI_NIFTILIB2_NAME ${NIFTI_PACKAGE_PREFIX}nifti2) 82 | 83 | add_nifti_library(${NIFTI_NIFTILIB2_NAME} nifti2_io.c ) 84 | target_link_libraries( ${NIFTI_NIFTILIB2_NAME} PUBLIC ${NIFTI_PACKAGE_PREFIX}znz ${NIFTI_SYSTEM_MATH_LIB}) 85 | +configure_file(nifti2.pc.in nifti2.pc @ONLY) 86 | set_target_properties( 87 | ${NIFTI_NIFTILIB2_NAME} 88 | PROPERTIES 89 | PUBLIC_HEADER 90 | "${CMAKE_CURRENT_LIST_DIR}/nifti1.h;${CMAKE_CURRENT_LIST_DIR}/nifti2.h;${CMAKE_CURRENT_LIST_DIR}/nifti2_io.h" 91 | + PKG_CONFIG ${CMAKE_CURRENT_BINARY_DIR}/nifti2.pc 92 | ) 93 | # Set library version when building shared libs. 94 | if(BUILD_SHARED_LIBS) 95 | diff --git a/nifti2/nifti2.pc.in b/nifti2/nifti2.pc.in 96 | new file mode 100644 97 | index 0000000..1111111 98 | --- /dev/null 99 | +++ b/nifti2/nifti2.pc.in 100 | @@ -0,0 +1,11 @@ 101 | +prefix=@CMAKE_INSTALL_PREFIX@ 102 | +exec_prefix=${prefix} 103 | +libdir=${prefix}/@NIFTI_INSTALL_LIBRARY_DIR@ 104 | +includedir=${prefix}/@NIFTI_INSTALL_INCLUDE_DIR@ 105 | + 106 | +Name: nifti2 107 | +Description: Core i/o routines for reading and writing nifti-2 format files 108 | +Version: @PROJECT_VERSION@ 109 | +Requires: znzlib 110 | +Libs: -L${libdir} -lnifti2 111 | +Cflags: -I${includedir} 112 | diff --git a/nifticdf/CMakeLists.txt b/nifticdf/CMakeLists.txt 113 | index 1111111..2222222 100644 114 | --- a/nifticdf/CMakeLists.txt 115 | +++ b/nifticdf/CMakeLists.txt 116 | @@ -1,11 +1,13 @@ 117 | set(NIFTI_CDFLIB_NAME ${NIFTI_PACKAGE_PREFIX}nifticdf) 118 | 119 | add_nifti_library(${NIFTI_CDFLIB_NAME} nifticdf.c ) 120 | +configure_file(nifticdf.pc.in nifticdf.pc @ONLY) 121 | set_target_properties( 122 | ${NIFTI_CDFLIB_NAME} 123 | PROPERTIES 124 | PUBLIC_HEADER 125 | "${CMAKE_CURRENT_LIST_DIR}/nifticdf.h" 126 | + PKG_CONFIG ${CMAKE_CURRENT_BINARY_DIR}/nifticdf.pc 127 | ) 128 | target_compile_options(${NIFTI_CDFLIB_NAME} PRIVATE "-D__COMPILE_UNUSED_FUNCTIONS__") 129 | target_link_libraries(${NIFTI_CDFLIB_NAME} PUBLIC ${NIFTI_PACKAGE_PREFIX}niftiio) 130 | diff --git a/nifticdf/nifticdf.pc.in b/nifticdf/nifticdf.pc.in 131 | new file mode 100644 132 | index 0000000..1111111 133 | --- /dev/null 134 | +++ b/nifticdf/nifticdf.pc.in 135 | @@ -0,0 +1,10 @@ 136 | +prefix=@CMAKE_INSTALL_PREFIX@ 137 | +exec_prefix=${prefix} 138 | +libdir=${prefix}/@NIFTI_INSTALL_LIBRARY_DIR@ 139 | +includedir=${prefix}/@NIFTI_INSTALL_INCLUDE_DIR@ 140 | + 141 | +Name: nifticdf 142 | +Description: Functions to compute cumulative distributions and their inverses 143 | +Version: @PROJECT_VERSION@ 144 | +Libs: -L${libdir} -lnifticdf 145 | +Cflags: -I${includedir} 146 | diff --git a/niftilib/CMakeLists.txt b/niftilib/CMakeLists.txt 147 | index 1111111..2222222 100644 148 | --- a/niftilib/CMakeLists.txt 149 | +++ b/niftilib/CMakeLists.txt 150 | @@ -2,11 +2,13 @@ set(NIFTI_NIFTILIB_NAME ${NIFTI_PACKAGE_PREFIX}niftiio) 151 | 152 | add_nifti_library(${NIFTI_NIFTILIB_NAME} nifti1_io.c ) 153 | target_link_libraries( ${NIFTI_NIFTILIB_NAME} PUBLIC ${NIFTI_PACKAGE_PREFIX}znz ${NIFTI_SYSTEM_MATH_LIB}) 154 | +configure_file(niftiio.pc.in niftiio.pc @ONLY) 155 | set_target_properties( 156 | ${NIFTI_NIFTILIB_NAME} 157 | PROPERTIES 158 | PUBLIC_HEADER 159 | "${CMAKE_CURRENT_LIST_DIR}/nifti1_io.h;${CMAKE_CURRENT_LIST_DIR}/nifti1.h" 160 | + PKG_CONFIG ${CMAKE_CURRENT_BINARY_DIR}/niftiio.pc 161 | ) 162 | # Set library version when building shared libs. 163 | if(BUILD_SHARED_LIBS) 164 | diff --git a/niftilib/niftiio.pc.in b/niftilib/niftiio.pc.in 165 | new file mode 100644 166 | index 0000000..1111111 167 | --- /dev/null 168 | +++ b/niftilib/niftiio.pc.in 169 | @@ -0,0 +1,11 @@ 170 | +prefix=@CMAKE_INSTALL_PREFIX@ 171 | +exec_prefix=${prefix} 172 | +libdir=${prefix}/@NIFTI_INSTALL_LIBRARY_DIR@ 173 | +includedir=${prefix}/@NIFTI_INSTALL_INCLUDE_DIR@ 174 | + 175 | +Name: niftiio 176 | +Description: Core i/o routines for reading and writing nifti-1 format files 177 | +Version: @PROJECT_VERSION@ 178 | +Requires: znzlib 179 | +Libs: -L${libdir} -lniftiio 180 | +Cflags: -I${includedir} 181 | diff --git a/znzlib/CMakeLists.txt b/znzlib/CMakeLists.txt 182 | index 1111111..2222222 100644 183 | --- a/znzlib/CMakeLists.txt 184 | +++ b/znzlib/CMakeLists.txt 185 | @@ -2,10 +2,12 @@ set(NIFTI_ZNZLIB_NAME ${NIFTI_PACKAGE_PREFIX}znz) 186 | 187 | add_nifti_library(${NIFTI_ZNZLIB_NAME} znzlib.c ) 188 | target_link_libraries( ${NIFTI_ZNZLIB_NAME} PUBLIC ${NIFTI_ZLIB_LIBRARIES} ) 189 | +configure_file(znzlib.pc.in znzlib.pc @ONLY) 190 | set_target_properties( 191 | ${NIFTI_ZNZLIB_NAME} 192 | PROPERTIES 193 | PUBLIC_HEADER ${CMAKE_CURRENT_LIST_DIR}/znzlib.h 194 | + PKG_CONFIG ${CMAKE_CURRENT_BINARY_DIR}/znzlib.pc 195 | ) 196 | target_compile_definitions(${NIFTI_ZNZLIB_NAME} PUBLIC ${ZNZ_COMPILE_DEF}) 197 | # Set library version if building shared libs. 198 | diff --git a/znzlib/znzlib.pc.in b/znzlib/znzlib.pc.in 199 | new file mode 100644 200 | index 0000000..1111111 201 | --- /dev/null 202 | +++ b/znzlib/znzlib.pc.in 203 | @@ -0,0 +1,12 @@ 204 | +prefix=@CMAKE_INSTALL_PREFIX@ 205 | +exec_prefix=${prefix} 206 | +libdir=${prefix}/@NIFTI_INSTALL_LIBRARY_DIR@ 207 | +includedir=${prefix}/@NIFTI_INSTALL_INCLUDE_DIR@ 208 | +zlib_support=true 209 | + 210 | +Name: znzlib 211 | +Description: Low level library for handling read/write of compressed files 212 | +Version: @PROJECT_VERSION@ 213 | +Requires: zlib 214 | +Libs: -L${libdir} -lznz 215 | +Cflags: -I${includedir} 216 | -------------------------------------------------------------------------------- /build/patches/openexr-2-fixes.patch: -------------------------------------------------------------------------------- 1 | This file is part of MXE. See LICENSE.md for licensing information. 2 | 3 | Contains ad hoc patches for cross building. 4 | 5 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 6 | From: Kleis Auke Wolthuizen 7 | Date: Wed, 24 Mar 2021 12:28:20 +0100 8 | Subject: [PATCH 1/1] Use ImathForward.h where possible 9 | 10 | 11 | diff --git a/src/lib/OpenEXR/ImfBoxAttribute.cpp b/src/lib/OpenEXR/ImfBoxAttribute.cpp 12 | index 1111111..2222222 100644 13 | --- a/src/lib/OpenEXR/ImfBoxAttribute.cpp 14 | +++ b/src/lib/OpenEXR/ImfBoxAttribute.cpp 15 | @@ -14,11 +14,7 @@ 16 | #include 17 | #include 18 | 19 | -IMATH_INTERNAL_NAMESPACE_HEADER_ENTER 20 | -template class IMF_EXPORT_TEMPLATE_TYPE Vec2; 21 | -template class IMF_EXPORT_TEMPLATE_TYPE Vec3; 22 | -template class IMF_EXPORT_TEMPLATE_TYPE Box; 23 | -IMATH_INTERNAL_NAMESPACE_HEADER_EXIT 24 | +#include 25 | 26 | #define COMPILING_IMF_BOX_ATTRIBUTE 27 | 28 | diff --git a/src/lib/OpenEXR/ImfMatrixAttribute.cpp b/src/lib/OpenEXR/ImfMatrixAttribute.cpp 29 | index 1111111..2222222 100644 30 | --- a/src/lib/OpenEXR/ImfMatrixAttribute.cpp 31 | +++ b/src/lib/OpenEXR/ImfMatrixAttribute.cpp 32 | @@ -16,10 +16,7 @@ 33 | #include 34 | #include 35 | 36 | -IMATH_INTERNAL_NAMESPACE_HEADER_ENTER 37 | -template class IMF_EXPORT_TEMPLATE_TYPE Matrix33; 38 | -template class IMF_EXPORT_TEMPLATE_TYPE Matrix44; 39 | -IMATH_INTERNAL_NAMESPACE_HEADER_EXIT 40 | +#include 41 | 42 | #define COMPILING_IMF_MATRIX_ATTRIBUTE 43 | 44 | diff --git a/src/lib/OpenEXR/ImfVecAttribute.cpp b/src/lib/OpenEXR/ImfVecAttribute.cpp 45 | index 1111111..2222222 100644 46 | --- a/src/lib/OpenEXR/ImfVecAttribute.cpp 47 | +++ b/src/lib/OpenEXR/ImfVecAttribute.cpp 48 | @@ -18,10 +18,7 @@ 49 | #include 50 | #include 51 | 52 | -IMATH_INTERNAL_NAMESPACE_HEADER_ENTER 53 | -template class IMF_EXPORT_TEMPLATE_TYPE Vec2; 54 | -template class IMF_EXPORT_TEMPLATE_TYPE Vec3; 55 | -IMATH_INTERNAL_NAMESPACE_HEADER_EXIT 56 | +#include 57 | 58 | #define COMPILING_IMF_VECTOR_ATTRIBUTE 59 | #include "ImfVecAttribute.h" 60 | diff --git a/src/lib/OpenEXRUtil/ImfDeepImageChannel.cpp b/src/lib/OpenEXRUtil/ImfDeepImageChannel.cpp 61 | index 1111111..2222222 100644 62 | --- a/src/lib/OpenEXRUtil/ImfDeepImageChannel.cpp 63 | +++ b/src/lib/OpenEXRUtil/ImfDeepImageChannel.cpp 64 | @@ -12,9 +12,7 @@ 65 | #include 66 | #include 67 | 68 | -IMATH_INTERNAL_NAMESPACE_HEADER_ENTER 69 | -class IMFUTIL_EXPORT_TYPE half; 70 | -IMATH_INTERNAL_NAMESPACE_HEADER_EXIT 71 | +#include 72 | 73 | #define COMPILING_IMF_DEEP_IMAGE_CHANNEL 74 | 75 | diff --git a/src/lib/OpenEXRUtil/ImfFlatImageChannel.cpp b/src/lib/OpenEXRUtil/ImfFlatImageChannel.cpp 76 | index 1111111..2222222 100644 77 | --- a/src/lib/OpenEXRUtil/ImfFlatImageChannel.cpp 78 | +++ b/src/lib/OpenEXRUtil/ImfFlatImageChannel.cpp 79 | @@ -12,9 +12,7 @@ 80 | #include 81 | #include 82 | 83 | -IMATH_INTERNAL_NAMESPACE_HEADER_ENTER 84 | -class IMFUTIL_EXPORT_TYPE half; 85 | -IMATH_INTERNAL_NAMESPACE_HEADER_EXIT 86 | +#include 87 | 88 | #define COMPILING_IMF_FLAT_IMAGE_CHANNEL 89 | 90 | -------------------------------------------------------------------------------- /build/patches/poppler-24-fixes.patch: -------------------------------------------------------------------------------- 1 | This file is part of MXE. See LICENSE.md for licensing information. 2 | 3 | Contains ad hoc patches for cross building. 4 | 5 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 6 | From: Kleis Auke Wolthuizen 7 | Date: Fri, 19 Feb 2021 16:00:00 +0100 8 | Subject: [PATCH 1/1] Fix bogus volatile caught by clang 11 9 | 10 | 11 | diff --git a/glib/poppler-enums.c.template b/glib/poppler-enums.c.template 12 | index 1111111..2222222 100644 13 | --- a/glib/poppler-enums.c.template 14 | +++ b/glib/poppler-enums.c.template 15 | @@ -15,7 +15,7 @@ 16 | GType 17 | @enum_name@_get_type (void) 18 | { 19 | - static volatile gsize g_define_type_id = 0; 20 | + static gsize g_define_type_id = 0; 21 | 22 | if (g_once_init_enter (&g_define_type_id)) { 23 | static const G@Type@Value values[] = { 24 | -------------------------------------------------------------------------------- /build/patches/sqlite-3-fixes.patch: -------------------------------------------------------------------------------- 1 | This file is part of MXE. See LICENSE.md for licensing information. 2 | 3 | Contains ad hoc patches for cross building. 4 | 5 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 6 | From: Kleis Auke Wolthuizen 7 | Date: Sat, 15 Feb 2025 14:21:30 +0100 8 | Subject: [PATCH 1/1] configure: avoid disabling thread safety if pthreads is 9 | unavailable 10 | 11 | Specifically, Windows does not require pthreads. 12 | 13 | Regressed since the migration of the build system to autosetup. 14 | 15 | Upstream-Status: Inappropriate [libvips specific - https://sqlite.org/forum/forumpost/93bedd58e5c4e6ea] 16 | 17 | diff --git a/autosetup/sqlite-config.tcl b/autosetup/sqlite-config.tcl 18 | index 1111111..2222222 100644 19 | --- a/autosetup/sqlite-config.tcl 20 | +++ b/autosetup/sqlite-config.tcl 21 | @@ -820,10 +820,10 @@ proc sqlite-handle-threadsafe {} { 22 | define LDFLAGS_PTHREAD "" 23 | set enable 0 24 | proj-if-opt-truthy threadsafe { 25 | + set enable 1 26 | msg-result "Checking for libs..." 27 | if {[proj-check-function-in-lib pthread_create pthread] 28 | && [proj-check-function-in-lib pthread_mutexattr_init pthread]} { 29 | - set enable 1 30 | define LDFLAGS_PTHREAD [get-define lib_pthread_create] 31 | undefine lib_pthread_create 32 | undefine lib_pthread_mutexattr_init 33 | -------------------------------------------------------------------------------- /build/patches/vips-8-dlldir-as-libdir.patch: -------------------------------------------------------------------------------- 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 2 | From: Kleis Auke Wolthuizen 3 | Date: Thu, 23 Sep 2021 17:55:19 +0200 4 | Subject: [PATCH 1/1] Support for using the DLL directory as libdir 5 | 6 | Upstream-Status: Pending [https://github.com/libvips/build-win64-mxe/issues/34] 7 | 8 | diff --git a/libvips/include/vips/internal.h b/libvips/include/vips/internal.h 9 | index 1111111..2222222 100644 10 | --- a/libvips/include/vips/internal.h 11 | +++ b/libvips/include/vips/internal.h 12 | @@ -426,6 +426,7 @@ guint32 vips__random(guint32 seed); 13 | guint32 vips__random_add(guint32 seed, int value); 14 | 15 | const char *vips__icc_dir(void); 16 | +const char *vips__dll_dir(void); 17 | const char *vips__windows_prefix(void); 18 | 19 | char *vips__get_iso8601(void); 20 | diff --git a/libvips/iofuncs/init.c b/libvips/iofuncs/init.c 21 | index 1111111..2222222 100644 22 | --- a/libvips/iofuncs/init.c 23 | +++ b/libvips/iofuncs/init.c 24 | @@ -1201,6 +1201,12 @@ vips_guess_prefix(const char *argv0, const char *env_name) 25 | const char * 26 | vips_guess_libdir(const char *argv0, const char *env_name) 27 | { 28 | +#if defined(G_OS_WIN32) && defined(VIPS_DLLDIR_AS_LIBDIR) 29 | + /* Sometimes users want to use the DLL directory where the libvips DLL 30 | + * resides as libdir. 31 | + */ 32 | + return vips__dll_dir(); 33 | +#else /*!G_OS_WIN32 || !VIPS_DLLDIR_AS_LIBDIR*/ 34 | const char *prefix = vips_guess_prefix(argv0, env_name); 35 | static char *libdir = NULL; 36 | 37 | @@ -1225,6 +1231,7 @@ vips_guess_libdir(const char *argv0, const char *env_name) 38 | libdir = g_strdup_printf("%s/lib", prefix); 39 | 40 | return libdir; 41 | +#endif /*G_OS_WIN32 && VIPS_DLLDIR_AS_LIBDIR*/ 42 | } 43 | 44 | /** 45 | diff --git a/libvips/iofuncs/util.c b/libvips/iofuncs/util.c 46 | index 1111111..2222222 100644 47 | --- a/libvips/iofuncs/util.c 48 | +++ b/libvips/iofuncs/util.c 49 | @@ -1986,6 +1986,53 @@ DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) 50 | return TRUE; 51 | } 52 | #endif 53 | + 54 | +#ifdef VIPS_DLLDIR_AS_LIBDIR 55 | +static void * 56 | +vips__dll_dir_once(void *null) 57 | +{ 58 | + /* From glib _glib_get_dll_directory() 59 | + */ 60 | + char *dll_dir; 61 | + char *p; 62 | + wchar_t wc_fn[MAX_PATH]; 63 | + 64 | +#ifdef DLL_EXPORT 65 | + if (vips__dll == NULL) 66 | + return NULL; 67 | +#endif 68 | + 69 | + /* This code is different from that in 70 | + * g_win32_get_package_installation_directory_of_module() in that 71 | + * here we return the actual folder where the libvips DLL is. We don't 72 | + * do the check for it being in a "bin" or "lib" subfolder and then 73 | + * returning the parent of that. 74 | + * 75 | + * In a statically built libvips, vips__dll will be NULL and we will 76 | + * thus look up the application's .exe file's location. 77 | + */ 78 | + if (!GetModuleFileNameW(vips__dll, wc_fn, MAX_PATH)) 79 | + return NULL; 80 | + 81 | + dll_dir = g_utf16_to_utf8(wc_fn, -1, NULL, NULL, NULL); 82 | + 83 | + p = strrchr(dll_dir, G_DIR_SEPARATOR); 84 | + if (p == NULL) 85 | + return NULL; 86 | + 87 | + *p = '\0'; 88 | + 89 | + return (void *) dll_dir; 90 | +} 91 | + 92 | +const char * 93 | +vips__dll_dir(void) 94 | +{ 95 | + static GOnce once = G_ONCE_INIT; 96 | + 97 | + return (const char *) g_once(&once, vips__dll_dir_once, NULL); 98 | +} 99 | +#endif /*VIPS_DLLDIR_AS_LIBDIR*/ 100 | #endif /*G_OS_WIN32*/ 101 | 102 | static void * 103 | -------------------------------------------------------------------------------- /build/patches/vips-8-heifsave-disable-hbr-support.patch: -------------------------------------------------------------------------------- 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 2 | From: Kleis Auke Wolthuizen 3 | Date: Mon, 1 Apr 2024 17:39:53 +0200 4 | Subject: [PATCH 1/1] heifsave: disable HBR support 5 | 6 | i.e. limit it to a bitdepth of 8, since we compile libaom with 7 | `-DCONFIG_AV1_HIGHBITDEPTH=0`. 8 | 9 | See: 10 | https://github.com/lovell/sharp/issues/3358 11 | https://github.com/kleisauke/net-vips/issues/217 12 | https://github.com/libvips/libvips/discussions/3910 13 | 14 | Upstream-Status: Inappropriate [disable feature] 15 | This is specific to libvips' prebuilt binaries. 16 | 17 | diff --git a/libvips/foreign/heifsave.c b/libvips/foreign/heifsave.c 18 | index 1111111..2222222 100644 19 | --- a/libvips/foreign/heifsave.c 20 | +++ b/libvips/foreign/heifsave.c 21 | @@ -531,20 +531,9 @@ vips_foreign_save_heif_build(VipsObject *object) 22 | if (heif->lossless) 23 | heif->subsample_mode = VIPS_FOREIGN_SUBSAMPLE_OFF; 24 | 25 | - /* Default 12 bit save for 16-bit images. 26 | + /* Prebuilt binaries support a bitdepth of 8 only. 27 | */ 28 | - if (!vips_object_argument_isset(object, "bitdepth")) 29 | - heif->bitdepth = 30 | - save->ready->Type == VIPS_INTERPRETATION_RGB16 || 31 | - save->ready->Type == VIPS_INTERPRETATION_GREY16 32 | - ? 12 33 | - : 8; 34 | - 35 | - /* HEIC and AVIF only implements 8 / 10 / 12 bit depth. 36 | - */ 37 | - if (heif->bitdepth != 12 && 38 | - heif->bitdepth != 10 && 39 | - heif->bitdepth != 8) { 40 | + if (heif->bitdepth != 8) { 41 | vips_error("heifsave", _("%d-bit colour depth not supported"), 42 | heif->bitdepth); 43 | return -1; 44 | @@ -738,14 +727,10 @@ vips_foreign_save_heif_build(VipsObject *object) 45 | } 46 | 47 | #define UC VIPS_FORMAT_UCHAR 48 | -#define US VIPS_FORMAT_USHORT 49 | 50 | -/* Except for 8-bit inputs, we send everything else to 16. We decide on 8-bit 51 | - * vs. 12 bit save based on Type in_build(), see above. 52 | - */ 53 | static VipsBandFormat vips_heif_bandfmt[10] = { 54 | /* Band format: UC C US S UI I F X D DX */ 55 | - /* Promotion: */ UC, UC, US, US, US, US, US, US, US, US 56 | + /* Promotion: */ UC, UC, UC, UC, UC, UC, UC, UC, UC, UC 57 | }; 58 | 59 | static void 60 | @@ -781,7 +766,7 @@ vips_foreign_save_heif_class_init(VipsForeignSaveHeifClass *class) 61 | _("Number of bits per pixel"), 62 | VIPS_ARGUMENT_OPTIONAL_INPUT, 63 | G_STRUCT_OFFSET(VipsForeignSaveHeif, bitdepth), 64 | - 8, 12, 12); 65 | + 8, 12, 8); 66 | 67 | VIPS_ARG_BOOL(class, "lossless", 13, 68 | _("Lossless"), 69 | @@ -834,7 +819,7 @@ vips_foreign_save_heif_init(VipsForeignSaveHeif *heif) 70 | { 71 | heif->ctx = heif_context_alloc(); 72 | heif->Q = 50; 73 | - heif->bitdepth = 12; 74 | + heif->bitdepth = 8; 75 | heif->compression = VIPS_FOREIGN_HEIF_COMPRESSION_HEVC; 76 | heif->effort = 4; 77 | heif->subsample_mode = VIPS_FOREIGN_SUBSAMPLE_AUTO; 78 | -------------------------------------------------------------------------------- /build/patches/zlib-1-fixes.patch: -------------------------------------------------------------------------------- 1 | This file is part of MXE. See LICENSE.md for licensing information. 2 | 3 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 4 | From: Alexander Karatarakis 5 | Date: Sun, 24 Sep 2017 00:03:34 -0700 6 | Subject: [PATCH 1/2] Do not build more things than needed 7 | 8 | 9 | diff --git a/CMakeLists.txt b/CMakeLists.txt 10 | index 1111111..2222222 100644 11 | --- a/CMakeLists.txt 12 | +++ b/CMakeLists.txt 13 | @@ -179,7 +179,15 @@ elseif(BUILD_SHARED_LIBS AND WIN32) 14 | endif() 15 | 16 | if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL ) 17 | - install(TARGETS zlib zlibstatic 18 | + if(BUILD_SHARED_LIBS) 19 | + set(ZLIB_TARGETS zlib) 20 | + set_target_properties(zlibstatic PROPERTIES EXCLUDE_FROM_ALL ON) 21 | + else() 22 | + set(ZLIB_TARGETS zlibstatic) 23 | + set_target_properties(zlib PROPERTIES EXCLUDE_FROM_ALL ON) 24 | + endif() 25 | + 26 | + install(TARGETS ${ZLIB_TARGETS} 27 | RUNTIME DESTINATION "${INSTALL_BIN_DIR}" 28 | ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" 29 | LIBRARY DESTINATION "${INSTALL_LIB_DIR}" ) 30 | 31 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 32 | From: "fix@me" 33 | Date: Sunday, 25 Feb 2018 21:37:44 +0200 34 | Subject: [PATCH 2/3] Fix DLL naming (libzlib.dll -> libz.dll) 35 | 36 | 37 | diff --git a/CMakeLists.txt b/CMakeLists.txt 38 | index 1111111..2222222 100644 39 | --- a/CMakeLists.txt 40 | +++ b/CMakeLists.txt 41 | @@ -167,6 +167,11 @@ if(NOT CYGWIN) 42 | set_target_properties(zlib PROPERTIES VERSION ${ZLIB_FULL_VERSION}) 43 | endif() 44 | 45 | +if(MINGW) 46 | + # when cross-compiling with mingw, we want to make libz, not libzlib 47 | + set_target_properties(zlib zlibstatic PROPERTIES OUTPUT_NAME z) 48 | +endif(MINGW) 49 | + 50 | if(UNIX) 51 | # On unix-like platforms the library is almost always called libz 52 | set_target_properties(zlib zlibstatic PROPERTIES OUTPUT_NAME z) 53 | 54 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 55 | From: Nicolas Pena 56 | Date: Tue, 8 Aug 2017 17:33:32 +0000 57 | Subject: [PATCH 3/3] Zlib patch: prevent uninitialized use of state->check 58 | 59 | This CL fixes a security bug in zlib. It was reported upstream long ago 60 | and the testcase was shared upstream but it's yet unsolved. As a fix, 61 | state->check is set to the same value as the adler32 of an empty string. 62 | 63 | Upstream bug: madler/zlib#245 64 | 65 | Upstream-Status: Pending [https://github.com/madler/zlib/issues/245] 66 | 67 | diff --git a/inflate.c b/inflate.c 68 | index 1111111..2222222 100644 69 | --- a/inflate.c 70 | +++ b/inflate.c 71 | @@ -207,6 +207,7 @@ int stream_size; 72 | state->strm = strm; 73 | state->window = Z_NULL; 74 | state->mode = HEAD; /* to pass state test in inflateReset2() */ 75 | + state->check = 1L; /* 1L is the result of adler32() zero length data */ 76 | ret = inflateReset2(strm, windowBits); 77 | if (ret != Z_OK) { 78 | ZFREE(strm, state); 79 | -------------------------------------------------------------------------------- /build/plugins/gtk4/graphene.mk: -------------------------------------------------------------------------------- 1 | PKG := graphene 2 | $(PKG)_WEBSITE := https://github.com/ebassi/graphene 3 | $(PKG)_DESCR := A thin layer of graphic data types 4 | $(PKG)_IGNORE := 5 | # https://github.com/ebassi/graphene/tarball/0cfa05ff62f244e4d5e7ac35a1979a23f25c5151 6 | $(PKG)_VERSION := 0cfa05f 7 | $(PKG)_CHECKSUM := ea56afe5d9f90c5ead9cba4be117b6a75db68ab4da3940569dc2c747b791fe66 8 | $(PKG)_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/$(PKG)-[0-9]*.patch))) 9 | $(PKG)_GH_CONF := ebassi/graphene/branches/master 10 | $(PKG)_DEPS := cc meson-wrapper glib 11 | 12 | # Build from the master branch for https://github.com/ebassi/graphene/commit/1a4430f448e0fcc8188cfe9323f1a688d0486eae 13 | define $(PKG)_BUILD 14 | $(MXE_MESON_WRAPPER) \ 15 | -Dintrospection=disabled \ 16 | -Dtests=false \ 17 | '$(SOURCE_DIR)' \ 18 | '$(BUILD_DIR)' 19 | 20 | $(MXE_NINJA) -C '$(BUILD_DIR)' -j '$(JOBS)' install 21 | endef 22 | -------------------------------------------------------------------------------- /build/plugins/gtk4/gtk4.mk: -------------------------------------------------------------------------------- 1 | PKG := gtk4 2 | $(PKG)_WEBSITE := https://gtk.org/ 3 | $(PKG)_DESCR := GTK4 4 | $(PKG)_IGNORE := 5 | $(PKG)_VERSION := 4.18.5 6 | $(PKG)_CHECKSUM := bb5267a062f5936947d34c9999390a674b0b2b0d8aa3472fe0d05e2064955abc 7 | $(PKG)_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/gtk-[0-9]*.patch))) 8 | $(PKG)_SUBDIR := gtk-$($(PKG)_VERSION) 9 | $(PKG)_FILE := gtk-$($(PKG)_VERSION).tar.xz 10 | $(PKG)_URL := https://download.gnome.org/sources/gtk/$(call SHORT_PKG_VERSION,$(PKG))/$($(PKG)_FILE) 11 | $(PKG)_DEPS := cc meson-wrapper glib gdk-pixbuf pango fontconfig cairo libepoxy graphene 12 | 13 | define $(PKG)_BUILD 14 | # Disable tools 15 | $(SED) -i "/subdir('tools')/d" '$(SOURCE_DIR)/meson.build' 16 | 17 | $(MXE_MESON_WRAPPER) \ 18 | -Dvulkan=disabled \ 19 | -Dintrospection=disabled \ 20 | -Dmedia-gstreamer=disabled \ 21 | -Dbuild-testsuite=false \ 22 | -Dbuild-examples=false \ 23 | -Dbuild-tests=false \ 24 | -Dbuild-demos=false \ 25 | '$(SOURCE_DIR)' \ 26 | '$(BUILD_DIR)' 27 | 28 | $(MXE_NINJA) -C '$(BUILD_DIR)' -j '$(JOBS)' install 29 | endef 30 | -------------------------------------------------------------------------------- /build/plugins/gtk4/overrides.mk: -------------------------------------------------------------------------------- 1 | $(PLUGIN_HEADER) 2 | 3 | # GTK requires GRegex 4 | glib_PATCHES := $(filter-out $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/../../patches/glib-2-without-gregex.patch))),$(glib_PATCHES)) 5 | glib_CONFIGURE_OPTS = --force-fallback-for=libpcre2-8 6 | 7 | # GTK requires cairo-win32, cairo-ps and cairo-pdf 8 | # https://gitlab.gnome.org/GNOME/gtk/-/issues/5072 9 | # Also enable the DWrite font backend in Cairo 10 | # https://gitlab.gnome.org/GNOME/gtk/-/issues/7144 11 | cairo_PATCHES := $(filter-out $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/../../patches/cairo-1-nanoserver-compat.patch))),$(cairo_PATCHES)) 12 | cairo_CONFIGURE_OPTS = -Dzlib=enabled -Ddwrite=enabled 13 | 14 | # nip4 needs -Doutput=enabled 15 | libxml2_MESON_OPTS = -Doutput=enabled 16 | 17 | # Override sub-dependencies 18 | libepoxy_DEPS := $(filter-out xorg-macros,$(libepoxy_DEPS)) 19 | -------------------------------------------------------------------------------- /build/plugins/gtk4/patches/gtk-4-fixes.patch: -------------------------------------------------------------------------------- 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 2 | From: Kleis Auke Wolthuizen 3 | Date: Thu, 26 Oct 2023 17:00:00 +0200 4 | Subject: [PATCH 1/3] Make gtk4-builder-tool optional 5 | 6 | 7 | diff --git a/docs/reference/gtk/images/meson.build b/docs/reference/gtk/images/meson.build 8 | index 1111111..2222222 100644 9 | --- a/docs/reference/gtk/images/meson.build 10 | +++ b/docs/reference/gtk/images/meson.build 11 | @@ -79,9 +79,9 @@ ui_files = [ 12 | 'windowcontrols.ui', 13 | ] 14 | 15 | -gtk_builder_tool = find_program('gtk4-builder-tool') 16 | - 17 | if get_option('screenshots') 18 | + gtk_builder_tool = find_program('gtk4-builder-tool') 19 | + 20 | foreach ui_file: ui_files 21 | png_file = ui_file.replace('.ui', '.png') 22 | gtk_images += custom_target('@0@ from @1@'.format(png_file, ui_file), 23 | 24 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 25 | From: Kleis Auke Wolthuizen 26 | Date: Sat, 14 Sep 2024 13:25:07 +0200 27 | Subject: [PATCH 2/3] Revert "Stop setting rgb antialiasing in font options" 28 | 29 | This reverts commit b569470b87d143d30c2388046c9a6450696f19b8. 30 | 31 | See: 32 | https://gitlab.gnome.org/GNOME/pango/-/issues/767 33 | https://github.com/msys2/MINGW-packages/pull/20311#issuecomment-2014971531 34 | 35 | diff --git a/gtk/gtksettings.c b/gtk/gtksettings.c 36 | index 1111111..2222222 100644 37 | --- a/gtk/gtksettings.c 38 | +++ b/gtk/gtksettings.c 39 | @@ -1451,6 +1451,8 @@ settings_update_font_options (GtkSettings *settings) 40 | cairo_hint_style_t hint_style; 41 | int antialias; 42 | cairo_antialias_t antialias_mode; 43 | + char *rgba_str; 44 | + cairo_subpixel_order_t subpixel_order; 45 | gboolean hint_font_metrics; 46 | 47 | if (settings->font_options) 48 | @@ -1460,6 +1462,7 @@ settings_update_font_options (GtkSettings *settings) 49 | "gtk-xft-antialias", &antialias, 50 | "gtk-xft-hinting", &hinting, 51 | "gtk-xft-hintstyle", &hint_style_str, 52 | + "gtk-xft-rgba", &rgba_str, 53 | "gtk-hint-font-metrics", &hint_font_metrics, 54 | NULL); 55 | 56 | @@ -1493,10 +1496,35 @@ settings_update_font_options (GtkSettings *settings) 57 | 58 | cairo_font_options_set_hint_style (settings->font_options, hint_style); 59 | 60 | + subpixel_order = CAIRO_SUBPIXEL_ORDER_DEFAULT; 61 | + if (rgba_str) 62 | + { 63 | + if (strcmp (rgba_str, "rgb") == 0) 64 | + subpixel_order = CAIRO_SUBPIXEL_ORDER_RGB; 65 | + else if (strcmp (rgba_str, "bgr") == 0) 66 | + subpixel_order = CAIRO_SUBPIXEL_ORDER_BGR; 67 | + else if (strcmp (rgba_str, "vrgb") == 0) 68 | + subpixel_order = CAIRO_SUBPIXEL_ORDER_VRGB; 69 | + else if (strcmp (rgba_str, "vbgr") == 0) 70 | + subpixel_order = CAIRO_SUBPIXEL_ORDER_VBGR; 71 | + } 72 | + 73 | + g_free (rgba_str); 74 | + 75 | + cairo_font_options_set_subpixel_order (settings->font_options, subpixel_order); 76 | + 77 | + antialias_mode = CAIRO_ANTIALIAS_DEFAULT; 78 | if (antialias == 0) 79 | - antialias_mode = CAIRO_ANTIALIAS_NONE; 80 | - else 81 | - antialias_mode = CAIRO_ANTIALIAS_GRAY; 82 | + { 83 | + antialias_mode = CAIRO_ANTIALIAS_NONE; 84 | + } 85 | + else if (antialias == 1) 86 | + { 87 | + if (subpixel_order != CAIRO_SUBPIXEL_ORDER_DEFAULT) 88 | + antialias_mode = CAIRO_ANTIALIAS_SUBPIXEL; 89 | + else 90 | + antialias_mode = CAIRO_ANTIALIAS_GRAY; 91 | + } 92 | 93 | cairo_font_options_set_antialias (settings->font_options, antialias_mode); 94 | } 95 | 96 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 97 | From: Christoph Reiter 98 | Date: Sat, 7 Sep 2024 13:39:22 +0200 99 | Subject: [PATCH 3/3] Disable automatic font rendering settings 100 | 101 | To restore the old code taking Windows settings into account. 102 | 103 | See: 104 | https://github.com/msys2/MINGW-packages/pull/21871#issuecomment-2335178531 105 | 106 | diff --git a/gtk/gtksettings.c b/gtk/gtksettings.c 107 | index 1111111..2222222 100644 108 | --- a/gtk/gtksettings.c 109 | +++ b/gtk/gtksettings.c 110 | @@ -973,7 +973,7 @@ gtk_settings_class_init (GtkSettingsClass *class) 111 | */ 112 | pspecs[PROP_FONT_RENDERING] = g_param_spec_enum ("gtk-font-rendering", NULL, NULL, 113 | GTK_TYPE_FONT_RENDERING, 114 | - GTK_FONT_RENDERING_AUTOMATIC, 115 | + GTK_FONT_RENDERING_MANUAL, 116 | GTK_PARAM_READWRITE); 117 | 118 | g_object_class_install_properties (gobject_class, NUM_PROPERTIES, pspecs); 119 | -------------------------------------------------------------------------------- /build/plugins/hevc/libde265.mk: -------------------------------------------------------------------------------- 1 | PKG := libde265 2 | $(PKG)_WEBSITE := https://www.libde265.org/ 3 | $(PKG)_DESCR := Open h.265 video codec implementation. 4 | $(PKG)_IGNORE := 5 | $(PKG)_VERSION := 1.0.16 6 | $(PKG)_CHECKSUM := b92beb6b53c346db9a8fae968d686ab706240099cdd5aff87777362d668b0de7 7 | $(PKG)_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/$(PKG)-[0-9]*.patch))) 8 | $(PKG)_GH_CONF := strukturag/libde265/releases,v 9 | $(PKG)_DEPS := cc 10 | 11 | define $(PKG)_BUILD 12 | # Disable tools with -DENABLE_{DE,EN}CODER=OFF 13 | cd '$(BUILD_DIR)' && $(TARGET)-cmake \ 14 | -DENABLE_DECODER=OFF \ 15 | -DENABLE_ENCODER=OFF \ 16 | '$(SOURCE_DIR)' 17 | $(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)' 18 | $(MAKE) -C '$(BUILD_DIR)' -j 1 $(subst -,/,$(INSTALL_STRIP_LIB)) 19 | endef 20 | -------------------------------------------------------------------------------- /build/plugins/hevc/overrides.mk: -------------------------------------------------------------------------------- 1 | $(PLUGIN_HEADER) 2 | 3 | IS_HEVC := $(true) 4 | 5 | # Override sub-dependencies 6 | libheif_DEPS := $(libheif_DEPS) libde265 x265 7 | -------------------------------------------------------------------------------- /build/plugins/hevc/patches/libde265-1-fixes.patch: -------------------------------------------------------------------------------- 1 | This file is part of MXE. See LICENSE.md for licensing information. 2 | 3 | Contains ad hoc patches for cross building. 4 | 5 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 20011 6 | From: Kleis Auke Wolthuizen 7 | Date: Sun, 16 Feb 2020 19:30:00 +0100 8 | Subject: [PATCH 1/1] Enable PIC code only for shared non-win32 builds 9 | 10 | 11 | diff --git a/CMakeLists.txt b/CMakeLists.txt 12 | index 1111111..2222222 100644 13 | --- a/CMakeLists.txt 14 | +++ b/CMakeLists.txt 15 | @@ -8,7 +8,10 @@ project (libde265 16 | set(CMAKE_CXX_STANDARD 11) 17 | set(CMAKE_CXX_STANDARD_REQUIRED ON) 18 | set(CMAKE_CXX_EXTENSIONS OFF) 19 | -set(CMAKE_POSITION_INDEPENDENT_CODE ON) 20 | + 21 | +if(NOT WIN32 AND ENABLE_SHARED) 22 | + set(CMAKE_POSITION_INDEPENDENT_CODE ON) 23 | +endif() 24 | 25 | # The version number. 26 | set (NUMERIC_VERSION 0x01001500) 27 | -------------------------------------------------------------------------------- /build/plugins/hevc/patches/x265-3-fixes-crlf.patch: -------------------------------------------------------------------------------- 1 | This file is part of MXE. See LICENSE.md for licensing information. 2 | 3 | Contains ad hoc patches for cross building. 4 | 5 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 6 | From: Kleis Auke Wolthuizen 7 | Date: Sun, 27 Sep 2020 14:00:00 +0200 8 | Subject: [PATCH 2/2] Correctly annotate data symbols within module-definition 9 | 10 | Helps llvm-mingw. 11 | 12 | diff --git a/source/x265.def.in b/source/x265.def.in 13 | index 1111111..2222222 100644 14 | --- a/source/x265.def.in 15 | +++ b/source/x265.def.in 16 | @@ -9,9 +9,9 @@ x265_picture_init 17 | x265_picture_alloc 18 | x265_picture_free 19 | x265_param_apply_profile 20 | -x265_max_bit_depth 21 | -x265_version_str 22 | -x265_build_info_str 23 | +x265_max_bit_depth DATA 24 | +x265_version_str DATA 25 | +x265_build_info_str DATA 26 | x265_encoder_headers 27 | x265_encoder_parameters 28 | x265_encoder_reconfig 29 | -------------------------------------------------------------------------------- /build/plugins/hevc/x265.mk: -------------------------------------------------------------------------------- 1 | PKG := x265 2 | $(PKG)_WEBSITE := http://x265.org/ 3 | $(PKG)_DESCR := H.265/HEVC video stream encoder. 4 | $(PKG)_IGNORE := 5 | $(PKG)_VERSION := 4.1 6 | $(PKG)_CHECKSUM := a31699c6a89806b74b0151e5e6a7df65de4b49050482fe5ebf8a4379d7af8f29 7 | $(PKG)_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/x265-[0-9]*.patch))) 8 | $(PKG)_SUBDIR := x265_$($(PKG)_VERSION) 9 | $(PKG)_FILE := x265_$($(PKG)_VERSION).tar.gz 10 | $(PKG)_URL := https://bitbucket.org/multicoreware/x265_git/downloads/$($(PKG)_FILE) 11 | $(PKG)_URL_2 := https://download.videolan.org/pub/videolan/x265/$(x265_FILE) 12 | $(PKG)_DEPS := cc $(BUILD)~nasm 13 | 14 | define $(PKG)_UPDATE 15 | $(WGET) -q -O- https://download.videolan.org/pub/videolan/x265/ | \ 16 | $(SED) -n 's,.*">x265_\([0-9][^<]*\)\.t.*,\1,p' | \ 17 | tail -1 18 | endef 19 | 20 | # `-DENABLE_DYNAMIC_HDR10=ON` -> `-DENABLE_HDR10_PLUS=ON` 21 | # x265 requires nasm 2.13 or newer (instead than yasm) after release 2.6. 22 | define $(PKG)_BUILD 23 | cd '$(BUILD_DIR)' && mkdir -p 10bit 12bit 24 | 25 | # 12 bit 26 | cd '$(BUILD_DIR)/12bit' && $(TARGET)-cmake '$(SOURCE_DIR)/source' \ 27 | -DHIGH_BIT_DEPTH=ON \ 28 | -DEXPORT_C_API=OFF \ 29 | -DENABLE_SHARED=OFF \ 30 | -DENABLE_ASSEMBLY=$(if $(call seq,64,$(BITS)),ON,OFF) \ 31 | -DENABLE_CLI=OFF \ 32 | -DENABLE_HDR10_PLUS=ON \ 33 | -DMAIN12=ON \ 34 | $(if $(call seq,aarch64,$(PROCESSOR)), -DCROSS_COMPILE_ARM64=ON) 35 | 36 | $(MAKE) -C '$(BUILD_DIR)/12bit' -j '$(JOBS)' 37 | cp '$(BUILD_DIR)/12bit/libx265.a' '$(BUILD_DIR)/libx265_main12.a' 38 | 39 | # 10 bit 40 | cd '$(BUILD_DIR)/10bit' && $(TARGET)-cmake '$(SOURCE_DIR)/source' \ 41 | -DHIGH_BIT_DEPTH=ON \ 42 | -DEXPORT_C_API=OFF \ 43 | -DENABLE_SHARED=OFF \ 44 | -DENABLE_ASSEMBLY=$(if $(call seq,64,$(BITS)),ON,OFF) \ 45 | -DENABLE_CLI=OFF \ 46 | -DENABLE_HDR10_PLUS=ON \ 47 | $(if $(call seq,aarch64,$(PROCESSOR)), -DCROSS_COMPILE_ARM64=ON) 48 | 49 | $(MAKE) -C '$(BUILD_DIR)/10bit' -j '$(JOBS)' 50 | cp '$(BUILD_DIR)/10bit/libx265.a' '$(BUILD_DIR)/libx265_main10.a' 51 | 52 | # 8bit 53 | cd '$(BUILD_DIR)' && $(TARGET)-cmake '$(SOURCE_DIR)/source' \ 54 | -DHIGH_BIT_DEPTH=OFF \ 55 | -DEXPORT_C_API=ON \ 56 | -DENABLE_SHARED=$(CMAKE_SHARED_BOOL) \ 57 | -DENABLE_ASSEMBLY=$(if $(call seq,64,$(BITS)),ON,OFF) \ 58 | -DENABLE_CLI=OFF \ 59 | -DENABLE_HDR10_PLUS=ON \ 60 | -DEXTRA_LIB='x265_main10.a;x265_main12.a' \ 61 | -DEXTRA_LINK_FLAGS=-L'$(BUILD_DIR)' \ 62 | -DLINKED_10BIT=ON \ 63 | -DLINKED_12BIT=ON \ 64 | $(if $(call seq,aarch64,$(PROCESSOR)), -DCROSS_COMPILE_ARM64=ON) 65 | 66 | $(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)' $(subst -,/,$(INSTALL_STRIP_LIB)) 67 | 68 | $(if $(BUILD_SHARED), \ 69 | rm -f '$(PREFIX)/$(TARGET)/lib/libx265.a' \ 70 | $(else), \ 71 | $(INSTALL) '$(BUILD_DIR)/libx265_main12.a' '$(PREFIX)/$(TARGET)/lib/libx265_main12.a'; \ 72 | $(INSTALL) '$(BUILD_DIR)/libx265_main10.a' '$(PREFIX)/$(TARGET)/lib/libx265_main10.a'; \ 73 | $(SED) -i 's|-lx265|-lx265 -lx265_main10 -lx265_main12|' '$(PREFIX)/$(TARGET)/lib/pkgconfig/x265.pc') 74 | 75 | '$(TARGET)-gcc' \ 76 | -W -Wall -Werror \ 77 | '$(TOP_DIR)/src/$(PKG)-test.c' \ 78 | -o '$(PREFIX)/$(TARGET)/bin/test-$(PKG).exe' \ 79 | `$(TARGET)-pkg-config --cflags --libs $(PKG)` 80 | endef 81 | -------------------------------------------------------------------------------- /build/plugins/jpegli/jpegli.mk: -------------------------------------------------------------------------------- 1 | PKG := jpegli 2 | $(PKG)_WEBSITE := https://github.com/google/jpegli 3 | $(PKG)_DESCR := Improved JPEG encoder and decoder implementation 4 | $(PKG)_IGNORE := 5 | # https://github.com/google/jpegli/tarball/5126d62d24d368f0ceadd53454653edeb9086386 6 | $(PKG)_VERSION := 5126d62 7 | $(PKG)_CHECKSUM := 8f3680ce581d78a698099b9586ef2b448a6d81ecd9d1d356ba526fc87ea29bf1 8 | $(PKG)_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/$(PKG)-[0-9]*.patch))) 9 | $(PKG)_GH_CONF := google/jpegli/branches/main 10 | $(PKG)_DEPS := cc highway lcms libjpeg-turbo 11 | 12 | define $(PKG)_BUILD 13 | cd '$(BUILD_DIR)' && $(TARGET)-cmake \ 14 | -DBUILD_TESTING=OFF \ 15 | -DJPEGXL_ENABLE_TOOLS=OFF \ 16 | -DJPEGXL_ENABLE_DOXYGEN=OFF \ 17 | -DJPEGXL_ENABLE_MANPAGES=OFF \ 18 | -DJPEGXL_ENABLE_BENCHMARK=OFF \ 19 | -DJPEGXL_ENABLE_SJPEG=OFF \ 20 | -DJPEGXL_ENABLE_OPENEXR=OFF \ 21 | -DJPEGXL_ENABLE_SKCMS=OFF \ 22 | -DJPEGXL_FORCE_SYSTEM_LCMS2=ON \ 23 | -DJPEGXL_FORCE_SYSTEM_HWY=ON \ 24 | -DJPEGXL_FORCE_SYSTEM_JPEG_TURBO=ON \ 25 | -DJPEGXL_INSTALL_JPEGLI_LIBJPEG=ON \ 26 | '$(SOURCE_DIR)' 27 | $(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)' 28 | $(MAKE) -C '$(BUILD_DIR)' -j 1 $(subst -,/,$(INSTALL_STRIP_LIB)) 29 | endef 30 | -------------------------------------------------------------------------------- /build/plugins/jpegli/overrides.mk: -------------------------------------------------------------------------------- 1 | $(PLUGIN_HEADER) 2 | 3 | IS_JPEGLI := $(true) 4 | 5 | # Override sub-dependencies 6 | gdk-pixbuf_DEPS := $(subst libjpeg-turbo,jpegli,$(gdk-pixbuf_DEPS)) 7 | imagemagick_DEPS := $(subst libjpeg-turbo,jpegli,$(imagemagick_DEPS)) 8 | graphicsmagick_DEPS := $(subst libjpeg-turbo,jpegli,$(graphicsmagick_DEPS)) 9 | openslide_DEPS := $(subst libjpeg-turbo,jpegli,$(openslide_DEPS)) 10 | poppler_DEPS := $(subst libjpeg-turbo,jpegli,$(poppler_DEPS)) 11 | tiff_DEPS := $(subst libjpeg-turbo,jpegli,$(tiff_DEPS)) 12 | vips-all_DEPS := $(subst libjpeg-turbo,jpegli,$(vips-all_DEPS)) 13 | vips-web_DEPS := $(subst libjpeg-turbo,jpegli,$(vips-web_DEPS)) 14 | -------------------------------------------------------------------------------- /build/plugins/jpegli/patches/jpegli-0.11-fixes.patch: -------------------------------------------------------------------------------- 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 2 | From: Martin Bruse 3 | Date: Mon, 8 Jul 2024 11:46:19 +0200 4 | Subject: [PATCH 1/1] Made it possible to force usage of system JPEG libraries. 5 | 6 | Upstream-Status: Submitted [https://github.com/libjxl/libjxl/pull/3704] 7 | 8 | diff --git a/lib/jpegli.cmake b/lib/jpegli.cmake 9 | index 1111111..2222222 100644 10 | --- a/lib/jpegli.cmake 11 | +++ b/lib/jpegli.cmake 12 | @@ -24,12 +24,30 @@ elseif(JPEGLI_LIBJPEG_LIBRARY_SOVERSION STREQUAL "8") 13 | set(JPEG_LIB_VERSION 80) 14 | endif() 15 | 16 | -configure_file( 17 | - ../third_party/libjpeg-turbo/jconfig.h.in include/jpegli/jconfig.h) 18 | -configure_file( 19 | - ../third_party/libjpeg-turbo/jpeglib.h include/jpegli/jpeglib.h COPYONLY) 20 | -configure_file( 21 | - ../third_party/libjpeg-turbo/jmorecfg.h include/jpegli/jmorecfg.h COPYONLY) 22 | +# Force system dependencies. 23 | +set(JPEGXL_FORCE_SYSTEM_JPEG_TURBO false CACHE BOOL 24 | + "Force using system installed jpegturbo instead of third_party/libjpeg-turbo source.") 25 | + 26 | +# libjpeg-turbo 27 | +find_package(JPEG) 28 | + 29 | +if (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/libjpeg-turbo/jpeglib.h" OR 30 | + JPEGXL_FORCE_SYSTEM_JPEG_TURBO) 31 | + if (NOT JPEG_FOUND) 32 | + message(FATAL_ERROR 33 | + "JPEG not found, install libjpeg62-turbo and libjpeg62-turbo-dev or" 34 | + " download libjpeg-turbo source to third_party/libjpeg-turbo from" 35 | + " https://github.com/libjpeg-turbo/libjpeg-turbo. You can use" 36 | + " ${PROJECT_SOURCE_DIR}/deps.sh to download this dependency.") 37 | + endif() 38 | +else() 39 | + configure_file( 40 | + ../third_party/libjpeg-turbo/jconfig.h.in include/jpegli/jconfig.h) 41 | + configure_file( 42 | + ../third_party/libjpeg-turbo/jpeglib.h include/jpegli/jpeglib.h COPYONLY) 43 | + configure_file( 44 | + ../third_party/libjpeg-turbo/jmorecfg.h include/jpegli/jmorecfg.h COPYONLY) 45 | +endif() 46 | 47 | add_library(jpegli-static STATIC EXCLUDE_FROM_ALL "${JPEGXL_INTERNAL_JPEGLI_SOURCES}") 48 | target_compile_options(jpegli-static PRIVATE "${JPEGXL_INTERNAL_FLAGS}") 49 | @@ -48,58 +66,57 @@ target_link_libraries(jpegli-static PUBLIC ${JPEGLI_INTERNAL_LIBS}) 50 | # Tests for jpegli-static 51 | # 52 | 53 | -find_package(JPEG) 54 | if(JPEG_FOUND AND BUILD_TESTING) 55 | -# TODO(eustas): merge into jxl_tests.cmake? 56 | + # TODO(eustas): merge into jxl_tests.cmake? 57 | 58 | -add_library(jpegli_libjpeg_util-obj OBJECT 59 | - ${JPEGXL_INTERNAL_JPEGLI_LIBJPEG_HELPER_FILES} 60 | -) 61 | -target_include_directories(jpegli_libjpeg_util-obj PRIVATE 62 | - "${PROJECT_SOURCE_DIR}" 63 | - "${JPEG_INCLUDE_DIRS}" 64 | -) 65 | -target_compile_options(jpegli_libjpeg_util-obj PRIVATE 66 | - "${JPEGXL_INTERNAL_FLAGS}" "${JPEGXL_COVERAGE_FLAGS}") 67 | - 68 | -# Individual test binaries: 69 | -file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/tests) 70 | -foreach (TESTFILE IN LISTS JPEGXL_INTERNAL_JPEGLI_TESTS) 71 | - # The TESTNAME is the name without the extension or directory. 72 | - get_filename_component(TESTNAME ${TESTFILE} NAME_WE) 73 | - add_executable(${TESTNAME} ${TESTFILE} 74 | - $ 75 | - ${JPEGXL_INTERNAL_JPEGLI_TESTLIB_FILES} 76 | + add_library(jpegli_libjpeg_util-obj OBJECT 77 | + ${JPEGXL_INTERNAL_JPEGLI_LIBJPEG_HELPER_FILES} 78 | ) 79 | - target_compile_options(${TESTNAME} PRIVATE 80 | - ${JPEGXL_INTERNAL_FLAGS} 81 | - # Add coverage flags to the test binary so code in the private headers of 82 | - # the library is also instrumented when running tests that execute it. 83 | - ${JPEGXL_COVERAGE_FLAGS} 84 | - ) 85 | - target_compile_definitions(${TESTNAME} PRIVATE 86 | - -DTEST_DATA_PATH="${JPEGXL_TEST_DATA_PATH}") 87 | - target_include_directories(${TESTNAME} PRIVATE 88 | + target_include_directories(jpegli_libjpeg_util-obj PRIVATE 89 | "${PROJECT_SOURCE_DIR}" 90 | - "${CMAKE_CURRENT_SOURCE_DIR}/include" 91 | - "${CMAKE_CURRENT_BINARY_DIR}/include" 92 | - ) 93 | - target_link_libraries(${TESTNAME} 94 | - hwy 95 | - jpegli-static 96 | - GTest::GTest 97 | - GTest::Main 98 | - ${JPEG_LIBRARIES} 99 | + "${JPEG_INCLUDE_DIRS}" 100 | ) 101 | - set_target_properties(${TESTNAME} PROPERTIES LINK_FLAGS "${JPEGXL_COVERAGE_LINK_FLAGS}") 102 | - # Output test targets in the test directory. 103 | - set_target_properties(${TESTNAME} PROPERTIES PREFIX "tests/") 104 | - if (WIN32 AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang") 105 | - set_target_properties(${TESTNAME} PROPERTIES COMPILE_FLAGS "-Wno-error") 106 | - endif () 107 | - # 240 seconds because some build types (e.g. coverage) can be quite slow. 108 | - gtest_discover_tests(${TESTNAME} DISCOVERY_TIMEOUT 240) 109 | -endforeach () 110 | + target_compile_options(jpegli_libjpeg_util-obj PRIVATE 111 | + "${JPEGXL_INTERNAL_FLAGS}" "${JPEGXL_COVERAGE_FLAGS}") 112 | + 113 | + # Individual test binaries: 114 | + file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/tests) 115 | + foreach (TESTFILE IN LISTS JPEGXL_INTERNAL_JPEGLI_TESTS) 116 | + # The TESTNAME is the name without the extension or directory. 117 | + get_filename_component(TESTNAME ${TESTFILE} NAME_WE) 118 | + add_executable(${TESTNAME} ${TESTFILE} 119 | + $ 120 | + ${JPEGXL_INTERNAL_JPEGLI_TESTLIB_FILES} 121 | + ) 122 | + target_compile_options(${TESTNAME} PRIVATE 123 | + ${JPEGXL_INTERNAL_FLAGS} 124 | + # Add coverage flags to the test binary so code in the private headers of 125 | + # the library is also instrumented when running tests that execute it. 126 | + ${JPEGXL_COVERAGE_FLAGS} 127 | + ) 128 | + target_compile_definitions(${TESTNAME} PRIVATE 129 | + -DTEST_DATA_PATH="${JPEGXL_TEST_DATA_PATH}") 130 | + target_include_directories(${TESTNAME} PRIVATE 131 | + "${PROJECT_SOURCE_DIR}" 132 | + "${CMAKE_CURRENT_SOURCE_DIR}/include" 133 | + "${CMAKE_CURRENT_BINARY_DIR}/include" 134 | + ) 135 | + target_link_libraries(${TESTNAME} 136 | + hwy 137 | + jpegli-static 138 | + GTest::GTest 139 | + GTest::Main 140 | + ${JPEG_LIBRARIES} 141 | + ) 142 | + set_target_properties(${TESTNAME} PROPERTIES LINK_FLAGS "${JPEGXL_COVERAGE_LINK_FLAGS}") 143 | + # Output test targets in the test directory. 144 | + set_target_properties(${TESTNAME} PROPERTIES PREFIX "tests/") 145 | + if (WIN32 AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang") 146 | + set_target_properties(${TESTNAME} PROPERTIES COMPILE_FLAGS "-Wno-error") 147 | + endif () 148 | + # 240 seconds because some build types (e.g. coverage) can be quite slow. 149 | + gtest_discover_tests(${TESTNAME} DISCOVERY_TIMEOUT 240) 150 | + endforeach () 151 | endif() 152 | 153 | # 154 | @@ -107,51 +124,51 @@ endif() 155 | # 156 | 157 | if (JPEGXL_ENABLE_JPEGLI_LIBJPEG AND NOT APPLE AND NOT WIN32 AND NOT EMSCRIPTEN) 158 | -add_library(jpegli-libjpeg-obj OBJECT "${JPEGXL_INTERNAL_JPEGLI_WRAPPER_SOURCES}") 159 | -target_compile_options(jpegli-libjpeg-obj PRIVATE ${JPEGXL_INTERNAL_FLAGS}) 160 | -target_compile_options(jpegli-libjpeg-obj PUBLIC ${JPEGXL_COVERAGE_FLAGS}) 161 | -set_property(TARGET jpegli-libjpeg-obj PROPERTY POSITION_INDEPENDENT_CODE ON) 162 | -target_include_directories(jpegli-libjpeg-obj PRIVATE 163 | - "$" 164 | - "$" 165 | -) 166 | -target_compile_definitions(jpegli-libjpeg-obj PUBLIC 167 | - ${JPEGLI_LIBJPEG_OBJ_COMPILE_DEFINITIONS} 168 | -) 169 | -set(JPEGLI_LIBJPEG_INTERNAL_OBJECTS $) 170 | - 171 | -file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/jpegli) 172 | -add_library(jpeg SHARED ${JPEGLI_LIBJPEG_INTERNAL_OBJECTS}) 173 | -target_link_libraries(jpeg PUBLIC ${JPEGXL_COVERAGE_FLAGS}) 174 | -target_link_libraries(jpeg PRIVATE jpegli-static) 175 | -set_target_properties(jpeg PROPERTIES 176 | - VERSION ${JPEGLI_LIBJPEG_LIBRARY_VERSION} 177 | - SOVERSION ${JPEGLI_LIBJPEG_LIBRARY_SOVERSION} 178 | - LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/jpegli" 179 | - RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/jpegli") 180 | - 181 | -# Add a jpeg.version file as a version script to tag symbols with the 182 | -# appropriate version number. 183 | -set_target_properties(jpeg PROPERTIES 184 | - LINK_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/jpegli/jpeg.version.${JPEGLI_LIBJPEG_LIBRARY_SOVERSION}) 185 | -set_property(TARGET jpeg APPEND_STRING PROPERTY 186 | - LINK_FLAGS " -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/jpegli/jpeg.version.${JPEGLI_LIBJPEG_LIBRARY_SOVERSION}") 187 | - 188 | -if (JPEGXL_INSTALL_JPEGLI_LIBJPEG) 189 | - install(TARGETS jpeg 190 | - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} 191 | - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} 192 | - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) 193 | - install( 194 | - DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/include/jpegli/" 195 | - DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") 196 | -endif() 197 | - 198 | -# This hides the default visibility symbols from static libraries bundled into 199 | -# the shared library. In particular this prevents exposing symbols from hwy 200 | -# in the shared library. 201 | -if(LINKER_SUPPORT_EXCLUDE_LIBS) 202 | + add_library(jpegli-libjpeg-obj OBJECT "${JPEGXL_INTERNAL_JPEGLI_WRAPPER_SOURCES}") 203 | + target_compile_options(jpegli-libjpeg-obj PRIVATE ${JPEGXL_INTERNAL_FLAGS}) 204 | + target_compile_options(jpegli-libjpeg-obj PUBLIC ${JPEGXL_COVERAGE_FLAGS}) 205 | + set_property(TARGET jpegli-libjpeg-obj PROPERTY POSITION_INDEPENDENT_CODE ON) 206 | + target_include_directories(jpegli-libjpeg-obj PRIVATE 207 | + "$" 208 | + "$" 209 | + ) 210 | + target_compile_definitions(jpegli-libjpeg-obj PUBLIC 211 | + ${JPEGLI_LIBJPEG_OBJ_COMPILE_DEFINITIONS} 212 | + ) 213 | + set(JPEGLI_LIBJPEG_INTERNAL_OBJECTS $) 214 | + 215 | + file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/jpegli) 216 | + add_library(jpeg SHARED ${JPEGLI_LIBJPEG_INTERNAL_OBJECTS}) 217 | + target_link_libraries(jpeg PUBLIC ${JPEGXL_COVERAGE_FLAGS}) 218 | + target_link_libraries(jpeg PRIVATE jpegli-static) 219 | + set_target_properties(jpeg PROPERTIES 220 | + VERSION ${JPEGLI_LIBJPEG_LIBRARY_VERSION} 221 | + SOVERSION ${JPEGLI_LIBJPEG_LIBRARY_SOVERSION} 222 | + LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/jpegli" 223 | + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/jpegli") 224 | + 225 | + # Add a jpeg.version file as a version script to tag symbols with the 226 | + # appropriate version number. 227 | + set_target_properties(jpeg PROPERTIES 228 | + LINK_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/jpegli/jpeg.version.${JPEGLI_LIBJPEG_LIBRARY_SOVERSION}) 229 | set_property(TARGET jpeg APPEND_STRING PROPERTY 230 | - LINK_FLAGS " ${LINKER_EXCLUDE_LIBS_FLAG}") 231 | -endif() 232 | + LINK_FLAGS " -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/jpegli/jpeg.version.${JPEGLI_LIBJPEG_LIBRARY_SOVERSION}") 233 | + 234 | + if (JPEGXL_INSTALL_JPEGLI_LIBJPEG) 235 | + install(TARGETS jpeg 236 | + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} 237 | + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} 238 | + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) 239 | + install( 240 | + DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/include/jpegli/" 241 | + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") 242 | + endif() 243 | + 244 | + # This hides the default visibility symbols from static libraries bundled into 245 | + # the shared library. In particular this prevents exposing symbols from hwy 246 | + # in the shared library. 247 | + if(LINKER_SUPPORT_EXCLUDE_LIBS) 248 | + set_property(TARGET jpeg APPEND_STRING PROPERTY 249 | + LINK_FLAGS " ${LINKER_EXCLUDE_LIBS_FLAG}") 250 | + endif() 251 | endif() 252 | 253 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 254 | From: Kleis Auke Wolthuizen 255 | Date: Thu, 7 Mar 2024 18:28:49 +0100 256 | Subject: [PATCH 2/2] Build fixes for Windows 257 | 258 | Upstream-Status: Pending 259 | 260 | diff --git a/lib/jpegli.cmake b/lib/jpegli.cmake 261 | index 1111111..2222222 100644 262 | --- a/lib/jpegli.cmake 263 | +++ b/lib/jpegli.cmake 264 | @@ -47,23 +47,26 @@ else() 265 | ../third_party/libjpeg-turbo/jpeglib.h include/jpegli/jpeglib.h COPYONLY) 266 | configure_file( 267 | ../third_party/libjpeg-turbo/jmorecfg.h include/jpegli/jmorecfg.h COPYONLY) 268 | + configure_file( 269 | + ../third_party/libjpeg-turbo/jerror.h include/jpegli/jerror.h COPYONLY) 270 | endif() 271 | 272 | -add_library(jpegli-static STATIC EXCLUDE_FROM_ALL "${JPEGXL_INTERNAL_JPEGLI_SOURCES}") 273 | -target_compile_options(jpegli-static PRIVATE "${JPEGXL_INTERNAL_FLAGS}") 274 | -target_compile_options(jpegli-static PUBLIC ${JPEGXL_COVERAGE_FLAGS}) 275 | -set_property(TARGET jpegli-static PROPERTY POSITION_INDEPENDENT_CODE ON) 276 | -target_include_directories(jpegli-static PRIVATE 277 | - "$" 278 | - "${JXL_HWY_INCLUDE_DIRS}" 279 | +add_library(jpegli-obj OBJECT "${JPEGXL_INTERNAL_JPEGLI_SOURCES}") 280 | +set_target_properties(jpegli-obj PROPERTIES POSITION_INDEPENDENT_CODE ON) 281 | +target_compile_options(jpegli-obj 282 | + PUBLIC "${JPEGXL_COVERAGE_FLAGS}" 283 | + PRIVATE "${JPEGXL_INTERNAL_FLAGS}" 284 | ) 285 | -target_include_directories(jpegli-static PUBLIC 286 | - "$" 287 | +target_include_directories(jpegli-obj 288 | + PUBLIC 289 | + "$" 290 | + PRIVATE 291 | + "$" 292 | + "${JXL_HWY_INCLUDE_DIRS}" 293 | ) 294 | -target_link_libraries(jpegli-static PUBLIC ${JPEGLI_INTERNAL_LIBS}) 295 | 296 | # 297 | -# Tests for jpegli-static 298 | +# Tests for jpegli 299 | # 300 | 301 | if(JPEG_FOUND AND BUILD_TESTING) 302 | @@ -85,6 +88,7 @@ if(JPEG_FOUND AND BUILD_TESTING) 303 | # The TESTNAME is the name without the extension or directory. 304 | get_filename_component(TESTNAME ${TESTFILE} NAME_WE) 305 | add_executable(${TESTNAME} ${TESTFILE} 306 | + $ 307 | $ 308 | ${JPEGXL_INTERNAL_JPEGLI_TESTLIB_FILES} 309 | ) 310 | @@ -102,11 +106,12 @@ if(JPEG_FOUND AND BUILD_TESTING) 311 | "${CMAKE_CURRENT_BINARY_DIR}/include" 312 | ) 313 | target_link_libraries(${TESTNAME} 314 | - hwy 315 | - jpegli-static 316 | - GTest::GTest 317 | - GTest::Main 318 | - ${JPEG_LIBRARIES} 319 | + PUBLIC 320 | + GTest::GTest 321 | + GTest::Main 322 | + ${JPEG_LIBRARIES} 323 | + PRIVATE 324 | + ${JPEGLI_INTERNAL_LIBS} 325 | ) 326 | set_target_properties(${TESTNAME} PROPERTIES LINK_FLAGS "${JPEGXL_COVERAGE_LINK_FLAGS}") 327 | # Output test targets in the test directory. 328 | @@ -120,48 +125,91 @@ if(JPEG_FOUND AND BUILD_TESTING) 329 | endif() 330 | 331 | # 332 | -# Build libjpeg.so that links to libjpeg-static 333 | +# Build libjpeg.{so,a,dll,lib} that uses the objects and properties of jpegli-obj 334 | # 335 | 336 | -if (JPEGXL_ENABLE_JPEGLI_LIBJPEG AND NOT APPLE AND NOT WIN32 AND NOT EMSCRIPTEN) 337 | - add_library(jpegli-libjpeg-obj OBJECT "${JPEGXL_INTERNAL_JPEGLI_WRAPPER_SOURCES}") 338 | - target_compile_options(jpegli-libjpeg-obj PRIVATE ${JPEGXL_INTERNAL_FLAGS}) 339 | - target_compile_options(jpegli-libjpeg-obj PUBLIC ${JPEGXL_COVERAGE_FLAGS}) 340 | - set_property(TARGET jpegli-libjpeg-obj PROPERTY POSITION_INDEPENDENT_CODE ON) 341 | - target_include_directories(jpegli-libjpeg-obj PRIVATE 342 | +if (JPEGXL_ENABLE_JPEGLI_LIBJPEG) 343 | + add_library(jpeg 344 | + $ 345 | + "${JPEGXL_INTERNAL_JPEGLI_WRAPPER_SOURCES}" 346 | + ) 347 | + target_link_libraries(jpeg 348 | + PUBLIC ${JPEGXL_COVERAGE_FLAGS} 349 | + PRIVATE ${JPEGLI_INTERNAL_LIBS} 350 | + ) 351 | + target_compile_options(jpeg PRIVATE ${JPEGXL_INTERNAL_FLAGS}) 352 | + target_include_directories(jpeg PRIVATE 353 | "$" 354 | "$" 355 | ) 356 | - target_compile_definitions(jpegli-libjpeg-obj PUBLIC 357 | - ${JPEGLI_LIBJPEG_OBJ_COMPILE_DEFINITIONS} 358 | - ) 359 | - set(JPEGLI_LIBJPEG_INTERNAL_OBJECTS $) 360 | - 361 | - file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/jpegli) 362 | - add_library(jpeg SHARED ${JPEGLI_LIBJPEG_INTERNAL_OBJECTS}) 363 | - target_link_libraries(jpeg PUBLIC ${JPEGXL_COVERAGE_FLAGS}) 364 | - target_link_libraries(jpeg PRIVATE jpegli-static) 365 | set_target_properties(jpeg PROPERTIES 366 | + POSITION_INDEPENDENT_CODE ON 367 | VERSION ${JPEGLI_LIBJPEG_LIBRARY_VERSION} 368 | SOVERSION ${JPEGLI_LIBJPEG_LIBRARY_SOVERSION} 369 | LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/jpegli" 370 | RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/jpegli") 371 | 372 | - # Add a jpeg.version file as a version script to tag symbols with the 373 | - # appropriate version number. 374 | - set_target_properties(jpeg PROPERTIES 375 | - LINK_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/jpegli/jpeg.version.${JPEGLI_LIBJPEG_LIBRARY_SOVERSION}) 376 | - set_property(TARGET jpeg APPEND_STRING PROPERTY 377 | - LINK_FLAGS " -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/jpegli/jpeg.version.${JPEGLI_LIBJPEG_LIBRARY_SOVERSION}") 378 | + if (APPLE) 379 | + set_property(TARGET jpeg APPEND_STRING PROPERTY 380 | + LINK_FLAGS "-Wl,-exported_symbol,_jpeg* -Wl,-exported_symbol,_tj*") 381 | + elseif (WIN32) 382 | + # Create jpeg.dll or libjpeg-.dll when building a 383 | + # shared library on Windows. 384 | + if (MSVC) 385 | + set_target_properties(jpeg PROPERTIES 386 | + RUNTIME_OUTPUT_NAME jpeg${JPEGLI_LIBJPEG_LIBRARY_SOVERSION}) 387 | + elseif (MINGW) 388 | + set_target_properties(jpeg PROPERTIES 389 | + RUNTIME_OUTPUT_NAME jpeg-${JPEGLI_LIBJPEG_LIBRARY_SOVERSION}) 390 | + endif() 391 | + else() 392 | + # Add a jpeg.version file as a version script to tag symbols with the 393 | + # appropriate version number. 394 | + set_target_properties(jpeg PROPERTIES 395 | + LINK_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/jpegli/jpeg.version.${JPEGLI_LIBJPEG_LIBRARY_SOVERSION}) 396 | + set_property(TARGET jpeg APPEND_STRING PROPERTY 397 | + LINK_FLAGS " -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/jpegli/jpeg.version.${JPEGLI_LIBJPEG_LIBRARY_SOVERSION}") 398 | + endif() # APPLE 399 | 400 | if (JPEGXL_INSTALL_JPEGLI_LIBJPEG) 401 | install(TARGETS jpeg 402 | RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} 403 | LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} 404 | ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) 405 | - install( 406 | - DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/include/jpegli/" 407 | - DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") 408 | + 409 | + if (NOT JPEGXL_FORCE_SYSTEM_JPEG_TURBO) 410 | + install( 411 | + DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/include/jpegli/" 412 | + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") 413 | + endif() 414 | + 415 | + ### Add a pkg-config file for libjpeg. 416 | + 417 | + # Allow adding prefix if CMAKE_INSTALL_INCLUDEDIR not absolute. 418 | + if (IS_ABSOLUTE "${CMAKE_INSTALL_INCLUDEDIR}") 419 | + set(PKGCONFIG_TARGET_INCLUDES "${CMAKE_INSTALL_INCLUDEDIR}") 420 | + else() 421 | + set(PKGCONFIG_TARGET_INCLUDES "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}") 422 | + endif() 423 | + # Allow adding prefix if CMAKE_INSTALL_LIBDIR not absolute. 424 | + if (IS_ABSOLUTE "${CMAKE_INSTALL_LIBDIR}") 425 | + set(PKGCONFIG_TARGET_LIBS "${CMAKE_INSTALL_LIBDIR}") 426 | + else() 427 | + set(PKGCONFIG_TARGET_LIBS "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}") 428 | + endif() 429 | + 430 | + if (BUILD_SHARED_LIBS) 431 | + set(JPEGLI_REQUIRES_TYPE "Requires.private") 432 | + set(JPEGLI_PRIVATE_LIBS "-lm ${PKGCONFIG_CXX_LIB}") 433 | + else() 434 | + set(JPEGLI_REQUIRES_TYPE "Requires") 435 | + set(JPEGLI_PUBLIC_LIBS "-lm ${PKGCONFIG_CXX_LIB}") 436 | + endif() 437 | + 438 | + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/jpegli/libjpeg.pc.in" 439 | + "libjpeg.pc" @ONLY) 440 | + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libjpeg.pc" 441 | + DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") 442 | endif() 443 | 444 | # This hides the default visibility symbols from static libraries bundled into 445 | diff --git a/lib/jpegli/libjpeg.pc.in b/lib/jpegli/libjpeg.pc.in 446 | new file mode 100644 447 | index 0000000..1111111 448 | --- /dev/null 449 | +++ b/lib/jpegli/libjpeg.pc.in 450 | @@ -0,0 +1,12 @@ 451 | +prefix=@CMAKE_INSTALL_PREFIX@ 452 | +exec_prefix=${prefix} 453 | +libdir=@PKGCONFIG_TARGET_LIBS@ 454 | +includedir=@PKGCONFIG_TARGET_INCLUDES@ 455 | + 456 | +Name: libjpeg 457 | +Description: Improved JPEG encoder and decoder implementation 458 | +Version: @JPEGXL_LIBRARY_VERSION@ 459 | +@JPEGLI_REQUIRES_TYPE@: libhwy 460 | +Libs: -L${libdir} -ljpeg @JPEGLI_PUBLIC_LIBS@ 461 | +Libs.private: @JPEGLI_PRIVATE_LIBS@ 462 | +Cflags: -I${includedir} 463 | -------------------------------------------------------------------------------- /build/plugins/mozjpeg/mozjpeg.mk: -------------------------------------------------------------------------------- 1 | PKG := mozjpeg 2 | $(PKG)_WEBSITE := https://github.com/mozilla/mozjpeg 3 | $(PKG)_DESCR := A JPEG codec that provides increased compression for JPEG images (libjpeg-turbo fork). 4 | $(PKG)_IGNORE := 5 | $(PKG)_VERSION := 4.1.5 6 | $(PKG)_CHECKSUM := 9fcbb7171f6ac383f5b391175d6fb3acde5e64c4c4727274eade84ed0998fcc1 7 | $(PKG)_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/$(PKG)-[0-9]*.patch))) 8 | $(PKG)_GH_CONF := mozilla/mozjpeg/tags,v 9 | $(PKG)_DEPS := cc $(BUILD)~nasm 10 | 11 | # WITH_TURBOJPEG=OFF turns off a library we don't use (we just use the 12 | # libjpeg API) 13 | define $(PKG)_BUILD 14 | cd '$(BUILD_DIR)' && $(TARGET)-cmake \ 15 | -DWITH_TURBOJPEG=OFF \ 16 | -DPNG_SUPPORTED=OFF \ 17 | -DENABLE_SHARED=$(CMAKE_SHARED_BOOL) \ 18 | -DENABLE_STATIC=$(CMAKE_STATIC_BOOL) \ 19 | -DCMAKE_ASM_NASM_COMPILER='$(PREFIX)/$(BUILD)/bin/nasm' \ 20 | '$(SOURCE_DIR)' 21 | $(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)' 22 | $(MAKE) -C '$(BUILD_DIR)' -j 1 $(subst -,/,$(INSTALL_STRIP_LIB)) 23 | endef 24 | -------------------------------------------------------------------------------- /build/plugins/mozjpeg/overrides.mk: -------------------------------------------------------------------------------- 1 | $(PLUGIN_HEADER) 2 | 3 | IS_MOZJPEG := $(true) 4 | 5 | # Override sub-dependencies 6 | gdk-pixbuf_DEPS := $(subst libjpeg-turbo,mozjpeg,$(gdk-pixbuf_DEPS)) 7 | imagemagick_DEPS := $(subst libjpeg-turbo,mozjpeg,$(imagemagick_DEPS)) 8 | graphicsmagick_DEPS := $(subst libjpeg-turbo,mozjpeg,$(graphicsmagick_DEPS)) 9 | openslide_DEPS := $(subst libjpeg-turbo,mozjpeg,$(openslide_DEPS)) 10 | poppler_DEPS := $(subst libjpeg-turbo,mozjpeg,$(poppler_DEPS)) 11 | tiff_DEPS := $(subst libjpeg-turbo,mozjpeg,$(tiff_DEPS)) 12 | vips-all_DEPS := $(subst libjpeg-turbo,mozjpeg,$(vips-all_DEPS)) 13 | vips-web_DEPS := $(subst libjpeg-turbo,mozjpeg,$(vips-web_DEPS)) 14 | 15 | # Disable the libjpeg-turbo build, just to be sure 16 | libjpeg-turbo_BUILD_x86_64-w64-mingw32 = 17 | libjpeg-turbo_BUILD_i686-w64-mingw32 = 18 | libjpeg-turbo_BUILD_aarch64-w64-mingw32 = 19 | -------------------------------------------------------------------------------- /build/plugins/mozjpeg/patches/mozjpeg-4-fixes.patch: -------------------------------------------------------------------------------- 1 | This file is part of MXE. See LICENSE.md for licensing information. 2 | 3 | Contains ad hoc patches for cross building. 4 | 5 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 6 | From: Alexpux 7 | Date: Sun, 18 Jan 2015 16:49:05 +0300 8 | Subject: [PATCH 1/1] Fix compatibility with "basestd.h" header 9 | 10 | Taken from: 11 | https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-libjpeg-turbo/0001-header-compat.mingw.patch 12 | 13 | diff --git a/jmorecfg.h b/jmorecfg.h 14 | index 1111111..2222222 100644 15 | --- a/jmorecfg.h 16 | +++ b/jmorecfg.h 17 | @@ -14,6 +14,12 @@ 18 | * optimizations. Most users will not need to touch this file. 19 | */ 20 | 21 | +/* prevents conflicts */ 22 | +#if defined(__MINGW32__) 23 | +#include /* typedefs INT16 and INT32 */ 24 | + 25 | +#define HAVE_BOOLEAN 26 | +#endif 27 | 28 | /* 29 | * Maximum number of components (color channels) allowed in JPEG image. 30 | @@ -87,6 +93,7 @@ typedef unsigned char JOCTET; 31 | #define GETJOCTET(value) (value) 32 | 33 | 34 | +#ifndef _BASETSD_H_ /* basestd.h from mingw-w64 defines UINT8, UINT16, INT16, INT32 */ 35 | /* These typedefs are used for various table entries and so forth. 36 | * They must be at least as wide as specified; but making them too big 37 | * won't cost a huge amount of memory, so we don't provide special 38 | @@ -134,14 +141,11 @@ typedef short INT16; 39 | */ 40 | 41 | #ifndef XMD_H /* X11/xmd.h correctly defines INT32 */ 42 | -#ifndef _BASETSD_H_ /* Microsoft defines it in basetsd.h */ 43 | -#ifndef _BASETSD_H /* MinGW is slightly different */ 44 | #ifndef QGLOBAL_H /* Qt defines it in qglobal.h */ 45 | typedef long INT32; 46 | #endif 47 | #endif 48 | #endif 49 | -#endif 50 | 51 | /* Datatype used for image dimensions. The JPEG standard only supports 52 | * images up to 64K*64K due to 16-bit fields in SOF markers. Therefore 53 | -------------------------------------------------------------------------------- /build/plugins/nightly/overrides.mk: -------------------------------------------------------------------------------- 1 | $(PLUGIN_HEADER) 2 | 3 | # Nightly build, skip checksum verification 4 | SKIP_CHECKSUM := $(true) 5 | 6 | vips-web_VERSION := $(GIT_COMMIT) 7 | vips-web_GH_CONF := libvips/libvips/branches/master 8 | vips-web_SUBDIR := libvips-libvips-$(GIT_COMMIT) 9 | vips-web_FILE := vips-web-$(GIT_COMMIT).tar.gz 10 | 11 | vips-all_VERSION := $(GIT_COMMIT) 12 | vips-all_GH_CONF := libvips/libvips/branches/master 13 | vips-all_SUBDIR := libvips-libvips-$(GIT_COMMIT) 14 | vips-all_FILE := vips-all-$(GIT_COMMIT).tar.gz 15 | -------------------------------------------------------------------------------- /build/plugins/proxy-libintl/overrides.mk: -------------------------------------------------------------------------------- 1 | $(PLUGIN_HEADER) 2 | 3 | IS_INTL_DUMMY := $(true) 4 | 5 | # Override sub-dependencies 6 | glib_DEPS := $(subst gettext,proxy-libintl,$(glib_DEPS)) 7 | 8 | # Disable the gettext build, just to be sure 9 | gettext_BUILD_x86_64-w64-mingw32 = 10 | gettext_BUILD_i686-w64-mingw32 = 11 | gettext_BUILD_aarch64-w64-mingw32 = 12 | -------------------------------------------------------------------------------- /build/plugins/proxy-libintl/patches/proxy-libintl-1-fixes.patch: -------------------------------------------------------------------------------- 1 | This file is part of MXE. See LICENSE.md for licensing information. 2 | 3 | Contains ad hoc patches for cross building. 4 | 5 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 6 | From: Kleis Auke Wolthuizen 7 | Date: Sun, 5 Jul 2020 23:00:00 +0200 8 | Subject: [PATCH 1/1] Only use the dllimport attribute for MSVC 9 | 10 | 11 | diff --git a/libintl.h b/libintl.h 12 | index 1111111..2222222 100644 13 | --- a/libintl.h 14 | +++ b/libintl.h 15 | @@ -60,8 +60,10 @@ 16 | /* Export when producing library, import when linking against library */ 17 | # ifdef G_INTL_COMPILATION 18 | # define G_INTL_EXPORT __declspec(dllexport) 19 | -# else 20 | +# elif defined(_MSC_VER) 21 | # define G_INTL_EXPORT __declspec(dllimport) 22 | +# else 23 | +# define G_INTL_EXPORT extern 24 | # endif 25 | #else 26 | # define G_INTL_EXPORT extern 27 | -------------------------------------------------------------------------------- /build/plugins/proxy-libintl/proxy-libintl.mk: -------------------------------------------------------------------------------- 1 | PKG := proxy-libintl 2 | $(PKG)_WEBSITE := https://github.com/frida/proxy-libintl 3 | $(PKG)_DESCR := Proxy for a dynamically loaded optional libintl. 4 | $(PKG)_IGNORE := 5 | $(PKG)_VERSION := 0.4 6 | $(PKG)_CHECKSUM := 13ef3eea0a3bc0df55293be368dfbcff5a8dd5f4759280f28e030d1494a5dffb 7 | $(PKG)_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/$(PKG)-[0-9]*.patch))) 8 | $(PKG)_GH_CONF := frida/proxy-libintl/tags 9 | $(PKG)_DEPS := cc meson-wrapper 10 | 11 | define $(PKG)_BUILD 12 | $(MXE_MESON_WRAPPER) \ 13 | --default-library=static \ 14 | '$(SOURCE_DIR)' \ 15 | '$(BUILD_DIR)' 16 | 17 | $(MXE_NINJA) -C '$(BUILD_DIR)' -j '$(JOBS)' install 18 | endef 19 | -------------------------------------------------------------------------------- /build/plugins/zlib-ng/overrides.mk: -------------------------------------------------------------------------------- 1 | $(PLUGIN_HEADER) 2 | 3 | IS_ZLIB_NG := $(true) 4 | 5 | # Override sub-dependencies 6 | cairo_DEPS := $(subst zlib,zlib-ng,$(cairo_DEPS)) 7 | cfitsio_DEPS := $(subst zlib,zlib-ng,$(cfitsio_DEPS)) 8 | freetype_DEPS := $(subst zlib,zlib-ng,$(freetype_DEPS)) 9 | freetype-bootstrap_DEPS := $(subst zlib,zlib-ng,$(freetype-bootstrap_DEPS)) 10 | glib_DEPS := $(subst zlib,zlib-ng,$(glib_DEPS)) 11 | lcms_DEPS := $(subst zlib,zlib-ng,$(lcms_DEPS)) 12 | libarchive_DEPS := $(subst zlib,zlib-ng,$(libarchive_DEPS)) 13 | libexif_DEPS := $(subst zlib,zlib-ng,$(libexif_DEPS)) 14 | libpng_DEPS := $(subst zlib,zlib-ng,$(libpng_DEPS)) 15 | libspng_DEPS := $(subst zlib,zlib-ng,$(libspng_DEPS)) 16 | matio_DEPS := $(subst zlib,zlib-ng,$(matio_DEPS)) 17 | nifticlib_DEPS := $(subst zlib,zlib-ng,$(nifticlib_DEPS)) 18 | openexr_DEPS := $(subst zlib,zlib-ng,$(openexr_DEPS)) 19 | openjpeg_DEPS := $(subst zlib,zlib-ng,$(openjpeg_DEPS)) 20 | openslide_DEPS := $(subst zlib,zlib-ng,$(openslide_DEPS)) 21 | poppler_DEPS := $(subst zlib,zlib-ng,$(poppler_DEPS)) 22 | sqlite_DEPS := $(subst zlib,zlib-ng,$(sqlite_DEPS)) 23 | tiff_DEPS := $(subst zlib,zlib-ng,$(tiff_DEPS)) 24 | 25 | # Disable the zlib build, just to be sure 26 | zlib_BUILD_x86_64-w64-mingw32 = 27 | zlib_BUILD_i686-w64-mingw32 = 28 | zlib_BUILD_aarch64-w64-mingw32 = 29 | -------------------------------------------------------------------------------- /build/plugins/zlib-ng/patches/zlib-ng-2-fixes.patch: -------------------------------------------------------------------------------- 1 | This file is part of MXE. See LICENSE.md for licensing information. 2 | 3 | Contains ad hoc patches for cross building. 4 | 5 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 6 | From: Kleis Auke Wolthuizen 7 | Date: Tue, 30 Jul 2019 16:30:00 +0200 8 | Subject: [PATCH 1/1] Fix DLL naming (libzlib.dll -> libz.dll) 9 | 10 | 11 | diff --git a/CMakeLists.txt b/CMakeLists.txt 12 | index 1111111..2222222 100644 13 | --- a/CMakeLists.txt 14 | +++ b/CMakeLists.txt 15 | @@ -1201,7 +1201,12 @@ endforeach() 16 | if(WIN32) 17 | # Shared library 18 | if(NOT DEFINED BUILD_SHARED_LIBS OR BUILD_SHARED_LIBS) 19 | - set_target_properties(zlib PROPERTIES OUTPUT_NAME zlib${SUFFIX}) 20 | + if(MINGW) 21 | + # When cross-compiling with MinGW-w64, we want to make libz, not libzlib 22 | + set_target_properties(${ZLIB_INSTALL_LIBRARIES} PROPERTIES OUTPUT_NAME z${SUFFIX}) 23 | + else() 24 | + set_target_properties(${ZLIB_INSTALL_LIBRARIES} PROPERTIES OUTPUT_NAME zlib${SUFFIX}) 25 | + endif() 26 | endif() 27 | # Static library 28 | if(NOT DEFINED BUILD_SHARED_LIBS) 29 | -------------------------------------------------------------------------------- /build/plugins/zlib-ng/zlib-ng.mk: -------------------------------------------------------------------------------- 1 | PKG := zlib-ng 2 | $(PKG)_WEBSITE := https://github.com/zlib-ng/zlib-ng 3 | $(PKG)_DESCR := zlib replacement with optimizations for "next generation" systems. 4 | $(PKG)_IGNORE := 5 | $(PKG)_VERSION := 2.2.4 6 | $(PKG)_CHECKSUM := a73343c3093e5cdc50d9377997c3815b878fd110bf6511c2c7759f2afb90f5a3 7 | $(PKG)_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/$(PKG)-[0-9]*.patch))) 8 | $(PKG)_GH_CONF := zlib-ng/zlib-ng/tags 9 | $(PKG)_DEPS := cc 10 | 11 | define $(PKG)_BUILD 12 | $(eval export CFLAGS += -O3) 13 | 14 | cd '$(BUILD_DIR)' && '$(TARGET)-cmake' \ 15 | -DZLIB_COMPAT=ON \ 16 | -DZLIB_ENABLE_TESTS=OFF \ 17 | '$(SOURCE_DIR)' 18 | 19 | $(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)' 20 | $(MAKE) -C '$(BUILD_DIR)' -j 1 $(subst -,/,$(INSTALL_STRIP_LIB)) 21 | endef 22 | -------------------------------------------------------------------------------- /build/settings/debug.mk: -------------------------------------------------------------------------------- 1 | # MXE will run as many parallel jobs as there are available CPU 2 | # cores. This variable can limit this. 3 | #JOBS := 4 4 | 5 | # Print the complete log if the build or download fails. 6 | MXE_VERBOSE := true 7 | 8 | # MXE stores intermediate files in the current directory by 9 | # default. Store them in /var/tmp instead to ensure git commands 10 | # are no-op. 11 | MXE_TMP := /var/tmp 12 | 13 | # Disable optimizations to improve debuggability. 14 | TARGET_CFLAGS := -g -gcodeview -Og -fdata-sections -ffunction-sections 15 | TARGET_CXXFLAGS := -g -gcodeview -Og -fdata-sections -ffunction-sections 16 | TARGET_LDFLAGS := -Wl,--pdb= -Wl,--gc-sections 17 | 18 | # Special flags for Rust. 19 | export CARGO_PROFILE_RELEASE_DEBUG := true 20 | export CARGO_PROFILE_RELEASE_CODEGEN_UNITS := 1 21 | export CARGO_PROFILE_RELEASE_INCREMENTAL := false 22 | export CARGO_PROFILE_RELEASE_LTO := true 23 | export CARGO_PROFILE_RELEASE_OPT_LEVEL := 1 24 | export CARGO_PROFILE_RELEASE_PANIC := abort 25 | 26 | # Install the various PDBs. 27 | INSTALL_PDB := $(true) 28 | 29 | # Avoid stripping. 30 | STRIP_TOOLCHAIN := $(false) 31 | STRIP_LIB := $(false) 32 | STRIP_EXE := $(false) 33 | 34 | # Disable ccache. 35 | MXE_USE_CCACHE := $(false) 36 | -------------------------------------------------------------------------------- /build/settings/release.mk: -------------------------------------------------------------------------------- 1 | # MXE will run as many parallel jobs as there are available CPU 2 | # cores. This variable can limit this. 3 | #JOBS := 4 4 | 5 | # Print the complete log if the build or download fails. 6 | MXE_VERBOSE := true 7 | 8 | # MXE stores intermediate files in the current directory by 9 | # default. Store them in /var/tmp instead to ensure git commands 10 | # are no-op. 11 | MXE_TMP := /var/tmp 12 | 13 | # Special flags for compiler. 14 | # Default optimisation level is for binary size (-Os). 15 | # Overridden to performance (-O3) for select dependencies that benefit. 16 | TARGET_CFLAGS := -Os -g -gcodeview -fdata-sections -ffunction-sections 17 | TARGET_CXXFLAGS := -Os -g -gcodeview -fdata-sections -ffunction-sections 18 | TARGET_LDFLAGS := -Wl,--pdb= -Wl,--gc-sections -Wl,-s 19 | 20 | # Special flags for Rust. 21 | export CARGO_PROFILE_RELEASE_DEBUG := false 22 | export CARGO_PROFILE_RELEASE_CODEGEN_UNITS := 1 23 | export CARGO_PROFILE_RELEASE_INCREMENTAL := false 24 | export CARGO_PROFILE_RELEASE_LTO := true 25 | export CARGO_PROFILE_RELEASE_OPT_LEVEL := z 26 | export CARGO_PROFILE_RELEASE_PANIC := abort 27 | 28 | # Install the various PDBs. 29 | INSTALL_PDB := $(true) 30 | 31 | # Debug info should be stored in the various PDBs, ensure we strip 32 | # any residual debug info from the libs. 33 | STRIP_LIB := $(true) 34 | 35 | # Disable ccache. 36 | MXE_USE_CCACHE := $(false) 37 | -------------------------------------------------------------------------------- /build/vips-all.mk: -------------------------------------------------------------------------------- 1 | PKG := vips-all 2 | $(PKG)_WEBSITE := https://libvips.github.io/libvips/ 3 | $(PKG)_DESCR := A fast image processing library with low memory needs. 4 | $(PKG)_IGNORE := 5 | $(PKG)_VERSION := 8.17.0 6 | $(PKG)_CHECKSUM := 8256a82f2e64c119ffadac99822350f45212f16df2505ea8dbae5ff4d0001996 7 | $(PKG)_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/vips-[0-9]*.patch))) 8 | $(PKG)_GH_CONF := libvips/libvips/releases,v,,,,.tar.xz 9 | $(PKG)_SUBDIR := vips-$($(PKG)_VERSION) 10 | $(PKG)_FILE := vips-$($(PKG)_VERSION).tar.xz 11 | $(PKG)_DEPS := cc meson-wrapper libwebp librsvg glib pango libarchive \ 12 | libjpeg-turbo tiff lcms libexif libheif libspng \ 13 | libimagequant highway imagemagick matio openexr \ 14 | cfitsio nifticlib poppler fftw openslide libjxl cgif 15 | 16 | define $(PKG)_PRE_CONFIGURE 17 | # Copy some files to the packaging directory 18 | mkdir -p '$(PREFIX)/$(TARGET)/vips-packaging' 19 | $(foreach f, ChangeLog LICENSE README.md, \ 20 | cp '$(SOURCE_DIR)/$(f)' '$(PREFIX)/$(TARGET)/vips-packaging';) 21 | 22 | (printf '{\n'; \ 23 | printf ' "aom": "$(aom_VERSION)",\n'; \ 24 | printf ' "archive": "$(libarchive_VERSION)",\n'; \ 25 | printf ' "brotli": "$(brotli_VERSION)",\n'; \ 26 | printf ' "cairo": "$(cairo_VERSION)",\n'; \ 27 | printf ' "cfitsio": "$(cfitsio_VERSION)",\n'; \ 28 | printf ' "cgif": "$(cgif_VERSION)",\n'; \ 29 | $(if $(IS_HEVC),printf ' "de265": "$(libde265_VERSION)"$(comma)\n';) \ 30 | printf ' "dicom": "$(libdicom_VERSION)",\n'; \ 31 | printf ' "exif": "$(libexif_VERSION)",\n'; \ 32 | printf ' "expat": "$(expat_VERSION)",\n'; \ 33 | printf ' "ffi": "$(libffi_VERSION)",\n'; \ 34 | printf ' "fftw": "$(fftw_VERSION)",\n'; \ 35 | printf ' "fontconfig": "$(fontconfig_VERSION)",\n'; \ 36 | printf ' "freetype": "$(freetype_VERSION)",\n'; \ 37 | printf ' "fribidi": "$(fribidi_VERSION)",\n'; \ 38 | printf ' "gdkpixbuf": "$(gdk-pixbuf_VERSION)",\n'; \ 39 | $(if $(IS_INTL_DUMMY),,printf ' "gettext": "$(gettext_VERSION)"$(comma)\n';) \ 40 | printf ' "glib": "$(glib_VERSION)",\n'; \ 41 | $(if $(findstring graphicsmagick,$($(PKG)_DEPS)),printf ' "graphicsmagick": "$(graphicsmagick_VERSION)"$(comma)\n';) \ 42 | printf ' "harfbuzz": "$(harfbuzz_VERSION)",\n'; \ 43 | printf ' "heif": "$(libheif_VERSION)",\n'; \ 44 | printf ' "highway": "$(highway_VERSION)",\n'; \ 45 | $(if $(findstring imagemagick,$($(PKG)_DEPS)),printf ' "imagemagick": "$(imagemagick_VERSION)"$(comma)\n';) \ 46 | printf ' "imagequant": "$(libimagequant_VERSION)",\n'; \ 47 | $(if $(IS_JPEGLI), \ 48 | printf ' "jpegli": "$(jpegli_VERSION)"$(comma)\n';, \ 49 | $(if $(IS_MOZJPEG),,printf ' "jpeg": "$(libjpeg-turbo_VERSION)"$(comma)\n';)) \ 50 | printf ' "jxl": "$(libjxl_VERSION)",\n'; \ 51 | printf ' "lcms": "$(lcms_VERSION)",\n'; \ 52 | printf ' "matio": "$(matio_VERSION)",\n'; \ 53 | $(if $(IS_MOZJPEG),printf ' "mozjpeg": "$(mozjpeg_VERSION)"$(comma)\n';) \ 54 | printf ' "nifti": "$(nifticlib_VERSION)",\n'; \ 55 | printf ' "openexr": "$(openexr_VERSION)",\n'; \ 56 | printf ' "openjpeg": "$(openjpeg_VERSION)",\n'; \ 57 | printf ' "openslide": "$(openslide_VERSION)",\n'; \ 58 | printf ' "pango": "$(pango_VERSION)",\n'; \ 59 | printf ' "pixman": "$(pixman_VERSION)",\n'; \ 60 | printf ' "png": "$(libpng_VERSION)",\n'; \ 61 | printf ' "poppler": "$(poppler_VERSION)",\n'; \ 62 | $(if $(IS_INTL_DUMMY),printf ' "proxy-libintl": "$(proxy-libintl_VERSION)"$(comma)\n';) \ 63 | printf ' "rsvg": "$(librsvg_VERSION)",\n'; \ 64 | printf ' "spng": "$(libspng_VERSION)",\n'; \ 65 | printf ' "sqlite": "$(sqlite_VERSION)",\n'; \ 66 | printf ' "tiff": "$(tiff_VERSION)",\n'; \ 67 | printf ' "vips": "$(vips-all_VERSION)",\n'; \ 68 | printf ' "webp": "$(libwebp_VERSION)",\n'; \ 69 | $(if $(IS_HEVC),printf ' "x265": "$(x265_VERSION)"$(comma)\n';) \ 70 | printf ' "xml": "$(libxml2_VERSION)",\n'; \ 71 | $(if $(IS_ZLIB_NG), \ 72 | printf ' "zlib-ng": "$(zlib-ng_VERSION)"\n';, \ 73 | printf ' "zlib": "$(zlib_VERSION)"\n';) \ 74 | printf '}';) \ 75 | > '$(PREFIX)/$(TARGET)/vips-packaging/versions.json' 76 | endef 77 | 78 | define $(PKG)_BUILD 79 | $($(PKG)_PRE_CONFIGURE) 80 | 81 | $(eval export CFLAGS += -O3) 82 | $(eval export CXXFLAGS += -O3) 83 | 84 | $(MXE_MESON_WRAPPER) \ 85 | -Ddeprecated=false \ 86 | -Dexamples=false \ 87 | -Dintrospection=disabled \ 88 | -Dmodules=enabled \ 89 | -Dheif-module=$(if $(IS_HEVC),enabled,disabled) \ 90 | $(if $(findstring graphicsmagick,$($(PKG)_DEPS)), -Dmagick-package=GraphicsMagick) \ 91 | -Dpdfium=disabled \ 92 | -Dquantizr=disabled \ 93 | -Dc_args='$(CFLAGS) -DVIPS_DLLDIR_AS_LIBDIR' \ 94 | '$(SOURCE_DIR)' \ 95 | '$(BUILD_DIR)' 96 | 97 | $(MXE_NINJA) -C '$(BUILD_DIR)' -j '$(JOBS)' install 98 | endef 99 | -------------------------------------------------------------------------------- /build/vips-web.mk: -------------------------------------------------------------------------------- 1 | PKG := vips-web 2 | $(PKG)_WEBSITE := https://libvips.github.io/libvips/ 3 | $(PKG)_DESCR := A fast image processing library with low memory needs. 4 | $(PKG)_IGNORE := 5 | $(PKG)_VERSION := 8.17.0 6 | $(PKG)_CHECKSUM := 8256a82f2e64c119ffadac99822350f45212f16df2505ea8dbae5ff4d0001996 7 | $(PKG)_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/vips-[0-9]*.patch))) 8 | $(PKG)_GH_CONF := libvips/libvips/releases,v,,,,.tar.xz 9 | $(PKG)_SUBDIR := vips-$($(PKG)_VERSION) 10 | $(PKG)_FILE := vips-$($(PKG)_VERSION).tar.xz 11 | $(PKG)_DEPS := cc meson-wrapper libwebp librsvg glib pango libarchive \ 12 | libjpeg-turbo tiff lcms libexif libheif libspng \ 13 | libimagequant highway cgif 14 | 15 | define $(PKG)_PRE_CONFIGURE 16 | # Copy some files to the packaging directory 17 | mkdir -p '$(PREFIX)/$(TARGET)/vips-packaging' 18 | $(foreach f, ChangeLog LICENSE README.md, \ 19 | cp '$(SOURCE_DIR)/$(f)' '$(PREFIX)/$(TARGET)/vips-packaging';) 20 | 21 | (printf '{\n'; \ 22 | printf ' "aom": "$(aom_VERSION)",\n'; \ 23 | printf ' "archive": "$(libarchive_VERSION)",\n'; \ 24 | printf ' "cairo": "$(cairo_VERSION)",\n'; \ 25 | printf ' "cgif": "$(cgif_VERSION)",\n'; \ 26 | printf ' "exif": "$(libexif_VERSION)",\n'; \ 27 | printf ' "expat": "$(expat_VERSION)",\n'; \ 28 | printf ' "ffi": "$(libffi_VERSION)",\n'; \ 29 | printf ' "fontconfig": "$(fontconfig_VERSION)",\n'; \ 30 | printf ' "freetype": "$(freetype_VERSION)",\n'; \ 31 | printf ' "fribidi": "$(fribidi_VERSION)",\n'; \ 32 | $(if $(IS_INTL_DUMMY),,printf ' "gettext": "$(gettext_VERSION)"$(comma)\n';) \ 33 | printf ' "glib": "$(glib_VERSION)",\n'; \ 34 | printf ' "harfbuzz": "$(harfbuzz_VERSION)",\n'; \ 35 | printf ' "heif": "$(libheif_VERSION)",\n'; \ 36 | printf ' "highway": "$(highway_VERSION)",\n'; \ 37 | printf ' "imagequant": "$(libimagequant_VERSION)",\n'; \ 38 | $(if $(IS_JPEGLI), \ 39 | printf ' "jpegli": "$(jpegli_VERSION)"$(comma)\n';, \ 40 | $(if $(IS_MOZJPEG),,printf ' "jpeg": "$(libjpeg-turbo_VERSION)"$(comma)\n';)) \ 41 | printf ' "lcms": "$(lcms_VERSION)",\n'; \ 42 | $(if $(IS_MOZJPEG),printf ' "mozjpeg": "$(mozjpeg_VERSION)"$(comma)\n';) \ 43 | printf ' "pango": "$(pango_VERSION)",\n'; \ 44 | printf ' "pixman": "$(pixman_VERSION)",\n'; \ 45 | printf ' "png": "$(libpng_VERSION)",\n'; \ 46 | $(if $(IS_INTL_DUMMY),printf ' "proxy-libintl": "$(proxy-libintl_VERSION)"$(comma)\n';) \ 47 | printf ' "rsvg": "$(librsvg_VERSION)",\n'; \ 48 | printf ' "spng": "$(libspng_VERSION)",\n'; \ 49 | printf ' "tiff": "$(tiff_VERSION)",\n'; \ 50 | printf ' "vips": "$(vips-web_VERSION)",\n'; \ 51 | printf ' "webp": "$(libwebp_VERSION)",\n'; \ 52 | printf ' "xml": "$(libxml2_VERSION)",\n'; \ 53 | $(if $(IS_ZLIB_NG), \ 54 | printf ' "zlib-ng": "$(zlib-ng_VERSION)"\n';, \ 55 | printf ' "zlib": "$(zlib_VERSION)"\n';) \ 56 | printf '}';) \ 57 | > '$(PREFIX)/$(TARGET)/vips-packaging/versions.json' 58 | endef 59 | 60 | define $(PKG)_BUILD 61 | $($(PKG)_PRE_CONFIGURE) 62 | 63 | $(eval export CFLAGS += -O3) 64 | $(eval export CXXFLAGS += -O3) 65 | 66 | # Always build as shared library, we need 67 | # libvips-42.dll for the language bindings. 68 | $(MXE_MESON_WRAPPER) \ 69 | --default-library=shared \ 70 | -Ddeprecated=false \ 71 | -Dexamples=false \ 72 | -Dintrospection=disabled \ 73 | -Dmodules=disabled \ 74 | -Dcfitsio=disabled \ 75 | -Dfftw=disabled \ 76 | -Djpeg-xl=disabled \ 77 | -Dmagick=disabled \ 78 | -Dmatio=disabled \ 79 | -Dnifti=disabled \ 80 | -Dopenexr=disabled \ 81 | -Dopenjpeg=disabled \ 82 | -Dopenslide=disabled \ 83 | -Dpdfium=disabled \ 84 | -Dpoppler=disabled \ 85 | -Dquantizr=disabled \ 86 | -Dppm=false \ 87 | -Danalyze=false \ 88 | -Dradiance=false \ 89 | '$(SOURCE_DIR)' \ 90 | '$(BUILD_DIR)' 91 | 92 | $(MXE_NINJA) -C '$(BUILD_DIR)' -j '$(JOBS)' install 93 | endef 94 | -------------------------------------------------------------------------------- /build/vipsdisp.mk: -------------------------------------------------------------------------------- 1 | PKG := vipsdisp 2 | $(PKG)_WEBSITE := https://github.com/jcupitt/vipsdisp 3 | $(PKG)_DESCR := Tiny libvips / gtk+4 image viewer 4 | $(PKG)_IGNORE := 5 | $(PKG)_VERSION := 3.1.0 6 | $(PKG)_CHECKSUM := 5c40e71c9c60232dcbf2e1c389295a4a102a27603bce994dbb2e35ff4f1844db 7 | $(PKG)_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/$(PKG)-[0-9]*.patch))) 8 | $(PKG)_GH_CONF := jcupitt/vipsdisp/releases,v,,,,.tar.xz 9 | $(PKG)_DEPS := cc meson-wrapper gtk4 vips-all 10 | 11 | define $(PKG)_PRE_CONFIGURE 12 | (printf '{\n'; \ 13 | printf ' "epoxy": "$(libepoxy_VERSION)",\n'; \ 14 | printf ' "graphene": "$(graphene_VERSION)",\n'; \ 15 | printf ' "gtk": "$(gtk4_VERSION)",\n'; \ 16 | printf ' "vipsdisp": "$(vipsdisp_VERSION)"\n'; \ 17 | printf '}';) \ 18 | > '$(PREFIX)/$(TARGET)/vips-packaging/versions-vipsdisp.json' 19 | endef 20 | 21 | define $(PKG)_BUILD 22 | $($(PKG)_PRE_CONFIGURE) 23 | 24 | $(eval export CFLAGS += -O3) 25 | 26 | $(MXE_MESON_WRAPPER) '$(SOURCE_DIR)' '$(BUILD_DIR)' 27 | 28 | $(MXE_NINJA) -C '$(BUILD_DIR)' -j '$(JOBS)' install 29 | endef 30 | -------------------------------------------------------------------------------- /container/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG BASE_IMAGE=ghcr.io/libvips/build-win64-mxe:latest 2 | FROM $BASE_IMAGE 3 | 4 | # Copy the contents of this repository to the container 5 | COPY . /data 6 | WORKDIR /usr/local/mxe 7 | 8 | ARG PKGS 9 | ARG MXE_TARGETS 10 | ARG DEBUG 11 | ARG GIT_COMMIT 12 | ARG PLUGIN_DIRS 13 | 14 | RUN \ 15 | if [ "$DEBUG" = true ]; then \ 16 | cp -f /data/settings/debug.mk settings.mk; \ 17 | else \ 18 | cp -f /data/settings/release.mk settings.mk; \ 19 | fi 20 | 21 | # Build requested packages and gendef (a tool for generating def files from DLLs) 22 | RUN --mount=type=cache,id=mxe-download,target=/usr/local/mxe/pkg \ 23 | make gendef $PKGS \ 24 | MXE_PLUGIN_DIRS="$PLUGIN_DIRS" \ 25 | MXE_TARGETS="$MXE_TARGETS" \ 26 | GIT_COMMIT=$GIT_COMMIT 27 | 28 | # The packaging dir is mounted here 29 | WORKDIR /data/packaging 30 | 31 | ENTRYPOINT ["/bin/bash", "package.sh"] 32 | -------------------------------------------------------------------------------- /container/base.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM docker.io/library/buildpack-deps:bookworm 2 | 3 | RUN \ 4 | apt-get update && \ 5 | apt-get install -qqy --no-install-recommends \ 6 | # http://mxe.cc/#requirements-debian 7 | autopoint bison build-essential flex gettext gperf \ 8 | intltool jq libtool-bin libxml-parser-perl lzip p7zip-full \ 9 | python-is-python3 python3-mako python3-packaging python3-tomli \ 10 | ruby zip 11 | 12 | WORKDIR /usr/local 13 | RUN git clone -b llvm-mingw-20250529 --single-branch https://github.com/kleisauke/mxe.git 14 | 15 | WORKDIR /usr/local/mxe 16 | 17 | # Bootstrap compilers and utilities 18 | RUN --mount=type=cache,id=mxe-download,target=/usr/local/mxe/pkg \ 19 | echo "MXE_TARGETS := x86_64-pc-linux-gnu" > settings.mk && \ 20 | make autotools cargo-c cc meson nasm pe-util \ 21 | MXE_VERBOSE=true \ 22 | MXE_TMP="/var/tmp" \ 23 | MXE_PLUGIN_DIRS="plugins/llvm-mingw" \ 24 | MXE_USE_CCACHE= 25 | -------------------------------------------------------------------------------- /packaging/gendeflibs.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # exit on error 4 | set -e 5 | 6 | if [[ "$*" == *--help* ]]; then 7 | cat <&2 ; exit 0; } 37 | 38 | for dllfile in "${dlls[@]}"; do 39 | base=$(basename $dllfile .dll) 40 | 41 | # dll names can have extra versioning in ... remove any trailing 42 | # "-\d+" pattern 43 | pure="${base%-+([[:digit:]])}" 44 | 45 | defname=$pure.def 46 | libname=$pure.lib 47 | 48 | if [ ! -f lib/$defname ]; then 49 | echo "Generating lib/$defname file for $base" 50 | gendef - $dllfile > lib/$defname 2> /dev/null 51 | fi 52 | 53 | if [ ! -f lib/$libname ]; then 54 | echo "Generating lib/$libname file for $base" 55 | $dlltool -d lib/$defname -l lib/$libname -D $dllfile 2> /dev/null 56 | fi 57 | done 58 | -------------------------------------------------------------------------------- /packaging/package-gtk.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # exit on error 4 | set -e 5 | 6 | if [[ "$*" == *--help* ]]; then 7 | cat <&2 ; continue; } 101 | 102 | pe_deps=$(peldd $pe_target --clear-path ${search_paths[@]/#/--path } ${whitelist[@]/#/--wlist } --all) 103 | for pe_dep in $pe_deps; do 104 | dir=$(dirname $pe_dep) 105 | base=$(basename $pe_dep .${pe_dep##*.}) 106 | target_dir="$repackage_dir/bin" 107 | [ "$dir" = "$module_dir" ] && target_dir+="/$module_dir_base" || true 108 | 109 | cp -n $pe_dep $target_dir 110 | 111 | # Copy PDB files 112 | [ -f $lib_dir/$base.pdb ] && cp -n $lib_dir/$base.pdb $pdb_dir || true 113 | done 114 | done 115 | 116 | echo "Copying install area $install_dir/" 117 | 118 | # Follow symlinks when copying /share and /etc directories 119 | cp -Lr $install_dir/{share,etc} $repackage_dir 120 | 121 | cd $repackage_dir 122 | 123 | echo "Cleaning unnecessary files / directories" 124 | 125 | # We need to distribute share/glib-2.0/schemas/* for GTK apps 126 | # Note: you may also need to set the XDG_DATA_DIRS env variable, see: 127 | # https://stackoverflow.com/a/28962391 128 | rm -rf share/glib-2.0/{codegen,dtds,gdb} 129 | 130 | rm -rf share/{aclocal,bash-completion,cmake,config.site,doc,gdb,gtk-2.0,gtk-doc,installed-tests,man,meson,thumbnailers,xml,zsh} 131 | rm -rf etc/bash_completion.d 132 | 133 | # We intentionally disabled the i18n features of (GNU) gettext, 134 | # so the locales are not needed. 135 | rm -rf share/locale 136 | 137 | # Remove .gitkeep files 138 | rm -f share/.gitkeep 139 | 140 | echo "Strip unneeded symbols" 141 | 142 | # Remove all symbols that are not needed 143 | if [ "$DEBUG" = false ]; then 144 | $strip --strip-unneeded bin/*.{exe,dll} 145 | [ -d "$module_dir" ] && $strip --strip-unneeded bin/$module_dir_base/*.dll || true 146 | fi 147 | 148 | echo "Copying packaging files" 149 | 150 | cp $install_dir/vips-packaging/{ChangeLog,LICENSE,README.md,versions.json} . 151 | cp $install_dir/vips-packaging/versions-$package.json . 152 | 153 | cd $work_dir 154 | 155 | zipfile=$package-$arch-$zip_suffix.zip 156 | 157 | echo "Creating $zipfile" 158 | 159 | rm -f $zipfile 160 | (cd $repackage_dir && zip -r -qq $work_dir/$zipfile .) 161 | 162 | zipfile=$package-pdb-$arch-$zip_suffix.zip 163 | 164 | echo "Creating $zipfile" 165 | 166 | rm -f $zipfile 167 | (cd $pdb_dir && zip -r -qq $work_dir/$zipfile .) 168 | -------------------------------------------------------------------------------- /packaging/package-vips.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # exit on error 4 | set -e 5 | 6 | if [[ "$*" == *--help* ]]; then 7 | cat <&2 ; continue; } 118 | 119 | pe_deps=$(peldd $pe_target --clear-path ${search_paths[@]/#/--path } ${whitelist[@]/#/--wlist } --all) 120 | for pe_dep in $pe_deps; do 121 | dir=$(dirname $pe_dep) 122 | base=$(basename $pe_dep .${pe_dep##*.}) 123 | target_dir="$repackage_dir/bin" 124 | [ "$dir" = "$module_dir" ] && target_dir+="/$module_dir_base" || true 125 | 126 | cp -n $pe_dep $target_dir 127 | 128 | # Copy PDB files 129 | [ -f $lib_dir/$base.pdb ] && cp -n $lib_dir/$base.pdb $pdb_dir || true 130 | done 131 | done 132 | 133 | echo "Copying install area $install_dir/" 134 | 135 | # Follow symlinks when copying /share, /etc and include directories 136 | cp -Lr $install_dir/{share,etc} $repackage_dir 137 | cp -Lr $install_dir/include/{glib-2.0,vips} $repackage_dir/include 138 | cp -Lr $install_dir/lib/{glib-2.0,pkgconfig} $repackage_dir/lib 139 | 140 | cd $repackage_dir 141 | 142 | echo "Generating import files" 143 | . $work_dir/gendeflibs.sh $target 144 | 145 | echo "Cleaning unnecessary files / directories" 146 | 147 | rm -rf share/glib-2.0 148 | 149 | # pkg-config files for OpenGL/GLU are not needed 150 | rm -f lib/pkgconfig/{gl,glu}.pc 151 | 152 | rm -rf share/{aclocal,bash-completion,cmake,config.site,doc,gdb,gtk-2.0,gtk-doc,installed-tests,man,meson,thumbnailers,xml,zsh} 153 | rm -rf etc/bash_completion.d 154 | 155 | # We intentionally disabled the i18n features of (GNU) gettext, 156 | # so the locales are not needed. 157 | rm -rf share/locale 158 | 159 | # Remove .gitkeep files 160 | rm -f share/.gitkeep 161 | 162 | # Allow sharp to import GLib symbols from libvips-42.dll 163 | sed -i -e 's|#define GLIB_STATIC_COMPILATION 1|/* #undef GLIB_STATIC_COMPILATION */|' \ 164 | -e 's|#define GOBJECT_STATIC_COMPILATION 1|/* #undef GOBJECT_STATIC_COMPILATION */|' \ 165 | lib/glib-2.0/include/glibconfig.h 166 | 167 | echo "Strip unneeded symbols" 168 | 169 | # Remove all symbols that are not needed 170 | if [ "$DEBUG" = false ]; then 171 | $strip --strip-unneeded bin/*.{exe,dll} 172 | [ -d "$module_dir" ] && $strip --strip-unneeded bin/$module_dir_base/*.dll || true 173 | fi 174 | 175 | echo "Copying packaging files" 176 | 177 | cp $install_dir/vips-packaging/{ChangeLog,LICENSE,README.md,versions.json} . 178 | 179 | cd $work_dir 180 | 181 | zipfile=vips-dev-$arch-$deps-$zip_suffix.zip 182 | 183 | echo "Creating $zipfile" 184 | 185 | rm -f $zipfile 186 | (cd /var/tmp && zip -r -qq $work_dir/$zipfile $(basename $repackage_dir)) 187 | 188 | zipfile=vips-pdb-$arch-$deps-$zip_suffix.zip 189 | 190 | echo "Creating $zipfile" 191 | 192 | rm -f $zipfile 193 | (cd /var/tmp && zip -r -qq $work_dir/$zipfile $(basename $pdb_dir)) 194 | -------------------------------------------------------------------------------- /packaging/package.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # exit on error 4 | set -e 5 | 6 | for pkg in $PKGS; do 7 | if [ "$pkg" = "vips-web" ] || [ "$pkg" = "vips-all" ]; then 8 | for target in $MXE_TARGETS; do 9 | ./package-vips.sh ${pkg/#vips-} $target 10 | done 11 | elif [ "$pkg" = "nip4" ] || [ "$pkg" = "vipsdisp" ]; then 12 | for target in $MXE_TARGETS; do 13 | ./package-gtk.sh $pkg $target 14 | done 15 | elif [ "$pkg" = "test-llvm-mingw" ]; then 16 | for target in $MXE_TARGETS; do 17 | cp /usr/local/mxe/usr/$target/bin/test-llvm-mingw.zip test-llvm-mingw-$target.zip 18 | done 19 | else 20 | echo "WARNING: Skipping packaging script for '$pkg'." >&2 21 | fi 22 | done 23 | -------------------------------------------------------------------------------- /packaging/variables.sh: -------------------------------------------------------------------------------- 1 | # included by packaging scripts 2 | 3 | # build-win64-mxe/packaging dir we are building 4 | work_dir=$(pwd) 5 | 6 | # MXE specific 7 | mxe_dir=/usr/local/mxe 8 | mxe_prefix=$mxe_dir/usr 9 | 10 | # Remove patch version component 11 | without_patch() { 12 | echo "${1%.[[:digit:]]*}" 13 | } 14 | 15 | if [ "$DEBUG" = true ]; then 16 | # Whitelist ucrtbased.dll for debug builds 17 | whitelist=(ucrtbased.dll) 18 | else 19 | # Whitelist the API set DLLs 20 | # Can't do api-ms-win-crt-*-l1-1-0.dll, unfortunately 21 | whitelist=(api-ms-win-crt-{conio,convert,environment,filesystem,heap,locale,math,multibyte,private,process,runtime,stdio,string,time,utility}-l1-1-0.dll) 22 | fi 23 | 24 | # Whitelist bcryptprimitives.dll for Rust 25 | # See: https://github.com/rust-lang/rust/pull/84096 26 | whitelist+=(bcryptprimitives.dll) 27 | 28 | # Whitelist ntdll.dll for Rust 29 | # See: https://github.com/rust-lang/rust/pull/108262 30 | whitelist+=(ntdll.dll) 31 | 32 | # Whitelist api-ms-win-core-synch-l1-2-0.dll for Rust 33 | # See: https://github.com/rust-lang/rust/pull/121317 34 | whitelist+=(api-ms-win-core-synch-l1-2-0.dll) 35 | --------------------------------------------------------------------------------