Skip to content

Commit

Permalink
Add the Pale Moon browser. It works (amd64 only).
Browse files Browse the repository at this point in the history
  • Loading branch information
ibara committed Feb 4, 2018
1 parent 36ec411 commit 0fcae18
Show file tree
Hide file tree
Showing 17 changed files with 398 additions and 67 deletions.
56 changes: 51 additions & 5 deletions www/palemoon/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Maybe i386 too, but has a hard requirement on SSE2 instructions.
ONLY_FOR_ARCHS = amd64

V = 27.5.1
V = 27.7.2
COMMENT = independent fork of Firefox with new layout engine
DISTNAME = palemoon-${V}
CATEGORIES = www x11
Expand All @@ -12,35 +12,81 @@ GH_ACCOUNT = MoonchildProductions
GH_PROJECT = Pale-Moon
GH_TAGNAME = ${V}_Release

SHARED_LIBS += browsercomps 1.0 # 1.0
SHARED_LIBS += dbusservice 1.0 # 1.0
SHARED_LIBS += mozgnome 1.0 # 1.0
SHARED_LIBS += mozalloc 1.0 # 1.0
SHARED_LIBS += mozjs 1.0 # 1.0
SHARED_LIBS += mozsqlite3 1.0 # 1.0
SHARED_LIBS += xul 1.0 # 1.0

HOMEPAGE = https://www.palemoon.org/
MAINTAINER = Brian Callahan <bcallah@openbsd.org>

# MPL 2.0
PERMIT_PACKAGE_CDROM = Yes

#WANTLIB += c m

# Hacky and probably ignored.
COMPILER = ports-gcc
WANTLIB += ${COMPILER_LIBCXX} X11 Xcomposite Xcursor Xdamage Xext
WANTLIB += Xfixes Xi Xinerama Xrandr Xrender Xt atk-1.0 c cairo
WANTLIB += dbus-1 dbus-glib-1 event fontconfig freetype gdk-x11-2.0
WANTLIB += gdk_pixbuf-2.0 gio-2.0 glib-2.0 gobject-2.0 gthread-2.0
WANTLIB += gtk-x11-2.0 icudata icui18n icuuc intl jpeg m nspr4
WANTLIB += nss3 nssutil3 pango-1.0 pangocairo-1.0 pangoft2-1.0
WANTLIB += plc4 plds4 smime3 sndio ssl3 vpx z

MODULES = lang/python
MODPY_RUNDEP = No

# XXX: ${MODGNU_AUTOCONF_DEPENDS} && AUTOCONF_VERSION=2.13 didn't work
BUILD_DEPENDS = archivers/unzip \
archivers/zip \
devel/autoconf/2.13 \
devel/yasm

LIB_DEPENDS = devel/nspr \
multimedia/libvpx \
textproc/icu4c \
security/nss \
x11/dbus-glib \
x11/gtk+2

CONFIGURE_ARGS = --verbose

USE_GMAKE = Yes

SEPARATE_BUILD = Yes

USE_WXNEEDED = Yes

SUBST_VARS += V

NO_TEST = Yes

# Upstream build instructions say this is necessary.
post-extract:
${SUBST_CMD} -DWRKBUILD="${WRKBUILD}" -DCFLAGS="${CFLAGS}" \
-c -m 644 ${FILESDIR}/mozconfig ${WRKSRC}/.mozconfig

# Build system can't find the compilers without this.
pre-configure:
sed -i -e 's,$${CC},${WRKDIR}/bin/cc,g' \
-e 's,$${CXX},${WRKDIR}/bin/c++,g' \
${WRKSRC}/client.mk

do-build:
cd ${WRKSRC} && ./mach build

