[packages/inchi] Up to 1.07.5

arekm arekm at pld-linux.org
Sat Nov 28 21:47:27 CET 2026


commit 90307897a2fe1c4d1690cd6017eaf09e5f57ef33
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Fri Nov 27 17:41:31 2026 +0100

    Up to 1.07.5

 inchi-rpm.patch | 219 +++++++++++++++-----------------------------------------
 inchi.spec      |  89 +++++++++--------------
 2 files changed, 91 insertions(+), 217 deletions(-)
---
diff --git a/inchi.spec b/inchi.spec
index e9578b3..b8c4bc2 100644
--- a/inchi.spec
+++ b/inchi.spec
@@ -2,27 +2,22 @@
 # Conditional build:
 %bcond_without	tests		# build without tests
 
-%define inchi_so_ver 1.05.00
-%define url_ver 105
+%define inchi_so_ver 1.07
 Summary:	The IUPAC International Chemical Identifier library
 Summary(pl.UTF-8):	Biblioteka międzynarodowych identyfikatorów chemicznych IUPAC
 Name:		inchi
-Version:	1.05
-Release:	2
-License:	LGPL v2+
+Version:	1.07.5
+Release:	1
+License:	MIT
 Group:		Libraries
-#Source0Download: http://www.inchi-trust.org/downloads/
-Source0:	http://www.inchi-trust.org/download/%{url_ver}/INCHI-1-SRC.zip
-# Source0-md5:	ccc497c7e6ced1521a6953d859e49af4
-Source1:	http://www.inchi-trust.org/download/%{url_ver}/INCHI-1-DOC.zip
-# Source1-md5:	7e40a7f8c0048dc2c63fd5a590a256df
-Source2:	http://www.inchi-trust.org/download/%{url_ver}/INCHI-1-TEST.zip
-# Source2-md5:	96800539d586f115b47baf245a8abdf3
+Source0:	https://github.com/IUPAC-InChI/InChI/archive/v%{version}/InChI-%{version}.tar.gz
+# Source0-md5:	29fbb28ab61a21346d2349b63ab6de05
 Patch0:		%{name}-rpm.patch
-URL:		http://www.inchi-trust.org/
-BuildRequires:	dos2unix
-BuildRequires:	sed >= 4.0
-BuildRequires:	unzip
+URL:		https://www.inchi-trust.org/
+BuildRequires:	cmake >= 3.21
+%if %{with tests}
+BuildRequires:	python3-pytest
+%endif
 Requires:	%{name}-libs = %{version}-%{release}
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -97,52 +92,38 @@ Ten pakiet zawiera dokumentację użytkownika do oprogramowania InChI
 oraz dokumentację API biblioteki InChI dla programistów.
 
 %prep
-%setup -q -n INCHI-1-SRC -a 1 -a 2
+%setup -q -n InChI-%{version}
 %patch -P0 -p1
 
-for file in LICENCE readme.txt ; do
-	dos2unix -k $file
-done
+%build
+%cmake -S INCHI-1-SRC/INCHI_API/demos/mol2inchi/src -B build-lib
 
-cd INCHI-1-TEST/test
-unzip -d reference -qq -a InChI_TestSet-result.zip
-for file in reference/its-*.txt ; do
-	dos2unix $file
-done
-%{__sed} -i -e 's,./inchi-1,../../INCHI_EXE/bin/Linux/inchi-1,g' TestSet2InChI.sh
+%{__make} -C build-lib
 
-%build
-for project in libinchi demos/inchi_main demos/mol2inchi ; do
-%{__make} -C INCHI_API/${project}/gcc \
-	ISLINUX=1 \
-	CC="%{__cc}" \
-	OPTFLAGS="%{rpmcflags}"
-done
-
-%{__make} -C INCHI_EXE/inchi-1/gcc \
-	C_COMPILER="%{__cc}" \
-	LINKER="%{__cc}" \
-	OPTFLAGS="%{rpmcflags}"
+%cmake -S INCHI-1-SRC/INCHI_EXE/inchi-1/src -B build-exe
+
+%{__make} -C build-exe
 
 %if %{with tests}
-export LD_LIBRARY_PATH=$(pwd)/INCHI_API/bin/Linux
-cd INCHI-1-TEST/test
-sh ./TestSet2InChI.sh
-for t in its-*.txt; do
-	cmp $t reference/$t
-done
+# test_io needs rdkit, which PLD does not ship
+cd INCHI-1-TEST
+PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
+PYTHONPATH=$(pwd)/src:$(pwd)/tests/test_executable \
+%{__python3} -m pytest tests/test_executable \
+	--ignore=tests/test_executable/test_io.py \
+	--exe-path=$(pwd)/../build-exe/bin/inchi-1
 %endif
 
 %install
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir},%{_includedir}/inchi}
 
