Skip to content

Commit

Permalink
sagemathgh-36731: build/pkgs/pillow: Allow discovery of libjpeg, up…
Browse files Browse the repository at this point in the history
…grade to 10.1.0

    
<!-- ^^^^^
Please provide a concise, informative and self-explanatory title.
Don't put issue numbers in there, do this in the PR body below.
For example, instead of "Fixes sagemath#1234" use "Introduce new method to
calculate 1+1"
-->
<!-- Describe your changes here in detail -->

As discussed in https://groups.google.com/g/sage-devel/c/A4nY3bh1oPI
@egourgoulhon

Here we make`libjpeg` a new "recommended" dummy package with spkg-
configure script -- same category as pandoc, ffmpeg, imagemagick,
texlive, so it appears in the installation instructions in
https://deploy-preview-36731--sagemath-
tobias.netlify.app/html/en/installation/source#debian-ubuntu-package-
installation (in the 3rd command line for each of the shown package
systems).

Use of libjpeg can be disabled using `./configure --without-system-
libjpeg`.

Everything done here would also be necessary if we decided to make
libjpeg a normal standard/optional package; that is beyond the scope of
this PR.

We also refine the "CI Linux incremental" workflow, which determines
what packages to uninstall (so that spkg-configure is tested) or to
build (important for optional packages), based on changed files.
Failures seen in https://github.com/sagemath/sage/actions/runs/691489095
0/job/18813211070?pr=36731#step:4:8 came from the workflow trying to
build dummy packages. We suppress these now, as seen in https://github.c
om/sagemath/sage/actions/runs/6915792754/job/18815135590?pr=36731#step:4
:8

Tests at https://github.com/mkoeppe/sage/actions/runs/6911535503
(Linux), https://github.com/mkoeppe/sage/actions/runs/6911535500 (macOS)

<!-- Why is this change required? What problem does it solve? -->
<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes sagemath#12345". -->
<!-- If your change requires a documentation PR, please link it
appropriately. -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
<!-- Feel free to remove irrelevant items. -->

- [x] The title is concise, informative, and self-explanatory.
- [x] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on
- sagemath#12345: short description why this is a dependency
- sagemath#34567: ...
-->

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: sagemath#36731
Reported by: Matthias Köppe
Reviewer(s): Eric Gourgoulhon
  • Loading branch information
Release Manager committed Nov 26, 2023
2 parents 87c87e2 + 30d5a7e commit 966fbfe
Show file tree
Hide file tree
Showing 20 changed files with 47 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci-linux-incremental.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ jobs:
- name: Determine targets to build
id: build-targets
run: |
echo "uninstall_targets=$(echo $(for a in '' ${{ steps.changed-packages.outputs.configures_all_changed_files }}; do echo $a | sed -E 's,build/pkgs/([_.a-z0-9]*)/spkg-configure[.]m4 *,\1-uninstall,'; done | sort -u))" >> $GITHUB_OUTPUT
echo "build_targets=$(echo $(for a in '' ${{ steps.changed-packages.outputs.pkgs_all_changed_files }}; do echo $a | sed -E 's,-,_,g;s,(build/)?pkgs/([-_.a-z0-9]*)/[^ ]* *,\2-ensure,;'; done | sort -u))" >> $GITHUB_OUTPUT
echo "uninstall_targets=$(echo $(for a in '' ${{ steps.changed-packages.outputs.configures_all_changed_files }}; do echo $a | sed -E 's,build/pkgs/([a-z0-9][_.a-z0-9]*)/spkg-configure[.]m4 *,\1-uninstall,'; done | sort -u))" >> $GITHUB_OUTPUT
echo "build_targets=$(echo $(for a in '' ${{ steps.changed-packages.outputs.pkgs_all_changed_files }}; do SPKG=$(echo $a | sed -E 's,-,_,g;s,(build/)?pkgs/([a-z0-9][-_.a-z0-9]*)/[^ ]* *,\2,;'); if [ -f "build/pkgs/$SPKG/checksums.ini" -o -f "build/pkgs/$SPKG/requirements.txt" -o -f "build/pkgs/$SPKG/spkg-install" ]; then echo "$SPKG-ensure"; fi; done | sort -u))" >> $GITHUB_OUTPUT
cat $GITHUB_OUTPUT
test:
Expand Down
2 changes: 2 additions & 0 deletions build/bin/sage-build-env-config.in
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ export SAGE_SUITESPARSE_PREFIX="@SAGE_SUITESPARSE_PREFIX@"

export SAGE_CONFIGURE_FFLAS_FFPACK="@SAGE_CONFIGURE_FFLAS_FFPACK@"

