Skip to contentSkip to conversation

package/python-networkx: bump version to 2.4, package/setools: bump version to 4.2.2

PATCH New aduskett at gmail.com 1 participant 1 message Dec 8, 2019

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 package/python-networkx: bump version to 2.4, package/setools: bump version to 4.2.2

From: Adam Duskett <[email protected]>

Setools is currently the only package that depends on python-networkx, and the updated version requires python-networkx >= 2.0.

This dependency chain means that both package versions must change at the same time in order for the new version of setools to work correctly.

Other changes:
- Update patches to work with 4.2.2.

- Set Python3 as a dependency as Python2 is no longer supported.

- Change the source URL to the new official upstream URL.

- Remove the check for Python2 or 3 in the setools.mk file as Python2 is no longer supported.

- Add a dependency on host-python-cython. From the changelog:
"Replaced the Python/SWIG/static-linked-libsepol policyrep module with a Cython implementation. This will have performance and memory-usage improvements and breaks the static linking to libsepol."

- Due to the above change: Remove SETOOLS_FIX_SETUP and HOST_SETOOLS_FIX_SETUP as setools no longer statically links to libsepol.a

- Fix the path for the removal of the setoolsgui directory if BR2_PACKAGE_PYTHON_PYQT5 is no longer selected.

---
Changes v1 -> v2:
- Add missing depends on BR2_PACKAGE_PYTHON3 in setools/Config.in

 package/python-networkx/python-networkx.hash  |  8 ++-
 package/python-networkx/python-networkx.mk    |  5 +-
 .../0001-remove-werror-flag-from-setup.patch  | 18 ++---
 ...e-setools.InfoFlowAnalysis-and-setoo.patch | 71 ++++++++++---------
 ...py-drop-path-prefix-from-man-install.patch | 42 -----------
 package/setools/Config.in                     |  3 +-
 package/setools/setools.hash                  |  6 +-
 package/setools/setools.mk                    | 34 ++-------
 8 files changed, 60 insertions(+), 127 deletions(-)
 delete mode 100644 package/setools/0003-setup.py-drop-path-prefix-from-man-install.patch
package/python-networkx/python-networkx.hash +5 -3
index 92383e75c4..a3837fb434 100644
@@ -1,4 +1,6 @@
-# md5 from https://pypi.python.org/pypi/networks/json, sha256 locally computed
-md5 6ef584a879e9163013e9a762e1cf7cd1 networkx-1.11.tar.gz
-sha256 0d0e70e10dfb47601cbb3425a00e03e2a2e97477be6f80638fef91d54dd1e4b8 networkx-1.11.tar.gz
+# From https://pypi.python.org/pypi/networks/json
+md5 63e3fdc9d3a46bcabc776acc5ea5fe48 networkx-2.4.tar.gz
+sha256 f8f4ff0b6f96e4f9b16af6b84622597b5334bf9cae8cf9b2e42e7985d5c95c64 networkx-2.4.tar.gz
+
+# Locally calculated
 sha256 f4c13bf0e83bef45116ebda6c360066df6fd99610efaea9790b998c5441b0c0d LICENSE.txt
package/python-networkx/python-networkx.mk +2 -3
index 4dfdbd5a1c..c785ccdde4 100644
@@ -4,10 +4,9 @@
 #
 ################################################################################
 
-# The current version of setools (v4.1.1) does not work with python-networkx past v1.11
-PYTHON_NETWORKX_VERSION = 1.11
+PYTHON_NETWORKX_VERSION = 2.4
 PYTHON_NETWORKX_SOURCE = networkx-$(PYTHON_NETWORKX_VERSION).tar.gz
