git: 6a5b2121a0ad - main - graphics/libimagequant: update to 4.0.4

From: Jan Beich <jbeich_at_FreeBSD.org>
Date: Wed, 02 Nov 2022 13:59:53 UTC
The branch main has been updated by jbeich:

URL: https://cgit.FreeBSD.org/ports/commit/?id=6a5b2121a0ad6200c59901eff74646bba5015bad

commit 6a5b2121a0ad6200c59901eff74646bba5015bad
Author:     Jan Beich <jbeich@FreeBSD.org>
AuthorDate: 2022-08-25 01:40:27 +0000
Commit:     Jan Beich <jbeich@FreeBSD.org>
CommitDate: 2022-11-02 13:58:14 +0000

    graphics/libimagequant: update to 4.0.4
    
    - Adjust license for "or later" clause
    - Point to homepage suggested upstream
    - Drop superfluous newlines
    - Take maintainership
    
    Changes:        https://github.com/ImageOptim/libimagequant/compare/2.17.0...4.0.4
    PR:             267520
    Approved by:    wen (maintainer)
---
 graphics/libimagequant/Makefile        | 37 ++++++++++++-----
 graphics/libimagequant/Makefile.crates | 34 ++++++++++++++++
 graphics/libimagequant/distinfo        | 74 ++++++++++++++++++++++++++++++++--
 3 files changed, 132 insertions(+), 13 deletions(-)

diff --git a/graphics/libimagequant/Makefile b/graphics/libimagequant/Makefile
index f938dc6eddde..c87584a9f592 100644
--- a/graphics/libimagequant/Makefile
+++ b/graphics/libimagequant/Makefile
@@ -1,28 +1,45 @@
 PORTNAME=	libimagequant
-PORTVERSION=	2.17.0
+PORTVERSION=	4.0.4
 CATEGORIES=	graphics
 
-MAINTAINER=	wen@FreeBSD.org
+MAINTAINER=	jbeich@FreeBSD.org
 COMMENT=	Image Quantization Library
-WWW=		https://github.com/ImageOptim/libimagequant
+WWW=		https://pngquant.org/lib/
 
-LICENSE=	GPLv3
+LICENSE=	GPLv3+
 LICENSE_FILE=	${WRKSRC}/COPYRIGHT
 
-BUILD_DEPENDS=	bash:shells/bash
-
-USES=		gmake localbase
+BUILD_DEPENDS=	cargo-cbuild:devel/cargo-c
 
+USES=		cargo
 USE_GITHUB=	yes
 GH_ACCOUNT=	ImageOptim
-
-GNU_CONFIGURE=	yes
+WRKSRC_SUBDIR=	imagequant-sys
 USE_LDCONFIG=	yes
-
 PLIST_FILES=	include/libimagequant.h \
 		lib/libimagequant.a \
 		lib/libimagequant.so \
 		lib/libimagequant.so.0 \
+		lib/libimagequant.so.0.0.0 \
 		libdata/pkgconfig/imagequant.pc
 
