PORTNAME=	gluon
DISTVERSIONPREFIX=	v
DISTVERSION=	0.18.2
PORTREVISION=	4
CATEGORIES=	lang
PKGNAMESUFFIX=	-language

MAINTAINER=	yuri@FreeBSD.org
COMMENT=	Static, type inferred and embeddable language
WWW=		https://gluon-lang.org

LICENSE=	MIT
LICENSE_FILE=	${WRKSRC}/../LICENSE

BROKEN_armv7=	compilation fails: (1) error[E0412]: cannot find type `AtomicU128` in module `core::sync::atomic` (2) LLVM ERROR: out of memory

USES=		cargo

USE_GITHUB=	yes
GH_ACCOUNT=	gluon-lang

WRKSRC_SUBDIR=	repl

MAKE_ENV=	GIT_HASH=${DISTVERSION}

CARGO_CRATES=	addr2line-0.20.0 \
		adler-1.0.2 \
		ahash-0.7.6 \
		ahash-0.8.3 \
		aho-corasick-1.0.5 \
		ansi_term-0.12.1 \
		anyhow-1.0.75 \
		anymap-0.12.1 \
		app_dirs2-2.5.5 \
		archery-0.4.0 \
		arrayvec-0.5.2 \
		ascii-canvas-3.0.0 \
		async-trait-0.1.73 \
		atty-0.2.14 \
		autocfg-1.1.0 \
		backtrace-0.3.68 \
		base64-0.21.3 \
		bincode-1.3.3 \
		bit-set-0.5.3 \
		bit-vec-0.6.3 \
		bitflags-1.3.2 \
		bitflags-2.4.0 \
		block-buffer-0.10.4 \
		bstr-0.2.17 \
		bstr-1.6.2 \
		bumpalo-3.13.0 \
		bytecount-0.5.1 \
		byteorder-1.4.3 \
		bytes-1.4.0 \
		cached-0.25.1 \
		camino-1.1.6 \
		cargo-deadlinks-0.8.1 \
		cargo-platform-0.1.3 \
		cargo_metadata-0.8.2 \
		cargo_metadata-0.14.2 \
		cast-0.2.7 \
		cast-0.3.0 \
		cc-1.0.83 \
		cesu8-1.1.0 \
		cfg-if-0.1.10 \
		cfg-if-1.0.0 \
		clap-2.34.0 \
		codespan-0.11.1 \
		codespan-reporting-0.11.1 \
		collect-mac-0.1.0 \
		combine-4.6.6 \
		compiletest_rs-0.7.1 \
		console-0.15.7 \
		convert_case-0.4.0 \
		core-foundation-0.9.3 \
		core-foundation-sys-0.8.4 \
		cpufeatures-0.2.9 \
		criterion-0.3.6 \
		criterion-plot-0.4.4 \
		crossbeam-channel-0.5.8 \
		crossbeam-deque-0.8.3 \
		crossbeam-epoch-0.9.15 \
		crossbeam-utils-0.7.2 \
		crossbeam-utils-0.8.16 \
		crunchy-0.2.2 \
		crypto-common-0.1.6 \
		cssparser-0.27.2 \
		cssparser-macros-0.6.1 \
		csv-1.1.6 \
		csv-core-0.1.10 \
		derive_more-0.99.17 \
		diff-0.1.13 \
		difference-2.0.0 \
		digest-0.10.7 \
		dirs-2.0.2 \
		dirs-next-2.0.0 \
		dirs-sys-0.3.6 \
		dirs-sys-next-0.1.2 \
		dissimilar-1.0.3 \
		downcast-rs-1.2.0 \
		dtoa-0.4.8 \
		dtoa-short-0.3.3 \
		either-1.9.0 \
		ena-0.14.2 \
		encode_unicode-0.3.6 \
		encoding_rs-0.8.28 \
		env_logger-0.9.3 \
		equivalent-1.0.1 \
		errno-0.3.3 \
		errno-dragonfly-0.1.2 \
		error-chain-0.12.4 \
		expect-test-1.4.1 \
		failure-0.1.8 \
		failure_derive-0.1.8 \
		fastrand-2.0.0 \
		filetime-0.2.15 \
		fixedbitset-0.4.2 \
		fnv-1.0.7 \
		foreign-types-0.3.2 \
		foreign-types-shared-0.1.1 \
		form_urlencoded-1.2.0 \
		frunk_core-0.4.2 \
		fuchsia-cprng-0.1.1 \
		futures-0.1.31 \
		futures-0.3.28 \
		futures-channel-0.3.28 \
		futures-core-0.3.28 \
		futures-executor-0.3.28 \
		futures-io-0.3.28 \
		futures-macro-0.3.28 \
		futures-sink-0.3.28 \
		futures-task-0.3.28 \
		futures-util-0.3.28 \
		fxhash-0.2.1 \
		generic-array-0.14.7 \
		getopts-0.2.21 \
		getrandom-0.1.16 \
		getrandom-0.2.10 \
		gimli-0.27.3 \
		glob-0.3.0 \
		gluon-salsa-0.15.2 \
		gluon-salsa-macros-0.15.2 \
		half-1.7.1 \
		handlebars-2.0.4 \
		handlebars-4.3.7 \
		hashbrown-0.5.0 \
		hashbrown-0.11.2 \
		hashbrown-0.13.2 \
		hashbrown-0.14.0 \
		heck-0.3.3 \
		hermit-abi-0.1.19 \
		hermit-abi-0.3.2 \
		http-0.2.9 \
		http-body-0.4.5 \
		httparse-1.8.0 \
		httpdate-1.0.3 \
		humantime-2.1.0 \
		hyper-0.14.27 \
		idna-0.4.0 \
		indexmap-1.7.0 \
		indexmap-2.0.0 \
		insta-1.31.0 \
		instant-0.1.11 \
		is-terminal-0.4.9 \
		itertools-0.10.5 \
		itoa-0.4.8 \
		itoa-1.0.9 \
		jni-0.21.1 \
		jni-sys-0.3.0 \
		js-sys-0.3.64 \
		lalrpop-0.19.12 \
		lalrpop-util-0.19.12 \
		lazy_static-1.4.0 \
		lazycell-1.3.0 \
		libc-0.2.147 \
		linked-hash-map-0.5.6 \
		linux-raw-sys-0.4.5 \
		little-skeptic-0.15.2 \
		lock_api-0.4.5 \
		log-0.4.20 \
		lol_html-0.3.3 \
		matches-0.1.9 \
		memchr-2.6.2 \
		memoffset-0.9.0 \
		mime-0.3.17 \
		miniz_oxide-0.7.1 \
		mio-0.8.8 \
		miow-0.3.7 \
		native-tls-0.2.11 \
		ndk-context-0.1.1 \
		new_debug_unreachable-1.0.4 \
		nix-0.14.1 \
		nodrop-0.1.14 \
		num-traits-0.2.16 \
		num_cpus-1.16.0 \
		object-0.31.1 \
		once_cell-1.18.0 \
		oorandom-11.1.3 \
		opener-0.5.2 \
		openssl-0.10.36 \
		openssl-probe-0.1.4 \
		openssl-sys-0.9.67 \
		ordered-float-2.10.0 \
		parking_lot-0.11.2 \
		parking_lot_core-0.8.5 \
		percent-encoding-2.3.0 \
		pest-2.7.3 \
		pest_derive-2.7.3 \
		pest_generator-2.7.3 \
		pest_meta-2.7.3 \
		petgraph-0.6.4 \
		phf-0.8.0 \
		phf_codegen-0.8.0 \
		phf_generator-0.8.0 \
		phf_macros-0.8.0 \
		phf_shared-0.8.0 \
		pico-args-0.3.4 \
		pin-project-lite-0.2.13 \
		pin-utils-0.1.0 \
		pkg-config-0.3.27 \
		plotters-0.3.1 \
		plotters-backend-0.3.2 \
		plotters-svg-0.3.1 \
		ppv-lite86-0.2.17 \
		precomputed-hash-0.1.1 \
		pretty-0.10.0 \
		pretty_assertions-1.4.0 \
		proc-macro-error-1.0.4 \
		proc-macro-error-attr-1.0.4 \
		proc-macro-hack-0.5.19 \
		proc-macro2-1.0.66 \
		pulldown-cmark-0.5.3 \
		pulldown-cmark-0.8.0 \
		quick-error-1.2.3 \
		quick-error-2.0.1 \
		quote-1.0.33 \
		rand-0.4.6 \
		rand-0.7.3 \
		rand-0.8.5 \
		rand_chacha-0.2.2 \
		rand_chacha-0.3.1 \
		rand_core-0.3.1 \
		rand_core-0.4.2 \
		rand_core-0.5.1 \
		rand_core-0.6.4 \
		rand_hc-0.2.0 \
		rand_pcg-0.2.1 \
		rand_xorshift-0.3.0 \
		rayon-1.7.0 \
		rayon-core-1.11.0 \
		rdrand-0.4.0 \
		redox_syscall-0.2.10 \
		redox_syscall-0.3.5 \
		redox_users-0.4.0 \
		regex-1.9.4 \
		regex-automata-0.1.10 \
		regex-automata-0.3.7 \
		regex-syntax-0.6.29 \
		regex-syntax-0.7.5 \
		remove_dir_all-0.5.3 \
		rexpect-0.4.0 \
		ring-0.16.20 \
		rpds-0.10.0 \
		rustc-demangle-0.1.23 \
		rustc-hash-1.1.0 \
		rustc_version-0.4.0 \
		rustfix-0.5.1 \
		rustix-0.38.11 \
		rustls-0.21.7 \
		rustls-webpki-0.100.2 \
		rustls-webpki-0.101.4 \
		rustversion-1.0.14 \
		rustyline-6.0.0 \
		ryu-1.0.15 \
		safemem-0.3.3 \
		same-file-1.0.6 \
		schannel-0.1.22 \
		scopeguard-1.2.0 \
		sct-0.7.0 \
		security-framework-2.4.2 \
		security-framework-sys-2.4.2 \
		selectors-0.22.0 \
		semver-0.9.0 \
		semver-1.0.18 \
		semver-parser-0.7.0 \
		serde-1.0.188 \
		serde_cbor-0.11.2 \
		serde_derive-1.0.188 \
		serde_derive_state-0.4.10 \
		serde_json-1.0.105 \
		serde_state-0.4.8 \
		servo_arc-0.1.1 \
		sha2-0.10.7 \
		signal-hook-registry-1.4.0 \
		similar-2.2.1 \
		siphasher-0.3.11 \
		slab-0.4.9 \
		smallvec-1.11.0 \
		socket2-0.4.9 \
		socket2-0.5.3 \
		spin-0.5.2 \
		stable_deref_trait-1.2.0 \
		static_assertions-1.1.0 \
		string_cache-0.8.1 \
		strsim-0.8.0 \
		strsim-0.10.0 \
		structopt-0.3.26 \
		structopt-derive-0.4.18 \
		syn-1.0.109 \
		syn-2.0.29 \
		synstructure-0.12.5 \
		tempdir-0.3.7 \
		tempfile-3.8.0 \
		tensile-0.7.0 \
		term-0.7.0 \
		termcolor-1.2.0 \
		tester-0.9.0 \
		textwrap-0.11.0 \
		thin-slice-0.1.1 \
		thiserror-1.0.47 \
		thiserror-impl-1.0.47 \
		tiny-keccak-2.0.2 \
		tinytemplate-1.2.1 \
		tinyvec-1.6.0 \
		tinyvec_macros-0.1.1 \
		tokio-1.32.0 \
		tokio-macros-2.1.0 \
		tokio-native-tls-0.3.1 \
		tokio-stream-0.1.7 \
		tower-service-0.3.2 \
		tracing-0.1.37 \
		tracing-core-0.1.31 \
		try-lock-0.2.4 \
		typed-arena-2.0.2 \
		typenum-1.16.0 \
		ucd-trie-0.1.6 \
		unicase-2.6.0 \
		unicode-bidi-0.3.13 \
		unicode-ident-1.0.11 \
		unicode-normalization-0.1.22 \
		unicode-segmentation-1.10.1 \
		unicode-width-0.1.10 \
		unicode-xid-0.2.4 \
		untrusted-0.7.1 \
		ureq-2.7.1 \
		url-2.4.1 \
		utf8parse-0.1.1 \
		vcpkg-0.2.15 \
		vec_map-0.8.2 \
		version_check-0.9.4 \
		void-1.0.2 \
		walkdir-2.3.3 \
		want-0.3.1 \
		wasi-0.9.0+wasi-snapshot-preview1 \
		wasi-0.11.0+wasi-snapshot-preview1 \
		wasm-bindgen-0.2.87 \
		wasm-bindgen-backend-0.2.87 \
		wasm-bindgen-macro-0.2.87 \
		wasm-bindgen-macro-support-0.2.87 \
		wasm-bindgen-shared-0.2.87 \
		web-sys-0.3.64 \
		webpki-roots-0.23.1 \
		winapi-0.3.9 \
		winapi-i686-pc-windows-gnu-0.4.0 \
		winapi-util-0.1.5 \
		winapi-x86_64-pc-windows-gnu-0.4.0 \
		windows-sys-0.45.0 \
		windows-sys-0.48.0 \
		windows-targets-0.42.2 \
		windows-targets-0.48.5 \
		windows_aarch64_gnullvm-0.42.2 \
		windows_aarch64_gnullvm-0.48.5 \
		windows_aarch64_msvc-0.42.2 \
		windows_aarch64_msvc-0.48.5 \
		windows_i686_gnu-0.42.2 \
		windows_i686_gnu-0.48.5 \
		windows_i686_msvc-0.42.2 \
		windows_i686_msvc-0.48.5 \
		windows_x86_64_gnu-0.42.2 \
		windows_x86_64_gnu-0.48.5 \
		windows_x86_64_gnullvm-0.42.2 \
		windows_x86_64_gnullvm-0.48.5 \
		windows_x86_64_msvc-0.42.2 \
		windows_x86_64_msvc-0.48.5 \
		xdg-2.5.2 \
		yaml-rust-0.4.5 \
		yansi-0.5.1

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

PLIST_FILES=	bin/${PORTNAME}

.include <bsd.port.options.mk>

.if ${ARCH} == i386
LTO_UNSAFE=	yes
.endif

post-install:
	@${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/${PORTNAME}

.include <bsd.port.mk>
