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

FEAT: ship with built-in FreeImage #3

Open
wants to merge 36 commits into
base: master
Choose a base branch
from

Conversation

FirefoxMetzger
Copy link
Collaborator

This PR adds plumbing to download, compile, and package the freeimage binary and make it part of the distributed wheel.

@almarklein
Copy link
Member

almarklein commented Oct 7, 2022

I'm trying to run this on my Mac. Using poetry build to build now. Can it also be build without poetry btw?

edit: ah, can also do setup.py install

Not there yet, but I'm making progress. This seems like a good resource: https://www.ultraengine.com/community/topic/59665-freeimage-build-errors/

When I know what to change, can I just change the FreeImage source or do you want it to be patched at runtime somehow?

@almarklein
Copy link
Member

Now stuck at

clang: error: invalid argument '-bundle' not allowed with '-dynamiclib'

@FirefoxMetzger
Copy link
Collaborator Author

I'm trying to run this on my Mac.

Thanks @almarklein 🎉

Can it also be build without poetry btw? edit: ah, can also do setup.py install

Yes and no. Under the hood poetry build generates a setup.py and calls distutils when building C extensions. If you have a setup.py in your repo, then that is because the process has crashed during building and didn't remove the autogenerated file :D

That said, it's perfectly fine to use it and, once things work, I can "port" it to poetry build.

An alternative could be to use the build system that ships with FreeImage (makefiles) and then just copy the binary into the target location. If that works directly without making modifications then I'd prefer that solution.

When I know what to change, can I just change the FreeImage source or do you want it to be patched at runtime somehow?

So far, I've downloaded the FreeImage source directly from Sourceforge, because I thought this is the easiest way to say "look, this is just vanilla FreeImage". However, if we do need to modify the source then I think it will be much easier for us to vendor the code.

Which option do you think is less work for us?

@almarklein
Copy link
Member

Under the hood poetry build generates a setup.py

Right, I found out after I posted :)

Which option do you think is less work for us?

I suppose it'd be easier if it stays visible what diffs we're applying, so that in case of an update they still work and/or can be updated ...

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.

2 participants