+post-patch:
+# XXX Drop after devel/cargo-c >= 0.9.9 per https://github.com/rust-lang/cargo/commit/43a063c80a53
+	@${REINPLACE_CMD} 's/dep://g' ${WRKSRC:H}/Cargo.toml
+
+do-build:
+	@${CARGO_CARGO_RUN} cbuild \
+		--verbose \
+		--verbose \
+		${CARGO_BUILD_ARGS}
+
+do-install:
+	@${CARGO_CARGO_RUN} cinstall \
+		--verbose \
+		--verbose \
+		--destdir "${STAGEDIR}" \
+		--prefix "${PREFIX}" \
+		${CARGO_INSTALL_ARGS}
+	@${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/*.so
+
 .include <bsd.port.mk>
diff --git a/graphics/libimagequant/Makefile.crates b/graphics/libimagequant/Makefile.crates
new file mode 100644
index 000000000000..64e97adc7031
--- /dev/null
+++ b/graphics/libimagequant/Makefile.crates
@@ -0,0 +1,34 @@
+CARGO_CRATES=	adler-1.0.2 \
+		ahash-0.7.6 \
+		arrayvec-0.7.2 \
+		autocfg-1.1.0 \
+		bitflags-1.3.2 \
+		bytemuck-1.12.2 \
+		cc-1.0.74 \
+		cfg-if-1.0.0 \
+		crc32fast-1.3.2 \
+		crossbeam-channel-0.5.6 \
+		crossbeam-deque-0.8.2 \
+		crossbeam-epoch-0.9.11 \
+		crossbeam-utils-0.8.12 \
+		either-1.8.0 \
+		fallible_collections-0.4.5 \
+		flate2-1.0.24 \
+		getrandom-0.2.8 \
+		hashbrown-0.12.3 \
+		hermit-abi-0.1.19 \
+		libc-0.2.137 \
+		lodepng-3.7.2 \
+		memoffset-0.6.5 \
+		miniz_oxide-0.5.4 \
+		noisy_float-0.2.0 \
+		num-traits-0.2.15 \
+		num_cpus-1.13.1 \
+		once_cell-1.16.0 \
+		rayon-1.5.3 \
+		rayon-core-1.9.3 \
+		rgb-0.8.34 \
+		scopeguard-1.1.0 \
+		thread_local-1.1.4 \
+		version_check-0.9.4 \
+		wasi-0.11.0+wasi-snapshot-preview1
diff --git a/graphics/libimagequant/distinfo b/graphics/libimagequant/distinfo
index c00f744461dd..1dc3a244f17c 100644
--- a/graphics/libimagequant/distinfo
+++ b/graphics/libimagequant/distinfo
@@ -1,3 +1,71 @@
-TIMESTAMP = 1639729308
-SHA256 (ImageOptim-libimagequant-2.17.0_GH0.tar.gz) = 9f6cc50182be4d2ece75118aa0b0fd3e9bbad06e94fd6b9eb3a4c08129c2dd26
-SIZE (ImageOptim-libimagequant-2.17.0_GH0.tar.gz) = 99343
+TIMESTAMP = 1661391627
+SHA256 (rust/crates/adler-1.0.2.crate) = f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe
+SIZE (rust/crates/adler-1.0.2.crate) = 12778
+SHA256 (rust/crates/ahash-0.7.6.crate) = fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47
+SIZE (rust/crates/ahash-0.7.6.crate) = 38030
+SHA256 (rust/crates/arrayvec-0.7.2.crate) = 8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6
+SIZE (rust/crates/arrayvec-0.7.2.crate) = 29341
+SHA256 (rust/crates/autocfg-1.1.0.crate) = d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa
+SIZE (rust/crates/autocfg-1.1.0.crate) = 13272
+SHA256 (rust/crates/bitflags-1.3.2.crate) = bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a
+SIZE (rust/crates/bitflags-1.3.2.crate) = 23021
+SHA256 (rust/crates/bytemuck-1.12.2.crate) = 5aec14f5d4e6e3f927cd0c81f72e5710d95ee9019fbeb4b3021193867491bfd8
+SIZE (rust/crates/bytemuck-1.12.2.crate) = 39603
+SHA256 (rust/crates/cc-1.0.74.crate) = 581f5dba903aac52ea3feb5ec4810848460ee833876f1f9b0fdeab1f19091574
+SIZE (rust/crates/cc-1.0.74.crate) = 59410
+SHA256 (rust/crates/cfg-if-1.0.0.crate) = baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd
+SIZE (rust/crates/cfg-if-1.0.0.crate) = 7934
+SHA256 (rust/crates/crc32fast-1.3.2.crate) = b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d
+SIZE (rust/crates/crc32fast-1.3.2.crate) = 38661
+SHA256 (rust/crates/crossbeam-channel-0.5.6.crate) = c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521
+SIZE (rust/crates/crossbeam-channel-0.5.6.crate) = 90292
+SHA256 (rust/crates/crossbeam-deque-0.8.2.crate) = 715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc
+SIZE (rust/crates/crossbeam-deque-0.8.2.crate) = 21237
+SHA256 (rust/crates/crossbeam-epoch-0.9.11.crate) = f916dfc5d356b0ed9dae65f1db9fc9770aa2851d2662b988ccf4fe3516e86348
+SIZE (rust/crates/crossbeam-epoch-0.9.11.crate) = 47900
+SHA256 (rust/crates/crossbeam-utils-0.8.12.crate) = edbafec5fa1f196ca66527c1b12c2ec4745ca14b50f1ad8f9f6f720b55d11fac
+SIZE (rust/crates/crossbeam-utils-0.8.12.crate) = 41785
+SHA256 (rust/crates/either-1.8.0.crate) = 90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797
+SIZE (rust/crates/either-1.8.0.crate) = 15992
+SHA256 (rust/crates/fallible_collections-0.4.5.crate) = c195cf4b2285d3c993eb887b4dc56b0d5728bbe1d0f9a99c0ac6bec2da3e4d85
+SIZE (rust/crates/fallible_collections-0.4.5.crate) = 49236
+SHA256 (rust/crates/flate2-1.0.24.crate) = f82b0f4c27ad9f8bfd1f3208d882da2b09c301bc1c828fd3a00d0216d2fbbff6
+SIZE (rust/crates/flate2-1.0.24.crate) = 70191
+SHA256 (rust/crates/getrandom-0.2.8.crate) = c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31
+SIZE (rust/crates/getrandom-0.2.8.crate) = 30553
+SHA256 (rust/crates/hashbrown-0.12.3.crate) = 8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888
+SIZE (rust/crates/hashbrown-0.12.3.crate) = 102968
+SHA256 (rust/crates/hermit-abi-0.1.19.crate) = 62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33
+SIZE (rust/crates/hermit-abi-0.1.19.crate) = 9979
+SHA256 (rust/crates/libc-0.2.137.crate) = fc7fcc620a3bff7cdd7a365be3376c97191aeaccc2a603e600951e452615bf89
+SIZE (rust/crates/libc-0.2.137.crate) = 606185
+SHA256 (rust/crates/lodepng-3.7.2.crate) = f0ad39f75bbaa4b10bb6f2316543632a8046a5bcf9c785488d79720b21f044f8
+SIZE (rust/crates/lodepng-3.7.2.crate) = 48504
+SHA256 (rust/crates/memoffset-0.6.5.crate) = 5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce
+SIZE (rust/crates/memoffset-0.6.5.crate) = 7686
+SHA256 (rust/crates/miniz_oxide-0.5.4.crate) = 96590ba8f175222643a85693f33d26e9c8a015f599c216509b1a6894af675d34
+SIZE (rust/crates/miniz_oxide-0.5.4.crate) = 53485
+SHA256 (rust/crates/noisy_float-0.2.0.crate) = 978fe6e6ebc0bf53de533cd456ca2d9de13de13856eda1518a285d7705a213af
+SIZE (rust/crates/noisy_float-0.2.0.crate) = 15564
+SHA256 (rust/crates/num-traits-0.2.15.crate) = 578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd
+SIZE (rust/crates/num-traits-0.2.15.crate) = 49262
+SHA256 (rust/crates/num_cpus-1.13.1.crate) = 19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1
+SIZE (rust/crates/num_cpus-1.13.1.crate) = 14752
+SHA256 (rust/crates/once_cell-1.16.0.crate) = 86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860
+SIZE (rust/crates/once_cell-1.16.0.crate) = 32120
+SHA256 (rust/crates/rayon-1.5.3.crate) = bd99e5772ead8baa5215278c9b15bf92087709e9c1b2d1f97cdb5a183c933a7d
+SIZE (rust/crates/rayon-1.5.3.crate) = 167246
+SHA256 (rust/crates/rayon-core-1.9.3.crate) = 258bcdb5ac6dad48491bb2992db6b7cf74878b0384908af124823d118c99683f
+SIZE (rust/crates/rayon-core-1.9.3.crate) = 65300
+SHA256 (rust/crates/rgb-0.8.34.crate) = 3603b7d71ca82644f79b5a06d1220e9a58ede60bd32255f698cb1af8838b8db3
+SIZE (rust/crates/rgb-0.8.34.crate) = 16285
+SHA256 (rust/crates/scopeguard-1.1.0.crate) = d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd
+SIZE (rust/crates/scopeguard-1.1.0.crate) = 11470
+SHA256 (rust/crates/thread_local-1.1.4.crate) = 5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180
+SIZE (rust/crates/thread_local-1.1.4.crate) = 13106
+SHA256 (rust/crates/version_check-0.9.4.crate) = 49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f
+SIZE (rust/crates/version_check-0.9.4.crate) = 14895
+SHA256 (rust/crates/wasi-0.11.0+wasi-snapshot-preview1.crate) = 9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423
+SIZE (rust/crates/wasi-0.11.0+wasi-snapshot-preview1.crate) = 28131
+SHA256 (ImageOptim-libimagequant-4.0.4_GH0.tar.gz) = d121bbfb380a54aca8ea9d973c2e63afcbc1db67db46ea6bc63eeba44d7937c8
+SIZE (ImageOptim-libimagequant-4.0.4_GH0.tar.gz) = 85226