Skip to content

Commit

Permalink
Trac #27823: spkg-configure.m4 for iconv
Browse files Browse the repository at this point in the history
In general the iconv SPKG is not even required.  It's not installed (or
rather, a dummy empty package is installed) for any platforms except
Cygwin, HP-UX, and Solaris.

The requirement for it on Cygwin is probably outdated--iconv is a
standard library on almost all Cygwin installations, and is surely more
up-to-date than when this SPKG was first added in #8567.  Support for
the other two platforms has not been maintained much.

We can add a configure-time check for it, and treat it as a dummy
package in most cases.

URL: https://trac.sagemath.org/27823
Reported by: embray
Ticket author(s): Dima Pasechnik, Erik Bray
Reviewer(s): Erik Bray, Dima Pasechnik
  • Loading branch information
Release Manager committed Jul 3, 2019
2 parents a9a1059 + 2b5ceb1 commit 19c0da6
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 1 deletion.
46 changes: 45 additions & 1 deletion bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,49 @@ PKG=build/pkgs/configure
MAKE="${MAKE:-make}"
CONFVERSION=$(cat $PKG/package-version.txt)

install_config_rpath() {
# The file config.rpath which comes from gettext is supposed to be
# installed by automake, but due to a bug in most distros it is not;
# see https://trac.sagemath.org/ticket/27823#comment:17
#
# Here we need to determine where gettext stores its data files and
# copy config.rpath from there to config/
gettextize="$(command -v gettextize)"
if [ -z "$gettextize" ]; then
echo >&2 "gettext and the gettextize program must be installed and be in"
echo >&2 "your PATH. E.g. Homebrew installs them in /usr/local/opt/gettext/bin."
return 179
fi
eval `sed -n '/^prefix=.*$/p' $gettextize`
eval `sed -n '/^datarootdir=.*$/p' $gettextize`
eval `sed -n '/^: \${gettext_datadir=.*$/p' $gettextize`

if [ -z "$gettext_datadir" ]; then
eval `sed -n '/^gettext_dir=.*$/p' $gettextize`
# In older versions (before 2014) this is spelled gettext_dir
# See https://github.com/autotools-mirror/gettext/commit/ff18897068486560e2bb421004cfbd42b7cdd0f8
gettext_datadir="$gettext_dir"
fi

if [ -z "$gettext_datadir" ]; then
echo >&2 "Failed to read the gettext_datadir directory from $gettextize"
echo >&2 "The config.rpath file must manually be copied into config/"
echo >&2 "This file is installed with gettext typically in /usr/share/gettext"
return 179
fi

config_rpath="$gettext_datadir/config.rpath"
if [ ! -f "$config_rpath" ]; then
echo >&2 "Missing $config_rpath file; this indicates a broken gettext install."
return 179
fi

echo "bootstrap:$LINENO: installing 'config/config.rpath'"
cp "$config_rpath" config/
}



bootstrap () {
rm -f m4/sage_spkg_configures.m4
spkg_configures=""
Expand All @@ -40,6 +83,7 @@ SAGE_SPKG_CONFIGURE_$(echo ${pkgname} | tr '[a-z]' '[A-Z]')"
done
echo "$spkg_configures" >> m4/sage_spkg_configures.m4

install_config_rpath && \
aclocal -I m4 && \
automake --add-missing --copy build/make/Makefile-auto && \
autoconf
Expand All @@ -48,7 +92,7 @@ SAGE_SPKG_CONFIGURE_$(echo ${pkgname} | tr '[a-z]' '[A-Z]')"
case $st in
0) true;; # Success

16|63|127) # no m4 for pkg-config, or autotools not installed, or version too old
179|16|63|127) # install_config_rpath failed|no m4 for pkg-config|autotools not installed|or version too old
if [ $DOWNLOAD = yes ]; then
echo >&2 "Bootstrap failed, downloading required files instead."
bootstrap-download || exit $?
Expand Down
7 changes: 7 additions & 0 deletions build/pkgs/iconv/spkg-configure.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
SAGE_SPKG_CONFIGURE([iconv], [
AM_ICONV
if test x$am_cv_func_iconv != xyes; then
sage_spkg_install_iconv=yes
fi
])

0 comments on commit 19c0da6

Please sign in to comment.