On Wed, 23 Sep 2026 19:43:39 +0000
Klemens Nanni <[email protected]> wrote:

> 23.09.2026 15:53, Nazarenko Mykyta пишет:
> > Hola ports@, kirill@, kn@.
> > 
> > The new versions of net/tdesktop and net/64gram now require tlottie 
> > instead of rlottie; the upstream, in turn, has made it impossible to build 
> > this library as an bundled option because it is written in Rust.
> > 
> > As you know, this library is used to render lottie animations, and it does 
> > so much faster than rlottie.
> > 
> > Tested it with 64gram 1.2.10, works fine.
> > 
> > With best regards,
> > Nazarenko Mykyta  
> 
> Thanks for the port, looks good to go with a few tweaks:
> 
> - variables before targets
> - no need to create common dirs
> - INSTALL_PROGRAM for .so files would set +x
> 
> 
> Questions:
> - Why the 'c-api' feature which is 'cpu' as opposed to
>   the default 'cpu', 'std'?  What's up with 'std'?
>   If that's required by tdesktop, a comment should explain that.
> 
> 
> Style nits, as you like:
> 
> - For wantlib i either copy from port-lib-depends-check as-is
>   or consistently assign (not amend) and indent, you did a mix.
> - Fewer empty lines? I'd group, e.g. MOD* and includes.
> 
> 
> Tests mostly pass, did you look at the failures?
> Just wondering, I'm fine with importing as-is:
> 
> failures:
>     dos::animated_repeater_product_stays_bounded
>     dos::animated_unique_lut_gradient_fills_stay_bounded
>     dos::clipped_dashed_round_join_zigzag_stays_bounded
>     dos::compounding_repeaters_are_rejected
>     dos::many_clipped_dashed_strokes_stay_bounded
>     dos::many_max_depth_parent_chains_stay_bounded
>     dos::max_legal_cumulative_shape_paints_stay_bounded
>     dos::nested_track_matte_target_surfaces_stay_bounded
>     dos::overshooting_easing_dashed_path_stays_bounded
>     dos::pr11_dashed_polystar_tiny_period_stays_bounded
>     dos::renderer_rejects_large_canvas_before_allocating_fallback
>     dos::reused_precomp_auto_orient_spatial_timeline_stays_bounded
>     dos::reused_precomp_auto_orient_split_position_timelines_stay_bounded
>     dos::reused_precomp_layer_opacity_timeline_stay_bounded
>     dos::reused_precomp_spatial_position_timelines_stay_bounded
>     dos::reused_precomp_unsorted_fill_properties_stay_bounded
> 
> test result: FAILED. 234 passed; 16 failed; 0 ignored; 0 measured; 0 filtered 
> out; finished in 16.25s
> 
> 
> diff --git a/graphics/tlottie/Makefile b/graphics/tlottie/Makefile
> index fcd26b663..1adc11a99 100644
> --- a/graphics/tlottie/Makefile
> +++ b/graphics/tlottie/Makefile
> @@ -14,25 +14,19 @@ HOMEPAGE =                
> https://github.com/dkaraush/tlottie
>  # MIT
>  PERMIT_PACKAGE =     Yes
>  
> -WANTLIB +=           ${MODCARGO_WANTLIB} m
> +WANTLIB =            ${MODCARGO_WANTLIB} m
>  
> -MODULES +=           devel/cargo
> -
> -MODCARGO_FEATURES =  c-api
> +MODULES =            devel/cargo
>  
>  CONFIGURE_STYLE =    cargo
> +SEPARATE_BUILD =     Yes
>  
>  MODCARGO_INSTALL =   No
>  
>  do-install:
> -     ${INSTALL_DATA_DIR} ${PREFIX}/include
>       ${INSTALL_DATA} ${WRKSRC}/include/tlottie.h ${PREFIX}/include/
> -     ${INSTALL_DATA_DIR} ${PREFIX}/lib
> -     ${INSTALL_PROGRAM} ${MODCARGO_TARGET_DIR}/release/libtlottie.so \
> +     ${INSTALL_DATA} ${MODCARGO_TARGET_DIR}/release/libtlottie.so \
>               ${PREFIX}/lib/libtlottie.so.${LIBtlottie_VERSION}
>  
> -SEPARATE_BUILD =     Yes
> -
>  .include "crates.inc"
> -
>  .include <bsd.port.mk>
> 

Agree with all of that, but we need to keep MODCARGO_FEATURES.

If we remove MODCARGO_FEATURES =  c-api, the resulting dynamic
library will lose the necessary functions with C compatible ABI because
the Rust compiler will kindly remove them. This will cause the linker to
throw a linking error when building net/tdesktop or net/64gram.

See : https://github.com/dkaraush/tlottie/blob/main/src/bindings/mod.rs

Build without MODCARGO_FEATURES = c-api :
nazarenko$ nm -gD /usr/local/lib/libtlottie.so.0.0
         W _Jv_RegisterClasses
         U _Unwind_Backtrace
         U _Unwind_DeleteException
         U _Unwind_GetDataRelBase
         U _Unwind_GetIP
         U _Unwind_GetIPInfo
         U _Unwind_GetLanguageSpecificData
         U _Unwind_GetRegionStart
         U _Unwind_GetTextRelBase
         U _Unwind_RaiseException
         U _Unwind_Resume
         U _Unwind_SetGR
         U _Unwind_SetIP
         W __cxa_atexit
         W __cxa_finalize
         U __errno
         W _thread_atfork
         U abort
         U calloc
         U close
         U dl_iterate_phdr
         U free
         U fstat
         U futex
         U getcwd
         U getenv
         U getexecpath
         U getthrid
         U lseek
         U malloc
         U memcmp
         U memcpy
         U memmove
         U memset
         U mmap
         U munmap
         U open
         U posix_memalign
         U pthread_getspecific
         U pthread_key_create
         U pthread_key_delete
         U pthread_setspecific
         U read
         U realloc
         U realpath
         U stat
         U strerror_r
         U strlen
         U write
         U writev

With MODCARGO_FEATURES = c-api :
nazarenko$ nm -gD /usr/local/lib/libtlottie.so.0.0
         W _Jv_RegisterClasses
         U _Unwind_Backtrace
         U _Unwind_DeleteException
         U _Unwind_GetDataRelBase
         U _Unwind_GetIP
         U _Unwind_GetIPInfo
         U _Unwind_GetLanguageSpecificData
         U _Unwind_GetRegionStart
         U _Unwind_GetTextRelBase
         U _Unwind_RaiseException
         U _Unwind_Resume
         U _Unwind_SetGR
         U _Unwind_SetIP
         W __cxa_atexit
         W __cxa_finalize
         U __errno
         W _thread_atfork
         U abort
         U arc4random_buf
         U atan2f
         U calloc
         U close
         U cosf
         U dl_iterate_phdr
         U free
         U fstat
         U futex
         U getcwd
         U getenv
         U getexecpath
         U getthrid
         U lseek
         U malloc
         U memcmp
         U memcpy
         U memmove
         U memset
         U mmap
         U munmap
         U open
         U posix_memalign
         U powf
         U pthread_getspecific
         U pthread_key_create
         U pthread_key_delete
         U pthread_setspecific
         U read
         U realloc
         U realpath
         U sinf
         U stat
         U strerror_r
         U strlen
0008c0a0 T tlottie_drop
0008c100 T tlottie_frame_count
0008c170 T tlottie_frame_rate
0008c190 T tlottie_height
0008c1b0 T tlottie_new
0008c1e0 T tlottie_new_with_options
0008c860 T tlottie_render
0008c8f0 T tlottie_render_alpha8
0008c980 T tlottie_render_alpha8_with_options
0008caa0 T tlottie_render_with_options
0008cbb0 T tlottie_width
         U write
         U writev

Also, I looked at the tests, and I can see that some of them failed, but at
least this doesn't affect the messenger's performance in any way - the
stickers are rendered normally.

Thanks kn@.
New tarball attached.

With best regards,
Nazarenko Mykyta

Attachment: tlottie-1.0.6.tar.gz
Description: application/gzip

Reply via email to