<div dir="ltr"><div>Aaron,</div><div><br></div><div>Your patch fails to apply against the head of SVN for me, with this error:<br><br> @ patch -p1 < ../aaron-rainbolt.patch<br>patching file bindings/swig/oldmake/Makefile.am<br>Hunk #1 FAILED at 76.<br>1 out of 1 hunk FAILED -- saving rejects to file bindings/swig/oldmake/Makefile.am.rej<br>patching file bindings/swig/package/Makefile.am<br>Hunk #1 FAILED at 84.<br>1 out of 1 hunk FAILED -- saving rejects to file bindings/swig/package/Makefile.am.rej<br>can't find file to patch at input line 35<br>Perhaps you used the wrong -p or --strip option?<br>The text leading up to this was:<br>--------------------------<br>|diff --git a/bindings/swig/package/Makefile.in<br>|b/bindings/swig/package/Makefile.in<br>|index b5f05c9..370a9e7 100644<br>|--- a/bindings/swig/package/Makefile.in<br>|+++ b/bindings/swig/package/Makefile.in<br>--------------------------<br>File to patch:</div><div><br></div><div>Furthermore, it looks like you are patching the autotools build system, which is not supported in the Python and Perl bindings. Those are only supported building through the CMake files. At least, they aren't supported by me as I don't go near autotools, and last I knew I was the only one working in the Swig bindings.</div><div><br></div><div>I don't know why your patch is failing to apply, as I don't believe there should be any drift in those Makefiles. I'd be happy to try again if you have any advice as to why the patch is not applying.</div><div><br></div><div>--Greg<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Sep 28, 2023 at 11:53 AM Aaron Rainbolt <<a href="mailto:arraybolt3@gmail.com">arraybolt3@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Good morning/evening, and thanks for your time.<br>
<br>
As distutils has been deprecated and finally removed in Python 3.12, <br>
SWORD is unable to build in Fedora without the following patch. The patch:<br>
<br>
* Replaces all references to distutils with their setuptools equivalents.<br>
<br>
* Modifies the build system to allow specifying a new CMake argument, <br>
"SWORD_PYTHON_INSTALL_ROOT", which allows setting the installation path <br>
for the Python bindings without generating a Python egg. (This is <br>
necessary since Python eggs have been deprecated as well and will likely <br>
be removed later. See <a href="https://github.com/pypa/setuptools/issues/3143" rel="noreferrer" target="_blank">https://github.com/pypa/setuptools/issues/3143</a> - <br>
specifying both a --root and a --prefix to the setup.py scripts seems to <br>
work around this issue.)<br>
<br>
All contributions in this patch are made available to the SWORD Project <br>
under the terms of the GNU General Public License version 2.<br>
<br>
Thanks for your consideration, and have a blessed day!<br>
<br>
Aaron<br>
<br>
(P.S. - the reason this appears to be a Git patch is because I used Git <br>
to let me generate a multi-file patch more easily. I realize SWORD uses <br>
SVN, sorry if this looks confusing.)<br>
<br>
<br>
<br>
>From 07b31a74ea920077fa0d69cdab2ab188dd17b322 Mon Sep 17 00:00:00 2001<br>
From: Aaron Rainbolt <<a href="mailto:arraybolt3@gmail.com" target="_blank">arraybolt3@gmail.com</a>><br>
Date: Wed, 27 Sep 2023 10:51:27 -0600<br>
Subject: [PATCH] Migrate to setuptools<br>
<br>
---<br>
  bindings/swig/oldmake/Makefile.am   | 2 +-<br>
  bindings/swig/package/Makefile.am   | 3 +--<br>
  bindings/swig/package/Makefile.in   | 3 +--<br>
  bindings/swig/python/CMakeLists.txt | 7 +++++--<br>
  4 files changed, 8 insertions(+), 7 deletions(-)<br>
<br>
diff --git a/bindings/swig/oldmake/Makefile.am <br>
b/bindings/swig/oldmake/Makefile.am<br>
index 45a37ef..789813b 100644<br>
--- a/bindings/swig/oldmake/Makefile.am<br>
+++ b/bindings/swig/oldmake/Makefile.am<br>
@@ -76,7 +76,7 @@ python_makebuild: $(PYTHONSWIG)<br>
      echo "writing python/setup.py"<br>
      @echo "#! /usr/bin/python" > python/setup.py<br>
      @echo "" >> python/setup.py<br>
