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/2.13.*: Switch to Meson build system #22974

Merged
merged 31 commits into from
Apr 22, 2024

Conversation

jwillikers
Copy link
Contributor

@jwillikers jwillikers commented Mar 4, 2024

This requires way less patching. Way less.
Fix the version in the pkg-config file to correctly map to the API version.
Update the font used in the test package and embed the OFL license in the font as suggested in the OFL FAQ.
Add this license to the license attribute of the test packages to make this licensing clear.

#23010 should be merged immediately after this PR to accommodate the correct API version being used now.

No longer blocked by conan-io/hooks#516.

In order to work for CMake versions before 3.29, the Meson generated static library on Windows is renamed from libfreetype.a to freetype.lib. CMake 3.29 and later properly detect static libraries generated by Meson on Windows for MSVC, i.e. static libraries suffixed with .a instead of .lib. This change is documented in the CMake 3.29 release notes:

On Windows, when targeting the MSVC ABI, the find_library() command now accepts .a file names after first considering .lib. This is symmetric with existing behavior when targeting the GNU ABI, in which the command accepts .lib file names after first considering .a.

@jwillikers jwillikers changed the title freetype: Switch to Meson build system freetype/2.13.2: Switch to Meson build system Mar 4, 2024
@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@jwillikers
Copy link
Contributor Author

This looks suspiciously like a long paths issue. I can build successfully on Windows locally.

Installing libfreetype.a to C:/J2/w/prod-v2/bsr@3/101217/eacfc/p/b/freet613ea5253c3ff/p\lib

@conan-center-bot

This comment has been minimized.

@ghost
Copy link

ghost commented Mar 6, 2024

I detected other pull requests that are modifying freetype/all recipe:

This message is automatically generated by https://github.com/ericLemanissier/conan-center-conflicting-prs so don't hesitate to report issues/improvements there.

@conan-center-bot

This comment has been minimized.

jwillikers added a commit to jwillikers/conan-center-index that referenced this pull request Mar 6, 2024
This patch is a bad workaround for improper versioning in the freetype package.
This is fixed in the freetype package itself in conan-io#22974.
@AbrilRBS AbrilRBS self-assigned this Mar 14, 2024
@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@jwillikers jwillikers changed the title freetype/2.13.2: Switch to Meson build system freetype/2.13.*: Switch to Meson build system Mar 21, 2024
@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

Co-authored-by: Martin Valgur <martin.valgur@gmail.com>
@conan-center-bot

This comment has been minimized.

@conan-center-bot
Copy link
Collaborator

Conan v1 pipeline ✔️

All green in build 31 (e5d09502a76f9f6e992942b31a305148b15ed3cd):

  • freetype/2.11.1:
    All packages built successfully! (All logs)

  • freetype/2.12.1:
    All packages built successfully! (All logs)

  • freetype/2.10.4:
    All packages built successfully! (All logs)

  • freetype/2.13.2:
    All packages built successfully! (All logs)

  • freetype/2.13.0:
    All packages built successfully! (All logs)

jwillikers added a commit to jwillikers/conan-center-index that referenced this pull request Apr 20, 2024
This patch is a bad workaround for improper versioning in the freetype package.
This is fixed in the freetype package itself in conan-io#22974.
Copy link
Contributor

@franramirez688 franramirez688 left a comment

Choose a reason for hiding this comment

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

Thanks a lot for this, @jwillikers! Blocking only to let me review it calmly 😁 Just a few minutes 🙏

Copy link
Contributor

@franramirez688 franramirez688 left a comment

Choose a reason for hiding this comment

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

LGTM! 👏

@conan-center-bot conan-center-bot merged commit 2243087 into conan-io:master Apr 22, 2024
33 checks passed
@jwillikers jwillikers deleted the freetype-meson branch April 22, 2024 11:55
@ericLemanissier ericLemanissier mentioned this pull request Apr 23, 2024
3 tasks
@jellespijker
Copy link
Contributor

jellespijker commented Apr 23, 2024