-PYTHON_NETWORKX_SITE = https://pypi.python.org/packages/c2/93/dbb41b03cf7c878a7409c8e92226531f840a423c9309ea534873a83c9192
+PYTHON_NETWORKX_SITE = https://files.pythonhosted.org/packages/bf/63/7b579dd3b1c49ce6b7fd8f6f864038f255201410905dd183cf7f4a3845cf
 PYTHON_NETWORKX_LICENSE = BSD-3-Clause
 PYTHON_NETWORKX_LICENSE_FILES = LICENSE.txt
 PYTHON_NETWORKX_SETUP_TYPE = setuptools
package/setools/0001-remove-werror-flag-from-setup.patch +9 -9
index 4f6d2efb96..95072fa235 100644
@@ -1,6 +1,6 @@
-From b2fe84bfd00117d4897f1f2e8f83d3410eb188b8 Mon Sep 17 00:00:00 2001
-From: Adam Duskett <[email protected]>
-Date: Thu, 12 Oct 2017 22:04:58 -0400
+From d2fbe16e6bb5b1b7ff53d3e33ab0d7ba95095a3b Mon Sep 17 00:00:00 2001
+From: Adam Duskett <[email protected]>
+Date: Sat, 7 Dec 2019 17:53:44 -0800
 Subject: [PATCH] remove werror flag from setup
 
 Compilers older than gcc6 will generate uninitialized variable warnings which
@@ -12,18 +12,18 @@ Signed-off-by: Adam Duskett <[email protected]>
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/setup.py b/setup.py
-index 2ca44c9..9319bf6 100644
+index ac8a876..759a136 100644
 --- a/setup.py
 +++ b/setup.py
