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

statically linking libheif #20

Open
woelper opened this issue Feb 26, 2024 · 11 comments
Open

statically linking libheif #20

woelper opened this issue Feb 26, 2024 · 11 comments

Comments

@woelper
Copy link

woelper commented Feb 26, 2024

Hi, and thank you for this great library!

I am trying to statically link libheif to make distribution of my program easier and not have the user install libheif individually. Is there a recommended or even built-in way of doing so?

@Cykooz
Copy link
Owner

Cykooz commented Feb 26, 2024

I'm afraid, I don't know how to do it. I've never done it before.

@neckaros
Copy link

neckaros commented Mar 3, 2024

Hi, and thank you for this great library!

I am trying to statically link libheif to make distribution of my program easier and not have the user install libheif individually. Is there a recommended or even built-in way of doing so?

I'm pretty new to rust but doesn't rust embed libraries in executable at build time?

@sophie-h
Copy link

sophie-h commented Mar 3, 2024

I'm pretty new to rust but doesn't rust embed libraries in executable at build time?

C libraries are manually dynamically linked. This has nothing to do with how rust crates work.

@JokerAJP
Copy link

JokerAJP commented Mar 4, 2024

How to support compiling into wasm?

@Cykooz
Copy link
Owner

Cykooz commented Apr 23, 2024

How to support compiling into wasm?

According to the Internet it is a very painful task.

@Cykooz
Copy link
Owner

Cykooz commented May 12, 2024

Also you have to consider that libheif is licensed under LGPL v3.

So if you want to distribute a combined work, you'll have to use the following license:

  • statically linked:
    • Either you must release both parts as LGPL.
    • Or provide everything that allow the user to relink the application with a different version of the LGPL source code. In this case the other requirements are the same as if it was dynamically linked.
  • dynamically linked: LGPL code stays LGPL, you can keep the proprietary code proprietary.

Source - https://stackoverflow.com/a/10179181

@neckaros
Copy link

Hi, and thank you for this great library!

I am trying to statically link libheif to make distribution of my program easier and not have the user install libheif individually. Is there a recommended or even built-in way of doing so?

@woelper Did you succeed in statically linking libheif ?

@woelper
Copy link
Author

woelper commented Jul 1, 2024

Not completely. I managed to get some success on windows, but not on other platforms.

@ForestJohnson
Copy link

ForestJohnson commented Jul 21, 2024

I know this is not Rust, but someone got it working by compiling libheif to WASM using emscripten and running it that way https://github.com/jerbob92/goheif/blob/feature/webassembly/libde265/libde265.go

Thanks to this guy, now my mom can access her photos

@vincent-herlemont
Copy link

Also you have to consider that libheif is licensed under LGPL v3.

@Cykooz, has the license changed since then, or did I miss something?

C.f. libheif/README.md#license

The libheif is distributed under the terms of the GNU Lesser General Public License. The sample applications are distributed under the terms of the MIT License.

@Cykooz
Copy link
Owner

Cykooz commented Jul 22, 2024

has the license changed since then, or did I miss something?

GNU Lesser General Public License - LGPL.
Nothing has changed.

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

No branches or pull requests

7 participants