Bump bundled mupdf to 1.28.6, matching the submodule pin of 0.8.1. Drop the empty-document patch: the fixes are in 0.8.1 upstream. Disable the new WITH_MICROTEX option; its submodules are not vendored. Assisted-by: Claude:claude-sonnet-5-5 Signed-off-by: Zakk <zakk@gentoozh.org>
102 lines
3.0 KiB
Bash
102 lines
3.0 KiB
Bash
# Copyright 2025-2026 Gentoo Authors
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
EAPI=8
|
|
|
|
inherit cmake optfeature xdg
|
|
|
|
MUPDF_PV="1.28.6"
|
|
SYNCTEX_COMMIT="917617707955cde0c2fae127130d9d3129303cbc"
|
|
|
|
DESCRIPTION="High-performance PDF reader that prioritizes screen space and control"
|
|
HOMEPAGE="https://github.com/dheerajshenoy/lektra"
|
|
SRC_URI="
|
|
https://github.com/dheerajshenoy/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
|
|
https://mupdf.com/downloads/archive/mupdf-${MUPDF_PV}-source.tar.gz
|
|
synctex? (
|
|
https://github.com/jlaurens/synctex/archive/${SYNCTEX_COMMIT}.tar.gz
|
|
-> ${PN}-synctex-${SYNCTEX_COMMIT}.tar.gz
|
|
)
|
|
"
|
|
|
|
# lektra is AGPL-3; the bundled synctex parser is MIT.
|
|
LICENSE="AGPL-3 synctex? ( MIT )"
|
|
SLOT="0"
|
|
KEYWORDS="~amd64 ~arm64"
|
|
IUSE="synctex"
|
|
|
|
# mupdf and, with synctex, the synctex parser are git submodules absent
|
|
# from the release tarball; both are vendored via SRC_URI. mupdf is built
|
|
# by the project's ExternalProject step through its own Makefile.
|
|
DEPEND="
|
|
dev-qt/qtbase:6[concurrent,gui,network,opengl,widgets]
|
|
dev-qt/qtsvg:6
|
|
virtual/zlib:=
|
|
"
|
|
RDEPEND="${DEPEND}"
|
|
BDEPEND="
|
|
dev-build/cmake
|
|
dev-qt/qttools:6[linguist]
|
|
"
|
|
|
|
PATCHES=(
|
|
"${FILESDIR}/${PN}-0.8.0-build-fixes.patch"
|
|
)
|
|
|
|
src_prepare() {
|
|
# The release tarball ships empty thirdparty/mupdf and thirdparty/synctex
|
|
# submodule directories; populate them from the vendored sources.
|
|
rmdir "${S}/thirdparty/mupdf" || die
|
|
mv "${WORKDIR}/mupdf-${MUPDF_PV}-source" "${S}/thirdparty/mupdf" || die
|
|
|
|
if use synctex; then
|
|
rmdir "${S}/thirdparty/synctex" || die
|
|
mv "${WORKDIR}/synctex-${SYNCTEX_COMMIT}" "${S}/thirdparty/synctex" || die
|
|
fi
|
|
|
|
# CMake 4 dropped compatibility with cmake_minimum_required() < 3.5.
|
|
# mupdf's bundled thirdparty CMake projects (zlib, freetype, freeglut,
|
|
# curl, ...) declare older minimums. They build through mupdf's Makefile,
|
|
# not CMake, but cmake.eclass still scans the tree and, on finding them,
|
|
# applies a policy workaround that trips the overlay elog gate as a QA
|
|
# notice. Raise every bundled minimum so the scan finds none.
|
|
find "${S}/thirdparty/mupdf" -name CMakeLists.txt -exec sed -i -E \
|
|
-e 's/^(\s*cmake_minimum_required\s*\(\s*VERSION\s+)[0-9.]+/\13.15/I' {} + || die
|
|
|
|
cmake_src_prepare
|
|
}
|
|
|
|
src_configure() {
|
|
local mycmakeargs=(
|
|
-DWITH_SYNCTEX=$(usex synctex ON OFF)
|
|
-DWITH_CCACHE=OFF
|
|
-DWITH_FONTCONFIG=OFF
|
|
-DWITH_LIBARCHIVE=OFF
|
|
-DWITH_LLD=OFF
|
|
-DWITH_LUA=OFF
|
|
-DWITH_MICROTEX=OFF
|
|
-DWITH_LLM_SUPPORT=OFF
|
|
)
|
|
cmake_src_configure
|
|
}
|
|
|
|
src_install() {
|
|
cmake_src_install
|
|
|
|
# Upstream installs docs to /usr/share/doc/lektra,
|
|
# but Gentoo requires /usr/share/doc/${PF}.
|
|
if [[ -d "${ED}/usr/share/doc/${PN}" && "${PN}" != "${PF}" ]]; then
|
|
mv "${ED}/usr/share/doc/${PN}"/* "${ED}/usr/share/doc/${PF}/" || die
|
|
rmdir "${ED}/usr/share/doc/${PN}" || die
|
|
fi
|
|
}
|
|
|
|
pkg_postinst() {
|
|
xdg_pkg_postinst
|
|
|
|
optfeature "SVG rendering" "gnome-base/librsvg x11-libs/cairo"
|
|
optfeature "DjVu documents" app-text/djvu
|
|
optfeature "EXIF metadata" media-libs/libexif
|
|
optfeature "JPEG XL images" media-libs/libjxl
|
|
}
|