diff --git a/app-text/mupdf/files/mupdf-1.21.1-no-drm.patch b/app-text/mupdf/files/mupdf-1.21.1-no-drm.patch new file mode 100644 index 0000000000000..356ee4b852dd1 --- /dev/null +++ b/app-text/mupdf/files/mupdf-1.21.1-no-drm.patch @@ -0,0 +1,18 @@ +diff --git a/source/html/epub-doc.c b/source/html/epub-doc.c +index f764242..83888dc 100644 +--- a/source/html/epub-doc.c ++++ b/source/html/epub-doc.c +@@ -692,10 +692,12 @@ epub_parse_header(fz_context *ctx, epub_document *doc) + epub_chapter **tailp; + int i; + ++ #ifdef drm + if (fz_has_archive_entry(ctx, zip, "META-INF/rights.xml")) + fz_throw(ctx, FZ_ERROR_GENERIC, "EPUB is locked by DRM"); + if (fz_has_archive_entry(ctx, zip, "META-INF/encryption.xml")) + fz_throw(ctx, FZ_ERROR_GENERIC, "EPUB is locked by DRM"); ++ #endif + + fz_var(buf); + fz_var(container_xml); + diff --git a/app-text/mupdf/metadata.xml b/app-text/mupdf/metadata.xml index 5d2f87cc3174f..c0d61774dbcf9 100644 --- a/app-text/mupdf/metadata.xml +++ b/app-text/mupdf/metadata.xml @@ -9,4 +9,7 @@ proxy-maint@gentoo.org Proxy Maintainers + + Enable support for Digital rights management (DRM) + diff --git a/app-text/mupdf/mupdf-1.21.1.ebuild b/app-text/mupdf/mupdf-1.21.1.ebuild index 87efa898ece6b..5b4674fadf250 100644 --- a/app-text/mupdf/mupdf-1.21.1.ebuild +++ b/app-text/mupdf/mupdf-1.21.1.ebuild @@ -16,7 +16,7 @@ S="${WORKDIR}"/${P}-source LICENSE="AGPL-3" SLOT="0/${PV}" KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~ppc ~ppc64 ~riscv ~s390 ~x86" -IUSE="+javascript opengl ssl X" +IUSE="+drm +javascript opengl ssl X" REQUIRED_USE="opengl? ( javascript )" # Although we use the bundled, patched version of freeglut in mupdf (because of @@ -52,6 +52,7 @@ PATCHES=( "${FILESDIR}"/${PN}-1.15-openssl-x11.patch # General cross fixes from Debian (refreshed) "${FILESDIR}"/${PN}-1.19.0-cross-fixes.patch + "${FILESDIR}"/$P-no-drm.patch ) src_prepare() { @@ -59,6 +60,8 @@ src_prepare() { use hppa && append-cflags -ffunction-sections + use drm && append-cflags -Ddrm + append-cflags "-DFZ_ENABLE_JS=$(usex javascript 1 0)" sed -e "1iOS = Linux" \