gentoo-ebuilds/media-libs/libiptcdata/libiptcdata-1.0.5-r1.ebuild
Matthew White f043a66074
media-libs/libiptcdata: add 1.0.5-r2 to fix compiling on Gentoo
Fix missing headers and libraries.

Compiling from inside the 'python' sub-directory doesn't set ${S} as
the top source directory, missing required headers and libraries.

[sam: Drop revbump.]

Closes: https://bugs.gentoo.org/936589
Closes: https://bugs.gentoo.org/941462
Package-Manager: portage-3.0.65-r1
Signed-off-by: Matthew White <mehw.is.me@inventati.org>
Closes: https://github.com/gentoo/gentoo/pull/38974
Signed-off-by: Sam James <sam@gentoo.org>
2024-10-14 02:02:38 +01:00

91 lines
2 KiB
Bash

# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{10..13} )
DISTUTILS_EXT=1
DISTUTILS_OPTIONAL=1
DISTUTILS_USE_PEP517=setuptools
inherit autotools distutils-r1
DESCRIPTION="Library for International Press Telecommunications Council (IPTC) metadata"
HOMEPAGE="https://github.com/ianw/libiptcdata https://libiptcdata.sourceforge.net/"
SRC_URI="https://github.com/ianw/${PN}/releases/download/release_1_0_5/${P}.tar.gz"
LICENSE="LGPL-2"
SLOT="0"
KEYWORDS="~alpha amd64 ~arm arm64 ~loong ppc ppc64 ~riscv sparc x86"
IUSE="doc examples nls python"
RDEPEND="
nls? ( virtual/libintl )
python? ( ${PYTHON_DEPS} )
"
DEPEND="${RDEPEND}"
BDEPEND="
dev-build/gtk-doc-am
virtual/pkgconfig
doc? ( >=dev-util/gtk-doc-1 )
nls? ( >=sys-devel/gettext-0.13.1 )
python? (
${DISTUTILS_DEPS}
${PYTHON_DEPS}
)
"
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
src_prepare() {
default
eautoreconf
if use python; then
cd python || die
# Bug #936589: compiling from inside the 'python' sub-directory
# might set that as the top source directory, and not ${S}, but
# "${S}/libiptcdata" is required to find headers and libraries.
# Symbolic linking "../libiptcdata" is a possible fix. Another
# way is adding in python/setup.py, under iptcdata's Extension,
# "include_dirs=['..']" and "library_dirs=['../libiptcdata']".
ln -s "../${PN}" . || die
distutils-r1_src_prepare
fi
}
src_configure () {
local myeconfargs=(
$(use_enable nls)
$(use_enable python)
$(use_enable doc gtk-doc)
)
econf "${myeconfargs[@]}"
if use python; then
cd python || die
distutils-r1_src_configure
fi
}
src_compile() {
default
if use python; then
cd python || die
distutils-r1_src_compile
fi
}
src_install () {
default
find "${D}" -name '*.la' -delete || die "failed to remove *.la files"
if use python; then
cd python || die
distutils-r1_src_install
fi
if use examples; then
dodoc python/README
dodoc -r python/examples
fi
}