export SAGE_HAVE_LIBJPEG="@SAGE_HAVE_LIBJPEG@"

export CONFIGURED_SAGE_EDITABLE="@SAGE_EDITABLE@"
export CONFIGURED_SAGE_WHEELS="@SAGE_WHEELS@"

Expand Down
2 changes: 1 addition & 1 deletion build/pkgs/_recommended/dependencies
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pandoc ffmpeg imagemagick texlive git
pandoc ffmpeg imagemagick texlive git libjpeg
13 changes: 13 additions & 0 deletions build/pkgs/libjpeg/SPKG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
libjpeg: JPEG image support
===========================

Description
-----------

This dummy package represents the image library ``libjpeg``.

We do not have an SPKG for it. The purpose of this dummy package is to
associate system package lists with it.

If the system package is installed, the package ``pillow`` will include
support for JPEG images.
1 change: 1 addition & 0 deletions build/pkgs/libjpeg/distros/alpine.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
libjpeg-turbo-dev
1 change: 1 addition & 0 deletions build/pkgs/libjpeg/distros/arch.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
libjpeg-turbo
1 change: 1 addition & 0 deletions build/pkgs/libjpeg/distros/debian.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
libjpeg-dev
1 change: 1 addition & 0 deletions build/pkgs/libjpeg/distros/fedora.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
libjpeg-turbo-devel
1 change: 1 addition & 0 deletions build/pkgs/libjpeg/distros/gentoo.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
media-libs/libjpeg-turbo
1 change: 1 addition & 0 deletions build/pkgs/libjpeg/distros/homebrew.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
jpeg-turbo
1 change: 1 addition & 0 deletions build/pkgs/libjpeg/distros/nix.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
libjpeg-turbo
1 change: 1 addition & 0 deletions build/pkgs/libjpeg/distros/opensuse.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
libjpeg-devel
1 change: 1 addition & 0 deletions build/pkgs/libjpeg/distros/slackware.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
libjpeg-turbo
1 change: 1 addition & 0 deletions build/pkgs/libjpeg/distros/void.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
libjpeg-turbo-devel
7 changes: 7 additions & 0 deletions build/pkgs/libjpeg/spkg-configure.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
SAGE_SPKG_CONFIGURE([libjpeg], [
PKG_CHECK_MODULES([libjpeg], [libjpeg], [
AC_SUBST([SAGE_HAVE_LIBJPEG], [1])
], [
sage_spkg_install_libjpeg=yes
])
])
1 change: 1 addition & 0 deletions build/pkgs/libjpeg/type
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
optional
4 changes: 2 additions & 2 deletions build/pkgs/pandoc/SPKG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pandoc: A document converter
Description
-----------

This script package represents the document converter pandoc.
This dummy package represents the document converter pandoc.

We do not have an SPKG for it. The purpose of this script package is to
We do not have an SPKG for it. The purpose of this dummy package is to
associate system package lists with it.
6 changes: 3 additions & 3 deletions build/pkgs/pillow/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tarball=Pillow-VERSION.tar.gz
sha1=47c1f2179bc7de5e3413feed08f7a859854030c3
md5=93a0585ab0ee9717a7576129bdabdf93
cksum=3176045361
sha1=be2dc6aeee145894f3ccbc2358a37f7849e710aa
md5=a55618c5d2fd64048dd3ea41bc39f7cd
cksum=3616378816
upstream_url=https://pypi.io/packages/source/p/pillow/Pillow-VERSION.tar.gz
2 changes: 1 addition & 1 deletion build/pkgs/pillow/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10.0.1
10.1.0
8 changes: 5 additions & 3 deletions build/pkgs/pillow/spkg-install.in
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
cd src

if [ "$CONDA_PREFIX" != "" ]; then
# Quoted quotes so that whitespace in CONDA_PREFIX works correctly.
# Below we run the command line through eval.
PILLOW_CONFIG_SETTINGS="$PILLOW_CONFIG_SETTINGS -C platform-guessing=disable"
fi

PILLOW_CONFIG_SETTINGS="-C debug=true -C jpeg=disable $PILLOW_CONFIG_SETTINGS"
if [ "$SAGE_HAVE_LIBJPEG" != 1 ]; then
PILLOW_CONFIG_SETTINGS="-C jpeg=disable $PILLOW_CONFIG_SETTINGS"
fi

PILLOW_CONFIG_SETTINGS="-C debug=true $PILLOW_CONFIG_SETTINGS"

eval sdh_pip_install $PILLOW_CONFIG_SETTINGS .

0 comments on commit 966fbfe

Please sign in to comment.