Skip to content

Commit

Permalink
Merge pull request #354 from AlexanderRichert-NOAA/release/1.5.0-nco
Browse files Browse the repository at this point in the history
approve me: Add static gettext support to subversion
  • Loading branch information
AlexanderRichert-NOAA authored Oct 20, 2023
2 parents 081dce5 + f44beb0 commit 855eb39
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions var/spack/repos/builtin/packages/subversion/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class Subversion(AutotoolsPackage):
variant("perl", default=False, description="Build with Perl bindings")
variant("apxs", default=True, description="Build with APXS")
variant("nls", default=True, description="Enable Native Language Support")
variant("pic", default=True, description="Enable position-independent code (PIC)")

depends_on("apr")
depends_on("apr-util")
Expand Down Expand Up @@ -79,6 +80,8 @@ def configure_args(self):
"--without-boost",
]

args.extend(self.with_or_without("pic"))

if spec.satisfies("@1.10:"):
args.extend(
[
Expand All @@ -105,13 +108,22 @@ def configure_args(self):

if "+nls" in spec:
args.append("--enable-nls")
ldflags = []
libs = []
if "intl" in spec["gettext"].libs.names:
# Using .libs.link_flags is the canonical way to add these arguments,
# but since libintl is much smaller than the rest and also the only
# necessary one, we would specify it by hand here
args.append("LIBS=-lintl")
libs.append("-lintl")
if not is_system_path(spec["gettext"].prefix):
args.append("LDFLAGS={0}".format(spec["gettext"].libs.search_flags))
ldflags.append(spec["gettext"].libs.search_flags)
if spec["gettext"].satisfies("~shared"):
ldflags.append(spec["iconv"].libs.search_flags)
libs.append(spec["iconv"].libs.link_flags)
if ldflags:
args.append("LDFLAGS=%s" % " ".join(ldflags))
if libs:
args.append("LIBS=%s" % " ".join(libs))
else:
args.append("--disable-nls")

Expand Down

0 comments on commit 855eb39

Please sign in to comment.