Skip to content

Commit

Permalink
dcmtk: new version and pic configuration (spack#39161)
Browse files Browse the repository at this point in the history
* dcmtk: checksum 3.6.7

compiles on macos

* dcmtk: support pic configuration

* [@spackbot] updating style on behalf of aumuell

* dcmtk: use define_from_variant for shorter code

* dcmtk: refine conflict

it appears that dcmtk < 3.6.7 only fails on macos/aarch64:
/Library/Developer/CommandLineTools/usr/lib/clang/14.0.3/include/xmmintrin.h:14:2:
  error: "This header is only meant to be used on x86 and x64 architecture"

---------

Co-authored-by: aumuell <[email protected]>
  • Loading branch information
aumuell and aumuell authored Aug 2, 2023
1 parent f079e7f commit 5d84825
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions var/spack/repos/builtin/packages/dcmtk/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class Dcmtk(CMakePackage):
homepage = "https://dicom.offis.de"
url = "https://github.com/DCMTK/dcmtk/archive/DCMTK-3.6.3.tar.gz"

version("3.6.7", sha256="17705dcdb2047d1266bb4e92dbf4aa6d4967819e8e3e94f39b7df697661b4860")
version("3.6.6", sha256="117097da6d50ddbad0e48bb1e6cdc61468e82ba1d32001dd8e2366b445133a8c")
version("3.6.5", sha256="37dad355d5513b4de4a86b5b7b0c3e9ec059860d88781b80916bba2a04e6d5b8")
version("3.6.4", sha256="e4b1de804a3fef38fe8cb9edd00262c3cbbd114b305511c14479dd888a9337d2")
Expand Down Expand Up @@ -41,9 +42,12 @@ class Dcmtk(CMakePackage):
variant("iconv", default=True, description="Charset conversion support (iconv)")
depends_on("iconv", type=("build", "link"))

variant("pic", default=False, description="Produce position-independent code")
variant("cxx11", default=False, description="Enable c++11 features")
variant("stl", default=True, description="Use native STL implementation")

conflicts("platform=darwin target=aarch64:", when="@:3.6.6")

def patch(self):
# Backport 3.6.4
if self.spec.satisfies("@:3.6.3 %fj"):
Expand All @@ -55,12 +59,15 @@ def patch(self):
)

def cmake_args(self):
args = ["-DDCMTK_WITH_OPENSSL={0}".format("ON" if "+ssl" in self.spec else "OFF")]
args += ["-DDCMTK_WITH_ZLIB={0}".format("ON" if "+zlib" in self.spec else "OFF")]
args += ["-DDCMTK_WITH_TIFF={0}".format("ON" if "+tiff" in self.spec else "OFF")]
args += ["-DDCMTK_WITH_PNG={0}".format("ON" if "+png" in self.spec else "OFF")]
args += ["-DDCMTK_WITH_XML={0}".format("ON" if "+xml" in self.spec else "OFF")]
args += ["-DDCMTK_WITH_ICONV={0}".format("ON" if "+iconv" in self.spec else "OFF")]
args += ["-DDCMTK_ENABLE_CXX11={0}".format("ON" if "+cxx11" in self.spec else "OFF")]
args += ["-DDCMTK_ENABLE_STL={0}".format("ON" if "+stl" in self.spec else "OFF")]
args = [
self.define_from_variant("DCMTK_WITH_OPENSSL", "ssl"),
self.define_from_variant("DCMTK_WITH_ZLIB", "zlib"),
self.define_from_variant("DCMTK_WITH_TIFF", "tiff"),
self.define_from_variant("DCMTK_WITH_PNG", "png"),
self.define_from_variant("DCMTK_WITH_XML", "xml"),
self.define_from_variant("DCMTK_WITH_ICONV", "iconv"),
self.define_from_variant("DCMTK_ENABLE_CXX11", "cxx11"),
self.define_from_variant("DCMTK_ENABLE_STL", "stl"),
self.define_from_variant("CMAKE_POSITION_INDEPENDENT_CODE", "pic"),
]
return args

0 comments on commit 5d84825

Please sign in to comment.