From f62efe5e2eb73a4fb45d99a6e73d834bc9af8b56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Yviquel?= Date: Sun, 1 Nov 2020 13:08:06 -0300 Subject: [PATCH] Fix rdma-core package installation (#19643) * add python-docutils dependency * adds symlink to script for better compatibility if py-docutils installation * Improve post_install phase of py-docutils Co-authored-by: Adam J. Stewart * fix review of rdma-core package * improve formating of py-docutils package Co-authored-by: Adam J. Stewart --- .../repos/builtin/packages/py-docutils/package.py | 12 ++++++++++++ .../repos/builtin/packages/rdma-core/package.py | 1 + 2 files changed, 13 insertions(+) diff --git a/var/spack/repos/builtin/packages/py-docutils/package.py b/var/spack/repos/builtin/packages/py-docutils/package.py index 573ecc6bae..07b0da2534 100644 --- a/var/spack/repos/builtin/packages/py-docutils/package.py +++ b/var/spack/repos/builtin/packages/py-docutils/package.py @@ -4,6 +4,7 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * +import os class PyDocutils(PythonPackage): @@ -39,3 +40,14 @@ class PyDocutils(PythonPackage): depends_on('python@2.2.1:3', when='@0.6:0.9', type=('build', 'run')) depends_on('python@2.2.1:2.8', when='@0.5.0:0.5.999', type=('build', 'run')) depends_on('python@2.1:2.8', when='@:0.4', type=('build', 'run')) + + # NOTE: This creates symbolic links to be able to run docutils scripts + # without .py file extension similarly to various linux distributions to + # increase compatibility with other packages + @run_after('install') + def post_install(self): + bin_path = self.prefix.bin + for file in os.listdir(bin_path): + if file.endswith(".py"): + os.symlink(os.path.join(bin_path, file), + os.path.join(bin_path, file[:-3])) diff --git a/var/spack/repos/builtin/packages/rdma-core/package.py b/var/spack/repos/builtin/packages/rdma-core/package.py index 79f12d98de..0e09e7d210 100644 --- a/var/spack/repos/builtin/packages/rdma-core/package.py +++ b/var/spack/repos/builtin/packages/rdma-core/package.py @@ -26,6 +26,7 @@ class RdmaCore(CMakePackage): version('13', sha256='e5230fd7cda610753ad1252b40a28b1e9cf836423a10d8c2525b081527760d97') depends_on('pkgconfig', type='build') + depends_on('py-docutils', type='build') depends_on('libnl') conflicts('platform=darwin', msg='rdma-core requires FreeBSD or Linux') conflicts('%intel', msg='rdma-core cannot be built with intel (use gcc instead)')