tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

libreoffice patch / unoconv upgrade



Hello

Right now, converters/unoconv is broken because it requires a python
interpreter with PAX mprotect disabled. 

Attached is a patch to misc/libreoffice and a converter/unoconv upgrade
that fixes that situation. 

Is it reasonable to commit during the freeze?

I note that misc/libreoffice disables PAX mprotect for gengal.bin.
Anyone knows what bug does that works around? I wonder if it could
be fixed too.

-- 
Emmanuel Dreyfus
manu%netbsd.org@localhost
Index: converters/unoconv/Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/converters/unoconv/Makefile,v
retrieving revision 1.10
diff -U 4 -r1.10 Makefile
--- converters/unoconv/Makefile	14 Aug 2023 05:23:58 -0000	1.10
+++ converters/unoconv/Makefile	19 Mar 2025 00:47:24 -0000
@@ -1,8 +1,8 @@
 # $NetBSD: Makefile,v 1.10 2023/08/14 05:23:58 wiz Exp $
 
-DISTNAME=	unoconv-0.7
-PKGREVISION=	6
+DISTNAME=	unoconv-0.8.2
+#PKGREVISION=	1
 CATEGORIES=	converters
 MASTER_SITES=	${MASTER_SITE_GITHUB:=dagwieers/}
 
 MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
Index: converters/unoconv/distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/converters/unoconv/distinfo,v
retrieving revision 1.4
diff -U 4 -r1.4 distinfo
--- converters/unoconv/distinfo	26 Oct 2021 10:06:53 -0000	1.4
+++ converters/unoconv/distinfo	19 Mar 2025 00:47:24 -0000
@@ -1,5 +1,5 @@
 $NetBSD: distinfo,v 1.4 2021/10/26 10:06:53 nia Exp $
 
-BLAKE2s (unoconv-0.7.tar.gz) = 0638813acb64f18278fa068d44cad166f7fb2b6fa844dbac47a1834c175bf161
-SHA512 (unoconv-0.7.tar.gz) = 3b0837e11f22733e0fbef93dc6aeabd0e2d3d59b6c35a6f7b29b86506a5842bcbffb3e889864d6e14c1e53dd306354690a699257fe60f36ce1d4455ab52b5df7
-Size (unoconv-0.7.tar.gz) = 96151 bytes
+BLAKE2s (unoconv-0.8.2.tar.gz) = 384f9e5acf3fc76f4b78c86b58650e8f89fe815f50c31349285cd966f43220ff
+SHA512 (unoconv-0.8.2.tar.gz) = cd6a4d06559895c0aebb5fda51ca86928474dd0ca0aa908e81762643186c29cf8436c889eedbb18bc74ed6016414d1aa831cd034614244d5aae677a6b4cdd4c9
+Size (unoconv-0.8.2.tar.gz) = 104072 bytes
Index: converters/unoconv/files/unoconv.sh
===================================================================
RCS file: /cvsroot/pkgsrc/converters/unoconv/files/unoconv.sh,v
retrieving revision 1.4
diff -U 4 -r1.4 unoconv.sh
--- converters/unoconv/files/unoconv.sh	29 Apr 2020 13:56:10 -0000	1.4
+++ converters/unoconv/files/unoconv.sh	19 Mar 2025 00:47:24 -0000
@@ -1,8 +1,9 @@
 #!/bin/sh
 
 PYTHONBIN=`@PKG_INFO_CMD@ -Q PYTHONBIN libreoffice`
-UNO_PATH=`@PKG_INFO_CMD@ -Q UNO_PATH libreoffice`
+VERS=`@PKG_INFO_CMD@ -e libreoffice | sed 's/nb[0-9]\{1,\}$//'`
+UNO_PATH=/usr/pkg/${VERS}/lib/libreoffice/program
 LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${UNO_PATH}
 
 export UNO_PATH
 export LD_LIBRARY_PATH
Index: misc/libreoffice/Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/misc/libreoffice/Makefile,v
retrieving revision 1.354
diff -U 4 -r1.354 Makefile
--- misc/libreoffice/Makefile	9 Feb 2025 14:44:06 -0000	1.354
+++ misc/libreoffice/Makefile	19 Mar 2025 00:47:24 -0000
@@ -3,9 +3,9 @@
 VERREL=		25.2.0
 VERRC=		3
 VER=		${VERREL}.${VERRC}
 DISTNAME=	libreoffice-${VER}
-PKGREVISION=	1
+PKGREVISION=	2
 CATEGORIES=	misc
 MASTER_SITES=	http://download.documentfoundation.org/libreoffice/src/${VERREL}/
 EXTRACT_SUFX=	.tar.xz
 
@@ -407,8 +407,9 @@
 .include "../../math/ltm/buildlink3.mk"
 .include "../../multimedia/gstreamer1/buildlink3.mk"
 .include "../../multimedia/gst-plugins1-base/buildlink3.mk"
 .include "../../net/libcmis/buildlink3.mk"
+BUILDLINK_API_DEPENDS.libcmis+=       libcmis>=0.6.1
 .include "../../net/mDNSResponder/buildlink3.mk"
 # Use PDFium instead of poppler for PDF import since 6.3.2.2nb1
 #.include "../../print/poppler-cpp/buildlink3.mk"
 #.include "../../print/poppler-includes/buildlink3.mk"
