gettext: Add 0.22.3 and fix keyerror: "shared" (#39423)

After the merge of #37957 (Add static and pic variants), if a gettext install
from a build before that merge is present, building any package using gettext
fails with keyerror: "shared" because the use of self.spec.variants["shared"]
does not check for the presence of the new variant in the old installation
but expects that the new key variants["shared"] exists always.

Fix it with a fallback to the default of True and update gettext to v22.3

Co-authored-by: Bernharad Kaindl <43588962+bernhardkaindl@users.noreply.github.com>
This commit is contained in:
Harmen Stoppels 2023-10-12 12:40:38 +02:00 committed by GitHub
parent 3935e047c6
commit 995e82e72b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 3 deletions

View file

@ -19,6 +19,7 @@ class Gettext(AutotoolsPackage, GNUMirrorPackage):
executables = [r"^gettext$"] executables = [r"^gettext$"]
version("0.22.3", sha256="b838228b3f8823a6c1eddf07297197c4db13f7e1b173b9ef93f3f945a63080b6")
version("0.21.1", sha256="50dbc8f39797950aa2c98e939947c527e5ac9ebd2c1b99dd7b06ba33a6767ae6") version("0.21.1", sha256="50dbc8f39797950aa2c98e939947c527e5ac9ebd2c1b99dd7b06ba33a6767ae6")
version("0.21", sha256="d20fcbb537e02dcf1383197ba05bd0734ef7bf5db06bdb241eb69b7d16b73192") version("0.21", sha256="d20fcbb537e02dcf1383197ba05bd0734ef7bf5db06bdb241eb69b7d16b73192")
version("0.20.2", sha256="b22b818e644c37f6e3d1643a1943c32c3a9bff726d601e53047d2682019ceaba") version("0.20.2", sha256="b22b818e644c37f6e3d1643a1943c32c3a9bff726d601e53047d2682019ceaba")
@ -127,10 +128,12 @@ def configure_args(self):
@property @property
def libs(self): def libs(self):
# Do not fail if the installed gettext did not yet have the shared variant:
shared_variant = self.spec.variants.get("shared")
libs = find_libraries( libs = find_libraries(
["libasprintf", "libgettextlib", "libgettextpo", "libgettextsrc", "libintl"], ["libasprintf", "libgettextlib", "libgettextpo", "libgettextsrc", "libintl"],
root=self.prefix, root=self.prefix,
recursive=True, recursive=True,
shared=self.spec.variants["shared"].value, shared=True if not shared_variant else shared_variant.value,
) )
return libs return libs

View file

@ -17,6 +17,7 @@ class Procps(AutotoolsPackage):
url = "https://gitlab.com/procps-ng/procps/-/archive/v4.0.3/procps-v4.0.3.tar.gz" url = "https://gitlab.com/procps-ng/procps/-/archive/v4.0.3/procps-v4.0.3.tar.gz"
version("master", branch="master") version("master", branch="master")
version("4.0.4", sha256="3214fab0f817d169f2c117842ba635bafb1cd6090273e311a8b5c6fc393ddb9d")
version("4.0.3", sha256="14cc21219c45d196772274ea3f194f6d668b6cc667fbde9ee6d8039121b73fa6") version("4.0.3", sha256="14cc21219c45d196772274ea3f194f6d668b6cc667fbde9ee6d8039121b73fa6")
version("4.0.2", sha256="b03e4b55eaa5661e726acb714e689356d80bc056b09965c2284d039ba8dc21e8") version("4.0.2", sha256="b03e4b55eaa5661e726acb714e689356d80bc056b09965c2284d039ba8dc21e8")
version("4.0.1", sha256="1eaff353306aba12816d14881f2b88c7c9d06023825f7224700f0c01f66c65cd") version("4.0.1", sha256="1eaff353306aba12816d14881f2b88c7c9d06023825f7224700f0c01f66c65cd")
@ -35,8 +36,11 @@ class Procps(AutotoolsPackage):
depends_on("pkgconfig@0.9.0:", type="build") depends_on("pkgconfig@0.9.0:", type="build")
depends_on("dejagnu", type="test") depends_on("dejagnu", type="test")
depends_on("iconv") depends_on("iconv")
depends_on("gettext", type="build") depends_on("gettext", type="build") # required by autogen.sh
depends_on("gettext", when="+nls") with when("+nls"):
depends_on("gettext")
# msgfmt 0.22 gives parsing errors
depends_on("gettext@:0.21", when="@:4.0.3")
depends_on("ncurses") depends_on("ncurses")
conflicts("platform=darwin", msg="procps is linux-only") conflicts("platform=darwin", msg="procps is linux-only")