-
-
Notifications
You must be signed in to change notification settings - Fork 686
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
Build wheels with compiled libraries #1241
Comments
This 4f82a4a breaks the possibility of doing this. For doing this a |
@liZe I plan to help here. I think needed dependencies are Pango and Gdk-Pixbuf right? |
Thank you!
The libraries directly used by WeasyPrint in
I’m really scared of adding a way to specify custom DLL names in WeasyPrint, because I’m afraid that it will add another configuration layer and cause bugs with a more complex way to debug. If it’s only done in the wheel (with specific code in the building script), then why not.
Gdk-Pixbuf is not needed anymore 😉. |
So I think there is no compiling work, everything you want is ready in the other repo. It should be just about getting those and package it properly. I think it should need a
Yeah I meant only for the wheel. Also, should it be fine to add tests on that? |
We’ve worked hard to remove |
Quick question: I have done it locally and wrote a script to do it. Now, when I run weasyprint --help I get a warning
which I kinda expected, and setting an environment variable before loading it should fix it, but it needs to include the fontconfig files also. Should I do that, or it isn't required? @liZe |
Fontconfig needs its configuration files, otherwise no That makes things a bit more complicated because AFAIK these files are searched in Concerning the renaming of the DLLs: Did you test your wheel on a system where none of the required GTK files is anywhere in your |
Setting an env var
Everything was compiled from the source and properly linked to necessary libraries so that it does it automatically. Essentially it was patching meson(the build system to do so). If interested have a look at the build scripts.
Works for me here, and it should be working. You could try that by downloading from https://github.com/Kozea/WeasyPrint/suites/2162062908/artifacts/44361621 |
They aren't relative sadly :(. It is hardcoded to the build folder actually, somewhere. Even Inskscape load it by setting an env var see this. |
I am including them in the wheel. Let's see what happens. |
I don't have a Windows system at hand to hard-core-test the wheel, e.g. by not using WeasyPrint standalone but within a project containing other modules requiring GTK libraries. Or inside an environment that does its own tricks to load GTK... |
Locally eveything looks good, I also added a test on GHA, as much as install the wheel and running |
Related to #1622. |
One good thing about wheels is that it allow us to embed DLL files. So simply adding all DLL files and making the wheel platform specific would significantly help users by not installing system dependencies. I recently made a PR in cairocffi repo Kozea/cairocffi#164 providing a way to do so. I got a nice repo which builds cairo as a single DLL file so I could do that. But here I couldn't find the one for Pango ( I don't think anything else is needed). So, finding a way to build that would be good or rather it can also be taken from msys2 in case of windows and brew in case of MacOS. I don't about linux.
What I did there was not that correct I think but I don't know. Possibly there should be a better solution and I started searching for similar libraries.
I found
freetype-py
which had a script to build freetype same thing can be done here also I think.Next, I found this issue pypa/wheel#128 which is more related and from that thread I found
pypandoc
where their implementation was very good IMHO, Seesetup.py
.Next, I found this thread at stackoverflow https://stackoverflow.com/questions/45150304/how-to-force-a-python-wheel-to-be-platform-specific-when-building-it.
Next, I find another interesting thing which is used with
cffi
ismilksnake
which simply suited this one but I haven't tried using it.Sorry, for a braindump I thought I would organize it a little better but I didn't find time.
Finally, the conclusion is there must be platform specific wheel so that weasyprint can simply be installed using
pip
without any system dependencies.The text was updated successfully, but these errors were encountered: