Lymphatus / caesium-image-compressor

Caesium is an image compression software that helps you store, send and share digital pictures, supporting JPG, PNG, WebP and TIFF formats. You can quickly reduce the file size (and resolution, if you want) by preserving the overall quality of the image.
https://saerasoft.com/caesium
GNU General Public License v3.0
3.47k stars 209 forks source link

build: Fix Linux builds #199

Closed jtojnar closed 1 year ago

Lymphatus commented 1 year ago

I feel like that these changes may break the build on Mac. I'll run a few tests manually because there's no macOS in the Github workflow yet.

jtojnar commented 1 year ago

I do not think this affects MacOS. It just stops building libcaesium as a DLL file (which I assume is useless on MacOS just like on Linux). And removes cargo, as it was only used for the aforementioned libcaesium build.

Lymphatus commented 1 year ago

Right now in the main branch the checks for macOS fail, but with this PR it fails almost instantly in the process. I think a better way of handling the libcaesium dependency is to check whether the library already exists in the system and, if not, invoke the build. On macOS, like Windows, there's no way to install libcaesium except manually (no brew for example) so most of the time it's needed. But in a case like your, where the library is installed by other means, the build is indeed useless. I'll work on it.

PS: the script is a bit misleading because of BUILD_BYPRODUCTS, but the ExternalProject actually builds a .so file for UNIX systems, not a .dll.

jtojnar commented 1 year ago

I think a better way of handling the libcaesium dependency is to check whether the library already exists in the system and, if not, invoke the build

Did that.

On macOS, like Windows, there's no way to install libcaesium except manually (no brew for example) so most of the time it's needed.

Hopefully, this will allow it to be packaged in Homebrew eventually.