diff --git a/graphics/imlib2-jxl/Makefile b/graphics/imlib2-jxl/Makefile index 29262ddf5d08..09253568e5db 100644 --- a/graphics/imlib2-jxl/Makefile +++ b/graphics/imlib2-jxl/Makefile @@ -1,39 +1,41 @@ PORTNAME= imlib2-jxl DISTVERSIONPREFIX= v -DISTVERSION= 0.1.1 -PORTREVISION= 4 +DISTVERSION= 0.2.0 CATEGORIES= graphics +PATCH_SITES= https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/commit/ +PATCHFILES+= de2b38f5f34f.patch:-p1 # libjxl 0.9 + MAINTAINER= jbeich@FreeBSD.org COMMENT= JPEG XL loader for imlib2 WWW= https://github.com/alistair7/imlib2-jxl LICENSE= BSD3CLAUSE LICENSE_FILE= ${WRKSRC}/LICENSE-BSD-ab LIB_DEPENDS= libImlib2.so:graphics/imlib2 \ libjxl.so:graphics/libjxl USES= gmake pkgconfig USE_GITHUB= yes GH_ACCOUNT= alistair7 MAKE_ENV= RELEASE_CFLAGS="${CFLAGS}" ALL_TARGET= # empty PLIST_FILES= lib/imlib2/loaders/jxl.so OPTIONS_DEFINE= LCMS2 OPTIONS_DEFAULT=LCMS2 LCMS2_LIB_DEPENDS= liblcms2.so:graphics/lcms2 post-patch-LCMS2-off: @${REINPLACE_CMD} -e '/-DIMLIB2JXL_USE_LCMS/d' \ -e 's/`pkg-config[^`]*lcms[^`]*`//' \ ${WRKSRC}/Makefile do-install: ${MKDIR} ${STAGEDIR}${PREFIX}/${PLIST_FILES:M*.so:H} ${INSTALL_LIB} ${WRKSRC}/${PLIST_FILES:M*.so:T} \ ${STAGEDIR}${PREFIX}/${PLIST_FILES:M*.so:H} .include diff --git a/graphics/imlib2-jxl/distinfo b/graphics/imlib2-jxl/distinfo index 64e175fc75f6..28c5c7e30634 100644 --- a/graphics/imlib2-jxl/distinfo +++ b/graphics/imlib2-jxl/distinfo @@ -1,3 +1,5 @@ -TIMESTAMP = 1642715616 -SHA256 (alistair7-imlib2-jxl-v0.1.1_GH0.tar.gz) = 25d220e4638948174d5e76c66e2f0441ee41e0758fa63f065cdfd51bb76c1465 -SIZE (alistair7-imlib2-jxl-v0.1.1_GH0.tar.gz) = 24731 +TIMESTAMP = 1682715689 +SHA256 (alistair7-imlib2-jxl-v0.2.0_GH0.tar.gz) = b49ded4e9251569cfa0245a3075796924656f565e681c60a02c8ec7e16fd9a71 +SIZE (alistair7-imlib2-jxl-v0.2.0_GH0.tar.gz) = 385197 +SHA256 (de2b38f5f34f.patch) = 3722403f4caa909535f3cfb37dda1b2c092d6370e2709241736b439b5a2e9cc8 +SIZE (de2b38f5f34f.patch) = 3181 diff --git a/graphics/imlib2-jxl/files/patch-imlib2-jxl.c b/graphics/imlib2-jxl/files/patch-imlib2-jxl.c deleted file mode 100644 index 9a1d71d329e3..000000000000 --- a/graphics/imlib2-jxl/files/patch-imlib2-jxl.c +++ /dev/null @@ -1,76 +0,0 @@ -https://github.com/alistair7/imlib2-jxl/commit/3888defd345f -https://github.com/alistair7/imlib2-jxl/commit/06a3b71e4d13 -https://github.com/alistair7/imlib2-jxl/commit/de2b38f5f34f - ---- imlib2-jxl.c.orig 2022-01-20 21:53:36 UTC -+++ imlib2-jxl.c -@@ -402,7 +402,7 @@ char load(ImlibImage *im, ImlibProgressFunction progre - * extract an ICC profile and save it for later. */ - - JxlColorEncoding color_enc; -- if(JxlDecoderGetColorAsEncodedProfile(dec, &pixel_format, JXL_COLOR_PROFILE_TARGET_DATA, &color_enc) == JXL_DEC_SUCCESS) -+ if(JxlDecoderGetColorAsEncodedProfile(dec, JXL_COLOR_PROFILE_TARGET_DATA, &color_enc) == JXL_DEC_SUCCESS) - { - if(color_enc.color_space == JXL_COLOR_SPACE_RGB && color_enc.transfer_function == JXL_TRANSFER_FUNCTION_SRGB) - { -@@ -412,7 +412,7 @@ char load(ImlibImage *im, ImlibProgressFunction progre - } - } - -- if(JxlDecoderGetICCProfileSize(dec, &pixel_format, JXL_COLOR_PROFILE_TARGET_DATA, &icc_size) != JXL_DEC_SUCCESS) -+ if(JxlDecoderGetICCProfileSize(dec, JXL_COLOR_PROFILE_TARGET_DATA, &icc_size) != JXL_DEC_SUCCESS) - { - icc_size = 0; - break; -@@ -420,7 +420,7 @@ char load(ImlibImage *im, ImlibProgressFunction progre - if(!(icc_blob = malloc(icc_size))) - RETURN_ERR("Failed to allocate %zu B for ICC profile", icc_size); - -- if(JxlDecoderGetColorAsICCProfile(dec, &pixel_format, JXL_COLOR_PROFILE_TARGET_DATA, icc_blob, icc_size) != JXL_DEC_SUCCESS) -+ if(JxlDecoderGetColorAsICCProfile(dec, JXL_COLOR_PROFILE_TARGET_DATA, icc_blob, icc_size) != JXL_DEC_SUCCESS) - icc_size = 0; - - break; -@@ -596,9 +596,9 @@ char save(ImlibImage *im, ImlibProgressFunction progre - if(JxlEncoderSetParallelRunner(enc, JxlThreadParallelRunner, runner) != JXL_ENC_SUCCESS) - RETURN_ERR("Failed in JxlEncoderSetParallelRunner"); - -- JxlEncoderOptions *opts; -- if(!(opts = JxlEncoderOptionsCreate(enc, NULL))) -- RETURN_ERR("Failed in JxlEncoderOptionsCreate"); -+ JxlEncoderFrameSettings *opts; -+ if(!(opts = JxlEncoderFrameSettingsCreate(enc, NULL))) -+ RETURN_ERR("Failed in JxlEncoderFrameSettingsCreate"); - - JxlPixelFormat pixel_format = { .align = 0, .data_type = JXL_TYPE_UINT8, .num_channels = 4, .endianness = JXL_NATIVE_ENDIAN}; - -@@ -633,14 +633,14 @@ char save(ImlibImage *im, ImlibProgressFunction progre - quality = max_quality; - - // Transform quality 0-99 to distance 15-0 -- if(JxlEncoderOptionsSetDistance(opts, 15 - (quality * 15/(float)max_quality)) != JXL_ENC_SUCCESS) -- RETURN_ERR("Failed in JxlEncoderOptionsSetDistance: %.1f", 15 - (quality * 15/(float)max_quality)); -+ if(JxlEncoderSetFrameDistance(opts, 15 - (quality * 15/(float)max_quality)) != JXL_ENC_SUCCESS) -+ RETURN_ERR("Failed in JxlEncoderSetFrameDistance: %.1f", 15 - (quality * 15/(float)max_quality)); - - // If quality is maxed out, explicity enable lossless mode - if(quality == max_quality) - { -- if(JxlEncoderOptionsSetLossless(opts, 1) != JXL_ENC_SUCCESS) -- RETURN_ERR("Failed in JxlEncoderOptionsSetLossless"); -+ if(JxlEncoderSetFrameLossless(opts, JXL_TRUE) != JXL_ENC_SUCCESS) -+ RETURN_ERR("Failed in JxlEncoderSetFrameLossless"); - } - - } -@@ -659,8 +659,8 @@ char save(ImlibImage *im, ImlibProgressFunction progre - // Transform compression 0-9 to effort 3-9 - compression = 3 + (int)roundf(compression * 6/(float)max_compression); - -- if(JxlEncoderOptionsSetEffort(opts, compression) != JXL_ENC_SUCCESS) -- RETURN_ERR("Failed in JxlEncoderOptionsSetEffort: %d", compression); -+ if(JxlEncoderFrameSettingsSetOption(opts, JXL_ENC_FRAME_SETTING_EFFORT, compression) != JXL_ENC_SUCCESS) -+ RETURN_ERR("Failed in JxlEncoderFrameSettingsSetOption(JXL_ENC_FRAME_SETTING_EFFORT, %d)", compression); - } - - const size_t pixels_size = 4 * im->w * im->h;