dev-python/mupdf - 1.27.2 (4nykey)

Search

Install

Install this version:

emerge -a =dev-python/mupdf-1.27.2

If this version is masked, you can unmask it using the autounmask tool or standard emerge options:

autounmask =dev-python/mupdf-1.27.2

Or alternatively:

emerge --autounmask-write -a =dev-python/mupdf-1.27.2

Package Information

Description:
Python bindings for the MuPDF library
Homepage:
https://mupdf.com
License:
AGPL-3

Ebuild Details

Version EAPI Keywords Slot
1.27.2 8 ~amd64 0/1.27.2
View Raw Ebuild
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

PYTHON_COMPAT=( python3_{12..14} )
DISTUTILS_USE_PEP517=no
DISTUTILS_EXT=1
LLVM_COMPAT=( {18..21} )
inherit distutils-r1 llvm-r2

DESCRIPTION="Python bindings for the MuPDF library"
HOMEPAGE="https://mupdf.com"
SRC_URI="https://mupdf.com/downloads/archive/${P}-source.tar.gz"
S="${WORKDIR}/${P}-source"

LICENSE="AGPL-3"
SLOT="0/${PV}"
KEYWORDS="~amd64"

DEPEND="
	~app-text/mupdf-${PV}
"
RDEPEND="
	${DEPEND}
"
BDEPEND="
	$(llvm_gen_dep '
		llvm-core/clang:${LLVM_SLOT}
	')
	dev-python/clang[${PYTHON_USEDEP}]
	dev-lang/swig
"
PATCHES=(
	"${FILESDIR}"/python.diff
)
distutils_enable_tests pytest

_buildpy() {
	"${EPYTHON}" ./scripts/mupdfwrap.py \
		--dir-so "build/shared-release-${EPYTHON}" "${@}" || die
}

python_compile() {
	_buildpy --build 23
}

src_compile() {
	# libmupdfcpp
	LD_LIBRARY_PATH="$(get_llvm_prefix)/$(get_libdir)" \
	tc-env_build ./scripts/mupdfwrap.py \
			--dir-so "build/shared-release" \
			--build 01 \
			|| die
	mv build/shared-release/libmupdfcpp.so{,.${PV}} .
	# _mupdf.so
	distutils-r1_src_compile
}

python_test() {
	local -x LD_LIBRARY_PATH="${S}"
	_buildpy --test-python
}

python_install() {
	python_domodule \
		build/shared-release-${EPYTHON}/{_mupdf.so,mupdf.py}
}

python_install_all() {
	dolib.so libmupdfcpp.so*
	doheader -r platform/c++/include/mupdf
}

Inherited Eclasses

Dependencies

DEPEND

	~app-text/mupdf-1.27.2

RDEPEND

	
	~app-text/mupdf-1.27.2

BDEPEND

	$(llvm_gen_dep '
		llvm-core/clang:${LLVM_SLOT}
	')
	dev-python/clang[${PYTHON_USEDEP}]
	dev-lang/swig

Manifest for 1.27.2

Type File Size Source URLs
DIST mupdf-1.27.2-source.tar.gz 66968384 bytes https://mupdf.com/downloads/archive/mupdf-1.27.2-source.tar.gz