This PR broke our builds, due to the version obtained from the raw file, see: https://github.com/Ultimaker/cura-workflows/actions/runs/8798472364/job/24145560363#step:16:27993
When building fontconfig it searches for freetype2 version 2.13.2 but the generated freetype2.pc uses the version extracted from the textfile which is 26.1.20

Is there a quick fix for this? It's blocking our release of Cura 5.7.1, current approach is setting the component_version to self.version in the package_info and then using that in our builds, but I don't know if this is the "proper" way of doing that

@ericLemanissier
Copy link
Contributor

yes: #23010

@jwillikers
Copy link
Contributor Author

This PR broke our builds, due to the version obtained from the raw file, see: https://github.com/Ultimaker/cura-workflows/actions/runs/8798472364/job/24145560363#step:16:27993 When building fontconfig it searches for freetype2 version 2.13.2 but the generated freetype2.pc uses the version extracted from the textfile which is 26.1.20

Is there a quick fix for this? It's blocking our release of Cura 5.7.1, current approach is setting the component_version to self.version in the package_info and then using that in our builds, but I don't know if this is the "proper" way of doing that

@jellespijker Yes, sorry about breaking that. I tried to make it as clear as possible to the team that fixing the pkg-config version would break the fontconfig package and require merging my PR #23010 ASAP.

franramirez688 pushed a commit to toge/conan-center-index that referenced this pull request Apr 23, 2024
* freetype: Switch to Meson build system

This requires way less patching. Way less.

* Add patch to find bzip2

* Bump PNG

* Set pkg-config version appropriately

* Don't use collect_libs

* Fix version for Conan V1

* Enable short paths

* Fix config

* Update the OpenSans-Bold font to version 3 from version 1

This changes the license of the font from the Apache license to the OFL.
This TTF file has been updated to include the full text of the license.
This follows the recommendation of the OFL's FAQ:
https://openfontlicense.org/how-to-use-ofl-fonts/#22a585885b5cb7cc58d60445ecf0d8ad6f76ef24

* Add license attribute to test package for the OpenSans font

The license is available here:
https://github.com/googlefonts/opensans/blob/main/OFL.txt

* Account for the name of the static library on Windows

* Revert "Account for the name of the static library on Windows"

This reverts commit 89275d0.

* Bump the minimum CMake version for the test packages

* See if a newer version of CMake fixes the test packages

* Try using short paths for the test package

* Check variables for modules before defining the target

* Enable short paths for the test_package_module

* Use a newer version of CMake in test_package_module

* Explicitly set the freetype library path for CMake

* Try setting FREETYPE_LIBRARIES

* Revert "Try setting FREETYPE_LIBRARIES"

This reverts commit bb3907b.

* Revert "Explicitly set the freetype library path for CMake"

This reverts commit babf66a.

* Set if CMAKE_FIND_LIBRARY_SUFFIXES to include ".a" suffixes on Windows

* Revert "Set if CMAKE_FIND_LIBRARY_SUFFIXES to include ".a" suffixes on Windows"

This reverts commit 0d30c04.

* Rename .a to .lib to workaround CMake versions prior to 3.29

* Remove lib prefix on Windows as well to allow CMake to find the library

* Build version 2.13.0 with Meson as well and remove tool_requires cmake

* Rename the patch file

* Remove pdb files

* Update recipes/freetype/meson/conanfile.py

Co-authored-by: Martin Valgur <martin.valgur@gmail.com>

* Correctly order versions

---------

Co-authored-by: Martin Valgur <martin.valgur@gmail.com>
conan-center-bot pushed a commit that referenced this pull request Apr 23, 2024
* fontconfig: Remove patch for freetype libtool version number

This patch is a bad workaround for improper versioning in the freetype package.
This is fixed in the freetype package itself in #22974.

* Fix missing conf fontconfig file

This fixes the following error, which can be seen when running the test package:

```
Fontconfig error: Cannot load default config file: No such file: (null)
```

This is fixed by installing the fontconfig configuration file.
It was being installed to the wrong location in the Meson package previously.
Additionally, don't set `FONTCONFIG_FILE`, but instead append to `FONTCONFIG_PATH` only.
This works and makes it easier for consumers to opt for the system font directory.
See #5782.

* Use relative paths for the updated Meson generator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants