Skip to content

Commit

Permalink
qpdf: new package (#44066)
Browse files Browse the repository at this point in the history
* New package: qpdf

* Update var/spack/repos/builtin/packages/qpdf/package.py

Co-authored-by: Alec Scott <hi@alecbcs.com>

* Fix format of cmake_args

---------

Co-authored-by: Alec Scott <hi@alecbcs.com>
  • Loading branch information
taliaferro and alecbcs committed May 10, 2024
1 parent 40bf9a1 commit 56251c1
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions var/spack/repos/builtin/packages/qpdf/package.py
@@ -0,0 +1,45 @@
# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)


from spack.package import *


class Qpdf(CMakePackage):
"""
QPDF is a command-line tool and C++ library that performs
content-preserving transformations on PDF files.
"""

homepage = "https://qpdf.sourceforge.io/"
url = "https://github.com/qpdf/qpdf/releases/download/v11.9.0/qpdf-11.9.0.tar.gz"

maintainers("taliaferro")

license("Apache-2.0", checked_by="taliaferro")

version("11.9.0", sha256="9f5d6335bb7292cc24a7194d281fc77be2bbf86873e8807b85aeccfbff66082f")

variant(
"crypto",
values=["openssl", "gnutls", "native", "implicit"],
default="implicit",
multi=False,
description="Provider of cryptographic functions.",
)

depends_on("zlib-api")
depends_on("jpeg")
depends_on("openssl", when="crypto=openssl")
depends_on("gnutls", when="crypto=gnutls")

def cmake_args(self):
args = []
if not self.spec.satisfies("crypto=implicit"):
crypto_type = self.spec.variants["crypto"].value.upper()
args.append("USE_IMPLICIT_CRYPTO=0")
args.append(f"REQUIRE_CRYPTO_{crypto_type}=1")

return args

0 comments on commit 56251c1

Please sign in to comment.