Index: misc/libreoffice/distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/misc/libreoffice/distinfo,v
retrieving revision 1.163
diff -U 4 -r1.163 distinfo
--- misc/libreoffice/distinfo	5 Feb 2025 03:50:01 -0000	1.163
+++ misc/libreoffice/distinfo	19 Mar 2025 00:47:24 -0000
@@ -207,8 +207,9 @@
 SHA1 (patch-Makefile.in) = c16214631f0e40af4b366c790c7b84e0e11a892e
 SHA1 (patch-autogen.sh) = 0fed5f88342112bed0f573d426cc2c3d05ed45c7
 SHA1 (patch-bridges_source_cpp__uno_gcc3__linux__intel_share.hxx) = 2eed9efc4a145687f409ba87806147dac2210c68
 SHA1 (patch-bridges_source_cpp__uno_gcc3__linux__x86-64_share.hxx) = e664faa4044feaafe8214fdf42f7d008b9aa29fc
+SHA1 (patch-bridges_source_cpp_uno_shared_vtablefactory.cxx) = 108892ef7251073679e05bf23debe0cba83e03bc
 SHA1 (patch-configure.ac) = c19a8201ddc9a3297ee8ca5a23ac0ba0145686fe
 SHA1 (patch-desktop_scripts_soffice.sh) = 443bbfde1056521901f5f599726053883a98a67d
 SHA1 (patch-external_mariadb-connector-c_UnpackedTarball__mariadb-connector-c.mk) = 13defabb6ed7c903872f4782cfd987960fdf2797
 SHA1 (patch-external_mariadb-connector-c_fix-debug-i386.patch.0) = 1d9bf372ee41827fed206abdb027fde8d2ec2dda
--- /dev/null	2025-03-19 01:27:35.672632650 +0100
+++ misc/libreoffice/patches/patch-bridges_source_cpp_uno_shared_vtablefactory.cxx	2025-03-19 01:29:08.133095083 +0100
@@ -0,0 +1,84 @@
+$NetBSD$
+
+posix_fallocate() may be available but unimplemented for a 
+given filesystem. Detect that situation once and use ftruncate()
+instead.
+
+Here LibreOffice need to mmap() a memory block RWX. At least on NetBSD,
+PAX mprofect will prevent this. LibreOffice has an alternative
+implementation that double mmap() a mkstemp() file, one time RW and
+the second tume RX. Make sure the mmap() RWX is only tried once.
+
+--- ./bridges/source/cpp_uno/shared/vtablefactory.cxx.orig
++++ ./bridges/source/cpp_uno/shared/vtablefactory.cxx
+@@ -245,17 +245,26 @@
+ 
+ #ifdef USE_DOUBLE_MMAP
+ bool VtableFactory::createBlock(Block &block, sal_Int32 slotCount) const
+ {
++#if defined(HAVE_POSIX_FALLOCATE)
++    static int use_fallocate = 1;
++#else
++    static int use_fallocate = 0;
++#endif
++    static int use_double_mmap = 0;
+     std::size_t size = getBlockSize(slotCount);
+     std::size_t pagesize = sysconf(_SC_PAGESIZE);
+     block.size = (size + (pagesize - 1)) & ~(pagesize - 1);
+     block.fd = -1;
+ 
+-    // Try non-doublemmaped allocation first:
+-    block.start = block.exec = rtl_arena_alloc(m_arena, &block.size);
+-    if (block.start != nullptr) {
+-        return true;
++    // try non-doublemmaped allocation first
++    if (!use_double_mmap) {
++        block.start = block.exec = rtl_arena_alloc(m_arena, &block.size);
++        if (block.start != nullptr) {
++            return true;
++        }
++        use_double_mmap = 1;
+     }
+ 
+     osl::Security aSecurity;
+     OUString strDirectory;
+@@ -280,20 +289,30 @@
+             break;
+         }
+         unlink(tmpfname.get());
+         tmpfname.reset();
++
++        int err;
+ #if defined(HAVE_POSIX_FALLOCATE)
+-        int err = posix_fallocate(block.fd, 0, block.size);
+-#else
+-        int err = ftruncate(block.fd, block.size);
++retry:
++        if (use_fallocate) {
++            err = posix_fallocate(block.fd, 0, block.size);
++            if (err == EOPNOTSUPP) {
++                use_fallocate = 0;
++                goto retry;
++            }
++        }
++        else
+ #endif
+-        if (err != 0)
+         {
+-#if defined(HAVE_POSIX_FALLOCATE)
+-            SAL_WARN("bridges", "posix_fallocate failed with code " << err);
+-#else
+-            SAL_WARN("bridges", "truncation of executable memory area failed with code " << err);
+-#endif
++            err = ftruncate(block.fd, block.size);
++        }
++
++        if (err != 0) {
++            if (use_fallocate)
++                SAL_WARN("bridges", "posix_fallocate failed with code " << err);
++            else
++                SAL_WARN("bridges", "truncation of executable memory area failed with code " << err);
+             close(block.fd);
+             block.fd = -1;
+             break;
+         }


Home | Main Index | Thread Index | Old Index