On 2019/01/06 21:28, Antoine Jacoutot wrote:
> On Sun, Jan 06, 2019 at 01:15:51PM -0700, Landry Breuil wrote:
> > CVSROOT:    /cvs
> > Module name:        ports
> > Changes by: lan...@cvs.openbsd.org  2019/01/06 13:15:51
> > 
> > Modified files:
> >     audio/ncmpc    : Makefile 
> > 
> > Log message:
> > Pass -Db_asneeded=false to meson so that it doesn't add -Wl,--as-needed.
> > 
> > Fixes the build on i386/ld.bfd archs which was failing with missing refs
> > to pthread functions, as reported by sthen@
> 
> Why not contain this to ld.bfd archs then?

Makes sense, but also why constrain it to ncmpc? meson itself seems
the obvious place, here's one way to do it (using patch+sed to avoid
a conditional patch file because I know what fun port updates are
when you use them :)

As a bonus this fixes gvfs.

Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/meson/Makefile,v
retrieving revision 1.38
diff -u -p -r1.38 Makefile
--- Makefile    11 Dec 2018 08:05:15 -0000      1.38
+++ Makefile    6 Jan 2019 20:41:50 -0000
@@ -7,6 +7,7 @@ GH_ACCOUNT=             mesonbuild
 GH_PROJECT=            meson
 GH_TAGNAME=            0.49.0
 EPOCH=                 0
+REVISION=              0
 
 CATEGORIES=            devel
 
@@ -24,8 +25,16 @@ MODPY_VERSION=               ${MODPY_DEFAULT_VERSION_
 
 RUN_DEPENDS=           devel/ninja
 
+.include <bsd.port.arch.mk>
+.if ${PROPERTIES:Mlld}
+ASNEEDED=              True
+.else
+ASNEEDED=              False
+.endif
+
 pre-configure:
        sed -ui "s,share/man,man," ${WRKSRC}/setup.py
+       sed -ui "s,%%ASNEEDED%%,${ASNEEDED}," 
${WRKSRC}/mesonbuild/compilers/compilers.py
 
 do-test:
        cd ${WRKSRC} && ${MODPY_BIN} ./run_tests.py
Index: patches/patch-mesonbuild_compilers_compilers_py
===================================================================
RCS file: patches/patch-mesonbuild_compilers_compilers_py
diff -N patches/patch-mesonbuild_compilers_compilers_py
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-mesonbuild_compilers_compilers_py     6 Jan 2019 20:41:50 
-0000
@@ -0,0 +1,14 @@
+$OpenBSD$
+
+Index: mesonbuild/compilers/compilers.py
+--- mesonbuild/compilers/compilers.py.orig
++++ mesonbuild/compilers/compilers.py
+@@ -346,7 +346,7 @@ base_options = {'b_pch': coredata.UserBooleanOption('b
+                                                        ['none', 'address', 
'thread', 'undefined', 'memory', 'address,undefined'],
+                                                        'none'),
+                 'b_lundef': coredata.UserBooleanOption('b_lundef', 'Use 
-Wl,--no-undefined when linking', True),
+-                'b_asneeded': coredata.UserBooleanOption('b_asneeded', 'Use 
-Wl,--as-needed when linking', True),
++                'b_asneeded': coredata.UserBooleanOption('b_asneeded', 'Use 
-Wl,--as-needed when linking', %%ASNEEDED%%),
+                 'b_pgo': coredata.UserComboOption('b_pgo', 'Use profile 
guided optimization',
+                                                   ['off', 'generate', 'use'],
+                                                   'off'),


Reply via email to