From 0505b5b3c6fe0213c455ef1587820876eba23524 Mon Sep 17 00:00:00 2001 From: Jonas Haag Date: Fri, 7 Aug 2026 14:33:42 +0200 Subject: [PATCH] Convert to rattler-build recipe format; make ghostscript an extra The permissive variants never link libgs; ghostscript is only an external delegate. Drop the hard run dependency for them and declare a 'ghostscript' optional dependency group instead, so gs-backed PDF/PS/EPS conversion becomes an explicit opt-in: imagemagick[extras=[ghostscript]]. The agpl variant keeps the unconditional run dependency. Blocked on repodata v3 support in conda-forge (conda/ceps#146). Closes gh-326 --- conda-forge.yml | 1 + recipe/meta.yaml | 99 --------------------------------------- recipe/recipe.yaml | 114 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 115 insertions(+), 99 deletions(-) delete mode 100644 recipe/meta.yaml create mode 100644 recipe/recipe.yaml diff --git a/conda-forge.yml b/conda-forge.yml index e377adc8..841a5c78 100644 --- a/conda-forge.yml +++ b/conda-forge.yml @@ -5,6 +5,7 @@ build_platform: linux_ppc64le: linux_64 conda_build: pkg_format: '2' +conda_build_tool: rattler-build conda_forge_output_validation: true github: branch_name: main diff --git a/recipe/meta.yaml b/recipe/meta.yaml deleted file mode 100644 index c7eba205..00000000 --- a/recipe/meta.yaml +++ /dev/null @@ -1,99 +0,0 @@ -{% set version = "7.1.2-27" %} -{% set build = 0 %} -{% if license_family == "agpl" %} - {% set build = build + 100 %} -{% endif %} - -package: - name: imagemagick - version: {{ version|replace("-", "_") }} - -source: - url: https://github.com/ImageMagick/ImageMagick/archive/{{ version }}.tar.gz - sha256: 485dad5226fda2417ea65f3eb6e3f63e7d5dfacacdf6f57f9c39b6ef1e3cb667 - patches: - - skip-additional-fd-tests-on-windows.patch # [win] - -build: - number: {{ build }} - string: {{ license_family }}_h{{ PKG_HASH }}_{{ PKG_BUILDNUM }} - ignore_run_exports_from: - # expat is only needed for pkg-config dependency resolution of fontconfig. - # ImageMagick does not use expat directly at runtime. - - expat - -requirements: - build: - - {{ compiler('c') }} - - {{ compiler('cxx') }} - - {{ stdlib("c") }} - - autotools_clang_conda # [win] - - gnuconfig # [unix] - - make # [unix] - - pkg-config - host: - - bzip2 - - expat - - fftw - - fontconfig - - fonts-conda-forge - - freetype - - ghostscript # [license_family == "agpl"] - - giflib - - glib - - graphviz - - jbig - - lcms2 - - libheif - - libjpeg-turbo - - libjxl - - liblzma-devel - - libpng - - libraw - - librsvg - - libtiff - - libwebp - - libxml2-devel - - libzip - - openexr - - openjpeg - - pango - - xorg-libx11 # [unix] - - xorg-libxext # [unix] - - xorg-libxrender # [unix] - - xorg-libxt # [unix] - - zlib - run: - - fonts-conda-forge - - ghostscript - - jbig # [win] - -test: - commands: - - magick --version - - # NOTE: On Windows, gslib appears in Delegates even without ghostscript in host deps, - # likely due to ImageMagick's automatic Ghostscript detection via Windows registry or nt-base.c hardcoding. - # Cannot reliably test gslib absence on Windows. - - magick --version | grep -q gslib && exit 1 || exit 0 # [unix and license_family != "agpl"] - - magick -size 10x10 xc:white white.png - - magick -size 10x10 xc:white white.jpg - - magick -size 10x10 xc:white white.tiff - - magick white.png white.jpg - - Magick++-config --cflags # [unix] - - if not exist %LIBRARY_BIN%\MagickCore-*.dll exit 1 # [win] - - if not exist %LIBRARY_BIN%\MagickWand-*.dll exit 1 # [win] - -about: - home: http://www.imagemagick.org/ - license_file: LICENSE - license: AGPL-3.0-only AND ImageMagick # [license_family == "agpl"] - license_family: AGPL # [license_family == "agpl"] - license: ImageMagick # [license_family == "imagemagick"] - license_family: Apache # [license_family == "imagemagick"] - summary: Software suite to create, edit, compose, or convert bitmap images. - -extra: - recipe-maintainers: - - ocefpaf - - halldc diff --git a/recipe/recipe.yaml b/recipe/recipe.yaml new file mode 100644 index 00000000..936d97b8 --- /dev/null +++ b/recipe/recipe.yaml @@ -0,0 +1,114 @@ +schema_version: 1 + +context: + version: "7.1.2-27" + build: ${{ 101 if license_family == "agpl" else 1 }} + +package: + name: imagemagick + version: ${{ version | replace("-", "_") }} + +source: + url: https://github.com/ImageMagick/ImageMagick/archive/${{ version }}.tar.gz + sha256: 485dad5226fda2417ea65f3eb6e3f63e7d5dfacacdf6f57f9c39b6ef1e3cb667 + patches: + - if: win + then: skip-additional-fd-tests-on-windows.patch + +build: + number: ${{ build }} + string: ${{ license_family }}_h${{ hash }}_${{ build_number }} + +requirements: + build: + - ${{ compiler('c') }} + - ${{ compiler('cxx') }} + - ${{ stdlib('c') }} + - if: win + then: autotools_clang_conda + - if: unix + then: + - gnuconfig + - make + - pkg-config + host: + - bzip2 + - expat + - fftw + - fontconfig + - fonts-conda-forge + - freetype + - if: license_family == "agpl" + then: ghostscript + - giflib + - glib + - graphviz + - jbig + - lcms2 + - libheif + - libjpeg-turbo + - libjxl + - liblzma-devel + - libpng + - libraw + - librsvg + - libtiff + - libwebp + - libxml2-devel + - libzip + - openexr + - openjpeg + - pango + - if: unix + then: + - xorg-libx11 + - xorg-libxext + - xorg-libxrender + - xorg-libxt + - zlib + run: + - fonts-conda-forge + - if: license_family == "agpl" + then: ghostscript + - if: win + then: jbig + # The permissive variants call ghostscript only as an external delegate + # (never linked); opt in explicitly via imagemagick[extras=[ghostscript]]. + extras: + ghostscript: + - ghostscript + ignore_run_exports: + from_package: + # expat is only needed for pkg-config dependency resolution of fontconfig. + # ImageMagick does not use expat directly at runtime. + - expat + +tests: + - script: + - magick --version + # NOTE: On Windows, gslib appears in Delegates even without ghostscript in host deps, + # likely due to ImageMagick's automatic Ghostscript detection via Windows registry or nt-base.c hardcoding. + # Cannot reliably test gslib absence on Windows. + - if: unix and license_family != "agpl" + then: magick --version | grep -q gslib && exit 1 || exit 0 + - magick -size 10x10 xc:white white.png + - magick -size 10x10 xc:white white.jpg + - magick -size 10x10 xc:white white.tiff + - magick white.png white.jpg + - if: unix + then: Magick++-config --cflags + - if: win + then: + - if not exist %LIBRARY_BIN%\MagickCore-*.dll exit 1 + - if not exist %LIBRARY_BIN%\MagickWand-*.dll exit 1 + +about: + homepage: http://www.imagemagick.org/ + license_file: LICENSE + license: ${{ "AGPL-3.0-only AND ImageMagick" if license_family == "agpl" else "ImageMagick" }} + summary: Software suite to create, edit, compose, or convert bitmap images. + +extra: + recipe-maintainers: + - ocefpaf + - halldc