[MacPorts] #63093: msort 8.53: fixing install by disabling iwidgets itcl dep & running patched old Makefile.am
MacPorts
noreply at macports.org
Mon Jun 14 11:23:28 UTC 2021
#63093: msort 8.53: fixing install by disabling iwidgets itcl dep & running patched
old Makefile.am
----------------------+--------------------
Reporter: vike2000 | Owner: (none)
Type: defect | Status: new
Priority: Normal | Milestone:
Component: ports | Version:
Keywords: | Port: msort
----------------------+--------------------
I don't know if I'm correct in creating this ticket as I'm doing. \\
Please forgive any annoying language / formatting.
I tried to summarise my steps for a successful `install` in the ticket
summary, \\
but I give you a full trace of my steps from problem to solution:
*
{{{#!bash
sudo port install msort
}}}
{{{
…
}}}
{{{#!bash
grep 'configure:.* error:'
'/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_itcl/itcl/work/itcl3.4/config.log'
}}}
Getting given an initial **error**:
{{{
configure:2138: error: C compiler cannot create executables
}}}
* (Examining some MacPorts configure/C-compiler options.)
* Finding ticket:44829#comment:9 mentioning **itcl** is "included in
MacPorts' tcl". \\
Also, above that, a question:
> is **msort** now effectively a dead twig on the port tree?
* **Patching** the **[changeset:628dec666f43bc38867b08a62ed3be9599a70d33
/macports-ports iwidgets Portfile]** to remove the **itcl** dep
{{{#!diff
--- tarballs 2020-11-17 00:47:06.000000000 +0100
+++ local 2021-06-13 12:09:18.000000000 +0200
@@ -21,7 +21,7 @@
checksums ${name}${version}.tar.gz md5
0e9c140e81ea6015b56130127c7deb03
-depends_build port:tk port:itcl
+depends_build port:tk
build.args CPPFLAGS=-I${prefix}/include
}}}
*
{{{#!bash
sudo port install msort
}}}
{{{
…
}}}
{{{#!bash
grep -B1 'error: use of undeclared identifier'
/opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_textproc_msort/msort/main.log|grep
-Ev '\^|--'
}}}
Getting given a secondary **error**
{{{
:info:build In file included from /opt/local/include/uninum/uninum.h:19:
:info:build /opt/local/include/gmp.h:1743:33: error: use of undeclared
identifier 'UINT_MAX'
:info:build /opt/local/include/gmp.h:1754:33: error: use of undeclared
identifier 'ULONG_MAX'
:info:build /opt/local/include/gmp.h:1765:33: error: use of undeclared
identifier 'USHRT_MAX'
}}}
* Finding [https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=806473#8 a
highly relevant comment before a debian bugreport getting fixed]:
> The problem is that by default Automake adds "`.`" to the include path
\\
> (which is a pretty dumb idea IMO), and that **msort** has a header named
\\
> `"limits.h"`. So now when GMP requests `<limits.h>`, the msort's one
gets \\
> included, instead of the system-wide one. Of course, the msort's header
\\
> doesn't define UINT_MAX and friends, hence the error.\\
>
> Adding "`nostdinc`" to AUTOMAKE_OPTIONS in **Makefile.am** and then \\
> regenerating Makefile.in should fix the bug.\\
>
> -- \\
> Jakub Wilk
Before seeing this, having (daftly) tried to patch `msort-*/info.c` with
an `#include <limits.h>`, \\
and having also seen `-I. -I. -I.` in the `make` output of the `clang`
runs, \\
I'm realizing this could be the solution:
{{{#!bash
(k=1 && p=msort && d=$p-8.53 && s=sudo\ -u\ macports && sp=sudo\ port &&
(((!k))||($sp clean $p && $sp extract $p)) &&
cd $($sp work $p)/$d &&
$s perl -i -pe$'s/^(AUTOMAKE_OPTIONS =.*?)( nostdinc)?(.*?)$/\\1
nostdinc\\3/' Makefile.am &&
$s automake) # automake is macports'
}}}
(I'm working in a [https://guide.macports.org/#development.local-
repositories local repo])
Getting given a tertiary **error**:
{{{
...
configure.ac:4: error: version mismatch. This is Automake 1.16.3,
configure.ac:4: but the definition used by this AM_INIT_AUTOMAKE
configure.ac:4: comes from Automake 1.9.6. You should recreate
configure.ac:4: aclocal.m4 with aclocal and run automake again.
...
}}}
Noting the error: **version mismatch**.
* Following [https://superuser.com/questions/383580/how-to-install-
autoconf-automake-and-related-tools-on-mac-os-x-from-source/897316#897316
a superuser.com/questions/383580/how-to-install-autoconf-automake...]
(cause a websearch didn't give me whether/how I could use something other
than the intuitive `port install automake @1.9.6` for that older version)
{{{#!bash
(b=automake && v=1.9.6 && n="$b"-"$v" && a=$n.tar.gz &&
cd /tmp && ([[ -a $a ]]||curl -OL http://ftpmirror.gnu.org/"$b"/"$a")
&&
rm -rf "$n" && tar -xzf "$a" &&
cd "$n" && ./configure && make && sudo make install)
}}}
Unknown if needed but I got this all working with it installed as well:
{{{#!bash
(b=autoconf && v=2.59 && n="$b"-"$v" && a=$n.tar.gz &&
cd /tmp && ([[ -a $a ]]||curl -OL http://ftpmirror.gnu.org/"$b"/"$a")
&&
rm -rf "$n" && tar -xzf "$a" &&
cd "$n" && ./configure && make && sudo make install)
}}}
* Finalizing, I can do a stream-patched variant of `port install msort`
{{{#!bash
(k=1 && p=msort && d=$p-8.53 && s=sudo\ -u\ macports && sp=sudo\ port &&
(((!k))||($sp clean $p && $sp extract $p)) &&
cd $($sp work $p)/$d &&
$s perl -i -pe$'s/^(AUTOMAKE_OPTIONS =.*?)( nostdinc)?(.*?)$/\\1
nostdinc\\3/' Makefile.am &&
$s /usr/local/bin/automake &&
$sp install $p)
}}}
Some warnings can be fixed by also running autoconf, but this is not
needed for `install`
{{{#!bash
(k=1 && p=msort && d=$p-8.53 && s=sudo\ -u\ macports && sp=sudo\ port &&
(((!k))||($sp clean $p && $sp extract $p)) &&
cd $($sp work $p)/$d &&
$s perl -i -pe$'s/^(AUTOMAKE_OPTIONS =.*?)( nostdinc)?(.*?)$/\\1
nostdinc\\3/' Makefile.am &&
$s /usr/local/bin/autoupdate &&
$s /usr/local/bin/aclocal &&
$s /usr/local/bin/autoconf &&
$s /usr/local/bin/automake &&
$sp install $p)
}}}
* Making use of the custom-installed (above) `/usr/local/bin/automake`
(old version 1.9.6) \\
I doubt any effort on my side to take this all the way through into the
`macports-ports` repo will be possible.
I have only used this `install` of msort for something equivalent to
`...|msort -qjl -ta -o= -cN -tz -o= -cN|...`. \\
Also please note that I haven't run any further testing on the
implications on removing the **iwidgets** dep on **itcl**.
Btw:
{{{#!bash
port version
uname -a
}}}
{{{
Version: 2.6.2
Darwin [redacted] 17.7.0 Darwin Kernel Version 17.7.0: Mon Aug 31 22:11:23
PDT 2020; root:xnu-4570.71.82.6~1/RELEASE_X86_64 x86_64
}}}
(I have now done `port selfupdate` for Version: 2.7.1)
Hope I haven't overlooked anything. \\
Thanks to any linked resources, anyone who takes interest in this and of
course the MacPorts project in general.
Peace, \\
vike
--
Ticket URL: <https://trac.macports.org/ticket/63093>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list