From 57822d3014f05d595bc7d6b71c048e4034f5247f Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Wed, 8 Jun 2022 22:33:56 -0700 Subject: clingo: fix ~python build (#30824) --- .github/workflows/bootstrap.yml | 1 + var/spack/repos/builtin/packages/clingo/package.py | 24 +++++++++++++--------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/.github/workflows/bootstrap.yml b/.github/workflows/bootstrap.yml index fce8c81d1f..4aeb013a56 100644 --- a/.github/workflows/bootstrap.yml +++ b/.github/workflows/bootstrap.yml @@ -12,6 +12,7 @@ on: # built-in repository or documentation - 'var/spack/repos/builtin/**' - '!var/spack/repos/builtin/packages/clingo-bootstrap/**' + - '!var/spack/repos/builtin/packages/clingo/**' - '!var/spack/repos/builtin/packages/python/**' - '!var/spack/repos/builtin/packages/re2c/**' - 'lib/spack/docs/**' diff --git a/var/spack/repos/builtin/packages/clingo/package.py b/var/spack/repos/builtin/packages/clingo/package.py index 2f32df4536..01438c1a3b 100644 --- a/var/spack/repos/builtin/packages/clingo/package.py +++ b/var/spack/repos/builtin/packages/clingo/package.py @@ -86,15 +86,19 @@ class Clingo(CMakePackage): except UnsupportedCompilerFlag: InstallError('clingo requires a C++14-compliant C++ compiler') - args = [ - '-DCLINGO_REQUIRE_PYTHON=ON', - '-DCLINGO_BUILD_WITH_PYTHON=ON', - '-DPYCLINGO_USER_INSTALL=OFF', - '-DPYCLINGO_USE_INSTALL_PREFIX=ON', - '-DCLINGO_BUILD_WITH_LUA=OFF', - self.cmake_py_shared - ] - if self.spec['cmake'].satisfies('@3.16.0:'): - args += self.cmake_python_hints + args = ['-DCLINGO_BUILD_WITH_LUA=OFF'] + + if '+python' in self.spec: + args += [ + '-DCLINGO_REQUIRE_PYTHON=ON', + '-DCLINGO_BUILD_WITH_PYTHON=ON', + '-DPYCLINGO_USER_INSTALL=OFF', + '-DPYCLINGO_USE_INSTALL_PREFIX=ON', + self.cmake_py_shared + ] + if self.spec['cmake'].satisfies('@3.16.0:'): + args += self.cmake_python_hints + else: + args += ['-DCLINGO_BUILD_WITH_PYTHON=OFF'] return args -- cgit v1.2.3-70-g09d2