From d2121f9c4cd35ff1a039c5d03542daddc1d5224bdde8c915279818327b816c8c Mon Sep 17 00:00:00 2001 From: sisungo Date: Sat, 7 Nov 2026 07:40:43 +0000 Subject: [PATCH] feat: add package firefox Signed-off-by: sisungo --- packages/firefox/mozconfig | 17 + .../0001-musl-audio-thread-priority.diff | 429 ++++++++++++++++++ .../patches/0003-libwebrtc-includes.diff | 10 + packages/firefox/patches/0004-musl-prctl.diff | 20 + .../patches/0005-clang-visibility.diff | 18 + packages/firefox/pkgbuild.py | 54 +++ 6 files changed, 548 insertions(+) create mode 100644 packages/firefox/mozconfig create mode 100644 packages/firefox/patches/0001-musl-audio-thread-priority.diff create mode 100644 packages/firefox/patches/0003-libwebrtc-includes.diff create mode 100644 packages/firefox/patches/0004-musl-prctl.diff create mode 100644 packages/firefox/patches/0005-clang-visibility.diff create mode 100644 packages/firefox/pkgbuild.py diff --git a/packages/firefox/mozconfig b/packages/firefox/mozconfig new file mode 100644 index 0000000..afa26d2 --- /dev/null +++ b/packages/firefox/mozconfig @@ -0,0 +1,17 @@ +ac_add_options --disable-bootstrap +ac_add_options --disable-debug +ac_add_options --disable-debug-symbols +ac_add_options --disable-jemalloc +ac_add_options --disable-tests +ac_add_options --disable-updater + +ac_add_options --enable-audio-backends=alsa +ac_add_options --enable-default-toolkit=cairo-gtk3-wayland-only +ac_add_options --with-distribution-id=org.semilabs.os +ac_add_options --with-wasi-sysroot=/usr/share/wasi-sysroot + +ac_add_options --disable-elf-hack +ac_add_options --enable-packed-relative-relocs + +ac_add_options --with-system-zlib +ac_add_options --with-system-pixman diff --git a/packages/firefox/patches/0001-musl-audio-thread-priority.diff b/packages/firefox/patches/0001-musl-audio-thread-priority.diff new file mode 100644 index 0000000..5118769 --- /dev/null +++ b/packages/firefox/patches/0001-musl-audio-thread-priority.diff @@ -0,0 +1,429 @@ +diff --git a/.cargo/config.toml.in b/.cargo/config.toml.in +--- a/.cargo/config.toml.in ++++ b/.cargo/config.toml.in +@@ -63,13 +63,13 @@ + [source."git+https://github.com/martinthomson/ohttp?rev=600931b5a1e947776cbaad931ed78f1e89005352"] + git = "https://github.com/martinthomson/ohttp" + rev = "600931b5a1e947776cbaad931ed78f1e89005352" + replace-with = "vendored-sources" + +-[source."git+https://github.com/mozilla/audioipc?rev=d3c9825"] ++[source."git+https://github.com/mozilla/audioipc?rev=ef46a7bd05032d1577208ff048d444cc7412c7b8"] + git = "https://github.com/mozilla/audioipc" +-rev = "d3c9825" ++rev = "ef46a7bd05032d1577208ff048d444cc7412c7b8" + replace-with = "vendored-sources" + + [source."git+https://github.com/mozilla/authenticator-rs?tag=v0.6.0"] + git = "https://github.com/mozilla/authenticator-rs" + tag = "v0.6.0" +diff --git a/Cargo.lock b/Cargo.lock +--- a/Cargo.lock ++++ b/Cargo.lock +@@ -334,13 +334,13 @@ + "bitflags 1.999.999", + ] + + [[package]] + name = "audio_thread_priority" +-version = "0.37.0" ++version = "0.38.0" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "e58c7a923538aa84eef9947d81924fb9f34d7db6004e179218ab57a7bb7700b6" ++checksum = "e0b30b2f3d2da482d0faeaafd8f88a38fbc62abb58d3b402cfa195793f4c92ab" + dependencies = [ + "cfg-if", + "dbus", + "libc", + "log", +@@ -349,11 +349,11 @@ + ] + + [[package]] + name = "audioipc2" + version = "0.6.0" +-source = "git+https://github.com/mozilla/audioipc?rev=d3c9825#d3c9825a876a5fc7b54101bd40d685acfc542917" ++source = "git+https://github.com/mozilla/audioipc?rev=ef46a7bd05032d1577208ff048d444cc7412c7b8#ef46a7bd05032d1577208ff048d444cc7412c7b8" + dependencies = [ + "arrayvec", + "ashmem", + "audio_thread_priority", + "bincode", +@@ -375,22 +375,22 @@ + ] + + [[package]] + name = "audioipc2-client" + version = "0.6.0" +-source = "git+https://github.com/mozilla/audioipc?rev=d3c9825#d3c9825a876a5fc7b54101bd40d685acfc542917" ++source = "git+https://github.com/mozilla/audioipc?rev=ef46a7bd05032d1577208ff048d444cc7412c7b8#ef46a7bd05032d1577208ff048d444cc7412c7b8" + dependencies = [ + "audio_thread_priority", + "audioipc2", + "cubeb-backend", + "log", + ] + + [[package]] + name = "audioipc2-server" + version = "0.6.0" +-source = "git+https://github.com/mozilla/audioipc?rev=d3c9825#d3c9825a876a5fc7b54101bd40d685acfc542917" ++source = "git+https://github.com/mozilla/audioipc?rev=ef46a7bd05032d1577208ff048d444cc7412c7b8#ef46a7bd05032d1577208ff048d444cc7412c7b8" + dependencies = [ + "audio_thread_priority", + "audioipc2", + "cubeb-core", + "log", +diff --git a/supply-chain/imports.lock b/supply-chain/imports.lock +--- a/supply-chain/imports.lock ++++ b/supply-chain/imports.lock +@@ -28,12 +28,12 @@ + user-id = 2915 + user-login = "Amanieu" + user-name = "Amanieu d'Antras" + + [[publisher.audio_thread_priority]] +-version = "0.37.0" +-when = "2026-08-10" ++version = "0.38.0" ++when = "2026-09-17" + user-id = 1258 + user-login = "padenot" + user-name = "Paul Adenot" + + [[publisher.bhttp]] +diff --git a/third_party/rust/audio_thread_priority/.cargo-checksum.json b/third_party/rust/audio_thread_priority/.cargo-checksum.json +--- a/third_party/rust/audio_thread_priority/.cargo-checksum.json ++++ b/third_party/rust/audio_thread_priority/.cargo-checksum.json +@@ -1 +1 @@ +-{"files":{".cargo_vcs_info.json":"13629c1e0aabfcffbae3bddf6a472231b10f973817c0bd549f5e2782036184dd",".github/workflows/rust.yml":"f1ff0376f6d30c204620d50af9c60c4374b7e5001ad290e3bf3595925923f8f2","Cargo.lock":"fff166a1e4746a81e6b2b060692ed73790e8472e7c0526f60f2870baf5edb480","Cargo.toml":"ada29a3c844b5aaa099cea6854b1ca73cf98795ab52b8085c196c2931d08688d","Cargo.toml.orig":"6bdedb288e992ab55fb7d728a7941b1c85fb430c75c72fae685126b87c5f9372","LICENSE":"32ee9dbf6196874fc9d406c54a888a6c4cbb9aa4a7f35b46befeaff43a78fe85","Makefile":"0f9a771cfb30c7c4b9961d82fdca4e9e229a955bb2e636474a4101389e18e938","README.md":"c123692b3b50dd621b896a8269814d609cbf1e532b461bf4a77854ddd607eb7a","atp_test.cpp":"8075a040941a65fb9e3f7cbf0535853ca6661c3ac442ec35569b42b24bbec797","audio_thread_priority.h":"c32ac62eaa6b9482e5a56c407a47ec470ccadcdc8c95b06d38bd593987975a74","generate_osx_bindings.sh":"06e4e03450f788ced18d31fff5660919e6f6ec1119ddace363ffeb82f0518a71","src/lib.rs":"6e384fb8103be42882a162f22f5f7350a427ef797d895f662f54953dd9aea59b","src/rt_android.rs":"2e54e3ac527bef0c11790013c9399e1f388752a952af667c85da0f6f53eeb7c9","src/rt_linux.rs":"53204f6aa158b270a22b4099cde58558ec5ff96292ac8955581b4bcfbf3443d3","src/rt_linux_native.rs":"283ba4e200a1de707a4c336cae5d7f2fec9fc9c7a5a0794c286b4228bfe926b4","src/rt_mach.rs":"723e29ee7392b10c30f803b90a23ec6cd7a8aaaf6e81fe711e86cb6588a13ff0","src/rt_win.rs":"1743f579aea1b29940fee2f0652e23f76e08153ec7cbca621e5720d526e25b96"},"package":"e58c7a923538aa84eef9947d81924fb9f34d7db6004e179218ab57a7bb7700b6"} +\ No newline at end of file ++{"files":{".cargo_vcs_info.json":"941d7dd364a5ca6de04e5a1129197df302d661f809bab3d5ba6d63eb63e364e6",".github/workflows/rust.yml":"0b36b48d6f1976ae3a089596945ef398e02cfcb584a8dd04cb1fc2f16d2fd45f","Cargo.lock":"338d7d500e7cd330949216e3e9e7242cf91439b3eec90a5a75812df7f1fa4108","Cargo.toml":"8f76e327c4ac3c0e333491e7d35c52053574c7ec403b0cc4344893459eaadef8","Cargo.toml.orig":"0f774ee30569ad64f6de4affb15469b240f91086ef2e02320d60e248c853938f","LICENSE":"32ee9dbf6196874fc9d406c54a888a6c4cbb9aa4a7f35b46befeaff43a78fe85","Makefile":"0f9a771cfb30c7c4b9961d82fdca4e9e229a955bb2e636474a4101389e18e938","README.md":"c123692b3b50dd621b896a8269814d609cbf1e532b461bf4a77854ddd607eb7a","atp_test.cpp":"8075a040941a65fb9e3f7cbf0535853ca6661c3ac442ec35569b42b24bbec797","audio_thread_priority.h":"c32ac62eaa6b9482e5a56c407a47ec470ccadcdc8c95b06d38bd593987975a74","generate_osx_bindings.sh":"06e4e03450f788ced18d31fff5660919e6f6ec1119ddace363ffeb82f0518a71","src/lib.rs":"6e384fb8103be42882a162f22f5f7350a427ef797d895f662f54953dd9aea59b","src/rt_android.rs":"2e54e3ac527bef0c11790013c9399e1f388752a952af667c85da0f6f53eeb7c9","src/rt_linux.rs":"6bfb616de5a089279aaa306ca408433c873fe66812b144750f77f9d975cc166d","src/rt_linux_native.rs":"0634c3bc9ad4f4cf86f30735b3234fbd1d544ce28009305fede08ca27e745538","src/rt_mach.rs":"723e29ee7392b10c30f803b90a23ec6cd7a8aaaf6e81fe711e86cb6588a13ff0","src/rt_win.rs":"1743f579aea1b29940fee2f0652e23f76e08153ec7cbca621e5720d526e25b96"},"package":"e0b30b2f3d2da482d0faeaafd8f88a38fbc62abb58d3b402cfa195793f4c92ab"} +\ No newline at end of file +diff --git a/third_party/rust/audio_thread_priority/.cargo_vcs_info.json b/third_party/rust/audio_thread_priority/.cargo_vcs_info.json +--- a/third_party/rust/audio_thread_priority/.cargo_vcs_info.json ++++ b/third_party/rust/audio_thread_priority/.cargo_vcs_info.json +@@ -1,6 +1,6 @@ + { + "git": { +- "sha1": "0aa1ecd7719b582b54f7648eec1f76e9f18cdd3c" ++ "sha1": "f7823feae23ac705d09156eaa84a4deea75fa55e" + }, + "path_in_vcs": "" + } +\ No newline at end of file +diff --git a/third_party/rust/audio_thread_priority/.github/workflows/rust.yml b/third_party/rust/audio_thread_priority/.github/workflows/rust.yml +--- a/third_party/rust/audio_thread_priority/.github/workflows/rust.yml ++++ b/third_party/rust/audio_thread_priority/.github/workflows/rust.yml +@@ -89,5 +89,41 @@ + # inherit it. This mirrors a real deployment rather than running the tests as root. + run: | + sudo prlimit --pid $$ --rtprio=10:10 + echo "RLIMIT_RTPRIO soft=$(ulimit -Sr) hard=$(ulimit -Hr)" + rustup run ${{ matrix.rust }} cargo test --no-default-features ++ ++ # musl defines pthread_t as a pointer instead of an integer, unlike glibc. ++ build-musl: ++ runs-on: ubuntu-24.04 ++ strategy: ++ matrix: ++ rust: [stable, nightly] ++ ++ steps: ++ - uses: actions/checkout@v2 ++ ++ - name: Install Rust (musl target) ++ run: | ++ rustup toolchain install ${{ matrix.rust }} --profile minimal ++ rustup target add x86_64-unknown-linux-musl --toolchain ${{ matrix.rust }} ++ ++ - name: Install Dependencies ++ run: sudo apt-get update && sudo apt-get install libdbus-1-dev ++ ++ - name: Build (musl, with dbus) ++ shell: bash ++ # The crate is a staticlib/rlib, so this doesn't link, and hence needs no musl libdbus: only ++ # the headers, which pkg-config finds for the host. ++ run: PKG_CONFIG_ALLOW_CROSS=1 rustup run ${{ matrix.rust }} cargo build --target x86_64-unknown-linux-musl --features dbus ++ ++ - name: Build (musl, without dbus) ++ shell: bash ++ run: rustup run ${{ matrix.rust }} cargo build --target x86_64-unknown-linux-musl --no-default-features ++ ++ - name: Test (musl, without dbus) ++ shell: bash ++ # Statically linked musl test binaries run fine on the glibc runner. As in the fallback job, ++ # the native promotion path needs permission to request real-time scheduling. ++ run: | ++ sudo prlimit --pid $$ --rtprio=10:10 ++ rustup run ${{ matrix.rust }} cargo test --target x86_64-unknown-linux-musl --no-default-features -- --nocapture +diff --git a/third_party/rust/audio_thread_priority/Cargo.lock b/third_party/rust/audio_thread_priority/Cargo.lock +--- a/third_party/rust/audio_thread_priority/Cargo.lock ++++ b/third_party/rust/audio_thread_priority/Cargo.lock +@@ -2,11 +2,11 @@ + # It is not intended for manual editing. + version = 4 + + [[package]] + name = "audio_thread_priority" +-version = "0.37.0" ++version = "0.38.0" + dependencies = [ + "cfg-if", + "dbus", + "libc", + "log 0.4.33", +diff --git a/third_party/rust/audio_thread_priority/Cargo.toml b/third_party/rust/audio_thread_priority/Cargo.toml +--- a/third_party/rust/audio_thread_priority/Cargo.toml ++++ b/third_party/rust/audio_thread_priority/Cargo.toml +@@ -10,11 +10,11 @@ + # See Cargo.toml.orig for the original contents. + + [package] + edition = "2018" + name = "audio_thread_priority" +-version = "0.37.0" ++version = "0.38.0" + authors = ["Paul Adenot "] + build = false + autolib = false + autobins = false + autoexamples = false +diff --git a/third_party/rust/audio_thread_priority/Cargo.toml.orig b/third_party/rust/audio_thread_priority/Cargo.toml.orig +--- a/third_party/rust/audio_thread_priority/Cargo.toml.orig ++++ b/third_party/rust/audio_thread_priority/Cargo.toml.orig +@@ -1,8 +1,8 @@ + [package] + name = "audio_thread_priority" +-version = "0.37.0" ++version = "0.38.0" + authors = ["Paul Adenot "] + description = "Bump a thread to real-time priority, for audio work, on Linux, Android, Windows and macOS" + license = "MPL-2.0" + repository = "https://github.com/mozilla/audio_thread_priority" + edition = "2018" +diff --git a/third_party/rust/audio_thread_priority/src/rt_linux.rs b/third_party/rust/audio_thread_priority/src/rt_linux.rs +--- a/third_party/rust/audio_thread_priority/src/rt_linux.rs ++++ b/third_party/rust/audio_thread_priority/src/rt_linux.rs +@@ -60,11 +60,13 @@ + impl RtPriorityThreadInfoInternal { + /// Serialize to a byte buffer. The fields are packed explicitly rather than transmuting the + /// struct, so no uninitialized padding bytes are ever read. Any trailing padding stays zero. + pub fn serialize(&self) -> [u8; std::mem::size_of::()] { + let thread_id = self.thread_id.to_ne_bytes(); +- let pthread_id = self.pthread_id.to_ne_bytes(); ++ // `pthread_t` is an integer with glibc but a pointer with musl: go through `usize`, which ++ // is as wide as both. ++ let pthread_id = (self.pthread_id as usize).to_ne_bytes(); + let pid = self.pid.to_ne_bytes(); + let policy = self.policy.to_ne_bytes(); + let priority = self.priority.to_ne_bytes(); + + let mut bytes = [0u8; std::mem::size_of::()]; +@@ -89,11 +91,11 @@ + chunk + } + let mut src = bytes.iter().copied(); + RtPriorityThreadInfoInternal { + thread_id: kernel_pid_t::from_ne_bytes(take(&mut src)), +- pthread_id: libc::pthread_t::from_ne_bytes(take(&mut src)), ++ pthread_id: usize::from_ne_bytes(take(&mut src)) as libc::pthread_t, + pid: libc::pid_t::from_ne_bytes(take(&mut src)), + policy: libc::c_int::from_ne_bytes(take(&mut src)), + priority: libc::c_int::from_ne_bytes(take(&mut src)), + } + } +diff --git a/third_party/rust/audio_thread_priority/src/rt_linux_native.rs b/third_party/rust/audio_thread_priority/src/rt_linux_native.rs +--- a/third_party/rust/audio_thread_priority/src/rt_linux_native.rs ++++ b/third_party/rust/audio_thread_priority/src/rt_linux_native.rs +@@ -76,11 +76,13 @@ + impl RtPriorityThreadInfoInternal { + /// Serialize to a byte buffer. The fields are packed explicitly rather than transmuting the + /// struct, so no uninitialized padding bytes are ever read. Any trailing padding stays zero. + pub fn serialize(&self) -> [u8; std::mem::size_of::()] { + let thread_id = self.thread_id.to_ne_bytes(); +- let pthread_id = self.pthread_id.to_ne_bytes(); ++ // `pthread_t` is an integer with glibc but a pointer with musl: go through `usize`, which ++ // is as wide as both. ++ let pthread_id = (self.pthread_id as usize).to_ne_bytes(); + let pid = self.pid.to_ne_bytes(); + let policy = self.policy.to_ne_bytes(); + let priority = self.priority.to_ne_bytes(); + + let mut bytes = [0u8; std::mem::size_of::()]; +@@ -105,11 +107,11 @@ + chunk + } + let mut src = bytes.iter().copied(); + RtPriorityThreadInfoInternal { + thread_id: kernel_pid_t::from_ne_bytes(take(&mut src)), +- pthread_id: libc::pthread_t::from_ne_bytes(take(&mut src)), ++ pthread_id: usize::from_ne_bytes(take(&mut src)) as libc::pthread_t, + pid: libc::pid_t::from_ne_bytes(take(&mut src)), + policy: libc::c_int::from_ne_bytes(take(&mut src)), + priority: libc::c_int::from_ne_bytes(take(&mut src)), + } + } +@@ -138,10 +140,30 @@ + /// The `sched_*` functions are thin syscall wrappers: they return -1 and set `errno`. + fn sched_error(context: &str) -> AudioThreadPriorityError { + AudioThreadPriorityError::new(&format!("{}: {}", context, OSError::last_os_error())) + } + ++/// Set the scheduling policy and priority of the thread with tid `tid`. ++/// ++/// This goes through the syscall directly because musl's `sched_setscheduler` is a stub that always ++/// fails with `ENOSYS`: POSIX specifies it as process-scoped, which Linux does not provide. The ++/// syscall is per-thread, which is what is needed here. ++fn sched_setscheduler( ++ tid: libc::pid_t, ++ policy: libc::c_int, ++ param: &libc::sched_param, ++) -> libc::c_long { ++ unsafe { ++ libc::syscall( ++ libc::SYS_sched_setscheduler, ++ tid, ++ policy, ++ param as *const libc::sched_param, ++ ) ++ } ++} ++ + /// A thread's system-wide tid narrowed to `pid_t` for the scheduler syscalls. A tid always fits in + /// `pid_t` (it is a pid), but convert defensively rather than truncating. + fn scheduler_tid(thread_id: kernel_pid_t) -> Result { + libc::pid_t::try_from(thread_id) + .map_err(|_| AudioThreadPriorityError::new("thread id does not fit in pid_t")) +@@ -234,12 +256,11 @@ + let tid = scheduler_tid(thread_info.thread_id)?; + + let mut param = unsafe { std::mem::zeroed::() }; + param.sched_priority = requested_priority(); + +- let rc = +- unsafe { libc::sched_setscheduler(tid, libc::SCHED_FIFO | SCHED_RESET_ON_FORK, ¶m) }; ++ let rc = sched_setscheduler(tid, libc::SCHED_FIFO | SCHED_RESET_ON_FORK, ¶m); + if rc < 0 { + return Err(sched_error("could not promote thread")); + } + + Ok(RtPriorityHandleInternal { thread_info }) +@@ -252,12 +273,11 @@ + // Keep SCHED_RESET_ON_FORK set (see demote_current_thread_from_real_time_internal): clearing it + // as an unprivileged thread would fail with EPERM. + let tid = scheduler_tid(thread_info.thread_id)?; + let mut param = unsafe { std::mem::zeroed::() }; + param.sched_priority = thread_info.priority; +- let rc = +- unsafe { libc::sched_setscheduler(tid, thread_info.policy | SCHED_RESET_ON_FORK, ¶m) }; ++ let rc = sched_setscheduler(tid, thread_info.policy | SCHED_RESET_ON_FORK, ¶m); + if rc < 0 { + return Err(sched_error("could not demote thread")); + } + Ok(()) + } +diff --git a/third_party/rust/audioipc2-client/.cargo-checksum.json b/third_party/rust/audioipc2-client/.cargo-checksum.json +--- a/third_party/rust/audioipc2-client/.cargo-checksum.json ++++ b/third_party/rust/audioipc2-client/.cargo-checksum.json +@@ -1 +1 @@ +-{"files":{"Cargo.toml":"e16f57291b3e7be5e035f2b1793b5864ae091d573df060ff032d484ca608c6a8","cbindgen.toml":"fb6abe1671497f432a06e40b1db7ed7cd2cceecbd9a2382193ad7534e8855e34","src/context.rs":"c351b782e9bb83a1fbc5127e07a4d06c59978256bb0dc265df256eb948a6cf4e","src/lib.rs":"0322bba9529c81c891bc2c033d402590058014da0df0730dbf9532380c2dabe8","src/send_recv.rs":"cd396a704f205d4ef680f484461a065aa29f624603d5031f9973779826fb3c19","src/stream.rs":"d7d4967c8ef760a58592aff23157357646528c1c83c9de394e1f9c8043f72a81"},"package":null} +\ No newline at end of file ++{"files":{"Cargo.toml":"b74876a8e35719161990b55d3b83127d883efcdddce79c866044ba59ab17e849","cbindgen.toml":"fb6abe1671497f432a06e40b1db7ed7cd2cceecbd9a2382193ad7534e8855e34","src/context.rs":"c351b782e9bb83a1fbc5127e07a4d06c59978256bb0dc265df256eb948a6cf4e","src/lib.rs":"0322bba9529c81c891bc2c033d402590058014da0df0730dbf9532380c2dabe8","src/send_recv.rs":"cd396a704f205d4ef680f484461a065aa29f624603d5031f9973779826fb3c19","src/stream.rs":"d7d4967c8ef760a58592aff23157357646528c1c83c9de394e1f9c8043f72a81"},"package":null} +\ No newline at end of file +diff --git a/third_party/rust/audioipc2-client/Cargo.toml b/third_party/rust/audioipc2-client/Cargo.toml +--- a/third_party/rust/audioipc2-client/Cargo.toml ++++ b/third_party/rust/audioipc2-client/Cargo.toml +@@ -34,11 +34,11 @@ + [dependencies] + cubeb-backend = "0.34" + log = "0.4" + + [dependencies.audio_thread_priority] +-version = "0.37" ++version = "0.38" + default-features = false + + [dependencies.audioipc] + path = "../audioipc" + package = "audioipc2" +diff --git a/third_party/rust/audioipc2-server/.cargo-checksum.json b/third_party/rust/audioipc2-server/.cargo-checksum.json +--- a/third_party/rust/audioipc2-server/.cargo-checksum.json ++++ b/third_party/rust/audioipc2-server/.cargo-checksum.json +@@ -1 +1 @@ +-{"files":{"Cargo.toml":"80d2db99b52346498fbdfd082fa294bf962d2442eefaaeb001ef04b009e5100b","cbindgen.toml":"fb6abe1671497f432a06e40b1db7ed7cd2cceecbd9a2382193ad7534e8855e34","src/lib.rs":"a19c1bad94e16a0cfcd1e93c25b97bf58cc00e9666b5c31652d8a2242decb36c","src/server.rs":"28d494e2d4a6ad673f77912578179eb7b1b8b927d7fd63048d099284d03aeda7"},"package":null} +\ No newline at end of file ++{"files":{"Cargo.toml":"7169f1242e389376f935ea01e29d17d7ebe52fcac3631c332357e1272fab1ba0","cbindgen.toml":"fb6abe1671497f432a06e40b1db7ed7cd2cceecbd9a2382193ad7534e8855e34","src/lib.rs":"a19c1bad94e16a0cfcd1e93c25b97bf58cc00e9666b5c31652d8a2242decb36c","src/server.rs":"28d494e2d4a6ad673f77912578179eb7b1b8b927d7fd63048d099284d03aeda7"},"package":null} +\ No newline at end of file +diff --git a/third_party/rust/audioipc2-server/Cargo.toml b/third_party/rust/audioipc2-server/Cargo.toml +--- a/third_party/rust/audioipc2-server/Cargo.toml ++++ b/third_party/rust/audioipc2-server/Cargo.toml +@@ -36,11 +36,11 @@ + log = "0.4" + once_cell = "1.2.0" + slab = "0.4" + + [dependencies.audio_thread_priority] +-version = "0.37" ++version = "0.38" + default-features = false + + [dependencies.audioipc] + path = "../audioipc" + package = "audioipc2" +diff --git a/third_party/rust/audioipc2/.cargo-checksum.json b/third_party/rust/audioipc2/.cargo-checksum.json +--- a/third_party/rust/audioipc2/.cargo-checksum.json ++++ b/third_party/rust/audioipc2/.cargo-checksum.json +@@ -1 +1 @@ +-{"files":{"Cargo.toml":"e5f446c16280d1294e630015be9bda06c489f20dde65c6d3c3b974325e676fdc","benches/serialization.rs":"495e9128fb7892c3460bf55c6dc56a3d9e8853331f566d43231e30fad2c00ff4","src/codec.rs":"49120cd77f09e4acace1629936157fc9afa0a846c9018ad2dd021b5f0e6577fd","src/errors.rs":"36fe5299aee55761366ddc5dcf2f6fb5d81d8a718c59394b6baeb4075fdfc1a7","src/ipccore.rs":"a06cf09aa600df1280538e7946223ab979f088848213fc9c1a394af312f81fbd","src/lib.rs":"98ba1fe514326d2ef374c9ccc3a7125836cdcc3abe62abcf9a4af0084205538a","src/messages.rs":"d294f24ce018603d2e141af3a06a983421a8da191275937bd2cfa8523064def1","src/rpccore.rs":"058477df2304b4d8c5d1a347663301bcdea3f772762f806963e63a0c8df9ea73","src/shm.rs":"61c9f5d158914cb0ed34d7ce898d1ab24d1a892c68ee0406ff03d01e5c172d32","src/sys/mod.rs":"e6fa1d260abf093e1f7b50185195e2d3aee0eb8c9774c6f253953b5896d838f3","src/sys/unix/cmsg.rs":"e7b7154d55ce57e16ba93d4982630077bf6c70fa56e572956f14ae15aa43cb4c","src/sys/unix/mod.rs":"de0cd5c7a44cfd7c1f5b8cd0260089dc7245373ff9baa0ce44acfdc2d407a9d1","src/sys/unix/msg.rs":"25244de3eba920fa42e032f8fa4ea4913a9fdeb5124ade61e707f6cc6dd946b0","src/sys/windows/mod.rs":"7eaabb76e62c6962b636320e2bbf79a78fce61659c799a798f7dd6d56b0be8a1"},"package":null} +\ No newline at end of file ++{"files":{"Cargo.toml":"4381ef3bff9eb36cfb1f0ef7793f09204229d3f7260144a2501ae83ca40b70c1","benches/serialization.rs":"495e9128fb7892c3460bf55c6dc56a3d9e8853331f566d43231e30fad2c00ff4","src/codec.rs":"49120cd77f09e4acace1629936157fc9afa0a846c9018ad2dd021b5f0e6577fd","src/errors.rs":"36fe5299aee55761366ddc5dcf2f6fb5d81d8a718c59394b6baeb4075fdfc1a7","src/ipccore.rs":"a06cf09aa600df1280538e7946223ab979f088848213fc9c1a394af312f81fbd","src/lib.rs":"98ba1fe514326d2ef374c9ccc3a7125836cdcc3abe62abcf9a4af0084205538a","src/messages.rs":"d294f24ce018603d2e141af3a06a983421a8da191275937bd2cfa8523064def1","src/rpccore.rs":"058477df2304b4d8c5d1a347663301bcdea3f772762f806963e63a0c8df9ea73","src/shm.rs":"61c9f5d158914cb0ed34d7ce898d1ab24d1a892c68ee0406ff03d01e5c172d32","src/sys/mod.rs":"e6fa1d260abf093e1f7b50185195e2d3aee0eb8c9774c6f253953b5896d838f3","src/sys/unix/cmsg.rs":"e7b7154d55ce57e16ba93d4982630077bf6c70fa56e572956f14ae15aa43cb4c","src/sys/unix/mod.rs":"de0cd5c7a44cfd7c1f5b8cd0260089dc7245373ff9baa0ce44acfdc2d407a9d1","src/sys/unix/msg.rs":"25244de3eba920fa42e032f8fa4ea4913a9fdeb5124ade61e707f6cc6dd946b0","src/sys/windows/mod.rs":"7eaabb76e62c6962b636320e2bbf79a78fce61659c799a798f7dd6d56b0be8a1"},"package":null} +\ No newline at end of file +diff --git a/third_party/rust/audioipc2/Cargo.toml b/third_party/rust/audioipc2/Cargo.toml +--- a/third_party/rust/audioipc2/Cargo.toml ++++ b/third_party/rust/audioipc2/Cargo.toml +@@ -66,11 +66,11 @@ + + [target.'cfg(target_os = "android")'.dependencies] + ashmem = "0.1.2" + + [target.'cfg(target_os = "linux")'.dependencies.audio_thread_priority] +-version = "0.37" ++version = "0.38" + default-features = false + + [target."cfg(unix)".dependencies] + arrayvec = "0.7" + iovec = "0.1" +diff --git a/toolkit/library/rust/shared/Cargo.toml b/toolkit/library/rust/shared/Cargo.toml +--- a/toolkit/library/rust/shared/Cargo.toml ++++ b/toolkit/library/rust/shared/Cargo.toml +@@ -25,12 +25,12 @@ + harfbuzz_glue = { path = "../../../../gfx/harfbuzz_glue" } + webrender_bindings = { path = "../../../../gfx/webrender_bindings" } + cubeb-coreaudio = { git = "https://github.com/mozilla/cubeb-coreaudio-rs", rev = "840f69c1b3f95accd582555e10abcef8ee67514b", optional = true } + cubeb-pulse = { git = "https://github.com/mozilla/cubeb-pulse-rs", rev="88194f91c8778fa608a19af7b91306094525595d", optional = true, features=["pulse-dlopen"] } + cubeb-sys = { version = "0.34", optional = true, features=["gecko-in-tree"] } +-audioipc2-client = { git = "https://github.com/mozilla/audioipc", rev = "d3c9825", optional = true } +-audioipc2-server = { git = "https://github.com/mozilla/audioipc", rev = "d3c9825", optional = true } ++audioipc2-client = { git = "https://github.com/mozilla/audioipc", rev = "ef46a7bd05032d1577208ff048d444cc7412c7b8", optional = true } ++audioipc2-server = { git = "https://github.com/mozilla/audioipc", rev = "ef46a7bd05032d1577208ff048d444cc7412c7b8", optional = true } + encoding_glue = { path = "../../../../intl/encoding_glue" } + locale_service_glue = { path = "../../../../intl/locale/rust/locale_service_glue" } + app_collator_glue = { path = "../../../../intl/app_collator_glue" } + authrs_bridge = { path = "../../../../dom/webauthn/authrs_bridge" } + gkrust_utils = { path = "../../../../xpcom/rust/gkrust_utils" } +@@ -46,11 +46,11 @@ + bitsdownload = { path = "../../../components/bitsdownload", optional = true } + storage = { path = "../../../../storage/rust" } + bookmark_sync = { path = "../../../components/places/bookmark_sync", optional = true } + buildid_reader_ffi = { path = "../../buildid_reader/ffi" } + chardetng_c = "1.0.0" +-audio_thread_priority = { version = "0.37", default-features = false } ++audio_thread_priority = { version = "0.38.0", default-features = false } + mdns_service = { path="../../../../dom/media/webrtc/transport/mdns_service", features = ["profiler"], optional = true } + neqo_glue = { path = "../../../../netwerk/socket/neqo_glue" } + wgpu_bindings = { path = "../../../../gfx/wgpu_bindings" } + fontations_glue = { path = "../../../../gfx/fontations_glue", optional = true } + mapped_hyph = { git = "https://github.com/jfkthame/mapped_hyph.git", rev = "eff105f6ad7ec9b79816cfc1985a28e5340ad14b" } + diff --git a/packages/firefox/patches/0003-libwebrtc-includes.diff b/packages/firefox/patches/0003-libwebrtc-includes.diff new file mode 100644 index 0000000..4e89440 --- /dev/null +++ b/packages/firefox/patches/0003-libwebrtc-includes.diff @@ -0,0 +1,10 @@ +--- a/third_party/libwebrtc/modules/desktop_capture/desktop_capturer.h ++++ b/third_party/libwebrtc/modules/desktop_capture/desktop_capturer.h +@@ -17,6 +17,7 @@ + #include + #include + #include ++#include + + // TODO(alcooper): Update include usage in downstream consumers and then change + // this to a forward declaration. diff --git a/packages/firefox/patches/0004-musl-prctl.diff b/packages/firefox/patches/0004-musl-prctl.diff new file mode 100644 index 0000000..5ac6d34 --- /dev/null +++ b/packages/firefox/patches/0004-musl-prctl.diff @@ -0,0 +1,20 @@ +see https://www.openwall.com/lists/musl/2025/06/12/11 + + /usr/include/sys/prctl.h:88:8: error: redefinition of 'prctl_mm_map' + 88 | struct prctl_mm_map { + | ^ + /usr/include/linux/prctl.h:134:8: note: previous definition is here + 134 | struct prctl_mm_map { + | ^ + +--- a/third_party/libwebrtc/rtc_base/platform_thread_types.cc ++++ b/third_party/libwebrtc/rtc_base/platform_thread_types.cc +@@ -12,7 +12,6 @@ + + // IWYU pragma: begin_keep + #if defined(WEBRTC_LINUX) +-#include + #include + #include + + diff --git a/packages/firefox/patches/0005-clang-visibility.diff b/packages/firefox/patches/0005-clang-visibility.diff new file mode 100644 index 0000000..2027201 --- /dev/null +++ b/packages/firefox/patches/0005-clang-visibility.diff @@ -0,0 +1,18 @@ +--- a/build/moz.configure/toolchain.configure ++++ b/build/moz.configure/toolchain.configure +@@ -2385,13 +2385,7 @@ + @depends(target, build_environment) + def visibility_flags(target, env): + if target.os != "WINNT": +- if target.kernel in ("Darwin", "FreeBSD", "OpenBSD"): +- return ("-fvisibility=hidden", "-fvisibility-inlines-hidden") +- return ( +- "-I%s/system_wrappers" % os.path.join(env.dist), +- "-include", +- "%s/config/gcc_hidden.h" % env.topsrcdir, +- ) ++ return ("-fvisibility=hidden", "-fvisibility-inlines-hidden") + + + @depends(target, visibility_flags) + diff --git a/packages/firefox/pkgbuild.py b/packages/firefox/pkgbuild.py new file mode 100644 index 0000000..d74c8b4 --- /dev/null +++ b/packages/firefox/pkgbuild.py @@ -0,0 +1,54 @@ +import os + +from lib.make import * + + +version("149.0") +description("the Mozilla Firefox web browser") +maintainer("sisungo ") +source_url("https://ftp.mozilla.org/pub/firefox/releases/149.0/source/firefox-149.0.source.tar.xz") + +builddep("shortcut/c++") +builddep("shortcut/autotools") +builddep("shortcut/rust") +builddep("alsa-lib-dev @target") +builddep("libgtk-dev (~3.0.0) @target") +builddep("cups-dev @target") +builddep("libz-dev @target") +builddep("libpixman-dev @target") + + +def apply_environ(): + os.environ["CC"] = "clang" + os.environ["CXX"] = "clang++" + os.environ["LDFLAGS"] = f"-Wl,-rpath,{get_prefix('firefox')}" + +def write_mozconfig(): + with open(".mozconfig", "wt+") as fd: + fd.write(f"ac_add_options --disable-bootstrap\n") + fd.write(f"ac_add_options --disable-debug\n") + fd.write(f"ac_add_options --disable-debug-symbols\n") + fd.write(f"ac_add_options --disable-jemalloc\n") + fd.write(f"ac_add_options --disable-tests\n") + fd.write(f"ac_add_options --disable-updater\n") + fd.write(f"ac_add_options --enable-audio-backends=alsa\n") + fd.write(f"ac_add_options --enable-default-toolchain=cairo-gtk3-wayland-only\n") + fd.write(f"ac_add_options --with-distribution-id=org.semilabs.os\n") + fd.write(f"ac_add_options --enable-packed-relative-relocs\n") + fd.write(f"ac_add_options --disable-elf-hack\n") + fd.write(f"ac_add_options --with-system-zlib\n") + fd.write(f"ac_add_options --with-system-pixman\n") + +def build(): + apply_environ() + write_mozconfig() + subprocess.run(["python3", "mach", "build"]) + +on_build(build) + + +def pack(composer): + pass + +package("firefox") +on_pack(pack) -- 2.56.0