Subject: [alpine-aports] [PATCH] testing/seamonkey: fix building 2.49.4 on x86

From: Andrew <[email-masked]>
Date: Sun, 7 Jul 2019 16:18:57 +0300

Hello, people. Thanks to patch I found in void-packages repository
(fix-i686-musl.patch) I was able to build seamonkey on alpine-edge
on x86. Also I am not sure if you can build seamonkey on architectures
other than x86 or x86_64, so I left 'arch="x86"'.

With best regards, Andrew.

---

diff --git a/testing/seamonkey/APKBUILD b/testing/seamonkey/APKBUILD
index f90bc0f943..5e2e9b4e5e 100644
--- a/testing/seamonkey/APKBUILD
+++ b/testing/seamonkey/APKBUILD
@@ -2,10 +2,10 @@
 # Maintainer: Marc Vertes <[email-masked]>
 pkgname=seamonkey
 pkgver=2.49.4
-pkgrel=6
+pkgrel=7
 pkgdesc="all-in-one internet application suite"
 url="http://www.seamonkey-project.org"
-arch="x86_64"
+arch="x86"
 license="MPL"
 makedepends="unzip zip gtk+2.0-dev yasm alsa-lib-dev libxt-dev linux-headers
 	hunspell-dev nspr-dev nss-dev jpeg-dev bzip2-dev zlib-dev libpng-dev
@@ -16,6 +16,7 @@ source=" https://archive.mozilla.org/pub/mozilla.org/seamonkey/releases/$pkgver/
 	mozconfig
 	fix-aouth.patch
 	fix-hunspell.patch
+	fix-i686-musl.patch
 	fix-libevent.patch
 	fix-libgen.patch
 	fix-linux-syscall.patch
@@ -39,8 +40,8 @@ build() {
 	unset MAKEFLAGS CPPFLAGS
 
 	# Disable some optimizations in gcc6 (rhbz#1328045)
-	CFLAGS="$CFLAGS -fno-delete-null-pointer-checks -fno-lifetime-dse -fno-schedule-insns2"
-	CXXFLAGS="$CXXFLAGS -fno-delete-null-pointer-checks -fno-lifetime-dse -fno-schedule-insns2"
+	CFLAGS="$CFLAGS -fno-delete-null-pointer-checks -fno-lifetime-dse -fno-schedule-insns2 -D_FILE_OFFSET_BITS=64"
+	CXXFLAGS="$CXXFLAGS -fno-delete-null-pointer-checks -fno-lifetime-dse -fno-schedule-insns2 -D_FILE_OFFSET_BITS=64"
 
 	make -f client.mk build
 }
@@ -71,7 +72,8 @@ package() {
 }
 
 sha512sums="f67dfb269c946da3d8dd6091daf51b80edac0f9e1fe88d860018c8628e5aaaaf17c91d086b6d7502465ccbfe6485fabdf072bb088af5c59520e77f12a5812625  seamonkey-2.49.4.source.tar.xz
-ce280a99c6ad15887129819c88bb7ce55a40eaae2fb928c7c9a08aa09dbbe33d9c78a6df1dd0c97869108ff542ea063d1e79d9adb910e0d7ba5c84ebb4e204a1  mozconfig
+c867aefaab21043455c6c5661c94082e864283ac5abe698b72c4b89ebe97d019740d0d607b94103d077c4003c0d5a7d2cad09c0c52900202fa2160cc06f1ed07  mozconfig
+ac6ad28654723f8ee56f6ddcf2dc2800ee217cd4946cc6b543242881aeaf3edc9f66664205fb6939cec9ce4a2cb2ead4758c0ce021858b672b297ba9295fa392  fix-i686-musl.patch
 c3b3b5a32f8672a42c051c03c31761414ce52c4a32258f1c7417af7de891e4b5f620ef2762034a18f84e5c7235559d920963aff0f28c2c1f4ae697a38d49b89c  fix-aouth.patch
 ea58a2cf58e7d1d99a2346a6977fcb2acff8052e304f9f0d66e24241d77fe352610537c4d2a886b9085b970368dbe46e5011acc210bebcdf22a88a4b5be960b1  fix-hunspell.patch
 c2a83214cadc827dd6d37c635ea92ff0779849e55e524b831f1a82ca09dc985770212a81377c2519c3470d752e922fa360d6e49fdfc1f6e9ee581f30ad1885f1  fix-libevent.patch
diff --git a/testing/seamonkey/fix-i686-musl.patch b/testing/seamonkey/fix-i686-musl.patch
new file mode 100644
index 0000000000..a85727d9b9
--- /dev/null
+++ b/testing/seamonkey/fix-i686-musl.patch
@@ -0,0 +1,20 @@
+--- a/mozilla/mozglue/misc/StackWalk.cpp	2017-04-11 04:13:21.000000000 +0200
++++ b/mozilla/mozglue/misc/StackWalk.cpp	2017-11-29 15:23:07.218649970 +0100
+@@ -41,7 +41,7 @@
+ #define MOZ_STACKWALK_SUPPORTS_MACOSX 0
+ #endif
+ 
+-#if (defined(linux) && \
++#if defined(__GLIBC__) && (defined(linux) && \
+      ((defined(__GNUC__) && (defined(__i386) || defined(PPC))) || \
+       defined(HAVE__UNWIND_BACKTRACE)))
+ #define MOZ_STACKWALK_SUPPORTS_LINUX 1
+@@ -911,7 +911,7 @@
+ }
+ 
+ // {x86, ppc} x {Linux, Mac} stackwalking code.
+-#if ((defined(__i386) || defined(PPC) || defined(__ppc__)) && \
++#if defined(__GLIBC__) && ((defined(__i386) || defined(PPC) || defined(__ppc__)) && \
+      (MOZ_STACKWALK_SUPPORTS_MACOSX || MOZ_STACKWALK_SUPPORTS_LINUX))
+ 
+ MFBT_API bool
diff --git a/testing/seamonkey/mozconfig b/testing/seamonkey/mozconfig
index d8023a340d..59d4b68483 100644
--- a/testing/seamonkey/mozconfig
+++ b/testing/seamonkey/mozconfig
@@ -27,7 +27,9 @@ ac_add_options --enable-default-toolkit=cairo-gtk2
 ac_add_options --enable-safe-browsing
 ac_add_options --enable-gio
 #ac_add_options --disable-gstreamer
-ac_add_options --enable-optimize
+#ac_add_options --enable-optimize
+ac_add_options --enable-optimize="$CFLAGS"
+ac_add_options --enable-pie
 ac_add_options --enable-strip
 ac_add_options --enable-install-strip
 ac_add_options --enable-official-branding
@@ -47,5 +49,8 @@ ac_add_options --disable-gnomeui
 ac_add_options --disable-jemalloc
 ac_add_options --disable-debug
 ac_add_options --disable-debug-symbols
+ac_add_options --enable-release
+ac_add_options --disable-gold
 
 export MOZILLA_OFFICIAL=1
+export BUILD_OFFICIAL=1

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---