From 71680229154c0f2f1910c1fab20cddeb8f01c633 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20D=C3=A9saulniers?= Date: Mon, 29 Feb 2016 12:56:16 -0500 Subject: [PATCH 1/3] pip to uninstall python files --- configure.ac | 24 +++++++++++++++--------- python/Makefile.am | 9 +++++++-- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/configure.ac b/configure.ac index 869a4f30..ff604401 100644 --- a/configure.ac +++ b/configure.ac @@ -16,21 +16,27 @@ AM_PROG_AR dnl Check for Doxygen AC_ARG_ENABLE([doc], [AS_HELP_STRING([--disable-doc], [Disable documentation generation (doxygen)])]) AS_IF([test "x$enable_doc" != "xno"], [ - AC_CHECK_PROGS([DOXYGEN], [doxygen]) - AS_IF([test -z "$DOXYGEN"],[AC_MSG_WARN([Doxygen not found - continuing without Doxygen support])]) -]) + AC_CHECK_PROGS([DOXYGEN], [doxygen]) + AS_IF([test -z "$DOXYGEN"],[AC_MSG_WARN([Doxygen not found - continuing without Doxygen support])]) + ]) AM_CONDITIONAL([HAVE_DOXYGEN], [test -n "$DOXYGEN"]) dnl Check for Python AC_ARG_ENABLE([python], [AS_HELP_STRING([--disable-python], [Disble python binding])]) AS_IF([test "x$enable_python" != "xno"], [ - AM_PATH_PYTHON([3.3],, [:]) - AS_IF([test -n "$PYTHON"],[ - AC_CHECK_PROGS([CYTHON], [cython]) - AS_IF([test -z "$CYTHON"],[AC_MSG_WARN([Cython not found - continuing without python support])]) - ]) -]) + AM_PATH_PYTHON([3.3],, [:]) + AS_IF([test -n "$PYTHON"],[ + AC_CHECK_PROGS([CYTHON], [cython]) + AS_IF([test -z "$CYTHON"],[AC_MSG_WARN([Cython not found - continuing without python support])]) + ]) + ]) AM_CONDITIONAL([USE_CYTHON], [test -n "$CYTHON"]) +dnl Check for pip support (uninstall) +AS_IF([test -n "$PYTHON"],[ + AC_CHECK_PROGS([PIP], [pip3]) + AS_IF([test -z "$PIP"],[AC_MSG_WARN([pip not found - continuing without python uninstall support])]) + AM_CONDITIONAL([HAVE_PIP], [test -n "$PIP"]) + ]) case "${host_os}" in "") diff --git a/python/Makefile.am b/python/Makefile.am index 3c6100be..0949da89 100644 --- a/python/Makefile.am +++ b/python/Makefile.am @@ -10,8 +10,13 @@ all-local: pybuild.stamp clean-local: rm -rf $(builddir)/build $(builddir)/*.so -install: +install-exec-local: $(PYTHON) setup.py install rm -rf $(builddir)/build -endif \ No newline at end of file +if HAVE_PIP +uninstall-local: + /usr/bin/yes | $(PIP) uninstall $(PACKAGE) +endif + +endif From 8a281c1d2c798835bea7a9f23383f0e47ab3d9cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20D=C3=A9saulniers?= Date: Wed, 6 Apr 2016 15:10:57 -0400 Subject: [PATCH 2/3] fallback to setup.py generated install record --- python/Makefile.am | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/python/Makefile.am b/python/Makefile.am index 0949da89..98b66995 100644 --- a/python/Makefile.am +++ b/python/Makefile.am @@ -1,5 +1,7 @@ if USE_CYTHON +PYTHON_INSTALL_RECORD = $(builddir)/install_record.txt + pybuild.stamp: LDFLAGS="-L$(top_srcdir)/src/.libs" $(PYTHON) setup.py build_ext --inplace echo stamp > pybuild.stamp @@ -8,15 +10,18 @@ CLEANFILES = pybuild.stamp all-local: pybuild.stamp clean-local: - rm -rf $(builddir)/build $(builddir)/*.so + rm -rf $(builddir)/build $(builddir)/*.so $(PYTHON_INSTALL_RECORD) install-exec-local: - $(PYTHON) setup.py install + $(PYTHON) setup.py install --record $(PYTHON_INSTALL_RECORD) rm -rf $(builddir)/build if HAVE_PIP uninstall-local: /usr/bin/yes | $(PIP) uninstall $(PACKAGE) +else +uninstall-local: + while read -r file; do rm -rvf $$file ; done <$(PYTHON_INSTALL_RECORD) endif endif From daca16a917bf0529d696e6e02a22f6bd6435a950 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20D=C3=A9saulniers?= Date: Wed, 6 Apr 2016 15:24:21 -0400 Subject: [PATCH 3/3] disable removing from record file. --- python/Makefile.am | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/python/Makefile.am b/python/Makefile.am index 98b66995..23398e0d 100644 --- a/python/Makefile.am +++ b/python/Makefile.am @@ -19,9 +19,7 @@ install-exec-local: if HAVE_PIP uninstall-local: /usr/bin/yes | $(PIP) uninstall $(PACKAGE) -else -uninstall-local: - while read -r file; do rm -rvf $$file ; done <$(PYTHON_INSTALL_RECORD) endif endif +