Skip to content

Commit

Permalink
Trac #29779: pkgconf: Update to 1.8.0, remove runtime dep on environm…
Browse files Browse the repository at this point in the history
…ent variable SAGE_LOCAL

(from #29411)

We upgrade pkgconf from the ancient version 0.9.7 and make it work
outside of `sage-env`.

URL: https://trac.sagemath.org/29779
Reported by: mkoeppe
Ticket author(s): Matthias Koeppe
Reviewer(s): Dima Pasechnik
  • Loading branch information
Release Manager committed Jul 1, 2022
2 parents c02edcb + 9c123af commit be2bda4
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 25 deletions.
9 changes: 5 additions & 4 deletions build/pkgs/pkgconf/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
tarball=pkgconf-VERSION.tar.gz
sha1=9943ba508c3293cd3afb5187f633104f8305af42
md5=56837bbee89a542ffe7012b4a52caf5b
cksum=320066684
tarball=pkgconf-VERSION.tar.xz
sha1=2b76eb2d88b2c4aecba937b337d218a13b67f14b
md5=823212dc241793df8ff1d097769a3473
cksum=896868382
upstream_url=https://distfiles.dereferenced.org/pkgconf/pkgconf-VERSION.tar.xz
2 changes: 1 addition & 1 deletion build/pkgs/pkgconf/dependencies
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
| patch
| patch xz

----------
All lines of this file are ignored except the first.
2 changes: 1 addition & 1 deletion build/pkgs/pkgconf/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.9.7.p2
1.8.0
12 changes: 3 additions & 9 deletions build/pkgs/pkgconf/patches/pkg-config.in
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
#!/usr/bin/env bash

if [ -z "$SAGE_LOCAL" ]; then
echo >&2 "This script requires that SAGE_LOCAL is set."
exit 1
fi

if [ -z "$PKG_CONFIG_PATH" ]; then
export PKG_CONFIG_PATH="$SAGE_LOCAL/lib/pkgconfig:$SAGE_LOCAL/share/pkgconfig"
export PKG_CONFIG_PATH="SAGE_LOCAL/lib/pkgconfig:SAGE_LOCAL/share/pkgconfig"
else
export PKG_CONFIG_PATH="$SAGE_LOCAL/lib/pkgconfig:$SAGE_LOCAL/share/pkgconfig:$PKG_CONFIG_PATH"
export PKG_CONFIG_PATH="SAGE_LOCAL/lib/pkgconfig:SAGE_LOCAL/share/pkgconfig:$PKG_CONFIG_PATH"
fi

dnl Launch system pkg-config or our own pkgconf
define(NEWLINE,`
')
define(PKG_CONFIG_COMMAND, translit(esyscmd(`command -v pkg-config'), NEWLINE))
exec ifelse(sysval, `0', PKG_CONFIG_COMMAND, `"$SAGE_LOCAL/bin/pkgconf" --keep-system-libs --keep-system-cflags') "$@"
exec ifelse(sysval, `0', PKG_CONFIG_COMMAND, `"SAGE_LOCAL/bin/pkgconf" --keep-system-libs --keep-system-cflags') "$@"
3 changes: 0 additions & 3 deletions build/pkgs/pkgconf/spkg-install.in
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
cd src

# workaround for incorrect permissions, see Trac #15742
chmod 755 install-sh

# Workaround for bugs with -D_FORTIFY_SOURCE=2 on antiques
export CPPFLAGS='-U_FORTIFY_SOURCE'

Expand Down
2 changes: 1 addition & 1 deletion build/pkgs/pkgconf/spkg-postinst.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Make absolutely sure Sage's existing pkg-config is deleted first, or
# else it will become self-referential; see Trac #25912
rm -f "$SAGE_LOCAL/bin/pkg-config"
m4 patches/pkg-config.in > pkg-config.out || \
m4 -DSAGE_LOCAL="$SAGE_LOCAL" patches/pkg-config.in > pkg-config.out || \
sdh_die "Error creating the pkg-config script."
chmod 755 pkg-config.out
sdh_install -T pkg-config.out "$SAGE_LOCAL/bin/pkg-config"
8 changes: 2 additions & 6 deletions build/pkgs/sagelib/spkg-install
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ fi
## the current directory (for the source tree).
## Building takes places in the build/ subdirectory.
##
## As a special exception, we feed SAGE_PKGS and SAGE_SPKG_INST.
## As a special exception, we feed SAGE_PKGS.
## They are needed by src/sage/misc/package.py. See meta-ticket #28815 for planned changes to this.

export SAGE_PKGS="$SAGE_ROOT"/build/pkgs
Expand All @@ -27,16 +27,12 @@ export PYTHON="$SAGE_LOCAL/bin/python3"

# We also poison all directories below SAGE_LOCAL.

export SAGE_LOCAL=/doesnotexist
export SAGE_PKGCONFIG=/doesnotexist
export SAGE_PKG_CONFIG_PATH=/doesnotexist
export SAGE_SPKG_SCRIPTS=/doesnotexist
export SAGE_SHARE=/doesnotexist

# Trac #29411: We cannot poison SAGE_LOCAL because the pkg-config script
# installed by the pkgconf spkg, generated from build/pkgs/pkgconf/patches/pkg-config.in,
# uses this variable.
# export SAGE_LOCAL=/doesnotexist

# Trac #30903: We cannot poison SAGE_DOC because setup.py installs the Jupyter kernel
# spec, which includes setting a symlink to the installed documentation.
# export SAGE_DOC=/doesnotexist
Expand Down

0 comments on commit be2bda4

Please sign in to comment.