[MacPorts] #46132: openjade @1.3.2_8: fails to build on OSX Lion
MacPorts
noreply at macports.org
Sat Jul 1 19:08:11 UTC 2017
#46132: openjade @1.3.2_8: fails to build on OSX Lion
------------------------------+-----------------------------
Reporter: pilgrimaflame@… | Owner: tlockhart1976@…
Type: defect | Status: reopened
Priority: Normal | Milestone:
Component: ports | Version: 2.3.3
Resolution: | Keywords:
Port: openjade |
------------------------------+-----------------------------
Comment (by dholl):
I think the problem is in Makefile.prog.in. Is MacPorts, this file is
patched by patch-clang.diff and patch-delete_la_files.diff in
textproc/openjade/files/
Check out this sed expression in patch-clang.diff
{{{
...
diff -Nurd -x'*~' Makefile.prog.in Makefile.prog.in
--- Makefile.prog.in 2002-01-22 06:57:53.000000000 -0500
+++ Makefile.prog.in 2007-04-23 03:40:08.000000000 -0400
@@ -12,14 +12,14 @@
ALL_LIBS = $(XLIBS) $(LIBS)
Makefile.lt:
- echo 'LT_LIBS='`echo $(ALL_LIBS)|sed 's/\.a/.la/g'` >Makefile.lt
+ echo 'LT_LIBS='`echo $(XLIBS)|sed 's/\.a/.la/g'` >Makefile.lt
PROG:=$(shell echo "$(PROG)" | sed '@program_transform_name@')
all: $(PROG)
...
}}}
and again in patch-delete_la_files.diff
{{{
--- Makefile.prog.in.orig 2013-09-02 18:50:59.000000000 -0700
+++ Makefile.prog.in 2013-09-02 18:52:56.000000000 -0700
@@ -12,7 +12,7 @@ LINKFLAGS = @LINKFLAGS@
ALL_LIBS = $(XLIBS) $(LIBS)
Makefile.lt:
- echo 'LT_LIBS='`echo $(XLIBS)|sed 's/\.a/.la/g'` >Makefile.lt
+ echo 'LT_LIBS='`echo $(XLIBS)|sed 's/\.a/.la/g'|sed
's|libosp\.la|libosp.dylib|'` >Makefile.lt
PROG:=$(shell echo "$(PROG)" | sed '@program_transform_name@')
}}}
I think the problem is in the regular expression {{{\.a}}} given for sed's
search pattern
{{{
... | sed 's/\.a/.la/g' ...
}}}
which matches a literal {{{.a}}} '''anywhere in the string'''.
For example, given this input:
{{{
> echo moo/Something.app/blah.a/libwtf.a
moo/Something.app/blech.a/libfubar.a
moo/Something.app/blah.a/libwtf.a moo/Something.app/blech.a/libfubar.a
}}}
'''this expression transforms {{{.app}}}, {{{.a/}}} and the trailing
{{{.a}}}'s here''':
{{{
> echo moo/Something.app/blah.a/libwtf.a
moo/Something.app/blech.a/libfubar.a | sed 's/\.a/.la/g'
moo/Something.lapp/blah.la/libwtf.la
moo/Something.lapp/blech.la/libfubar.la
}}}
This sed expression needs the search modified to prevent changing all
{{{.a}}} occurrences.
In this next example, I'll modify it to look for either a trailing end-of-
line (regex {{{$}}}) or a white-space (regex: {{{[[:space:]]}}}) after the
literal {{{.a}}} (regex: {{{\.a}}}). To match either {{{$}}} or
{{{[[:space:]]}}}, I'll join them with {{{( | )}}}, so I'll also pass -E
to sed to enable this "extended regular expression" syntax. I'll also
need to include a {{{\1}}} in the replacement side of the sed expression
to preserve the white-space that gets included in the match.
{{{
> echo moo/Something.app/blah.a/libwtf.a
moo/Something.app/blech.a/libfubar.a | sed -E
's/\.a([[:space:]]|$)/.la\1/g'
moo/Something.app/blah.a/libwtf.la moo/Something.app/blech.a/libfubar.la
}}}
(I included the extra description for folks who may not already be versed
in regular expressions...)
I summary, the fix is to change {{{sed 's/\.a/.la/g'}}} in these patches
to {{{sed -E 's/\.a([[:space:]]|$)/.la\1/g'}}}
I'm testing this now through https://github.com/dholl/macports-
ports/commit/ca6dadcd7e6887094525e2372c13c71691aabf7a
(My test will take a while, since I'll just re-run my whole project from
scratch for my own paranoia.)
Questions? Comments?
Once I have a working fix, is there any special process beside submitting
a usual GitHub PR to incorporate it?
--
Ticket URL: <https://trac.macports.org/ticket/46132#comment:14>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list