Сравнение inchi-1.06-r1 с inchi-1.07.5

/usr/portage/sci-libs/inchi/inchi-1.07.5.ebuild 2026-07-11 20:03:06.457002567 +0300
1
# Copyright 1999-2023 Gentoo Authors
1
# Copyright 1999-2026 Gentoo Authors
2 2
# Distributed under the terms of the GNU General Public License v2
3 3

  
4 4
EAPI=8
5 5

  
6
inherit flag-o-matic toolchain-funcs
6
PYTHON_COMPAT=( python3_{12..15} )
7
inherit cmake flag-o-matic python-any-r1
7 8

  
8 9
DESCRIPTION="Program and library for generating standard and non-standard InChI and InChIKeys"
9 10
HOMEPAGE="https://www.iupac.org/inchi/"
10
SRC_URI="
11
	https://www.inchi-trust.org/download/${PV//.}/INCHI-1-SRC.zip -> ${P}.zip
12
	doc? ( https://www.inchi-trust.org/download/${PV//.}/INCHI-1-DOC.zip -> ${P}-doc.zip )
13
"
14
S="${WORKDIR}/INCHI-1-SRC"
11
SRC_URI="https://github.com/IUPAC-InChI/InChI/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
12
S="${WORKDIR}/InChI-${PV}"
15 13

  
16 14
LICENSE="IUPAC-InChi"
17 15
SLOT="0"
18
KEYWORDS="amd64 arm ~ppc ppc64 ~x86"
19
IUSE="doc"
16
KEYWORDS="amd64 ~arm ~ppc ppc64 ~x86"
17
IUSE="test"
18
RESTRICT="!test? ( test )"
19

  
20
DEPEND="test? ( dev-cpp/gtest )"
21
BDEPEND="
22
	test? (
23
		${PYTHON_DEPS}
24
		$(python_gen_any_dep '
25
			dev-python/pytest[${PYTHON_USEDEP}]
26
		')
27
	)
28
"
20 29

  
21
BDEPEND="app-arch/unzip"
30
PATCHES=(
31
	"${FILESDIR}"/${PN}-1.07.5-flags.patch
32
	"${FILESDIR}"/${PN}-1.07.5-unbundle_gtest.patch
33
)
22 34

  
23
src_compile() {
24
	local common_opts target_opts
35
python_check_deps() {
36
	python_has_version -b "dev-python/pytest[${PYTHON_USEDEP}]"
37
}
25 38

  
26
	append-cflags \${P_INCL} -ansi -DCOMPILE_ANSI_ONLY -fPIC -c
27
	append-cxxflags \${P_INCL} -ansi -frtti -c
28

  
29
	common_opts=(
30
			C_COMPILER="$(tc-getCC)"
31
			CPP_COMPILER="$(tc-getCXX)"
32
			AR="$(tc-getAR)"
33
			RANLIB="$(tc-getRANLIB)"
34
			LINKER="$(tc-getCXX)"
35
			SHARED_LINK="$(tc-getCC)"
36
			SHARED_LINK_PARM="${LDFLAGS} -shared "
37
			ISLINUX=1
38
	)
39
pkg_setup() {
40
	use test && python-any-r1_pkg_setup
41
}
39 42

  
40
	# Compile the library
41
	target_opts=(
42
		LINKER_OPTIONS="${LDFLAGS} "
43
		C_OPTIONS="${CFLAGS} -DTARGET_API_LIB -D_LIB -D_XOPEN_SOURCE=500 " #874696
44
		CPP_OPTIONS="${CXXFLAGS} -DTARGET_API_LIB  -D_LIB "
45
		CREATE_MAIN=
46
	)
47
	emake -C INCHI_API/libinchi/gcc "${common_opts[@]}" "${target_opts[@]}"
43
src_prepare() {
44
	cmake_src_prepare
45
	if use test; then
46
		sed -e '/INCHI_LIB_PATH = (/,/)/s|"[^"]*"|"'"${BUILD_DIR}"'/INCHI-1-SRC/INCHI_API/libinchi/src/lib/libinchi.so"|' \
47
			-i INCHI-1-TEST/tests/test_library/test_multithreading.py || die
48
	else
49
		cmake_comment_add_subdirectory INCHI-1-TEST/tests/test_unit
50
	fi
51
}
48 52

  
49
	pushd "INCHI_API/bin/Linux" || die
50
	ln -s libinchi.so.1 libinchi.so || die
51
	popd > /dev/null || die
52

  
53
	# Compile the executable
54
	target_opts=(
55
		LINKER_OPTIONS="${LDFLAGS} -L${S}/INCHI_API/bin/Linux -linchi "
56
		C_COMPILER_OPTIONS="${CFLAGS} -DTARGET_EXE_STANDALONE "
57
		CPP_COMPILER_OPTIONS="${CXXFLAGS}  -DTARGET_EXE_STANDALONE "
58
		CREATE_MAIN=
59
	)
60
	emake -C INCHI_EXE/inchi-1/gcc "${common_opts[@]}" "${target_opts[@]}"
53
src_configure() {
54
		# gtest-1.17 requires at least C++17
55
		use test && append-cxxflags -std=gnu++17
56
		cmake_src_configure
57
}
58

  
59
src_test() {
60
	BUILD_DIR="${BUILD_DIR}/INCHI-1-TEST/tests/test_unit/" cmake_src_test
61 61

  
62
	local -x PYTHONPATH="${S}/INCHI-1-TEST/src"
63
	EPYTEST_IGNORE=(
64
		INCHI-1-TEST/tests/test_meta/test_performance.py # timeout
65
		INCHI-1-TEST/tests/test_meta/test_permutation.py # missing rdkit
66
		INCHI-1-TEST/tests/test_meta/test_drivers.py # needs pydantic
67
	)
68
	epytest . INCHI-1-TEST/tests/test_executable --exe-path="${BUILD_DIR}"/INCHI-1-SRC/INCHI_EXE/inchi-1/src/bin/inchi-1
69
	"${EPYTHON}" INCHI-1-TEST/tests/test_library/test_multithreading.py 1>/dev/null
70
	# this test is very verbose
71
	if [[ $? -eq 0 ]]; then
72
		einfo "test_library/test_multithreading.py PASSED"
73
	else
74
		die "test_library/test_multithreading.py FAILED"
75
	fi
62 76
}
63 77

  
64 78
src_install() {
65
	dodoc readme*.txt
66
	if use doc ; then
67
		pushd "${WORKDIR}/INCHI-1-DOC" || die
68
		docinto doc
69
		dodoc *.pdf readme.txt
70
		popd || die
71
	fi
72
	dobin "${S}/INCHI_EXE/bin/Linux/inchi-1"
73
	dolib.so "${S}/INCHI_API/bin/Linux/"lib*so*
74
	doheader "${S}/INCHI_BASE/src/"{inchi_api,ixa}.h
79
	# no INSTALL in cmake files
80
	dodoc INCHI-1-SRC/readme.txt INCHI-1-DOC/{readme.txt,*.pdf}
81
	dobin "${BUILD_DIR}"/INCHI-1-SRC/INCHI_EXE/inchi-1/src/bin/inchi-1
82
	dolib.so "${BUILD_DIR}"/INCHI-1-SRC/INCHI_API/libinchi/src/lib/libinchi.so
83
	dosym libinchi.so /usr/$(get_libdir)/libinchi.so.${PV}
84
	dosym libinchi.so /usr/$(get_libdir)/libinchi.so.$(ver_cut 1)
85
	doheader "${S}/INCHI-1-SRC/INCHI_BASE/src/"{inchi_api,ixa}.h
75 86
}
Спасибо!