sagemath/sage

pkgconf: Update to 1.8.0, remove runtime dep on environment variable SAGE_LOCAL

Closed this issue · 23 comments

(from #29411)

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

CC: @orlitzky @dimpase @vbraun

Component: packages: standard

Keywords: sd111

Author: Matthias Koeppe

Branch/Commit: 9c123af

Reviewer: Dima Pasechnik

Issue created by migration from https://trac.sagemath.org/ticket/29779

comment:2

It looks like we can specify the *.pc file location at build time using --with-pkg-config-dir:

https://github.com/pkgconf/pkgconf/blob/master/configure.ac

Afterwards, we can probably just symlink pkgconf to "pkg-config", and then rely on PATH to choose the right one.

comment:3

src/bin/sage-env already prepends the sage-specific *.pc file path to PKG_CONFIG_PATH in case the system pkg-config is used. From pkgconf's spkg-configure.m4:

AS_IF([test -z "$ac_cv_path_PKGCONF"], [
   sage_spkg_install_pkgconf=yes
   AC_SUBST(SAGE_PKG_CONFIG_PATH, [''])
   AC_MSG_RESULT([installing pkgconf spkg])], [
dnl the following as needed as long as Sage creates .pc files during build and/or configure
   AC_SUBST(SAGE_PKG_CONFIG_PATH, ['$SAGE_LOCAL/lib/pkgconfig'])
   AC_MSG_RESULT([using pkg-config from the system])
])

Then in sage-env,

if [ -n "$SAGE_PKG_CONFIG_PATH" ]; then
    # set up external pkg-config to look into SAGE_LOCAL/lib/pkgconfig/
    # (Sage's pkgconf spkg takes care of this, if installed)
    export PKG_CONFIG_PATH="$SAGE_PKG_CONFIG_PATH${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
fi

So we "shouldn't" be hurt by ditching the pkgconf wrapper script and hard-coding the full list of paths into pkgconf at build time.

comment:4

Sounds right to me

Changed keywords from none to sd111

comment:6

Hoping we can make progress on this ticket this week - https://wiki.sagemath.org/days111

comment:7

Sage development has entered the release candidate phase for 9.3. Setting a new milestone for this ticket based on a cursory review of ticket status, priority, and last modification date.

comment:8

Any progress here?

comment:12

@orlitzky, it sounds like you have some free time. Care to work on this ticket?

comment:13

I never wanted to work on it in the first place. pkg-config is a standard, stable, system utility that's available everywhere. We should delete the SPKG and require that the user have it installed. Treadmill tickets like these are a complete waste of time, but not mine.

Author: Matthias Koeppe

Description changed:

--- 
+++ 
@@ -1,2 +1,3 @@
 (from #29411)
 
+We upgrade pkgconf from the ancient version 0.9.7 and make it work outside of `sage-env`.

New commits:

eeb61dfbuild/pkgs/pkgconf: Update to 1.8.0
0e26f83build/pkgs/pkgconf: Use SAGE_LOCAL at build time, not run time

Commit: 0e26f83

comment:17

there are changes of $SAGE_LOCAL to unprefixed by $. What does it do - if it was to be substituted I'd expect @SAGE_LOCAL@?

comment:18

These are resolved as m4 macros - see the m4 invocation in spkg-postinst.in

Changed commit from 0e26f83 to 9c123af

Branch pushed to git repo; I updated commit sha1. New commits:

9c123afbuild/pkgs/sagelib/spkg-install: Poison SAGE_LOCAL
comment:20

Let's get this in please

comment:21

lgtm

Reviewer: Dima Pasechnik

comment:22

Thanks!