diff options
author | Chris Marsh <chrismarsh.c2@gmail.com> | 2024-02-29 21:12:27 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-29 21:12:27 -0600 |
commit | 983422facf5c4c7af9ef3456ff7d7f43ffa13305 (patch) | |
tree | 1b109e8f44ccaf1524cb0801d41011a975e4430e | |
parent | d0bdd6623867d448fbca894a78baa985da4d6963 (diff) | |
download | spack-983422facf5c4c7af9ef3456ff7d7f43ffa13305.tar.gz spack-983422facf5c4c7af9ef3456ff7d7f43ffa13305.tar.bz2 spack-983422facf5c4c7af9ef3456ff7d7f43ffa13305.tar.xz spack-983422facf5c4c7af9ef3456ff7d7f43ffa13305.zip |
libogg does not build a shared libary with cmake (#42877)
* when built with cmake, libogg does not build with a shared libary by default. This resolves that
* spack style fixes
* Clean up imports
* enforce +pic when +shared
-rw-r--r-- | var/spack/repos/builtin/packages/libogg/package.py | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/var/spack/repos/builtin/packages/libogg/package.py b/var/spack/repos/builtin/packages/libogg/package.py index 45613a654c..d711e95483 100644 --- a/var/spack/repos/builtin/packages/libogg/package.py +++ b/var/spack/repos/builtin/packages/libogg/package.py @@ -5,7 +5,7 @@ import os -from spack.build_systems.generic import GenericBuilder +from spack.build_systems import cmake, generic from spack.package import * @@ -22,6 +22,16 @@ class Libogg(CMakePackage, AutotoolsPackage, Package): version("1.3.4", sha256="fe5670640bd49e828d64d2879c31cb4dde9758681bb664f9bdbf159a01b0c76e") version("1.3.2", sha256="e19ee34711d7af328cb26287f4137e70630e7261b17cbe3cd41011d73a654692") + variant("shared", default=True, description="Build shared library", when="build_system=cmake") + variant( + "pic", + default=True, + description="Produce position-independent code (for shared libs)", + when="build_system=cmake", + ) + + requires("+pic", when="+shared") + # Backport a patch that fixes an unsigned typedef problem on macOS: # https://github.com/xiph/ogg/pull/64 patch( @@ -37,7 +47,17 @@ class Libogg(CMakePackage, AutotoolsPackage, Package): ) -class GenericBuilder(GenericBuilder): +class CMakeBuilder(cmake.CMakeBuilder): + def cmake_args(self): + base_cmake_args = [ + self.define_from_variant("BUILD_SHARED_LIBS", "shared"), + self.define_from_variant("CMAKE_POSITION_INDEPENDENT_CODE", "pic"), + ] + + return base_cmake_args + + +class GenericBuilder(generic.GenericBuilder): phases = ["build", "install"] def is_64bit(self): |