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

Freetype fails to find freetype on macos #38663

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

vbraun
Copy link
Member

@vbraun vbraun commented Sep 15, 2024

Freetype fails to find freetype on macos (Mac mini M2 with only XCode installed):

src/checkdep_freetype2.c:8:10: fatal error: 'ft2build.h' file not found
#include <ft2build.h>
         ^~~~~~~~~~~~
2 errors generated.
error: command '/usr/bin/gcc' failed with exit code 1

Sage skips installing zlib on macos because it is installed as part of XCode. The freetype configuration uses freetype-config which ends up using pkg-config to find zlib. In their infinite wisdom, Apple does not ship the .pc file:

vbraun@Mini-M2 local % ./bin/freetype-config
Package zlib was not found in the pkg-config search path.
Perhaps you should add the directory containing `zlib.pc'
to the PKG_CONFIG_PATH environment variable
Package 'zlib', required by 'libpng', not found
Package zlib was not found in the pkg-config search path.
Perhaps you should add the directory containing `zlib.pc'
to the PKG_CONFIG_PATH environment variable
Package 'zlib', required by 'libpng', not found

Solution is to require a zlib.pc file via PKG_CHECK_MODULES([zlib], ...

📝 Checklist

  • The title is concise and informative.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation and checked the documentation preview.

⌛ Dependencies

    src/checkdep_freetype2.c:8:10: fatal error: 'ft2build.h' file not found
    #include <ft2build.h>
             ^~~~~~~~~~~~
    2 errors generated.
    error: command '/usr/bin/gcc' failed with exit code 1

Sage skips installing zlib on macos because it is installed as part of
XCode. The freetype configuration uses freetype-config which ends up
using pkg-config to find zlib. In their infinite wisdom, Apple does
not ship the .pc file:

    vbraun@Mini-M2 local % ./bin/freetype-config
    Package zlib was not found in the pkg-config search path.
    Perhaps you should add the directory containing `zlib.pc'
    to the PKG_CONFIG_PATH environment variable
    Package 'zlib', required by 'libpng', not found
    Package zlib was not found in the pkg-config search path.
    Perhaps you should add the directory containing `zlib.pc'
    to the PKG_CONFIG_PATH environment variable
    Package 'zlib', required by 'libpng', not found

Solution is to require a zlib.pc file via PKG_CHECK_MODULES([zlib], ...
vbraun pushed a commit to vbraun/sage that referenced this pull request Sep 17, 2024
Freetype fails to find freetype on macos (Mac mini M2 with only XCode
installed):

    src/checkdep_freetype2.c:8:10: fatal error: 'ft2build.h' file not
found
    #include <ft2build.h>
             ^~~~~~~~~~~~
    2 errors generated.
    error: command '/usr/bin/gcc' failed with exit code 1

Sage skips installing zlib on macos because it is installed as part of
XCode. The freetype configuration uses freetype-config which ends up
using pkg-config to find zlib. In their infinite wisdom, Apple does not
ship the .pc file:

    vbraun@Mini-M2 local % ./bin/freetype-config
    Package zlib was not found in the pkg-config search path.
    Perhaps you should add the directory containing `zlib.pc'
    to the PKG_CONFIG_PATH environment variable
    Package 'zlib', required by 'libpng', not found
    Package zlib was not found in the pkg-config search path.
    Perhaps you should add the directory containing `zlib.pc'
    to the PKG_CONFIG_PATH environment variable
    Package 'zlib', required by 'libpng', not found

Solution is to require a zlib.pc file via PKG_CHECK_MODULES([zlib], ...

<!-- ^ Please provide a concise and informative title. -->
<!-- ^ Don't put issue numbers in the title, do this in the PR
description below. -->
<!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method
to calculate 1 + 2". -->
<!-- v Describe your changes below in detail. -->
<!-- v Why is this change required? What problem does it solve? -->
<!-- v If this PR resolves an open issue, please link to it here. For
example, "Fixes sagemath#12345". -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

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

### ⌛ Dependencies

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

URL: sagemath#38663
Reported by: Volker Braun
Reviewer(s):
Copy link

Documentation preview for this PR (built with commit 7a3eac6; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant