On Tue, Aug 24, 2021 at 09:33:43PM -0400, Brad Smith wrote:
> Here is an update to libass 0.15.1.
>
> libass (0.15.1)
> * Fix currently known 0.15.0 regressions:
> * Fix crashing on some ASS files with embedded fonts
> * Fix total font fallback failure with some fonts on Core Text
> * Fix embedded and memory fonts not actually being used
> unless ass_set_fonts was called after they have been added
> * Fix events assuming the largest xbord-value of a preceding
> event of the same frame during collision handling
> * Fix \fscx0 and \fscy0 making more text disappear than they should
> * Fix shift in vertical positioning of some right-to-left
> events with \an4-6, \pos, \move or Scroll effects
> * Fix imprecise output for \be with huge argument
> * Fix the --enable-large-tiles configure switch doing nothing
> * Fix output of ASM-enabled builds deviating from non-ASM builds
> * Fix ASM-builds on Haiku and 32-bit *BSDs
> * Overhaul x86 assembly for better performance
> and to allow ASM-enabled PIC-builds on 32-bit
> * Reduce temporary allocation in rendering
> * DirectWrite: request fonts on demand for better performance and
> improved compatibility with external on-demand font activation
> * Log libass version numbers upon renderer startup
> * Accept pointers to const as arguments to ass_add_font
> * Improve VSFilter compatibility:
> * Disregard zero area events in collision handling
> * Do not apply \fsp to vector drawings
> * Fix bug preventing cutting out glyphs from border & shadow
> with abnormal \fad values (or causing aliasing artifacts
> in some cases with normal values)
Here is an updated diff with a fix rolled in to allow enabling the
assembly support for amd64.
Index: Makefile
===================================================================
RCS file: /home/cvs/ports/multimedia/libass/Makefile,v
retrieving revision 1.25
diff -u -p -u -p -r1.25 Makefile
--- Makefile 14 Dec 2020 15:56:36 -0000 1.25
+++ Makefile 27 Aug 2021 17:34:29 -0000
@@ -2,7 +2,7 @@
COMMENT= portable ASS/SSA subtitle renderer
-VER= 0.15.0
+VER= 0.15.1
DISTNAME= libass-${VER}
CATEGORIES= multimedia devel
MASTER_SITES= https://github.com/libass/libass/releases/download/${VER}/
@@ -28,8 +28,14 @@ LIB_DEPENDS= converters/libiconv \
devel/harfbuzz
CONFIGURE_STYLE= gnu
-CONFIGURE_ARGS= --disable-asm
CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \
LDFLAGS="-L${LOCALBASE}/lib"
+
+.if ${MACHINE_ARCH} == "i386"
+CONFIGURE_ARGS= --disable-asm
+.endif
+
+post-patch:
+ chmod ${BINMODE} ${WRKSRC}/ltnasm.sh
.include <bsd.port.mk>
Index: distinfo
===================================================================
RCS file: /home/cvs/ports/multimedia/libass/distinfo,v
retrieving revision 1.17
diff -u -p -u -p -r1.17 distinfo
--- distinfo 14 Dec 2020 15:56:36 -0000 1.17
+++ distinfo 25 Aug 2021 01:14:14 -0000
@@ -1,2 +1,2 @@
-SHA256 (libass-0.15.0.tar.xz) = nwkjDJoKpo73qmqeKrcJypVwIPhC5SxbLlK4AafZ6DM=
-SIZE (libass-0.15.0.tar.xz) = 367848
+SHA256 (libass-0.15.1.tar.xz) = HN05ydAHsG5zfnc4AE1/OM+bHpKEPzcweyTn/2OrjlM=
+SIZE (libass-0.15.1.tar.xz) = 369884
Index: patches/patch-libass_Makefile_in
===================================================================
RCS file: patches/patch-libass_Makefile_in
diff -N patches/patch-libass_Makefile_in
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-libass_Makefile_in 27 Aug 2021 17:35:43 -0000
@@ -0,0 +1,26 @@
+$OpenBSD$
+
+Use a libtool-wrapper script for NASM.
+
+Libtool thinks NASM acts just like the C-compiler, which isn't true
+for e.g. -f options. Previously we used -prefer-non-pic to avoid libtool
+passing any additional flags, which worked well on all tested platforms
+but as it turns out at least on OpenBSD this does not work.
+This now also means we'll automatically get the -DPIC flag as needed,
+which might perhaps also help some platforms we didn't test yet; before
+we fully relied on x86inc's automatic setting for PIC in assembly.
+
+https://github.com/libass/libass/issues/539
+
+Index: libass/Makefile.in
+--- libass/Makefile.in.orig
++++ libass/Makefile.in
+@@ -844,7 +844,7 @@ uninstall-am: uninstall-dist_assheadersHEADERS \
+
+
+ .asm.lo:
+- $(nasm_verbose)$(LIBTOOL) $(AM_V_lt) --tag=CC --mode=compile $(AS)
$(ASFLAGS) -I$(srcdir)/ -o $@ $< -prefer-non-pic
++ $(nasm_verbose)$(LIBTOOL) $(AM_V_lt) --tag=CC --mode=compile
$(top_srcdir)/ltnasm.sh $(AS) $(ASFLAGS) -I$(srcdir)/ -o $@ $<
+
+ # Tell versions [3.59,3.63) of GNU make to not export all variables.
+ # Otherwise a system limit (for SysV at least) may be exceeded.
Index: patches/patch-ltnasm_sh
===================================================================
RCS file: patches/patch-ltnasm_sh
diff -N patches/patch-ltnasm_sh
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-ltnasm_sh 27 Aug 2021 17:35:43 -0000
@@ -0,0 +1,47 @@
+$OpenBSD$
+
+Use a libtool-wrapper script for NASM.
+
+Libtool thinks NASM acts just like the C-compiler, which isn't true
+for e.g. -f options. Previously we used -prefer-non-pic to avoid libtool
+passing any additional flags, which worked well on all tested platforms
+but as it turns out at least on OpenBSD this does not work.
+This now also means we'll automatically get the -DPIC flag as needed,
+which might perhaps also help some platforms we didn't test yet; before
+we fully relied on x86inc's automatic setting for PIC in assembly.
+
+https://github.com/libass/libass/issues/539
+
+Index: ltnasm.sh
+--- ltnasm.sh.orig
++++ ltnasm.sh
+@@ -0,0 +1,29 @@
++#!/bin/sh
++
++# Translate libtool supplied C-compiler options for NASM.
++# libtool treats NASM like the C compiler, and may supply -f??? options
++# which are interpreted as the output file format by NASM, causing errors.
++# Notably libtool will set -DPIC -fPIC and -fno-common; we want to keep
++# -DPIC but remove everything else.
++#
++# Filtering the options as done here in this plain POSIX shell script would
++# mess up if there were any spaces in the arguments, but this will never
happen
++# since our filenames or options do not contain spaces and source paths are
++# also not allowed to contain spaces.
++
++cmd=""
++while [ "$#" -gt 0 ] ; do
++ case "$1" in
++ # NASM accepts both -f format and -fformat,
++ # we always use the former, and libtool supplied
++ # C-compiler options will always use the latter.
++ -f) cmd="$cmd $1" ;;
++ -f*) : ;;
++ -DPIC) cmd="$cmd -DPIC=1" ;;
++ *) cmd="$cmd $1" ;;
++ esac
++ shift
++done
++
++#echo "$cmd"
++exec $cmd