do-install:
cd ${WRKSRC} && ./mach package
${INSTALL_DATA_DIR} ${PREFIX}/lib/palemoon-${V}
cd ${WRKBUILD}/dist/palemoon && \
find * -type d -exec ${INSTALL_DATA_DIR} \
"${PREFIX}/lib/palemoon-${V}/{}" \;
cd ${WRKBUILD}/dist/palemoon && \
find * -type f -exec ${INSTALL_DATA} \
"{}" "${PREFIX}/lib/palemoon-${V}/{}" \;
${INSTALL_PROGRAM} ${WRKBUILD}/dist/palemoon/palemoon{,-bin} \
${PREFIX}/lib/palemoon-${V}
${SUBST_CMD} -c -m 755 ${FILESDIR}/palemoon ${PREFIX}/bin/palemoon

.include <bsd.port.mk>
1 change: 0 additions & 1 deletion www/palemoon/TODO

This file was deleted.

4 changes: 2 additions & 2 deletions www/palemoon/distinfo
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
SHA256 (palemoon-27.5.1.tar.gz) = XQqXL7a0kiUmK9DFUFy4g37dPTJqsnARP0AjUdoTIGo=
SIZE (palemoon-27.5.1.tar.gz) = 179609050
SHA256 (palemoon-27.7.2.tar.gz) = DeHR0xhdFHDuNHdKnwWLftkwdXszeIihMjzriLMYYMw=
SIZE (palemoon-27.7.2.tar.gz) = 179831808
5 changes: 4 additions & 1 deletion www/palemoon/files/mozconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ac_add_options --enable-application=browser

mk_add_options MOZ_OBJDIR="${WRKBUILD}"

ac_add_options --enable-optimize="${CFLAGS} -msse2 -mfpmath=sse"
ac_add_options --enable-optimize="${CFLAGS} -msse2 -mfpmath=sse -I${LOCALBASE}/include"
ac_add_options --with-pthreads

ac_add_options --disable-installer
Expand All @@ -29,3 +29,6 @@ ac_add_options --with-system-webp="${LOCALBASE}"
ac_add_options --with-system-sqlite="${LOCALBASE}"
ac_add_options --with-system-ffi="${LOCALBASE}"
ac_add_options --with-system-pixman
ac_add_options --with-system-libvpx
ac_add_options --with-system-nss
ac_add_options --with-system-nspr
3 changes: 3 additions & 0 deletions www/palemoon/files/palemoon
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

cd ${TRUEPREFIX}/lib/palemoon-${V} && ./palemoon
8 changes: 4 additions & 4 deletions www/palemoon/patches/patch-client_mk
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
$OpenBSD$

Something better?
Need to be explicit with compilers.

Index: client.mk
--- client.mk.orig
+++ client.mk
@@ -319,6 +319,8 @@ CONFIG_STATUS_DEPS := \
@@ -320,6 +320,8 @@ CONFIG_STATUS_DEPS := \

CONFIGURE_ENV_ARGS += \
MAKE='$(MAKE)' \
+ CC='${WRKDIR}/bin/cc' \
+ CXX='${WRKDIR}/bin/c++' \
+ CC='${CC}' \
+ CXX='${CXX}' \
$(NULL)

# configure uses the program name to determine @srcdir@. Calling it without
74 changes: 74 additions & 0 deletions www/palemoon/patches/patch-config_gcc-stl-wrapper_template_h
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
$OpenBSD$

https://hg.mozilla.org/mozilla-central/rev/68da139d0866

Index: config/gcc-stl-wrapper.template.h
--- config/gcc-stl-wrapper.template.h.orig
+++ config/gcc-stl-wrapper.template.h
@@ -22,32 +22,6 @@
#define NOMINMAX 1
#endif

