Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewritten Cairo and pngquant installation instructions for Windows #7163

Merged
merged 1 commit into from
May 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 25 additions & 13 deletions docs/plugins/requirements/image-processing.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,17 @@ Material for MkDocs makes use of for generating [social cards] and performing

=== ":fontawesome-brands-windows: Windows"

As stated in the [installation guide], the easiest way to get up and running
with the [Cairo Graphics] library on Windows is by installing [GTK+]. You
can also download a precompiled [GTK runtime].
The easiest way to get up and running with the [Cairo Graphics] library is
by installing it via [MSYS2], which is a software distribution and building
platform for Windows. Run the following command inside of a MSYS2 shell:

```
pacman -S mingw-w64-ucrt-x86_64-cairo
```

MSYS2 provides the Cairo Graphics library in several different environments.
The above command uses the [UCRT64] environment, as recommended by the MSYS2
developers.

=== ":material-linux: Linux"

Expand Down Expand Up @@ -88,8 +96,8 @@ The following environments come with a preinstalled version of [Cairo Graphics]:
[Cairo Graphics]: https://www.cairographics.org/
[Homebrew]: https://brew.sh/
[installation guide]: https://www.cairographics.org/download/
[GTK+]: https://www.gtk.org/docs/installations/windows/
[GTK runtime]: https://github.com/tschoonj/GTK-for-Windows-Runtime-Environment-Installer/releases
[MSYS2]: https://www.msys2.org/
[UCRT64]: https://www.msys2.org/docs/environments/
[Docker image]: https://hub.docker.com/r/squidfunk/mkdocs-material/
[GitHub Actions]: ../../publishing-your-site.md#with-github-actions

Expand All @@ -111,9 +119,13 @@ explains how to install [pngquant] system:

=== ":fontawesome-brands-windows: Windows"

Installing [pngquant] on Windows is a little more involved. The
[pngquant-winbuild] repository contains a guide on how to set up an
environment for building [pngquant] on Windows.
The easiest way to get [pngquant] is by installing it via [MSYS2], which is
a software distribution and building platform for Windows. Run the following
command inside of a MSYS2 shell:

```
pacman -S mingw-w64-ucrt-x86_64-pngquant
```

=== ":material-linux: Linux"

Expand Down Expand Up @@ -190,19 +202,19 @@ process is different:
environmental `PATH` variable. Additionally each library `name` is checked
in [two variants][find-library-Windows] with the `name` and `name.dll` format.

The default installation path of [GTK runtime] is:
The default binary and shared library path for the [UCRT64] environment of
[MSYS2], in which the packages were installed using the above commands, is:

```powershell
C:\Program Files\GTK3-Runtime Win64
C:\msys64\ucrt64\bin
```

and the libraries are in the `<INSTALL-DIR>\lib` directory. Use the debug
script below to check if the path is included. If it isn't then:
Use the debug script below to check if the path is included. If it isn't then:

1. Press ++windows+r++.
2. Run the `SystemPropertiesAdvanced` applet.
Copy link
Collaborator

@kamilkrzyskow kamilkrzyskow May 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are libs installed via pacman available outside of the MSYS2 terminal?
Also if they are available, then some path is added to the PATH variable, are those instructions below still accurate?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shared libraries are in \bin directory, which is noted in the changed lines just above this one; \lib directory contains only static libraries, which should not be in PATH, as far as I understand.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the 4th point in list should point to the bin and not lib directory, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Let me clear that up.

3. Select "Environmental Variables" at the bottom.
4. Add the whole path to the `lib` directory to your `Path` variable.
4. Add the whole path to the above directory to your `Path` variable.
5. Click OK on all open windows to apply changes.
6. Fully restart any open Terminal windows and their parent hosts like IDEs.

Expand Down