-install -p INCHI_EXE/bin/Linux/inchi-1 $RPM_BUILD_ROOT%{_bindir}
-install -p INCHI_API/bin/Linux/mol2inchi $RPM_BUILD_ROOT%{_bindir}
-install -p INCHI_API/bin/Linux/libinchi.so.%{inchi_so_ver} $RPM_BUILD_ROOT%{_libdir}
-ln -s libinchi.so.%{inchi_so_ver} $RPM_BUILD_ROOT%{_libdir}/libinchi.so.1
-ln -s libinchi.so.1 $RPM_BUILD_ROOT%{_libdir}/libinchi.so
-cp -p INCHI_BASE/src/{inchi_api,ixa}.h $RPM_BUILD_ROOT%{_includedir}/inchi
+install -p build-exe/bin/inchi-1 $RPM_BUILD_ROOT%{_bindir}
+install -p build-lib/bin/mol2inchi $RPM_BUILD_ROOT%{_bindir}
+install -p build-lib/bin/libinchi.so.%{version} $RPM_BUILD_ROOT%{_libdir}
+ln -s libinchi.so.%{version} $RPM_BUILD_ROOT%{_libdir}/libinchi.so.%{inchi_so_ver}
+ln -s libinchi.so.%{inchi_so_ver} $RPM_BUILD_ROOT%{_libdir}/libinchi.so
+cp -p INCHI-1-SRC/INCHI_BASE/src/{inchi_api,ixa}.h $RPM_BUILD_ROOT%{_includedir}/inchi
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -157,13 +138,13 @@ rm -rf $RPM_BUILD_ROOT
 
 %files libs
 %defattr(644,root,root,755)
-%doc LICENCE readme.txt
-%attr(755,root,root) %{_libdir}/libinchi.so.*.*.*
-%attr(755,root,root) %ghost %{_libdir}/libinchi.so.1
+%doc LICENSE INCHI-1-SRC/readme.txt
+%{_libdir}/libinchi.so.%{version}
+%ghost %{_libdir}/libinchi.so.%{inchi_so_ver}
 
 %files devel
 %defattr(644,root,root,755)
-%attr(755,root,root) %{_libdir}/libinchi.so
+%{_libdir}/libinchi.so
 %{_includedir}/inchi
 
 %files doc
