Skip to content

Commit 57960d2

Browse files
authored
Merge pull request #496 from climbfuji/bugfix/extzlib_pkgconfig_freetype
Workaround for freetype build error with external libz and spack-built pkg-config
2 parents 033e700 + 3d42db4 commit 57960d2

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

share/spack/qa/run-style-tests

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,9 @@ fi
2626
# verify that the code style is correct
2727
spack style --root-relative "${args[@]}"
2828

29-
# verify that the license headers are present
30-
spack license verify
29+
# DH* 20250102 - temporarily comment out until
30+
# spack-stack-dev is updated from spack develop
31+
# and includes https://github.com/spack/spack/pull/48352
32+
## verify that the license headers are present
33+
#spack license verify
34+
# *DH

var/spack/repos/builtin/packages/freetype/package.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# Spack Project Developers. See the top-level COPYRIGHT file for details.
33
#
44
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
5+
import os
56

67
from spack.build_systems.autotools import AutotoolsBuilder
78
from spack.build_systems.cmake import CMakeBuilder
@@ -54,6 +55,7 @@ class Freetype(AutotoolsPackage, CMakePackage):
5455

5556
depends_on("bzip2")
5657
depends_on("libpng")
58+
depends_on("zlib-api")
5759
for plat in ["linux", "darwin"]:
5860
depends_on("pkgconfig", type="build", when="platform=%s" % plat)
5961

@@ -95,7 +97,7 @@ def configure_args(self):
9597
"--with-bzip2=yes",
9698
"--with-harfbuzz=no",
9799
"--with-png=yes",
98-
"--with-zlib=no",
100+
"--with-zlib=yes",
99101
]
100102
if self.spec.satisfies("@2.9.1:"):
101103
args.append("--enable-freetype-config")
@@ -106,6 +108,11 @@ def configure_args(self):
106108
def setup_build_environment(self, env):
107109
if self.spec.satisfies("+pic"):
108110
env.set("CFLAGS", "-fPIC")
111+
if self.spec["zlib-api"].external:
112+
env.append_path(
113+
"PKG_CONFIG_PATH",
114+
os.path.dirname(find_first(self.spec["zlib-api"].prefix, "zlib.pc", bfs_depth=10)),
115+
)
109116

110117

111118
class CMakeBuilder(CMakeBuilder):

0 commit comments

Comments
 (0)