pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pkg/51695: www/firefox FreeBSD and DragonFly build fixes and audio playback options



The following reply was made to PR pkg/51695; it has been noted by GNATS.

From: David Shao <davshao%gmail.com@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: pkg/51695: www/firefox FreeBSD and DragonFly build fixes and
 audio playback options
Date: Fri, 10 Mar 2017 23:08:13 -0800

 Thank you for the extraordinary effort that has been put into porting all
 of the FreeBSD ports bug fixes into Firefox 52, and a couple of DragonFly
 fixes as well.
 
 1) One huge problem:  FreeBSD 12 current doesn't seem to like
 
  CONFIGURE_ENV+=        CPP=${CPP}
 
 from mozilla-common.mk.  Even configure bombs out fast with:
 
 cd /usr/pkgsrc/www/firefox/work/firefox-52.0 && autoconf
 cd /usr/pkgsrc/www/firefox/work/firefox-52.0/js/src && autoconf
 cd /usr/pkgsrc/www/firefox/work/firefox-52.0 && mkdir ../build
 cd /usr/pkgsrc/www/firefox/work/firefox-52.0/../build && touch
 old-configure.vars
 env: -E: No such file or directory
 *** Error code 127
 
 
 The entries from /usr/pkg/etc/mk.conf look like this:
 
 .ifdef BSD_PKG_MK    # begin pkgsrc settings
 
 ABI=            64
 PKGSRC_COMPILER=    clang
 CC=            clang
 CXX=            clang++
 CPP=            ${CC} -E
 CLANGBASE=        /usr
 
 PKG_DBDIR=        /var/pkgsrc/db/pkg
 LOCALBASE=        /usr/pkg
 VARBASE=        /var
 PKG_TOOLS_BIN=        /usr/pkg/sbin
 PKGINFODIR=        info
 PKGMANDIR=        man
 
 PREFER_PKGSRC=        yes
 
 
 .endif            # end pkgsrc settings
 
 And .if .endif conditional for FreeBSD commenting out that one
 line is enough for Firefox 52 build to succeed on FreeBSD 12,
 and I am composing this reply using it.
 
 I have not had time to test FreeBSD 11 stable or release, but
 I suspect similar problems.  Any reports from people running
 other BSDs using clang as their base compiler?
 
 2) A much smaller quibble but one of the patches actually
 addresses the DragonFly malloc.h problem.  Thus I don't
 seem to need to use from Makefile:
 
 -SUBST_CLASSES+=            dfly_malloc_h
 -SUBST_STAGE.dfly_malloc_h=    pre-configure
 -SUBST_MESSAGE.dfly_malloc_h=    Dont include malloc.h on dragonflybsd
 -SUBST_SED.dfly_malloc_h=    -e 's,HAVE_MALLOC_H,HAVE_MALLOC_H \&\&
 !defined(__DragonFly__),g'
 -SUBST_FILES.dfly_malloc_h=    media/libav/libavutil/mem.c
 -SUBST_FILES.dfly_malloc_h+=    media/ffvpx/libavutil/mem.c
 
 I think it might have been this one:
 
 $NetBSD: patch-build_moz.configure_memory.configure,v 1.1 2017/02/16
 02:25:17 maya Exp $
 
 Recognise DragonflyBSD
 
 --- build/moz.configure/memory.configure.orig    2017-01-16
 16:16:51.000000000 +0000
 +++ build/moz.configure/memory.configure
 @@ -66,7 +66,7 @@ def jemalloc_os_define(jemalloc, jemallo
              return 'MOZ_MEMORY_LINUX'
          if target.kernel == 'Darwin':
              return 'MOZ_MEMORY_DARWIN'
 -        if target.kernel in ('kFreeBSD', 'FreeBSD', 'NetBSD'):
 +        if target.kernel in ('kFreeBSD', 'FreeBSD', 'NetBSD', 'DragonFly'):
              return 'MOZ_MEMORY_BSD'
          die('--enable-jemalloc is not supported on %s', target.kernel)
 
 3) This patch is from DragonFly dports but I don't think they've updated to
 Firefox 52 yet.
 
 diff -Nur -x CVS
 www/firefox.orig/patches/patch-js_src_jsnativestack.cpp
 www/firefox/patches/patch-js_src_jsnativestack.cpp
 --- www/firefox.orig/patches/patch-js_src_jsnativestack.cpp
 1969-12-31 16:00:00.000000000 -0800
 +++ www/firefox/patches/patch-js_src_jsnativestack.cpp    2017-02-02
 21:50:16.000000000 -0800
 @@ -0,0 +1,16 @@
 +$NetBSD$
 +
 +From DragonFly dports
 +
 +--- js/src/jsnativestack.cpp.orig    2016-05-12 17:13:19.000000000 +0000
 ++++ js/src/jsnativestack.cpp
 +@@ -102,7 +102,8 @@ js::GetNativeStackBaseImpl()
 +     pthread_attr_init(&sattr);
 + #  if defined(__OpenBSD__)
 +     stack_t ss;
 +-#  elif defined(PTHREAD_NP_H) || defined(_PTHREAD_NP_H_) || defined(NETBSD)
 ++#  elif defined(PTHREAD_NP_H) || defined(_PTHREAD_NP_H_) || defined(NETBSD)  \
 ++     || defined(__DragonFly__)
 +     /* e.g. on FreeBSD 4.8 or newer, neundorf%kde.org@localhost */
 +     pthread_attr_get_np(thread, &sattr);
 + #  else
 
 4) I have simply lost track about whether these patches for the ridiculous
 moving of a couple of functions to sys/lwp.h are needed anymore.
 
 diff -Nur -x CVS
 www/firefox.orig/patches/patch-ipc_chromium_src_base_platform__thread__posix.cc
 www/firefox/patches/patch-ipc_chromium_src_base_platform__thread__posix.cc
 --- www/firefox.orig/patches/patch-ipc_chromium_src_base_platform__thread__posix.cc
    2016-06-16 05:08:21.000000000 -0700
 +++ www/firefox/patches/patch-ipc_chromium_src_base_platform__thread__posix.cc
    2017-02-02 21:48:15.000000000 -0800
 @@ -2,10 +2,11 @@
 
  * Support NetBSD
  * Support Solaris
 +* DragonFly may or may not move lwp definitions, from DragonFly dports
 
 ---- ipc/chromium/src/base/platform_thread_posix.cc.orig    2016-05-12
 17:13:13.000000000 +0000
 +--- ipc/chromium/src/base/platform_thread_posix.cc.orig    2016-09-05
 20:12:53.000000000 +0000
  +++ ipc/chromium/src/base/platform_thread_posix.cc
 -@@ -10,7 +10,9 @@
 +@@ -12,10 +12,17 @@
   #if defined(OS_MACOSX)
   #include <mach/mach.h>
   #elif defined(OS_NETBSD)
 @@ -15,7 +16,15 @@
   #elif defined(OS_LINUX)
   #include <sys/syscall.h>
   #include <sys/prctl.h>
 -@@ -105,7 +107,8 @@ void PlatformThread::SetName(const char*
 ++#elif defined(OS_DRAGONFLY)
 ++#include <sys/param.h>
 ++#if __DragonFly_version >= 400709
 ++#include <sys/lwp.h>
 ++#endif
 + #endif
 +
 + #if !defined(OS_MACOSX)
 +@@ -107,7 +114,8 @@ void PlatformThread::SetName(const char*
 
 
 diff -Nur -x CVS
 www/firefox.orig/patches/patch-media_webrtc_trunk_webrtc_base_thread__checker__impl.cc
 www/firefox/patches/patch-media_webrtc_trunk_webrtc_base_thread__checker__impl.cc
 --- www/firefox.orig/patches/patch-media_webrtc_trunk_webrtc_base_thread__checker__impl.cc
    1969-12-31 16:00:00.000000000 -0800
 +++ www/firefox/patches/patch-media_webrtc_trunk_webrtc_base_thread__checker__impl.cc
    2017-02-02 21:54:10.000000000 -0800
 @@ -0,0 +1,18 @@
 +$NetBSD$
 +
 +DragonFly may or may not move lwp definitions, from DragonFly dports
 +
 +--- media/webrtc/trunk/webrtc/base/thread_checker_impl.cc.orig
 2016-05-12 17:13:19.000000000 +0000
 ++++ media/webrtc/trunk/webrtc/base/thread_checker_impl.cc
 +@@ -22,6 +22,11 @@
 + #include <lwp.h>
 + #elif defined(__FreeBSD__)
 + #include <pthread_np.h>
 ++#elif defined(__DragonFly__)
 ++#include <sys/param.h>
 ++#if __DragonFly_version >= 400709
 ++#include <sys/lwp.h>
 ++#endif
 + #endif
 +
 + namespace rtc {
 


Home | Main Index | Thread Index | Old Index