Conditional setting of PATCH_FILES, or use a sed -i instead of a patch.

--
 Sent from a phone, apologies for poor formatting.

On 24 September 2021 10:08:11 Theo Buehler <[email protected]> wrote:

On Fri, Sep 24, 2021 at 11:03:05AM +0200, Antoine Jacoutot wrote:
On Fri, Sep 24, 2021 at 10:43:08AM +0200, Theo Buehler wrote:
> The patch below makes pulseaudio build on sparc64.
>
> The problem is that the determination of libintl_dep works as intended
> with base-clang but fails with ports-gcc (*). Thus, pacat and a couple
> other programs are linked without -lintl on sparc64, which won't work.
>
> http://build-failures.rhaalovely.net/sparc64/2021-09-18/audio/pulseaudio.log
>
> I did not bump revision, since this should not change anything on
> architectures where pulseaudio 15.0 already builds.

Could we maybe add the patch only for the ".if !${PROPERTIES:Mclang}" case?

If you tell me how to do that...

Note that cc.has_function('dgettext') is false for ${PROPERTIES:Mclang}
and true for !${PROPERTIES:Mclang}.


>
>
> (*) Meson uses the test program below which compiles with
>
> egcc -L/usr/local/lib -I/usr/local/include testfile.c -o test.out -O2 -pipe -O0 -std=gnu11
>
> but doesn't compile with clang.
>
> int main(void) {
>         /* With some toolchains (MSYS2/mingw for example) the compiler
>          * provides various builtins which are not really implemented and
>          * fall back to the stdlib where they aren't provided and fail at
>          * build/link time. In case the user provides a header, including
>          * the header didn't lead to the function being defined, and the
>          * function we are checking isn't a builtin itself we assume the
>          * builtin is not functional and we just error out. */
>         #if !1 && !defined(dgettext) && !0
>             #error "No definition for __builtin_dgettext found in the prefix"
>         #endif
>
>         #ifdef __has_builtin
>             #if !__has_builtin(__builtin_dgettext)
>                 #error "__builtin_dgettext not found"
>             #endif
>         #elif ! defined(dgettext)
>             __builtin_dgettext;
>         #endif
>    return 0;
> }
>
> Index: patches/patch-meson_build
> ===================================================================
> RCS file: /cvs/ports/audio/pulseaudio/patches/patch-meson_build,v
> retrieving revision 1.1
> diff -u -p -r1.1 patch-meson_build
> --- patches/patch-meson_build      15 Aug 2021 16:36:56 -0000      1.1
> +++ patches/patch-meson_build      24 Sep 2021 08:14:33 -0000
> @@ -18,6 +18,15 @@ Index: meson.build
>   cdata.set_quoted('PA_DLSEARCHPATH', modlibexecdir)
>   cdata.set_quoted('PA_SYSTEM_USER', get_option('system_user'))
>   cdata.set_quoted('PA_SYSTEM_GROUP', get_option('system_group'))
> +@@ -348,7 +348,7 @@ if cc.has_header_symbol('sys/syscall.h', 'SYS_memfd_cr
> + endif
> +
> + if cc.has_function('dgettext')
> +-  if host_machine.system() != 'windows'
> ++ if host_machine.system() != 'windows' and host_machine.system() != 'openbsd'
> +     libintl_dep = []
> +   else
> +     libintl_dep = cc.find_library('intl')
>  @@ -432,6 +432,8 @@ foreach f : [
>       cdata.set(define, 1)
>     endif
>

--
Antoine

Reply via email to