PORTNAME=	wasm-pack
DISTVERSIONPREFIX=	v
DISTVERSION=	0.14.0
PORTREVISION=	3
CATEGORIES=	www

MAINTAINER=	yuri@FreeBSD.org
COMMENT=	Workflow tool for Rust-generated WebAssembly
WWW=		https://rustwasm.github.io/wasm-pack/ \
		https://github.com/rustwasm/wasm-pack

LICENSE=	APACHE20 MIT
LICENSE_COMB=	dual
LICENSE_FILE_APACHE20=	${WRKSRC}/LICENSE-APACHE
LICENSE_FILE_MIT=	${WRKSRC}/LICENSE-MIT

BUILD_DEPENDS=	gmake:devel/gmake \
		zstd>0:archivers/zstd
LIB_DEPENDS=	libcurl.so:ftp/curl

USES=		cargo perl5 pkgconfig
USE_PERL5=	build

USE_GITHUB=	yes
GH_ACCOUNT=	rustwasm

RUSTFLAGS=	${ARCH:S/i386/YES/:C/^[a-z].*//:S/YES/-C target-feature=+sse,+sse2/} # add sse sse2 target-features only on i386

CARGO_CRATES=	addr2line-0.25.1 \
		adler2-2.0.1 \
		aes-0.8.4 \
		aho-corasick-1.1.4 \
		android_system_properties-0.1.5 \
		anstream-0.6.21 \
		anstyle-1.0.13 \
		anstyle-parse-0.2.7 \
		anstyle-query-1.1.5 \
		anstyle-wincon-3.0.11 \
		anyhow-1.0.100 \
		arbitrary-1.4.2 \
		assert_cmd-2.1.2 \
		autocfg-1.5.0 \
		backtrace-0.3.76 \
		base64-0.22.1 \
		binary-install-0.4.1 \
		bitflags-2.10.0 \
		block-buffer-0.10.4 \
		bstr-1.12.1 \
		bumpalo-3.19.1 \
		byteorder-1.5.0 \
		bzip2-0.5.2 \
		bzip2-sys-0.1.13+1.0.8 \
		camino-1.2.2 \
		cargo-platform-0.3.2 \
		cargo_metadata-0.23.1 \
		cc-1.2.53 \
		cfg-if-1.0.4 \
		chrono-0.4.43 \
		cipher-0.4.4 \
		clap-4.5.54 \
		clap_builder-4.5.54 \
		clap_derive-4.5.49 \
		clap_lex-0.7.7 \
		colorchoice-1.0.4 \
		console-0.16.2 \
		constant_time_eq-0.3.1 \
		core-foundation-sys-0.8.7 \
		cpufeatures-0.2.17 \
		crc-3.4.0 \
		crc-catalog-2.4.0 \
		crc32fast-1.5.0 \
		crossbeam-utils-0.8.21 \
		crypto-common-0.1.7 \
		deflate64-0.1.10 \
		deranged-0.5.5 \
		derive_arbitrary-1.4.2 \
		dialoguer-0.12.0 \
		difflib-0.4.0 \
		digest-0.10.7 \
		dirs-next-2.0.0 \
		dirs-sys-next-0.1.2 \
		displaydoc-0.2.5 \
		encode_unicode-1.0.0 \
		env_filter-0.1.4 \
		env_home-0.1.0 \
		env_logger-0.11.8 \
		equivalent-1.0.2 \
		errno-0.3.14 \
		fastrand-2.3.0 \
		filetime-0.2.27 \
		find-msvc-tools-0.1.8 \
		flate2-1.1.8 \
		float-cmp-0.10.0 \
		form_urlencoded-1.2.2 \
		fs4-0.6.6 \
		futures-core-0.3.31 \
		futures-executor-0.3.31 \
		futures-task-0.3.31 \
		futures-util-0.3.31 \
		generic-array-0.14.7 \
		getrandom-0.2.17 \
		getrandom-0.3.4 \
		gimli-0.32.3 \
		glob-0.3.3 \
		hashbrown-0.16.1 \
		heck-0.5.0 \
		hex-0.4.3 \
		hmac-0.12.1 \
		human-panic-2.0.6 \
		iana-time-zone-0.1.64 \
		iana-time-zone-haiku-0.1.2 \
		icu_collections-2.1.1 \
		icu_locale_core-2.1.1 \
		icu_normalizer-2.1.1 \
		icu_normalizer_data-2.1.1 \
		icu_properties-2.1.2 \
		icu_properties_data-2.1.2 \
		icu_provider-2.1.1 \
		idna-1.1.0 \
		idna_adapter-1.2.1 \
		indexmap-2.13.0 \
		inout-0.1.4 \
		is_executable-0.1.2 \
		is_terminal_polyfill-1.70.2 \
		itoa-1.0.17 \
		jobserver-0.1.34 \
		js-sys-0.3.85 \
		lazy_static-1.5.0 \
		libc-0.2.180 \
		libredox-0.1.12 \
		linux-raw-sys-0.4.15 \
		linux-raw-sys-0.11.0 \
		litemap-0.8.1 \
		lock_api-0.4.14 \
		log-0.4.29 \
		lzma-rs-0.3.0 \
		lzma-sys-0.1.20 \
		memchr-2.7.6 \
		miniz_oxide-0.8.9 \
		normalize-line-endings-0.3.0 \
		ntapi-0.4.2 \
		num-conv-0.1.0 \
		num-traits-0.2.19 \
		objc2-core-foundation-0.3.2 \
		objc2-io-kit-0.3.2 \
		object-0.37.3 \
		once_cell-1.21.3 \
		once_cell_polyfill-1.70.2 \
		parking_lot-0.12.5 \
		parking_lot_core-0.9.12 \
		path-clean-1.0.1 \
		pbkdf2-0.12.2 \
		percent-encoding-2.3.2 \
		pin-project-lite-0.2.16 \
		pin-utils-0.1.0 \
		pkg-config-0.3.32 \
		potential_utf-0.1.4 \
		powerfmt-0.2.0 \
		predicates-3.1.3 \
		predicates-core-1.0.9 \
		predicates-tree-1.0.12 \
		proc-macro2-1.0.105 \
		quote-1.0.43 \
		r-efi-5.3.0 \
		redox_syscall-0.5.18 \
		redox_syscall-0.7.0 \
		redox_users-0.4.6 \
		regex-1.12.2 \
		regex-automata-0.4.13 \
		regex-syntax-0.8.8 \
		ring-0.17.14 \
		rustc-demangle-0.1.27 \
		rustix-0.38.44 \
		rustix-1.1.3 \
		rustls-0.23.36 \
		rustls-pki-types-1.14.0 \
		rustls-webpki-0.103.9 \
		rustversion-1.0.22 \
		same-file-1.0.6 \
		scc-2.4.0 \
		scopeguard-1.2.0 \
		sdd-3.0.10 \
		semver-1.0.27 \
		serde-1.0.228 \
		serde_core-1.0.228 \
		serde_derive-1.0.228 \
		serde_ignored-0.1.14 \
		serde_json-1.0.149 \
		serde_spanned-1.0.4 \
		serial_test-3.3.1 \
		serial_test_derive-3.3.1 \
		sha1-0.10.6 \
		shell-words-1.1.1 \
		shlex-1.3.0 \
		simd-adler32-0.3.8 \
		siphasher-0.3.11 \
		siphasher-1.0.1 \
		slab-0.4.11 \
		smallvec-1.15.1 \
		socks-0.3.4 \
		stable_deref_trait-1.2.1 \
		strsim-0.11.1 \
		subtle-2.6.1 \
		syn-2.0.114 \
		synstructure-0.13.2 \
		sysinfo-0.37.2 \
		tar-0.4.44 \
		tempfile-3.24.0 \
		termtree-0.5.1 \
		thiserror-1.0.69 \
		thiserror-2.0.18 \
		thiserror-impl-1.0.69 \
		thiserror-impl-2.0.18 \
		time-0.3.45 \
		time-core-0.1.7 \
		tinystr-0.8.2 \
		toml-0.9.11+spec-1.1.0 \
		toml_datetime-0.7.5+spec-1.1.0 \
		toml_parser-1.0.6+spec-1.1.0 \
		toml_writer-1.0.6+spec-1.1.0 \
		typenum-1.19.0 \
		unicode-ident-1.0.22 \
		unicode-width-0.2.2 \
		untrusted-0.9.0 \
		ureq-2.12.1 \
		url-2.5.8 \
		utf8_iter-1.0.4 \
		utf8parse-0.2.2 \
		uuid-1.19.0 \
		version_check-0.9.5 \
		wait-timeout-0.2.1 \
		walkdir-2.5.0 \
		wasi-0.11.1+wasi-snapshot-preview1 \
		wasip2-1.0.2+wasi-0.2.9 \
		wasm-bindgen-0.2.108 \
		wasm-bindgen-macro-0.2.108 \
		wasm-bindgen-macro-support-0.2.108 \
		wasm-bindgen-shared-0.2.108 \
		webpki-roots-0.26.11 \
		webpki-roots-1.0.5 \
		which-8.0.0 \
		winapi-0.3.9 \
		winapi-i686-pc-windows-gnu-0.4.0 \
		winapi-util-0.1.11 \
		winapi-x86_64-pc-windows-gnu-0.4.0 \
		windows-0.61.3 \
		windows-collections-0.2.0 \
		windows-core-0.61.2 \
		windows-core-0.62.2 \
		windows-future-0.2.1 \
		windows-implement-0.60.2 \
		windows-interface-0.59.3 \
		windows-link-0.1.3 \
		windows-link-0.2.1 \
		windows-numerics-0.2.0 \
		windows-result-0.3.4 \
		windows-result-0.4.1 \
		windows-strings-0.4.2 \
		windows-strings-0.5.1 \
		windows-sys-0.48.0 \
		windows-sys-0.52.0 \
		windows-sys-0.59.0 \
		windows-sys-0.61.2 \
		windows-targets-0.48.5 \
		windows-targets-0.52.6 \
		windows-threading-0.1.0 \
		windows_aarch64_gnullvm-0.48.5 \
		windows_aarch64_gnullvm-0.52.6 \
		windows_aarch64_msvc-0.48.5 \
		windows_aarch64_msvc-0.52.6 \
		windows_i686_gnu-0.48.5 \
		windows_i686_gnu-0.52.6 \
		windows_i686_gnullvm-0.52.6 \
		windows_i686_msvc-0.48.5 \
		windows_i686_msvc-0.52.6 \
		windows_x86_64_gnu-0.48.5 \
		windows_x86_64_gnu-0.52.6 \
		windows_x86_64_gnullvm-0.48.5 \
		windows_x86_64_gnullvm-0.52.6 \
		windows_x86_64_msvc-0.48.5 \
		windows_x86_64_msvc-0.52.6 \
		winnow-0.7.14 \
		winsafe-0.0.19 \
		wit-bindgen-0.51.0 \
		writeable-0.6.2 \
		xattr-1.6.1 \
		xz2-0.1.7 \
		yoke-0.8.1 \
		yoke-derive-0.8.1 \
		zerofrom-0.1.6 \
		zerofrom-derive-0.1.6 \
		zeroize-1.8.2 \
		zeroize_derive-1.4.3 \
		zerotrie-0.2.3 \
		zerovec-0.11.5 \
		zerovec-derive-0.11.2 \
		zip-2.4.2 \
		zmij-1.0.16 \
		zopfli-0.8.3 \
		zstd-0.13.3 \
		zstd-safe-7.2.4 \
		zstd-sys-2.0.16+zstd.1.5.7

OPENSSLINC=	/usr/include
OPENSSLLIB=	/usr/lib

PLIST_FILES=	bin/${PORTNAME}

.include <bsd.port.mk>