-@@ -146,7 +146,7 @@ ext_py_mods = [Extension('setools.policyrep._qpol',
-                           'libqpol/policy_scan.c',
-                           'libqpol/xen_query.c'],
-                          include_dirs=include_dirs,
+@@ -105,7 +105,7 @@ ext_py_mods = [Extension('setools.policyrep', ['setools/policyrep.pyx'],
+                          libraries=['selinux', 'sepol'],
+                          library_dirs=lib_dirs,
+                          define_macros=macros,
 -                         extra_compile_args=['-Werror', '-Wextra',
 +                         extra_compile_args=['-Wextra',
                                               '-Waggregate-return',
                                               '-Wfloat-equal',
                                               '-Wformat', '-Wformat=2',
 -- 
-2.13.6
+2.23.0
 
package/setools/0002-Do-not-export-use-setools.InfoFlowAnalysis-and-setoo.patch +36 -35

153 lines not on this page · raw message

package/setools/0003-setup.py-drop-path-prefix-from-man-install.patch deleted +0 -42

42 lines not on this page · raw message

package/setools/Config.in +1 -2
index 56a85b01c8..a279fc0951 100644
@@ -1,11 +1,10 @@
 config BR2_PACKAGE_SETOOLS
 	bool "setools"
+	depends on BR2_PACKAGE_PYTHON3
 	depends on !BR2_STATIC_LIBS
 	depends on BR2_TOOLCHAIN_HAS_THREADS
 	depends on BR2_USE_WCHAR
 	depends on BR2_USE_MMU
-	select BR2_PACKAGE_PYTHON3 if !BR2_PACKAGE_PYTHON
-	select BR2_PACKAGE_PYTHON_ENUM34 if !BR2_PACKAGE_PYTHON3
 	select BR2_PACKAGE_PYTHON_NETWORKX # runtime
 	select BR2_PACKAGE_PYTHON_SETUPTOOLS
 	select BR2_PACKAGE_LIBSELINUX
package/setools/setools.hash +2 -4
index 8729297064..de633ca643 100644
@@ -1,7 +1,5 @@
-# From https://github.com/TresysTechnology/setools3/wiki/Download
-md5	d68d0d4e4da0f01da0f208782ff04b91	setools-4.1.1.tar.bz2
-# Locally computed
-sha256	46a927ea2b163cbe1d35cc35da43e45853e13720c7e02d4cf75a498783c19610 setools-4.1.1.tar.gz
+# Locally calculated
+sha256	826ab1974579357c8ec7c01aa0a2997b46beb85b8ad915898273c9619cd27a80 setools-4.2.2.tar.gz
 sha256  2f7547e10f76a382c24c053595f38a5cc6dda9347f508f254ca490e0046a9624 COPYING
 sha256  8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 COPYING.GPL
 sha256  dc626520dcd53a22f727af3ee42c770e56c97a64fe3adb063799d8ab032fe551 COPYING.LGPL
package/setools/setools.mk +5 -29
index 63ca3651e8..0f53f49972 100644
@@ -4,38 +4,14 @@
 #
 ################################################################################
 
-SETOOLS_VERSION = 4.1.1
-SETOOLS_SITE = $(call github,TresysTechnology,setools,$(SETOOLS_VERSION))
-SETOOLS_DEPENDENCIES = libselinux libsepol python-setuptools host-bison host-flex host-swig
+SETOOLS_VERSION = 4.2.2
+SETOOLS_SITE = $(call github,SELinuxProject,setools,$(SETOOLS_VERSION))
+SETOOLS_DEPENDENCIES = libselinux libsepol python-setuptools host-bison host-flex host-swig host-python-cython
 SETOOLS_INSTALL_STAGING = YES
 SETOOLS_LICENSE = GPL-2.0+, LGPL-2.1+
 SETOOLS_LICENSE_FILES = COPYING COPYING.GPL COPYING.LGPL
 SETOOLS_SETUP_TYPE = setuptools
-HOST_SETOOLS_DEPENDENCIES = host-libselinux host-libsepol host-python-networkx
-
-ifeq ($(BR2_PACKAGE_PYTHON3),y)
-SETOOLS_PYLIBVER = python$(PYTHON3_VERSION_MAJOR)
-else
-SETOOLS_PYLIBVER = python$(PYTHON_VERSION_MAJOR)
-SETOOLS_DEPENDENCIES += python-enum34
-HOST_SETOOLS_DEPENDENCIES += host-python-enum34
-endif
-
-define SETOOLS_FIX_SETUP
-	# By default, setup.py will look for libsepol.a in the host machines
-	# /usr/lib directory. This needs to be changed to the staging directory.
-	$(SED) "s at base_lib_dirs =.*@base_lib_dirs = ['$(STAGING_DIR)/usr/lib']@g" \
-		$(@D)/setup.py
-endef
-SETOOLS_POST_PATCH_HOOKS += SETOOLS_FIX_SETUP
-
-define HOST_SETOOLS_FIX_SETUP
-	# By default, setup.py will look for libsepol.a in the host machines
-	# /usr/lib directory. This needs to be changed to the host directory.
-	$(SED) "s at base_lib_dirs =.*@base_lib_dirs = ['$(HOST_DIR)/lib']@g" \
-		$(@D)/setup.py
-endef
-HOST_SETOOLS_POST_PATCH_HOOKS += HOST_SETOOLS_FIX_SETUP
+HOST_SETOOLS_DEPENDENCIES = host-libselinux host-libsepol host-python-networkx host-python-cython
 
 # apol requires pyqt5. However, the setools installation
 # process will install apol even if pyqt5 is missing.
@@ -43,7 +19,7 @@ HOST_SETOOLS_POST_PATCH_HOOKS += HOST_SETOOLS_FIX_SETUP
 ifeq ($(BR2_PACKAGE_PYTHON_PYQT5),)
 define SETOOLS_REMOVE_QT_SCRIPTS
 	$(RM) $(TARGET_DIR)/usr/bin/apol
-	$(RM) -r $(TARGET_DIR)/lib/$(SETOOLS_PYLIBVER)/site-packages/setoolsgui/
+	$(RM) -r $(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages/setoolsgui/
 endef
 SETOOLS_POST_INSTALL_TARGET_HOOKS += SETOOLS_REMOVE_QT_SCRIPTS
 endif
Signature · 1 line
2.23.0