As stated in readme.md: " Usage Please use the files from the releases page in your projects. Do not use the git checkout directly! The different source and header files are amalgamated into one miniz.c/miniz.h pair in a build step (amalgamate.sh). Include miniz.c and miniz.h in your project to use Miniz. " Reproducible: Always Steps to Reproduce: 1. Install dev-libs/miniz Actual Results: Include folder contains several miniz headers: $ ls -la /usr/include/miniz celkem 112 drwxr-xr-x 2 root root 4096 8. říj 20.24 . drwxr-xr-x 459 root root 36864 8. říj 16.06 .. -rw-r--r-- 1 root root 2516 11. dub 2019 miniz_common.h -rw-r--r-- 1 root root 23264 11. dub 2019 miniz.h -rw-r--r-- 1 root root 9871 11. dub 2019 miniz_tdef.h -rw-r--r-- 1 root root 8030 11. dub 2019 miniz_tinfl.h -rw-r--r-- 1 root root 24049 11. dub 2019 miniz_zip.h Expected Results: Only amalgamated miniz.h is present I'm trying to compile latest development version of prusaslicer and it fails on undeclared mz_zip_archive type Only "miniz.h" is included in source code. [ 30%] Building CXX object src/libslic3r/CMakeFiles/libslic3r.dir/Format/OBJ.cpp.o In file included from /home/marian/programy/PrusaSlicer-version_2.4.0-alpha3/src/libslic3r/Format/AMF.cpp:30: /home/marian/programy/PrusaSlicer-version_2.4.0-alpha3/src/libslic3r/miniz_extension.hpp:9:22: error: ‘mz_zip_archive’ was not declared in this scope 9 | bool open_zip_reader(mz_zip_archive *zip, const std::string &fname_utf8); | ^~~~~~~~~~~~~~ /home/marian/programy/PrusaSlicer-version_2.4.0-alpha3/src/libslic3r/miniz_extension.hpp:9:38: error: ‘zip’ was not declared in this scope 9 | bool open_zip_reader(mz_zip_archive *zip, const std::string &fname_utf8); | ^~~ /home/marian/programy/PrusaSlicer-version_2.4.0-alpha3/src/libslic3r/miniz_extension.hpp:9:43: error: expected primary-expression before ‘const’ 9 | bool open_zip_reader(mz_zip_archive *zip, const std::string &fname_utf8);
Created attachment 744072 [details] miniz-2.2.0.ebuild Updated and bumped ebuild
Created attachment 744075 [details, diff] files/build-shared-libs.patch By default amalgamated source part builds only static libs regardless to BUILD_SHARED_LIBS setting. Should be fixed by upstream. I'm not sure if proposed patch is correct, but works for me ;-)
Update: Prusa-slicer still does not compile. As per https://github.com/prusa3d/PrusaSlicer/blob/master/src/miniz/README-Prusa.txt - they did some changes to the miniz package, so it does not compile with upstream version. But cmake prefers system miniz and compillation fails. ``` PrusaResearch (Vojtech) homebrewed the following: mz_zip_writer_add_staged_open(), mz_zip_writer_add_staged_data() and mz_zip_writer_add_staged_finish() were derived from mz_zip_writer_add_read_buf_callback() by splitting it and passing a new mz_zip_writer_staged_context between them. ``` https://github.com/prusa3d/PrusaSlicer/issues/7080
Just a note. System miniz is no more used: https://github.com/prusa3d/PrusaSlicer/commit/94843bb6bf1a99af6fafcc21a81912dd3dff71e7
I don't think that this is a problem (at least, not any more): - We don't want to build the header-only version of the library, it's effectively just static linking. - We don't need to concatenate all of the headers together, the main miniz.h includes the other header files so consumers shouldn't care if they get the amalgamation or the individual files.