-// Don't include mozalloc for cstdlib. See bug 1245076.
-#ifndef moz_dont_include_mozalloc_for_cstdlib
-# define moz_dont_include_mozalloc_for_cstdlib
-#endif
-#ifndef moz_dont_include_mozalloc_for_${HEADER}
-// mozalloc.h wants <new>; break the cycle by always explicitly
-// including <new> here. NB: this is a tad sneaky. Sez the gcc docs:
-//
-// `#include_next' does not distinguish between <file> and "file"
-// inclusion, nor does it check that the file you specify has the
-// same name as the current file. It simply looks for the file
-// named, starting with the directory in the search path after the
-// one where the current file was found.
-# include_next <new>
-
-// See if we're in code that can use mozalloc. NB: this duplicates
-// code in nscore.h because nscore.h pulls in prtypes.h, and chromium
-// can't build with that being included before base/basictypes.h.
-# if !defined(XPCOM_GLUE) && !defined(NS_NO_XPCOM) && !defined(MOZ_NO_MOZALLOC)
-# include "mozilla/mozalloc.h"
-# else
-# error "STL code can only be used with infallible ::operator new()"
-# endif
-
-#endif
-
#if defined(DEBUG) && !defined(_GLIBCXX_DEBUG)
// Enable checked iterators and other goodies
//
@@ -58,9 +32,33 @@
// # define _GLIBCXX_DEBUG 1
#endif

+// Don't include mozalloc for cstdlib. See bug 1245076.
+#ifndef moz_dont_include_mozalloc_for_cstdlib
+# define moz_dont_include_mozalloc_for_cstdlib
+#endif
+
+// Include mozalloc after the STL header and all other headers it includes
+// have been preprocessed.
+#if !defined(MOZ_INCLUDE_MOZALLOC_H) && \
+ !defined(moz_dont_include_mozalloc_for_${HEADER})
+# define MOZ_INCLUDE_MOZALLOC_H
+# define MOZ_INCLUDE_H_FROM_${HEADER}
+#endif
+
#pragma GCC visibility push(default)
#include_next <${HEADER}>
#pragma GCC visibility pop
+
+#ifdef MOZ_INCLUDE_MOZALLOC_H_FROM_${HEADER}
+// See if we're in clode that can use mozalloc. NB: this duplicates
+// code in nscore.h because nscore.h pulls in prtypes.h, and chromium
+// can't built with that being included before base/basictypes.h.
+# if !defined(XPCOM_GLUE) && !defined(NS_NO_XPCOM) && !defined(MOZ_NO_MOZALLOC)
+# include "mozilla/mozalloc.h"
+# else
+# error "STL code can only be used with infallible ::operator new()"
+# endif
+#endif

// gcc calls a __throw_*() function from bits/functexcept.h when it
// wants to "throw an exception". functexcept exists nominally to
17 changes: 17 additions & 0 deletions www/palemoon/patches/patch-config_gcc_hidden_h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
$OpenBSD$

Maybe one day we'll run with a clang built binary.
We'll need this when we do.

Index: config/gcc_hidden.h
--- config/gcc_hidden.h.orig
+++ config/gcc_hidden.h
@@ -2,5 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

-/* Begin all files as hidden visibility */
+/* Begin all files as hidden visibility, but only if using gcc */
+#ifndef __llvm__
#pragma GCC visibility push(hidden)
+#endif
25 changes: 25 additions & 0 deletions www/palemoon/patches/patch-config_make-stl-wrappers_py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
$OpenBSD$

https://hg.mozilla.org/mozilla-central/rev/68da139d0866

Index: config/make-stl-wrappers.py
--- config/make-stl-wrappers.py.orig
+++ config/make-stl-wrappers.py
@@ -30,7 +30,6 @@ def main(outdir, compiler, template_file, header_list_
os.mkdir(outdir)

template = open(template_file, 'r').read()
- path_to_new = header_path('new', compiler)

for header in open(header_list_file, 'r'):
header = header.rstrip()
@@ -40,8 +39,7 @@ def main(outdir, compiler, template_file, header_list_
path = header_path(header, compiler)
with FileAvoidWrite(os.path.join(outdir, header)) as f:
f.write(string.Template(template).substitute(HEADER=header,
- HEADER_PATH=path,
- NEW_HEADER_PATH=path_to_new))
+ HEADER_PATH=path))


if __name__ == '__main__':
47 changes: 47 additions & 0 deletions www/palemoon/patches/patch-gfx_skia_generate_mozbuild_py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
$OpenBSD$