-    @echo "from distutils.core import setup, Extension" >> python/setup.py<br>
+    @echo "from setuptools import setup, Extension" >> python/setup.py<br>
      @echo "setup (name = \"sword\"," >> python/setup.py<br>
      @echo "    version = \"$(VERSION)\"," >> python/setup.py<br>
      @echo "    maintainer = \"Sword Developers\"," >> python/setup.py<br>
diff --git a/bindings/swig/package/Makefile.am <br>
b/bindings/swig/package/Makefile.am<br>
index 14500c3..f44974d 100644<br>
--- a/bindings/swig/package/Makefile.am<br>
+++ b/bindings/swig/package/Makefile.am<br>
@@ -84,8 +84,7 @@ python_makebuild: $(PYTHONSWIG)<br>
      echo "writing python/setup.py"<br>
      @echo "#! /usr/bin/python" > python/setup.py<br>
      @echo "" >> python/setup.py<br>
-    @echo "from distutils.core import setup" >> python/setup.py<br>
-    @echo "from distutils.extension import Extension" >> python/setup.py<br>
+    @echo "from setuptools import setup, Extension" >> python/setup.py<br>
      @echo "import commands" >> python/setup.py<br>
      @echo "" >> python/setup.py<br>
      @echo "def pkgconfig(*packages, **kw):" >> python/setup.py<br>
diff --git a/bindings/swig/package/Makefile.in <br>
b/bindings/swig/package/Makefile.in<br>
index b5f05c9..370a9e7 100644<br>
--- a/bindings/swig/package/Makefile.in<br>
+++ b/bindings/swig/package/Makefile.in<br>
@@ -938,8 +938,7 @@ python_makebuild: $(PYTHONSWIG)<br>
      echo "writing python/setup.py"<br>
      @echo "#! /usr/bin/python" > python/setup.py<br>
      @echo "" >> python/setup.py<br>
-    @echo "from distutils.core import setup" >> python/setup.py<br>
-    @echo "from distutils.extension import Extension" >> python/setup.py<br>
+    @echo "from setuptools import setup, Extension" >> python/setup.py<br>
      @echo "import commands" >> python/setup.py<br>
      @echo "" >> python/setup.py<br>
      @echo "def pkgconfig(*packages, **kw):" >> python/setup.py<br>
diff --git a/bindings/swig/python/CMakeLists.txt <br>
b/bindings/swig/python/CMakeLists.txt<br>
index cbb4058..247bc79 100644<br>
--- a/bindings/swig/python/CMakeLists.txt<br>
+++ b/bindings/swig/python/CMakeLists.txt<br>
@@ -25,7 +25,7 @@ ENDIF(NOT PYTHONLIBS_FOUND)<br>
<br>
  SET(PY_SCRIPT "#!${PYTHON_EXECUTABLE}<br>
<br>
-from distutils.core import setup, Extension<br>
+from setuptools import setup, Extension<br>
  setup(<br>
      name='sword',<br>
      version='${SWORD_VERSION}',<br>
@@ -51,8 +51,11 @@ <br>
ADD_CUSTOM_TARGET(swordswig_python${SWORD_PYTHON_VERSION} ALL<br>
      WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")<br>
<br>
  # Allow user installation to custom directory<br>
+IF(NOT SWORD_PYTHON_INSTALL_ROOT STREQUAL "")<br>
+    SET(SETUP_ARGS "\"--root=${SWORD_PYTHON_INSTALL_ROOT}\"")<br>
+ENDIF(NOT SWORD_PYTHON_INSTALL_ROOT STREQUAL "")<br>
  IF(NOT SWORD_PYTHON_INSTALL_DIR STREQUAL "")<br>
-    SET(SETUP_ARGS "\"--prefix=${SWORD_PYTHON_INSTALL_DIR}\"")<br>
+    SET(SETUP_ARGS "${SETUP_ARGS}\"--prefix=${SWORD_PYTHON_INSTALL_DIR}\"")<br>
  ENDIF(NOT SWORD_PYTHON_INSTALL_DIR STREQUAL "")<br>
  CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/<a href="http://install.cmake.in" rel="noreferrer" target="_blank">install.cmake.in</a>"<br>
             "${CMAKE_CURRENT_BINARY_DIR}/install.cmake")<br>
-- <br>
2.41.0<br>
<br>
_______________________________________________<br>
sword-devel mailing list: <a href="mailto:sword-devel@crosswire.org" target="_blank">sword-devel@crosswire.org</a><br>
<a href="http://crosswire.org/mailman/listinfo/sword-devel" rel="noreferrer" target="_blank">http://crosswire.org/mailman/listinfo/sword-devel</a><br>
Instructions to unsubscribe/change your settings at above page<br>
</blockquote></div>