Closed bbhtt closed 1 year ago
Yes, you can, first, when building, the presence of the libheif library is checked, if it is, then nothing is built and does not download.
It checks for libheif with the commands:
gcc -llibheif
and gcc -lheif
/usr/lib/gcc/aarch64-unknown-linux-gnu/12.2.0/../../../../aarch64-unknown-linux-gnu/bin/ld: cannot find -lheif: No such file or directory
collect2: error: ld returned 1 exit status
yeah, in Flatpak this command do not see that libheif is installed. Need new universal command/method for this, will look later into this...
EDITED: Need to implement searching libraries using pkg-config
if it is available in the system.
It checks for libheif with the commands: gcc -llibheif and gcc -lheif
It's because I think gcc looks only in /usr
, but /usr
in the sandbox is from the runtime and is read-only. The libraries in the manifest gets installed to /app
gcc -I /app/share/include -L /app/lib -lheif
works:
$ flatpak run --command=sh com.example.test
[📦 com.example.test ~]$ gcc -I /app/share/include -L /app/lib -lheif
/usr/lib/gcc/x86_64-unknown-linux-gnu/12.2.0/../../../../x86_64-unknown-linux-gnu/bin/ld: warning: libx265.so.199, needed by /app/lib/libheif.so, not found (try using -rpath or -rpath-link)
/usr/lib/gcc/x86_64-unknown-linux-gnu/12.2.0/../../../../x86_64-unknown-linux-gnu/bin/ld: warning: libde265.so, needed by /app/lib/libheif.so, not found (try using -rpath or -rpath-link)
/usr/lib/gcc/x86_64-unknown-linux-gnu/12.2.0/../../../../x86_64-unknown-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-unknown-linux-gnu/12.2.0/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
/buildstream-build/csu/../sysdeps/x86_64/start.S:103: undefined reference to `main'
/usr/lib/gcc/x86_64-unknown-linux-gnu/12.2.0/../../../../x86_64-unknown-linux-gnu/bin/ld: /app/lib/libheif.so: undefined reference to `de265_flush_data'
/usr/lib/gcc/x86_64-unknown-linux-gnu/12.2.0/../../../../x86_64-unknown-linux-gnu/bin/ld: /app/lib/libheif.so: undefined reference to `de265_get_chroma_format'
/usr/lib/gcc/x86_64-unknown-linux-gnu/12.2.0/../../../../x86_64-unknown-linux-gnu/bin/ld: /app/lib/libheif.so: undefined reference to `de265_release_next_picture'
/usr/lib/gcc/x86_64-unknown-linux-gnu/12.2.0/../../../../x86_64-unknown-linux-gnu/bin/ld: /app/lib/libheif.so: undefined reference to `de265_get_image_plane'
/usr/lib/gcc/x86_64-unknown-linux-gnu/12.2.0/../../../../x86_64-unknown-linux-gnu/bin/ld: /app/lib/libheif.so: undefined reference to `de265_init'
/usr/lib/gcc/x86_64-unknown-linux-gnu/12.2.0/../../../../x86_64-unknown-linux-gnu/bin/ld: /app/lib/libheif.so: undefined reference to `x265_api_get_199'
/usr/lib/gcc/x86_64-unknown-linux-gnu/12.2.0/../../../../x86_64-unknown-linux-gnu/bin/ld: /app/lib/libheif.so: undefined reference to `de265_new_decoder'
/usr/lib/gcc/x86_64-unknown-linux-gnu/12.2.0/../../../../x86_64-unknown-linux-gnu/bin/ld: /app/lib/libheif.so: undefined reference to `de265_get_image_full_range_flag'
/usr/lib/gcc/x86_64-unknown-linux-gnu/12.2.0/../../../../x86_64-unknown-linux-gnu/bin/ld: /app/lib/libheif.so: undefined reference to `de265_get_image_height'
/usr/lib/gcc/x86_64-unknown-linux-gnu/12.2.0/../../../../x86_64-unknown-linux-gnu/bin/ld: /app/lib/libheif.so: undefined reference to `de265_free'
/usr/lib/gcc/x86_64-unknown-linux-gnu/12.2.0/../../../../x86_64-unknown-linux-gnu/bin/ld: /app/lib/libheif.so: undefined reference to `de265_get_version'
/usr/lib/gcc/x86_64-unknown-linux-gnu/12.2.0/../../../../x86_64-unknown-linux-gnu/bin/ld: /app/lib/libheif.so: undefined reference to `de265_decode'
/usr/lib/gcc/x86_64-unknown-linux-gnu/12.2.0/../../../../x86_64-unknown-linux-gnu/bin/ld: /app/lib/libheif.so: undefined reference to `de265_push_NAL'
/usr/lib/gcc/x86_64-unknown-linux-gnu/12.2.0/../../../../x86_64-unknown-linux-gnu/bin/ld: /app/lib/libheif.so: undefined reference to `de265_start_worker_threads'
/usr/lib/gcc/x86_64-unknown-linux-gnu/12.2.0/../../../../x86_64-unknown-linux-gnu/bin/ld: /app/lib/libheif.so: undefined reference to `de265_free_decoder'
/usr/lib/gcc/x86_64-unknown-linux-gnu/12.2.0/../../../../x86_64-unknown-linux-gnu/bin/ld: /app/lib/libheif.so: undefined reference to `de265_get_image_transfer_characteristics'
/usr/lib/gcc/x86_64-unknown-linux-gnu/12.2.0/../../../../x86_64-unknown-linux-gnu/bin/ld: /app/lib/libheif.so: undefined reference to `de265_get_image_colour_primaries'
/usr/lib/gcc/x86_64-unknown-linux-gnu/12.2.0/../../../../x86_64-unknown-linux-gnu/bin/ld: /app/lib/libheif.so: undefined reference to `de265_get_image_width'
/usr/lib/gcc/x86_64-unknown-linux-gnu/12.2.0/../../../../x86_64-unknown-linux-gnu/bin/ld: /app/lib/libheif.so: undefined reference to `de265_get_bits_per_pixel'
/usr/lib/gcc/x86_64-unknown-linux-gnu/12.2.0/../../../../x86_64-unknown-linux-gnu/bin/ld: /app/lib/libheif.so: undefined reference to `de265_get_image_matrix_coefficients'
/usr/lib/gcc/x86_64-unknown-linux-gnu/12.2.0/../../../../x86_64-unknown-linux-gnu/bin/ld: /app/lib/libheif.so: undefined reference to `de265_get_next_picture'
@bbhtt Good afternoon. Could you check this pull request(#130) - does it fix your problem or not? I'm not very familiar with flatpack, I don't know how to upgrade the YML file so that it downloads the archive from the pull request - to check.
@bbhtt Good afternoon. Could you check this pull request(#130) - does it fix your problem or not? I'm not very familiar with flatpack, I don't know how to upgrade the YML file so that it downloads the archive from the pull request - to check.
Thank you it seems to work:
Package heif was not found in the pkg-config search path.
Perhaps you should add the directory containing `heif.pc'
to the PKG_CONFIG_PATH environment variable
Package 'heif', required by 'virtual:world', not found
Looking for `heif` using pkg-config.
Looking for `libheif` using pkg-config.
Found `libheif` using pkg-config: (['/app/lib'], ['/app/include', '/usr/include'])
building '_pillow_heif' extension
Fixed in 0.13.1
Describe the bug
Hello, I'm trying to build this in a flatpak environment which has no network access, I added the necessary libraries listed in https://github.com/bigcat88/pillow_heif/blob/7319c506664e0c5e0f01b3dcd0576c7328a4c813/libheif/linux_build_libs.py#L12-L15
But it still seems to try downloading them for some reason. Is a fully offline build not possible?
Dependencies I added:
See the minimal manifest below
Steps/Code to Reproduce
flatpak install org.freedesktop.Platform//22.08
,flatpak install org.freedesktop.Sdk//22.08
flatpak-builder build --force-clean test.yaml
Expected Results
It should find that libaom, libde265, libheif and x265 are already installed
Actual Results
Tries to download them
Versions