Iceweasel: add recipe for 140.1.0 ESR version

This commit is contained in:
Gerasim Troeglazov
2025-07-31 15:51:17 +10:00
parent 72842914c2
commit b9c836af8a
3 changed files with 6447 additions and 0 deletions

View File

@@ -0,0 +1,183 @@
SUMMARY="Unofficial Haiku port of Mozilla Firefox ESR"
DESCRIPTION="Iceweasel is an open source web browser. \
It achieves balance between ease of use and customization, catering to the \
needs of both casual and power users."
HOMEPAGE="https://github.com/kenz-gelsoft/gecko-dev"
COPYRIGHT="1995-2025 Mozilla Developers and Contributors"
LICENSE="MPL v2.0"
REVISION="1"
SOURCE_URI="https://ftp.mozilla.org/pub/firefox/releases/${portVersion}esr/source/firefox-${portVersion}esr.source.tar.xz"
CHECKSUM_SHA256="d15c65d790e0c371b5c95332141b1bdeb29fefc27f852d22a5f542b6d1bc1922"
SOURCE_DIR="firefox-$portVersion"
PATCHES="
iceweasel_esr-$portVersion.patchset
iceweasel_launcher-$portVersion.patchset
"
ADDITIONAL_FILES="
iceweasel.rdef.in
iceweasel_launcher.rdef.in
branding.zip
mozconfig
"
ARCHITECTURES="!x86_64"
PROVIDES="
iceweasel_esr= $portVersion
app:Iceweasel= $portVersion
"
CONFLICTS="
iceweasel
iceweasel_bin
"
REQUIRES="
haiku
lib:libatk_1.0
lib:libcairo
lib:libcairo_gobject
lib:libdbus_1
lib:libevent_2.1
lib:libgdk_3
lib:libgdk_pixbuf_2.0
lib:libglib_2.0
lib:libgtk_3
lib:libharfbuzz
lib:libintl
lib:libmediahelpers
lib:libnotify
lib:libnspr4
lib:libnss3
lib:libpango_1.0
lib:libpangocairo_1.0
lib:libpng16
lib:libz
"
BUILD_REQUIRES="
haiku_devel
devel:libdbus_1
devel:libdbus_glib_1
devel:libevent
devel:libglib_2.0
devel:libgtk_3
devel:libmediahelpers
devel:libnotify
devel:libnspr4
devel:libnss3
devel:libpng16
devel:libvpx
devel:libwebp
devel:libzstd
"
BUILD_PREREQUIRES="
llvm20
nodejs20
rust_bin
cmd:autoconf_2.13
cmd:cbindgen
cmd:clang++
cmd:gawk
cmd:gcc
cmd:git
cmd:gn
cmd:lld >= 20
cmd:m4
cmd:make
cmd:nasm
cmd:perl
cmd:pip3
cmd:pkg_config
cmd:python3
cmd:tar
cmd:unzip
cmd:xargs
cmd:zip
"
PATCH ()
{
# extract browser branding for iceweasel
unzip -o $sourceDir/../../additional-files/branding.zip -o -d $sourceDir/browser/branding
}
BUILD()
{
chmod +x \
build/cargo-linker \
mach
rm -f mozconfig
cp -f $portDir/additional-files/mozconfig mozconfig
export DISABLE_ASLR=1
export MOZBUILD_STATE_PATH="$sourceDir/.mozconfig"
./mach -vv \
--no-interactive bootstrap \
--application-choice="Firefox for Desktop" \
--exclude=sysroot-wasm32-wasi
./mach python build/gn_processor.py dom/media/webrtc/third_party_build/gn-configs/webrtc.json
./mach build
cd tools/haiku-launcher
gcc -o "Iceweasel Browser" launcher.cpp -lbe
}
INSTALL()
{
export DISABLE_ASLR=1
export MOZBUILD_STATE_PATH="$sourceDir/.mozconfig"
./mach install
./mach package
mkdir -p $appsDir
mv /usr/local/lib/Iceweasel $appsDir/Iceweasel
cp "tools/haiku-launcher/Iceweasel Browser" $appsDir/Iceweasel
mkdir -p $appsDir/Iceweasel/lib
# arranging the files in lib directories
cd $appsDir/Iceweasel
mv \
libgkcodecs.so \
liblgpllibs.so \
libmozavcodec.so \
libmozavutil.so \
libmozgtk.so \
libmozsqlite3.so \
libmozwayland.so \
libxul.so \
lib
local APP_SIGNATURE="application/x-vnd.iceweasel"
local MAJOR="`echo "$portVersion" | cut -d. -f1`"
local MIDDLE="`echo "$portVersion" | cut -d. -f2`"
local MINOR="`echo "$portVersion" | cut -d. -f3`"
local LONG_INFO="$SUMMARY"
sed \
-e "s|@APP_SIGNATURE@|$APP_SIGNATURE|" \
-e "s|@MAJOR@|$MAJOR|" \
-e "s|@MIDDLE@|$MIDDLE|" \
-e "s|@MINOR@|$MINOR|" \
-e "s|@LONG_INFO@|$LONG_INFO|" \
$portDir/additional-files/iceweasel.rdef.in > iceweasel.rdef
sed \
-e "s|@MAJOR@|$MAJOR|" \
-e "s|@MIDDLE@|$MIDDLE|" \
-e "s|@MINOR@|$MINOR|" \
-e "s|@LONG_INFO@|$LONG_INFO|" \
$portDir/additional-files/iceweasel_launcher.rdef.in > iceweasel_launcher.rdef
addResourcesToBinaries iceweasel.rdef "$appsDir/Iceweasel/Iceweasel"
addResourcesToBinaries iceweasel_launcher.rdef "$appsDir/Iceweasel/Iceweasel Browser"
addAppDeskbarSymlink $appsDir/Iceweasel/Iceweasel
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,126 @@
From 87d14d4ef2e06f7dfeeb66aa2fac74fef2e58cc6 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Sun, 6 Apr 2025 10:13:00 +1000
Subject: Add simple launcher app
diff --git a/tools/haiku-launcher/launcher.cpp b/tools/haiku-launcher/launcher.cpp
new file mode 100644
index 0000000..86a9f22
--- /dev/null
+++ b/tools/haiku-launcher/launcher.cpp
@@ -0,0 +1,111 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <errno.h>
+#include <string.h>
+
+#include <Application.h>
+#include <Alert.h>
+#include <String.h>
+#include <Resources.h>
+#include <Roster.h>
+#include <Mime.h>
+#include <Path.h>
+#include <AppFileInfo.h>
+#include <kernel/image.h>
+
+class BrowserLauncherApp : public BApplication {
+ public:
+ BrowserLauncherApp(const char *signature, int argc, char **argv);
+ ~BrowserLauncherApp() {};
+
+ virtual void RefsReceived(BMessage *pmsg);
+ virtual void ArgvRecieved(int32 argc, char**argv);
+ virtual void ReadyToRun();
+ BString GetBinPath(void);
+
+ private:
+ BString fCommandLine;
+};
+
+BrowserLauncherApp::BrowserLauncherApp(const char *signature, int argc, char **argv)
+ : BApplication(signature)
+{
+ ArgvRecieved(argc, argv);
+}
+
+BString
+BrowserLauncherApp::GetBinPath(void)
+{
+ BPath binPath;
+
+ image_info info;
+ int32 cookie = 0;
+
+ while (get_next_image_info(B_CURRENT_TEAM, &cookie, &info) == B_OK) {
+ if (info.type == B_APP_IMAGE) {
+ binPath.SetTo(info.name);
+ binPath.GetParent(&binPath);
+ break;
+ }
+ }
+
+ binPath.Append("Iceweasel");
+
+ return binPath.Path();
+}
+
+void
+BrowserLauncherApp::RefsReceived(BMessage *pmsg)
+{
+ fCommandLine = GetBinPath();
+
+ entry_ref ref;
+ for (int32 i = 0; pmsg->FindRef("refs", i, &ref) == B_OK; i++) {
+ BPath file = BPath(&ref);
+ fCommandLine += " \"";
+ fCommandLine += file.Path();
+ fCommandLine += "\"";
+ }
+
+ BString url;
+ for (int32 i = 0; pmsg->FindString("url", i, &url) == B_OK; i++) {
+ fCommandLine += " \"";
+ fCommandLine += url;
+ fCommandLine += "\"";
+ }
+
+ fCommandLine += " &";
+}
+
+void
+BrowserLauncherApp::ArgvRecieved(int32 argc, char**argv)
+{
+ BMessage message(B_REFS_RECEIVED);
+ for (int i = 1; i < argc; i++) {
+ const char* url = argv[i];
+ BEntry entry(argv[i], true);
+ BPath path;
+ if (entry.Exists() && entry.GetPath(&path) == B_OK)
+ url = path.Path();
+ message.AddString("url", url);
+ }
+ RefsReceived(&message);
+}
+
+void
+BrowserLauncherApp::ReadyToRun()
+{
+ if (!fCommandLine.IsEmpty())
+ system(fCommandLine.String());
+
+ Quit();
+}
+
+int main(int argc, char **argv)
+{
+ BrowserLauncherApp application("application/x-vnd.iceweasel-launcher", argc, argv);
+ application.Run();
+ return 0;
+}
+
+
--
2.48.1