diff --git a/inchi-rpm.patch b/inchi-rpm.patch
index d7445f6..6d68277 100644
--- a/inchi-rpm.patch
+++ b/inchi-rpm.patch
@@ -1,163 +1,56 @@
---- INCHI-1-SRC/INCHI_API/libinchi/gcc/makefile.orig	2017-06-21 19:51:24.162061661 +0200
-+++ INCHI-1-SRC/INCHI_API/libinchi/gcc/makefile	2017-06-21 19:53:20.892060327 +0200
-@@ -38,14 +38,14 @@
- API_CALLER_PATHNAME = $(LIB_DIR)/$(API_CALLER_NAME)
- # === Linker to create (Shared) InChI library ====
- ifndef SHARED_LINK
--  SHARED_LINK = gcc -shared
-+  SHARED_LINK = $(CC) -shared
- endif
- # === Linker to create Main program =====
- ifndef LINKER
-   ifdef ISLINUX
--	 LINKER_CWD_PATH = -Wl,-R,""
-+	 LINKER_CWD_PATH =
-   endif
--  LINKER = gcc -s $(LINKER_CWD_PATH)
-+  LINKER = $(CC) $(LINKER_CWD_PATH)
- endif
- ifndef P_LIBR
- 	P_LIBR = ../../libinchi/src/
-@@ -65,14 +65,14 @@
- endif
- # === C Compiler ===============
- ifndef C_COMPILER
--  C_COMPILER = gcc
-+  C_COMPILER = $(CC)
- endif
- # === C Compiler Options =======
- ifndef C_OPTIONS
-   ifndef CALLER_IS_MOL2INCHI
--	C_OPTIONS = -ansi -O3 -c
-+	C_OPTIONS = -ansi $(OPTFLAGS) -c
-   else
--	C_OPTIONS = -O3 -c  
-+	C_OPTIONS = $(OPTFLAGS) -c  
-   endif
-   ifdef ISLINUX
- 	ifndef C_SO_OPTIONS
---- INCHI-1-SRC/INCHI_API/demos/inchi_main/gcc/makefile.orig	2017-01-17 14:40:34.000000000 +0100
-+++ INCHI-1-SRC/INCHI_API/demos/inchi_main/gcc/makefile	2017-06-21 21:00:25.642014371 +0200
-@@ -30,22 +30,22 @@
- # === Main program name ====
- ifndef API_CALLER_NAME
-   ifndef CALLER_IS_MOL2INCHI 
--  API_CALLER_NAME = inchi_main$
-+  API_CALLER_NAME = inchi_main
-   else
--  API_CALLER_NAME = mol2inchi$
-+  API_CALLER_NAME = mol2inchi
-   endif
- endif
- API_CALLER_PATHNAME = $(LIB_DIR)/$(API_CALLER_NAME)
- # === Linker to create (Shared) InChI library ====
- ifndef SHARED_LINK
--  SHARED_LINK = gcc -shared
-+  SHARED_LINK = $(CC) -shared
- endif
- # === Linker to create Main program =====
- ifndef LINKER
-   ifdef ISLINUX
--	 LINKER_CWD_PATH = -Wl,-R,""
-+	 LINKER_CWD_PATH =
-   endif
--  LINKER = gcc -s $(LINKER_CWD_PATH)
-+  LINKER = $(CC) $(LINKER_CWD_PATH)
- endif
- ifndef P_LIBR
- 	P_LIBR = ../../../libinchi/src/
-@@ -65,14 +65,14 @@
- endif
- # === C Compiler ===============
- ifndef C_COMPILER
--  C_COMPILER = gcc
-+  C_COMPILER = $(CC)
- endif
- # === C Compiler Options =======
- ifndef C_OPTIONS
-   ifndef CALLER_IS_MOL2INCHI
--	C_OPTIONS = -ansi -O3 -c
-+	C_OPTIONS = -ansi $(OPTFLAGS) -c
-   else
--	C_OPTIONS = -O3 -c  
-+	C_OPTIONS = $(OPTFLAGS) -c  
-   endif
-   ifdef ISLINUX
- 	ifndef C_SO_OPTIONS
---- INCHI-1-SRC/INCHI_API/demos/mol2inchi/gcc/makefile.orig	2017-01-17 14:40:34.000000000 +0100
-+++ INCHI-1-SRC/INCHI_API/demos/mol2inchi/gcc/makefile	2017-06-21 21:01:20.392013745 +0200
-@@ -30,22 +30,22 @@
- # === Main program name ====
- ifndef API_CALLER_NAME
-   ifndef CALLER_IS_MOL2INCHI 
--  API_CALLER_NAME = inchi_main$
-+  API_CALLER_NAME = inchi_main
-   else
--  API_CALLER_NAME = mol2inchi$
-+  API_CALLER_NAME = mol2inchi
-   endif
- endif
- API_CALLER_PATHNAME = $(LIB_DIR)/$(API_CALLER_NAME)
- # === Linker to create (Shared) InChI library ====
- ifndef SHARED_LINK
--  SHARED_LINK = gcc -shared
-+  SHARED_LINK = $(CC) -shared
- endif
- # === Linker to create Main program =====
- ifndef LINKER
-   ifdef ISLINUX
--	 LINKER_CWD_PATH = -Wl,-R,""
-+	 LINKER_CWD_PATH =
-   endif
--  LINKER = gcc -s $(LINKER_CWD_PATH)
-+  LINKER = $(CC) $(LINKER_CWD_PATH)
- endif
- ifndef P_LIBR
- 	P_LIBR = ../../../libinchi/src/
-@@ -65,14 +65,14 @@
- endif
- # === C Compiler ===============
- ifndef C_COMPILER
--  C_COMPILER = gcc
-+  C_COMPILER = $(CC)
- endif
- # === C Compiler Options =======
- ifndef C_OPTIONS
-   ifndef CALLER_IS_MOL2INCHI
--	C_OPTIONS = -ansi -O3 -c
-+	C_OPTIONS = -ansi $(OPTFLAGS) -c
-   else
--	C_OPTIONS = -O3 -c
-+	C_OPTIONS = $(OPTFLAGS) -c
-   endif
-   ifdef ISLINUX
- 	ifndef C_SO_OPTIONS
---- INCHI-1-SRC/INCHI_EXE/inchi-1/gcc/makefile.orig	2016-09-08 19:08:16.000000000 +0200
-+++ INCHI-1-SRC/INCHI_EXE/inchi-1/gcc/makefile	2017-06-22 16:03:35.017897870 +0200
-@@ -13,7 +13,7 @@
- 	CPP_COMPILER = g++
- endif
- ifndef LINKER
--	LINKER = g++ -s
-+	LINKER = $(C_COMPILER)
- endif
- ifndef INCHI_EXECUTABLE_NAME
- 	ifdef windir
-@@ -36,14 +36,14 @@
- endif
- #P_INCL = -I$(P_MAIN) -I$(P_BASE)
- P_INCL = -I$(P_MAIN) -I$(P_BASE)
--C_COMPILER_OPTIONS = $(P_INCL) -ansi -DCOMPILE_ANSI_ONLY -DTARGET_EXE_STANDALONE -O3 -c
-+C_COMPILER_OPTIONS = $(P_INCL) -ansi -DCOMPILE_ANSI_ONLY -DTARGET_EXE_STANDALONE $(OPTLAGS) -c
- #C_COMPILER_OPTIONS = -c $(P_INCL) -ansi -O3 -fsigned-char -ffunction-sections -fexpensive-optimizations -fstack-check -fexceptions -Wall -pedantic -Wbad-function-cast -Wreturn-type -Wformat -Wuninitialized -Wcast-align -Wshadow -Wunused -Wunused-value -Wunused-variable -Wunused-function -Wunused-parameter -Wunused-label -Wcomment -Wcast-qual -Wconversion -Wimplicit-int -Wmissing-braces -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wsign-compare -Wfloat-equal -Wstrict-prototypes -Wwrite-strings -Wundef -Waggregate-return -Wchar-subscripts -Wformat-nonliteral -Wnested-externs -Wsequence-point -Wpointer-arith -mfancy-math-387 -mieee-fp -mno-soft-float
- ifdef windir
- # no -ansi option due to reported MinGw bug
--	CPP_COMPILER_OPTIONS = $(P_INCL) -D_LIB -DTARGET_EXE_STANDALONE -O3 -frtti -c
-+	CPP_COMPILER_OPTIONS = $(P_INCL) -D_LIB -DTARGET_EXE_STANDALONE $(OPTLAGS) -frtti -c
- 	#CPP_COMPILER_OPTIONS = -c $(P_INCL) -D_LIB -O3 -frtti -Wall -pedantic -Wreturn-type -Wformat -Wuninitialized -ffunction-sections -fexpensive-optimizations -fstack-check -fexceptions -Wcast-align -Wshadow -Wunused -Wunused-value -Wunused-variable -Wunused-function -fsigned-char -Wcast-qual -Wconversion -Wmissing-braces -Wredundant-decls -Wsign-compare -Wfloat-equal -Wwrite-strings -mfancy-math-387 -mieee-fp -mno-soft-float
- else
--	CPP_COMPILER_OPTIONS = $(P_INCL) -D_LIB -DTARGET_EXE_STANDALONE -ansi -O3 -frtti -c
-+	CPP_COMPILER_OPTIONS = $(P_INCL) -D_LIB -DTARGET_EXE_STANDALONE -ansi $(OPTLAGS) -frtti -c
- 	#CPP_COMPILER_OPTIONS = -c $(P_INCL) -D_LIB -ansi -O3 -frtti -Wall -pedantic -Wreturn-type -Wformat -Wuninitialized -ffunction-sections -fexpensive-optimizations -fstack-check -fexceptions -Wcast-align -Wshadow -Wunused -Wunused-value -Wunused-variable -Wunused-function -fsigned-char -Wcast-qual -Wconversion -Wmissing-braces -Wredundant-decls -Wsign-compare -Wfloat-equal -Wwrite-strings -mfancy-math-387 -mieee-fp -mno-soft-float
- endif
- #LINKER_OPTIONS = -static-libgcc
+# upstream CMake hardcodes -O1 and -Wno-all over rpm flags, builds libinchi without a soname
+# and mixes plain and keyword target_link_libraries() for mol2inchi
+diff -urN a/INCHI-1-SRC/INCHI_API/demos/mol2inchi/src/CMakeLists.txt b/INCHI-1-SRC/INCHI_API/demos/mol2inchi/src/CMakeLists.txt
+--- a/INCHI-1-SRC/INCHI_API/demos/mol2inchi/src/CMakeLists.txt
++++ b/INCHI-1-SRC/INCHI_API/demos/mol2inchi/src/CMakeLists.txt
+@@ -8,7 +8,7 @@
+ set(gcc_like_cxx "$<COMPILE_LANG_AND_ID:C,ARMClang,AppleClang,Clang,GNU,LCC>")
+ set(msvc_cxx "$<COMPILE_LANG_AND_ID:C,MSVC>")
+ target_compile_options(mol2inchi_compiler_flags INTERFACE
+-	"$<${gcc_like_cxx}:$<BUILD_INTERFACE:-g;-O1;-c;-fno-strict-aliasing;-Wno-all>>"
++	"$<${gcc_like_cxx}:$<BUILD_INTERFACE:-fno-strict-aliasing>>"
+ 	"$<${msvc_cxx}:$<BUILD_INTERFACE:-W3;-MT;-O2>>"
+ )
+ 
+@@ -70,7 +70,7 @@
+ 	set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
+ 	set(THREADS_PREFER_PTHREAD_FLAG TRUE)
+ 	find_package(Threads REQUIRED)
+-	target_link_libraries(mol2inchi Threads::Threads)
++	target_link_libraries(mol2inchi PUBLIC Threads::Threads)
+ 	add_custom_command(TARGET mol2inchi POST_BUILD
+ 		COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:libinchi> $<TARGET_FILE_DIR:mol2inchi>
+ 		COMMAND_EXPAND_LISTS
+diff -urN a/INCHI-1-SRC/INCHI_API/libinchi/src/CMakeLists.txt b/INCHI-1-SRC/INCHI_API/libinchi/src/CMakeLists.txt
+--- a/INCHI-1-SRC/INCHI_API/libinchi/src/CMakeLists.txt
++++ b/INCHI-1-SRC/INCHI_API/libinchi/src/CMakeLists.txt
+@@ -8,7 +8,7 @@
+ set(gcc_like_cxx "$<COMPILE_LANG_AND_ID:C,ARMClang,AppleClang,Clang,GNU,LCC>")
+ set(msvc_cxx "$<COMPILE_LANG_AND_ID:C,MSVC>")
+ target_compile_options(libinchi_compiler_flags INTERFACE
+-	"$<${gcc_like_cxx}:$<BUILD_INTERFACE:-g;-O1;-c;-fno-strict-aliasing;-Wno-all>>"
++	"$<${gcc_like_cxx}:$<BUILD_INTERFACE:-fno-strict-aliasing>>"
+ 	"$<${msvc_cxx}:$<BUILD_INTERFACE:-W3;-MT;-O2>>"
+ )
+ 
+@@ -162,7 +162,7 @@
+ string(REGEX REPLACE "/RTC(su|[1su])" "" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}")
+ string(REGEX REPLACE "/RTC(su|[1su])" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
+ 
+-set_target_properties(libinchi PROPERTIES PREFIX "")
++set_target_properties(libinchi PROPERTIES PREFIX "" VERSION 1.07.5 SOVERSION 1.07)
+ 
+ 
+ if(UNIX AND NOT APPLE)
+diff -urN a/INCHI-1-SRC/INCHI_EXE/inchi-1/src/CMakeLists.txt b/INCHI-1-SRC/INCHI_EXE/inchi-1/src/CMakeLists.txt
+--- a/INCHI-1-SRC/INCHI_EXE/inchi-1/src/CMakeLists.txt
++++ b/INCHI-1-SRC/INCHI_EXE/inchi-1/src/CMakeLists.txt
+@@ -8,7 +8,7 @@
+ set(gcc_like_cxx "$<COMPILE_LANG_AND_ID:C,ARMClang,AppleClang,Clang,GNU,LCC>")
+ set(msvc_cxx "$<COMPILE_LANG_AND_ID:C,MSVC>")
+ target_compile_options(inchi_compiler_flags INTERFACE
+-	"$<${gcc_like_cxx}:$<BUILD_INTERFACE:-g;-O1;-c;-fno-strict-aliasing;-Wno-all>>"
++	"$<${gcc_like_cxx}:$<BUILD_INTERFACE:-fno-strict-aliasing>>"
+ 	"$<${msvc_cxx}:$<BUILD_INTERFACE:-W3;-MT;-O2>>"
+ )
+ 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/inchi.git/commitdiff/90307897a2fe1c4d1690cd6017eaf09e5f57ef33



More information about the pld-cvs-commit mailing list