PORTNAME=	punchy
DISTVERSIONPREFIX=	v
DISTVERSION=	0.0.4
PORTREVISION=	1
CATEGORIES=	games wayland

MAINTAINER=	jbeich@FreeBSD.org
COMMENT=	2.5D side-scroller beatemup, made in Bevy
WWW=		https://fishfight.org/

LICENSE=	CC-BY-NC-4.0 MIT
LICENSE_COMB=	multi

LIB_DEPENDS=	libasound.so:audio/alsa-lib \
		libudev.so:devel/libudev-devd
RUN_DEPENDS=	${LOCALBASE}/lib/alsa-lib/libasound_module_pcm_oss.so:audio/alsa-plugins \
		${LOCALBASE}/lib/libvulkan.so:graphics/vulkan-loader

USES=		cargo
USE_GITHUB=	yes
GH_ACCOUNT=	fishfolk
PLIST_FILES=	bin/${PORTNAME}
PORTDATA=	*

CARGO_CRATES=	ab_glyph-0.2.16 \
		ab_glyph_rasterizer-0.1.5 \
		adler-1.0.2 \
		adler32-1.2.0 \
		ahash-0.7.6 \
		aho-corasick-0.7.18 \
		alsa-0.6.0 \
		alsa-sys-0.3.1 \
		android_log-sys-0.2.0 \
		android_logger-0.10.1 \
		android_system_properties-0.1.4 \
		ansi_term-0.12.1 \
		anyhow-1.0.62 \
		approx-0.5.1 \
		arboard-2.1.1 \
		arrayvec-0.7.2 \
		ash-0.37.0+1.3.209 \
		async-channel-1.7.1 \
		async-executor-1.4.1 \
		async-task-4.3.0 \
		atomic-arena-0.1.1 \
		atomic_refcell-0.1.8 \
		atty-0.2.14 \
		autocfg-1.1.0 \
		base64-0.13.0 \
		bevy-0.8.1 \
		bevy-inspector-egui-0.12.1 \
		bevy-inspector-egui-derive-0.12.0 \
		bevy-inspector-egui-rapier-0.5.0 \
		bevy-parallax-0.2.0 \
		bevy_app-0.8.1 \
		bevy_asset-0.8.1 \
		bevy_core-0.8.1 \
		bevy_core_pipeline-0.8.1 \
		bevy_derive-0.8.1 \
		bevy_diagnostic-0.8.1 \
		bevy_ecs-0.8.1 \
		bevy_ecs_macros-0.8.1 \
		bevy_egui-0.15.1 \
		bevy_encase_derive-0.8.1 \
		bevy_fluent-0.4.0 \
		bevy_gilrs-0.8.1 \
		bevy_hierarchy-0.8.1 \
		bevy_input-0.8.1 \
		bevy_internal-0.8.1 \
		bevy_kira_audio-0.11.0 \
		bevy_log-0.8.1 \
		bevy_macro_utils-0.8.1 \
		bevy_math-0.8.1 \
		bevy_mikktspace-0.8.1 \
		bevy_mod_debugdump-0.5.0 \
		bevy_pbr-0.8.1 \
		bevy_ptr-0.8.1 \
		bevy_rapier2d-0.16.2 \
		bevy_reflect-0.8.1 \
		bevy_reflect_derive-0.8.1 \
		bevy_render-0.8.1 \
		bevy_render_macros-0.8.1 \
		bevy_scene-0.8.1 \
		bevy_sprite-0.8.1 \
		bevy_tasks-0.8.1 \
		bevy_text-0.8.1 \
		bevy_time-0.8.1 \
		bevy_transform-0.8.1 \
		bevy_ui-0.8.1 \
		bevy_utils-0.8.1 \
		bevy_window-0.8.1 \
		bevy_winit-0.8.1 \
		bindgen-0.59.2 \
		bit-set-0.5.3 \
		bit-vec-0.6.3 \
		bitflags-1.3.2 \
		block-0.1.6 \
		bstr-0.2.17 \
		bumpalo-3.11.0 \
		bytemuck-1.12.1 \
		bytemuck_derive-1.2.1 \
		byteorder-1.4.3 \
		bytes-1.2.1 \
		cache-padded-1.2.0 \
		calloop-0.9.3 \
		cc-1.0.73 \
		cesu8-1.1.0 \
		cexpr-0.6.0 \
		cfg-if-0.1.10 \
		cfg-if-1.0.0 \
		cfg_aliases-0.1.1 \
		clang-sys-1.3.3 \
		clap-2.34.0 \
		clipboard-win-4.4.2 \
		cocoa-0.24.0 \
		cocoa-foundation-0.1.0 \
		codespan-reporting-0.11.1 \
		color_quant-1.1.0 \
		combine-4.6.6 \
		concurrent-queue-1.2.4 \
		console_error_panic_hook-0.1.7 \
		const_panic-0.2.4 \
		copyless-0.1.5 \
		core-foundation-0.7.0 \
		core-foundation-0.9.3 \
		core-foundation-sys-0.7.0 \
		core-foundation-sys-0.8.3 \
		core-graphics-0.19.2 \
		core-graphics-0.22.3 \
		core-graphics-types-0.1.1 \
		core-video-sys-0.1.4 \
		coreaudio-rs-0.10.0 \
		coreaudio-sys-0.2.10 \
		cpal-0.13.5 \
		crc32fast-1.3.2 \
		crossbeam-0.8.2 \
		crossbeam-channel-0.5.6 \
		crossbeam-deque-0.8.2 \
		crossbeam-epoch-0.9.10 \
		crossbeam-queue-0.3.6 \
		crossbeam-utils-0.8.11 \
		cstr_core-0.2.6 \
		cty-0.2.2 \
		d3d12-0.5.0 \
		darling-0.13.4 \
		darling_core-0.13.4 \
		darling_macro-0.13.4 \
		deflate-0.8.6 \
		deflate-1.0.0 \
		derive_more-0.99.17 \
		directories-4.0.1 \
		dirs-sys-0.3.7 \
		dispatch-0.2.0 \
		dlib-0.5.0 \
		downcast-rs-1.2.0 \
		egui-0.18.1 \
		egui_extras-0.18.0 \
		either-1.8.0 \
		emath-0.18.0 \
		encase-0.3.0 \
		encase_derive-0.3.0 \
		encase_derive_impl-0.3.0 \
		encoding_rs-0.8.31 \
		env_logger-0.8.4 \
		epaint-0.18.1 \
		erased-serde-0.3.23 \
		error-code-2.3.1 \
		euclid-0.22.7 \
		event-listener-2.5.3 \
		fastrand-1.8.0 \
		filetime-0.2.17 \
		fixedbitset-0.4.2 \
		fluent-0.16.0 \
		fluent-bundle-0.15.2 \
		fluent-langneg-0.13.0 \
		fluent-syntax-0.11.0 \
		fnv-1.0.7 \
		foreign-types-0.3.2 \
		foreign-types-shared-0.1.1 \
		form_urlencoded-1.0.1 \
		fsevent-sys-4.1.0 \
		futures-core-0.3.24 \
		futures-io-0.3.24 \
		futures-lite-1.12.0 \
		fxhash-0.2.1 \
		gethostname-0.2.3 \
		getrandom-0.2.7 \
		gilrs-0.9.0 \
		gilrs-core-0.4.1 \
		glam-0.21.3 \
		glob-0.3.0 \
		globset-0.4.9 \
		glow-0.11.2 \
		glyph_brush_layout-0.2.3 \
		gpu-alloc-0.5.3 \
		gpu-alloc-types-0.2.0 \
		gpu-descriptor-0.2.3 \
		gpu-descriptor-types-0.1.1 \
		guillotiere-0.6.2 \
		hash32-0.2.1 \
		hash32-derive-0.1.1 \
		hashbrown-0.12.3 \
		heck-0.3.3 \
		hermit-abi-0.1.19 \
		hex-0.4.3 \
		hexasphere-7.2.0 \
		hexf-parse-0.2.1 \
		ident_case-1.0.1 \
		idna-0.2.3 \
		image-0.23.14 \
		image-0.24.3 \
		indexmap-1.9.1 \
		inotify-0.9.6 \
		inotify-sys-0.1.5 \
		inplace_it-0.3.4 \
		instant-0.1.12 \
		intl-memoizer-0.5.1 \
		intl_pluralrules-7.0.1 \
		io-kit-sys-0.2.0 \
		itertools-0.10.3 \
		itoa-1.0.3 \
		iyes_loopless-0.7.1 \
		jni-0.19.0 \
		jni-sys-0.3.0 \
		jobserver-0.1.24 \
		jpeg-decoder-0.1.22 \
		js-sys-0.3.59 \
		khronos-egl-4.1.0 \
		kira-0.6.1 \
		kqueue-1.0.6 \
		kqueue-sys-1.0.3 \
		lazy_static-1.4.0 \
		lazycell-1.3.0 \
		leafwing-input-manager-0.5.2 \
		leafwing_input_manager_macros-0.5.0 \
		libc-0.2.132 \
		libloading-0.7.3 \
		libm-0.2.5 \
		libudev-sys-0.1.4 \
		lock_api-0.4.8 \
		log-0.4.17 \
		mach-0.3.2 \
		malloc_buf-0.0.6 \
		matchers-0.1.0 \
		matches-0.1.9 \
		matrixmultiply-0.3.2 \
		memchr-2.5.0 \
		memmap2-0.3.1 \
		memoffset-0.6.5 \
		metal-0.24.0 \
		minimal-lexical-0.2.1 \
		miniz_oxide-0.3.7 \
		miniz_oxide-0.4.4 \
		miniz_oxide-0.5.3 \
		mio-0.8.4 \
		naga-0.9.0 \
		nalgebra-0.31.1 \
		nalgebra-macros-0.1.0 \
		ndk-0.5.0 \
		ndk-0.6.0 \
		ndk-context-0.1.1 \
		ndk-glue-0.5.2 \
		ndk-glue-0.6.2 \
		ndk-macro-0.3.0 \
		ndk-sys-0.2.2 \
		ndk-sys-0.3.0 \
		nix-0.22.3 \
		nix-0.23.1 \
		nix-0.24.2 \
		nohash-hasher-0.2.0 \
		nom-7.1.1 \
		notify-5.0.0-pre.15 \
		num-complex-0.4.2 \
		num-derive-0.3.3 \
		num-integer-0.1.45 \
		num-iter-0.1.43 \
		num-rational-0.3.2 \
		num-rational-0.4.1 \
		num-traits-0.2.15 \
		num_cpus-1.13.1 \
		num_enum-0.5.7 \
		num_enum_derive-0.5.7 \
		objc-0.2.7 \
		objc-foundation-0.1.1 \
		objc_exception-0.1.2 \
		objc_id-0.1.1 \
		oboe-0.4.6 \
		oboe-sys-0.4.5 \
		once_cell-1.13.1 \
		optional-0.5.0 \
		owned_ttf_parser-0.15.1 \
		parking-2.0.0 \
		parking_lot-0.11.2 \
		parking_lot-0.12.1 \
		parking_lot_core-0.8.5 \
		parking_lot_core-0.9.3 \
		parry2d-0.9.0 \
		paste-1.0.8 \
		peeking_take_while-0.1.2 \
		percent-encoding-2.1.0 \
		petgraph-0.6.2 \
		petitset-0.2.1 \
		pin-project-lite-0.2.9 \
		pkg-config-0.3.25 \
		png-0.16.8 \
		png-0.17.5 \
		pp-rs-0.2.1 \
		ppv-lite86-0.2.16 \
		pretty-type-name-1.0.0 \
		proc-macro-crate-1.2.1 \
		proc-macro-error-1.0.4 \
		proc-macro-error-attr-1.0.4 \
		proc-macro2-1.0.43 \
		profiling-1.0.6 \
		quote-1.0.21 \
		radsort-0.1.0 \
		rand-0.8.5 \
		rand_chacha-0.3.1 \
		rand_core-0.6.3 \
		range-alloc-0.1.2 \
		rapier2d-0.14.0 \
		raw-window-handle-0.4.3 \
		rawpointer-0.2.1 \
		rectangle-pack-0.4.2 \
		redox_syscall-0.2.16 \
		redox_users-0.4.3 \
		regex-1.6.0 \
		regex-automata-0.1.10 \
		regex-syntax-0.6.27 \
		renderdoc-sys-0.7.1 \
		ringbuf-0.2.8 \
		robust-0.2.3 \
		ron-0.7.1 \
		rustc-hash-1.1.0 \
		rusty-xinput-1.2.0 \
		ryu-1.0.11 \
		safe_arch-0.6.0 \
		same-file-1.0.6 \
		scoped-tls-1.0.0 \
		scopeguard-1.1.0 \
		self_cell-0.10.2 \
		serde-1.0.144 \
		serde_derive-1.0.144 \
		serde_yaml-0.9.10 \
		sha1_smol-1.0.0 \
		sharded-slab-0.1.4 \
		shlex-1.1.0 \
		simba-0.7.2 \
		slab-0.4.7 \
		slotmap-1.0.6 \
		smallvec-1.9.0 \
		smithay-client-toolkit-0.15.4 \
		spade-2.0.0 \
		spirv-0.2.0+1.5.4 \
		stdweb-0.1.3 \
		str-buf-1.0.6 \
		strsim-0.8.0 \
		strsim-0.10.0 \
		structopt-0.3.26 \
		structopt-derive-0.4.18 \
		svg_fmt-0.4.1 \
		symphonia-0.5.1 \
		symphonia-bundle-mp3-0.5.1 \
		symphonia-codec-vorbis-0.5.1 \
		symphonia-core-0.5.1 \
		symphonia-format-ogg-0.5.1 \
		symphonia-metadata-0.5.1 \
		symphonia-utils-xiph-0.5.1 \
		syn-1.0.99 \
		sys-locale-0.2.1 \
		taffy-0.1.0 \
		termcolor-1.1.3 \
		textwrap-0.11.0 \
		thiserror-1.0.32 \
		thiserror-impl-1.0.32 \
		thread_local-1.1.4 \
		tiff-0.6.1 \
		tinystr-0.3.4 \
		tinyvec-1.6.0 \
		tinyvec_macros-0.1.0 \
		toml-0.5.9 \
		tracing-0.1.36 \
		tracing-attributes-0.1.22 \
		tracing-core-0.1.29 \
		tracing-log-0.1.3 \
		tracing-subscriber-0.3.15 \
		tracing-wasm-0.2.1 \
		ttf-parser-0.15.2 \
		type-map-0.4.0 \
		typenum-1.15.0 \
		unic-langid-0.9.0 \
		unic-langid-impl-0.9.0 \
		unicode-bidi-0.3.8 \
		unicode-ident-1.0.3 \
		unicode-normalization-0.1.21 \
		unicode-segmentation-1.9.0 \
		unicode-width-0.1.9 \
		unicode-xid-0.2.3 \
		unsafe-libyaml-0.2.2 \
		url-2.2.2 \
		uuid-1.1.2 \
		valuable-0.1.0 \
		vec_map-0.8.2 \
		version_check-0.9.4 \
		waker-fn-1.1.0 \
		walkdir-2.3.2 \
		wasi-0.11.0+wasi-snapshot-preview1 \
		wasm-bindgen-0.2.82 \
		wasm-bindgen-backend-0.2.82 \
		wasm-bindgen-futures-0.4.32 \
		wasm-bindgen-macro-0.2.82 \
		wasm-bindgen-macro-support-0.2.82 \
		wasm-bindgen-shared-0.2.82 \
		wayland-client-0.29.5 \
		wayland-commons-0.29.5 \
		wayland-cursor-0.29.5 \
		wayland-protocols-0.29.5 \
		wayland-scanner-0.29.5 \
		wayland-sys-0.29.5 \
		web-sys-0.3.59 \
		webbrowser-0.7.1 \
		weezl-0.1.7 \
		wgpu-0.13.1 \
		wgpu-core-0.13.2 \
		wgpu-hal-0.13.2 \
		wgpu-types-0.13.2 \
		wide-0.7.4 \
		widestring-0.5.1 \
		winapi-0.3.9 \
		winapi-i686-pc-windows-gnu-0.4.0 \
		winapi-util-0.1.5 \
		winapi-wsapoll-0.1.1 \
		winapi-x86_64-pc-windows-gnu-0.4.0 \
		windows-sys-0.36.1 \
		windows_aarch64_msvc-0.36.1 \
		windows_i686_gnu-0.36.1 \
		windows_i686_msvc-0.36.1 \
		windows_x86_64_gnu-0.36.1 \
		windows_x86_64_msvc-0.36.1 \
		winit-0.26.1 \
		x11-dl-2.20.0 \
		x11rb-0.9.0 \
		xcursor-0.3.4 \
		xi-unicode-0.3.0 \
		xml-rs-0.8.4

post-patch:
# Search assets under PREFIX instead of current directory
	@${REINPLACE_CMD} 's,assets",../${DATADIR_REL}/&,' \
		${WRKSRC}/cargo-crates/bevy_asset-*/src/lib.rs

post-install:
	(cd ${WRKSRC} && ${COPYTREE_SHARE} "assets" ${STAGEDIR}${DATADIR})

.include <bsd.port.mk>