Don't attempt SSSE3 or SSE4.

Index: gfx/skia/generate_mozbuild.py
--- gfx/skia/generate_mozbuild.py.orig
+++ gfx/skia/generate_mozbuild.py
@@ -37,7 +37,7 @@ if not CONFIG['INTEL_ARCHITECTURE'] and CONFIG['CPU_AR
'trunk/src/opts/memset32_neon.S',
]

-if CONFIG['INTEL_ARCHITECTURE'] and CONFIG['GNU_CC'] and CONFIG['OS_ARCH'] != 'WINNT':
+if CONFIG['INTEL_ARCHITECTURE'] and CONFIG['GNU_CC'] and CONFIG['OS_ARCH'] == 'WINNT':
if CONFIG['CPU_ARCH'] == 'x86_64':
SOURCES += [
'trunk/src/opts/SkBlitRow_opts_SSE4_x64_asm.S',
@@ -79,9 +79,6 @@ LOCAL_INCLUDES += [
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android', 'gtk2', 'gtk3', 'qt', 'gonk', 'cocoa'):
DEFINES['SK_USE_POSIX_THREADS'] = 1

-if CONFIG['INTEL_ARCHITECTURE'] and CONFIG['HAVE_TOOLCHAIN_SUPPORT_MSSSE3']:
- DEFINES['SK_BUILD_SSSE3'] = 1
-
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android', 'gonk'):
DEFINES['SK_FONTHOST_CAIRO_STANDALONE'] = 0

@@ -115,20 +112,15 @@ if CONFIG['_MSC_VER']:
if CONFIG['INTEL_ARCHITECTURE'] and CONFIG['GNU_CC']:
SOURCES['trunk/src/opts/SkBitmapFilter_opts_SSE2.cpp'].flags += CONFIG['SSE2_FLAGS']
SOURCES['trunk/src/opts/SkBitmapProcState_opts_SSE2.cpp'].flags += CONFIG['SSE2_FLAGS']
- SOURCES['trunk/src/opts/SkBitmapProcState_opts_SSSE3.cpp'].flags += ['-mssse3']
SOURCES['trunk/src/opts/SkBlitRect_opts_SSE2.cpp'].flags += CONFIG['SSE2_FLAGS']
SOURCES['trunk/src/opts/SkBlitRow_opts_SSE2.cpp'].flags += CONFIG['SSE2_FLAGS']
SOURCES['trunk/src/opts/SkBlurImage_opts_SSE2.cpp'].flags += CONFIG['SSE2_FLAGS']
- SOURCES['trunk/src/opts/SkBlurImage_opts_SSE4.cpp'].flags += ['-msse4.1']
SOURCES['trunk/src/opts/SkMorphology_opts_SSE2.cpp'].flags += CONFIG['SSE2_FLAGS']
SOURCES['trunk/src/opts/SkUtils_opts_SSE2.cpp'].flags += CONFIG['SSE2_FLAGS']
SOURCES['trunk/src/opts/SkXfermode_opts_SSE2.cpp'].flags += CONFIG['SSE2_FLAGS']
elif CONFIG['CPU_ARCH'] == 'arm' and CONFIG['GNU_CC'] and CONFIG['BUILD_ARM_NEON']:
DEFINES['__ARM_HAVE_OPTIONAL_NEON_SUPPORT'] = 1
DEFINES['USE_ANDROID_NDK_CPU_FEATURES'] = 0
-elif CONFIG['CLANG_CL']:
- SOURCES['trunk/src/opts/SkBitmapProcState_opts_SSSE3.cpp'].flags += ['-mssse3']
- SOURCES['trunk/src/opts/SkBlurImage_opts_SSE4.cpp'].flags += ['-msse4.1']

if CONFIG['GNU_CXX'] and CONFIG['CPU_ARCH'] == 'arm':
SOURCES['skia/src/opts/SkBlitRow_opts_arm.cpp'].flags += ['-fomit-frame-pointer']

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 0fcae18

Please sign in to comment.