diff --git a/games/veloren-weekly/Makefile b/games/veloren-weekly/Makefile index a2e219c7d131..8fe40e8fd8a1 100644 --- a/games/veloren-weekly/Makefile +++ b/games/veloren-weekly/Makefile @@ -1,81 +1,80 @@ PORTNAME= veloren PORTVERSION= s20230913 CATEGORIES= games wayland PKGNAMESUFFIX= -weekly MAINTAINER= jbeich@FreeBSD.org COMMENT= Multiplayer voxel RPG written in Rust (weekly snapshot) WWW= https://veloren.net/ LICENSE= GPLv3 LICENSE_FILE= ${WRKSRC}/LICENSE -BROKEN= fails to build with rust 1.72 https://gitlab.com/veloren/veloren/-/issues/1875 BROKEN_aarch64= https://github.com/rust-lang/libc/issues/3217 ONLY_FOR_ARCHS= aarch64 amd64 i386 ONLY_FOR_ARCHS_REASON= unsupported platform by https://github.com/wasmerio/wasmer LIB_DEPENDS= libasound.so:audio/alsa-lib \ libudev.so:devel/libudev-devd \ libshaderc_shared.so:graphics/shaderc RUN_DEPENDS= ${LOCALBASE}/lib/alsa-lib/libasound_module_pcm_oss.so:audio/alsa-plugins \ ${LOCALBASE}/lib/libvulkan.so:graphics/vulkan-loader USES= cargo xorg USE_XORG= xcb USE_GITLAB= yes GL_TAGNAME= 93fc044b03b77ed2df47389a38541ede5efc7274 CARGO_ENV= VELOREN_USERDATA_STRATEGY=system SHADERC_LIB_DIR="${LOCALBASE}/lib" PLIST_FILES= bin/${PORTNAME}-server-cli \ bin/${PORTNAME}-voxygen \ share/applications/net.veloren.veloren.desktop \ share/metainfo/net.veloren.veloren.metainfo.xml \ share/pixmaps/net.veloren.veloren.png PORTDATA= * CONFLICTS_INSTALL= ${PORTNAME} .if ${MACHINE_ARCH} == i386 # https://github.com/rust-lang/rust/issues/85598 CARGO_ENV+= CARGO_PROFILE_RELEASE_LTO=false .endif # Fixes error "Instruction does not dominate all uses!" LTO_UNSAFE= yes # https://gitlab.com/veloren/veloren/issues/264 CARGO_ENV+= RUSTC_BOOTSTRAP=1 # XXX https://github.com/rust-lang/cargo/issues/4101 CARGO_INSTALL_PATH= server-cli voxygen post-patch: # .git/ directory is missing, so don't abort if git binary is also missing @${REINPLACE_CMD} -e 's/"git"/"${TRUE}"/' \ ${WRKSRC}/common/build.rs # Extract (snapshot) version from the port instead of empty file @${REINPLACE_CMD} -e '/GIT_HASH/s/=.*/= "${GL_TAGNAME:C/(.{8}).*/\1/}";/' \ -e "/GIT_DATE.*static/s/=.*/= \"$$(date -ur $$(${AWK} '/TIMESTAMP/ { print $$3 }' \ ${DISTINFO_FILE}) +'%Y-%m-%d-%H:%M')\";/" \ ${WRKSRC}/common/src/util/mod.rs # Respect PREFIX != /usr/local for system assets @${REINPLACE_CMD} -e 's,/usr/share,${DATADIR:H},' \ ${WRKSRC}/common/assets/src/lib.rs do-install: # XXX [workspace.dependencies] breaks rebuild in subdirs .for f in ${CARGO_INSTALL_PATH} ${INSTALL_PROGRAM} ${CARGO_TARGET_DIR}/*/*/${PORTNAME}-$f \ ${STAGEDIR}${PREFIX}/bin .endfor post-install: ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/* (cd ${WRKSRC} && ${COPYTREE_SHARE} assets ${STAGEDIR}${DATADIR}) ${RLN} ${STAGEDIR}${DATADIR}/assets/voxygen/*.desktop \ ${STAGEDIR}${PREFIX}/share/applications ${RLN} ${STAGEDIR}${DATADIR}/assets/voxygen/*.png \ ${STAGEDIR}${PREFIX}/share/pixmaps ${MKDIR} ${STAGEDIR}${PREFIX}/share/metainfo ${RLN} ${STAGEDIR}${DATADIR}/assets/voxygen/*.metainfo.xml \ ${STAGEDIR}${PREFIX}/share/metainfo .include diff --git a/games/veloren-weekly/files/patch-rust-1.72 b/games/veloren-weekly/files/patch-rust-1.72 new file mode 100644 index 000000000000..83d5c836df36 --- /dev/null +++ b/games/veloren-weekly/files/patch-rust-1.72 @@ -0,0 +1,179 @@ +https://gitlab.com/veloren/veloren/-/issues/1875 + +--- common/src/lib.rs.orig 2023-09-13 10:25:00 UTC ++++ common/src/lib.rs +@@ -14,7 +14,7 @@ + arbitrary_self_types, + int_roundings + )] +-#![feature(hash_drain_filter)] ++#![feature(hash_extract_if)] + + pub use common_assets as assets; + pub use uuid; +--- common/systems/src/lib.rs.orig 2023-09-13 10:25:00 UTC ++++ common/systems/src/lib.rs +@@ -1,4 +1,4 @@ +-#![feature(drain_filter, let_chains)] ++#![feature(extract_if, let_chains)] + #![allow(clippy::option_map_unit_fn)] + + mod aura; +--- common/systems/src/mount.rs.orig 2023-09-13 10:25:00 UTC ++++ common/systems/src/mount.rs +@@ -61,7 +61,7 @@ impl<'a> System<'a> for Sys { + .map(|c| ( + // Only take inputs and actions from the rider if the mount is not intelligent (TODO: expand the definition of 'intelligent'). + if !matches!(body, Some(Body::Humanoid(_))) { +- let actions = c.actions.drain_filter(|action| match action { ++ let actions = c.actions.extract_if(|action| match action { + ControlAction::StartInput { input: i, .. } + | ControlAction::CancelInput(i) => matches!(i, InputKind::Jump | InputKind::Fly | InputKind::Roll), + _ => false +@@ -151,7 +151,7 @@ impl<'a> System<'a> for Sys { + let inputs = controllers.get_mut(entity).map(|c| { + let actions: Vec<_> = c + .actions +- .drain_filter(|action| match action { ++ .extract_if(|action| match action { + ControlAction::StartInput { input: i, .. } + | ControlAction::CancelInput(i) => { + matches!(i, InputKind::Jump | InputKind::Fly | InputKind::Roll) +--- network/protocol/src/lib.rs.orig 2023-09-13 10:25:00 UTC ++++ network/protocol/src/lib.rs +@@ -1,4 +1,4 @@ +-#![feature(drain_filter)] ++#![feature(extract_if)] + //! Network Protocol + //! + //! a I/O-Free protocol for the veloren network crate. +--- network/protocol/src/quic.rs.orig 2023-09-13 10:25:00 UTC ++++ network/protocol/src/quic.rs +@@ -388,7 +388,7 @@ where + // try to order pending + let mut pending_violated = false; + let mut reliable = vec![]; +- self.pending_reliable_buffers.drain_filter(|(_, buffer)| { ++ self.pending_reliable_buffers.extract_if(|(_, buffer)| { + // try to get Sid without touching buffer + let mut testbuffer = buffer.clone(); + match ITFrame::read_frame(&mut testbuffer) { +--- server/src/lib.rs.orig 2023-09-13 10:25:00 UTC ++++ server/src/lib.rs +@@ -3,13 +3,13 @@ + #![deny(clippy::clone_on_ref_ptr)] + #![feature( + box_patterns, +- drain_filter, ++ extract_if, + let_chains, + never_type, + option_zip, + unwrap_infallible + )] +-#![feature(hash_drain_filter)] ++#![feature(hash_extract_if)] + + pub mod automod; + mod character_creator; +--- server/src/persistence/character_updater.rs.orig 2023-09-13 10:25:00 UTC ++++ server/src/persistence/character_updater.rs +@@ -267,7 +267,7 @@ impl CharacterUpdater { + } + + pub fn process_batch_completion(&mut self, completed_batch_id: u64) { +- self.pending_database_actions.drain_filter(|_, event| { ++ self.pending_database_actions.extract_if(|_, event| { + matches!(event, DatabaseAction::Submitted { + batch_id, + } if completed_batch_id == *batch_id) +--- voxygen/src/lib.rs.orig 2023-09-13 10:25:00 UTC ++++ voxygen/src/lib.rs +@@ -4,8 +4,7 @@ + #![deny(clippy::clone_on_ref_ptr)] + #![feature( + array_methods, +- array_zip, +- drain_filter, ++ extract_if, + trait_alias, + option_get_or_insert_default, + map_try_insert, +--- voxygen/src/render/pipelines/bloom.rs.orig 2023-09-13 10:25:00 UTC ++++ voxygen/src/render/pipelines/bloom.rs +@@ -112,7 +112,7 @@ impl BloomLayout { + device: &wgpu::Device, + src_color: &wgpu::TextureView, + sampler: &wgpu::Sampler, +- half_pixel: Consts, ++ half_pixel: &Consts, + ) -> BindGroup { + let bind_group = device.create_bind_group(&wgpu::BindGroupDescriptor { + label: None, +--- voxygen/src/render/pipelines/trail.rs.orig 2023-09-13 10:25:00 UTC ++++ voxygen/src/render/pipelines/trail.rs +@@ -39,7 +39,7 @@ impl Add for Vertex { + + fn add(self, other: Self) -> Self::Output { + Self { +- pos: self.pos.zip(other.pos).map(|(a, b)| a + b), ++ pos: core::array::from_fn(|i| self.pos[i] + other.pos[i]), + } + } + } +--- voxygen/src/render/renderer/locals.rs.orig 2023-09-13 10:25:00 UTC ++++ voxygen/src/render/renderer/locals.rs +@@ -58,10 +58,11 @@ impl Locals { + ); + + let bloom_binds = bloom.map(|bloom| { +- bloom +- .src_views +- .zip(bloom.locals) // zip arrays +- .map(|(view, locals)| layouts.bloom.bind(device, view, sampler, locals)) ++ core::array::from_fn(|i| { ++ layouts ++ .bloom ++ .bind(device, bloom.src_views[i], sampler, &bloom.locals[i]) ++ }) + }); + + Self { +@@ -107,10 +108,11 @@ impl Locals { + &self.postprocess, + ); + self.bloom_binds = bloom.map(|bloom| { +- bloom +- .src_views +- .zip(bloom.locals) // zip arrays +- .map(|(view, locals)| layouts.bloom.bind(device, view, sampler, locals)) ++ core::array::from_fn(|i| { ++ layouts ++ .bloom ++ .bind(device, bloom.src_views[i], sampler, &bloom.locals[i]) ++ }) + }); + } + } +--- voxygen/src/scene/math.rs.orig 2023-09-13 10:25:00 UTC ++++ voxygen/src/scene/math.rs +@@ -250,7 +250,7 @@ pub fn clip_object_by_plane