Building Pale Moon without dbus, gconf, pulseaudio

For contributed third party builds not necessarily configured like the main product.
e.g. AVX builds, SSE builds, Pandora builds.
User avatar
andyprough
Astronaut
Astronaut
Posts: 688
Joined: 2020-05-31, 04:33

Building Pale Moon without dbus, gconf, pulseaudio

Unread post by andyprough » 2022-06-09, 15:39

I wanted to use Pale Moon on Hyperbola Linux, but it is an ultra-minimal distro with no dbus, gconf, or pulseaudio, and with an older 2.30 version of glib. To build it, I used antiX 19, a very fast but older Debian-based release which will still be supported for the next several years, and which has glib 2.28.

My build dependencies were handled with the normal Debian packages minus the dbus, gconf, and libpulse packages:

Code: Select all

sudo apt install libgtk2.0-dev autoconf2.13 yasm libegl1-mesa-dev libasound2-dev libxt-dev zlib1g-dev libssl-dev libsqlite3-dev libbz2-dev libx11-xcb-dev zip python2.7 build-essential binutils git make cmake
My .mozconfig had an additional set of options to disable dbus, gconf, gio, pulseaudio:

Code: Select all

# My customizations
ac_add_options --disable-dbus
ac_add_options --disable-gconf
ac_add_options --disable-gio
ac_add_options --disable-pulseaudio
and I changed the --enable-optimize options in .mozconfig as follows:

Code: Select all

ac_add_options --enable-optimize="-O2 -w -march=native -mfpmath=sse -fomit-frame-pointer -pipe -fno-unwind-tables -fno-asynchronous-unwind-tables"
Since this is a non-standard build, I commented out the official branding options in .mozconfig.

It builds and seems to work like normal, including video and audio.

Credit to @Walter Dnes for the .mozconfig changes: viewtopic.php?p=148317#p148317

User avatar
Nuck-TH
Project Contributor
Project Contributor
Posts: 195
Joined: 2020-03-02, 16:04

Re: Building Pale Moon without dbus, gconf, pulseaudio

Unread post by Nuck-TH » 2022-06-09, 16:11

If you plan to distribute your build, then you shouldn't use -march=native as it builds for instruction/extension set of build machine cpu.

User avatar
andyprough
Astronaut
Astronaut
Posts: 688
Joined: 2020-05-31, 04:33

Re: Building Pale Moon without dbus, gconf, pulseaudio

Unread post by andyprough » 2022-06-09, 16:35

Nuck-TH wrote:
2022-06-09, 16:11
If you plan to distribute your build, then you shouldn't use -march=native as it builds for instruction/extension set of build machine cpu.
Good point, I should have thought of that. Let me know anything else you see that I should correct, very much appreciated.

vannilla
Moon Magic practitioner
Moon Magic practitioner
Posts: 2181
Joined: 2018-05-05, 13:29

Re: Building Pale Moon without dbus, gconf, pulseaudio

Unread post by vannilla » 2022-06-09, 16:59

Doesn't GIO come with GTK itself? There shouldn't be a need to disable it.

User avatar
athenian200
Contributing developer
Contributing developer
Posts: 1480
Joined: 2018-10-28, 19:56
Location: Georgia

Re: Building Pale Moon without dbus, gconf, pulseaudio

Unread post by athenian200 » 2022-06-09, 17:04

I can definitely see this being useful for some people on Linux.

Though I will say, I thought the official Linux builds are supposed to fallback to ALSA if PulseAudio isn't available? I remember both backends being compiled in back when I was messing with that.
"The Athenians, however, represent the unity of these opposites; in them, mind or spirit has emerged from the Theban subjectivity without losing itself in the Spartan objectivity of ethical life. With the Athenians, the rights of the State and of the individual found as perfect a union as was possible at all at the level of the Greek spirit." -- Hegel's philosophy of Mind

User avatar
andyprough
Astronaut
Astronaut
Posts: 688
Joined: 2020-05-31, 04:33

Re: Building Pale Moon without dbus, gconf, pulseaudio

Unread post by andyprough » 2022-06-09, 17:05

vannilla wrote:
2022-06-09, 16:59
Doesn't GIO come with GTK itself? There shouldn't be a need to disable it.
I'm following @Walter Dnes' lead on that one, that's the one I can't quite figure out. I'll try building it with gio enabled and see if it will still run on Hyperbola or if it creates a problem. But I'm assuming he did that for a reason. Every time I try to change one of his parameters the build fails, so he probably knew what he was doing.

User avatar
andyprough
Astronaut
Astronaut
Posts: 688
Joined: 2020-05-31, 04:33

Re: Building Pale Moon without dbus, gconf, pulseaudio

Unread post by andyprough » 2022-06-09, 17:07

athenian200 wrote:
2022-06-09, 17:04
I can definitely see this being useful for some people on Linux.

Though I will say, I thought the official Linux builds are supposed to fallback to ALSA if PulseAudio isn't available? I remember both backends being compiled in back when I was messing with that.
I don't know, Hyperbola is very picky, and the fact it uses sndio instead of alsa may also complicate matters. I can give it a try though.
Plus, Hyperbola people are extremely biased about software, especially against any Lennart Pottering code.

User avatar
athenian200
Contributing developer
Contributing developer
Posts: 1480
Joined: 2018-10-28, 19:56
Location: Georgia

Re: Building Pale Moon without dbus, gconf, pulseaudio

Unread post by athenian200 » 2022-06-09, 17:22

andyprough wrote:
2022-06-09, 17:07
I don't know, Hyperbola is very picky, and the fact it uses sndio instead of alsa may also complicate matters. I can give it a try though.
Plus, Hyperbola people are extremely biased about software, especially against any Lennart Pottering code.
Oh yeah, I forgot and assumed if they weren't using PulseAudio they were using ALSA. But yeah, there is a compile-time flag to enable sndio, it was implemented specifically for Hyperbola so they could do IceWeasel I believe.
"The Athenians, however, represent the unity of these opposites; in them, mind or spirit has emerged from the Theban subjectivity without losing itself in the Spartan objectivity of ethical life. With the Athenians, the rights of the State and of the individual found as perfect a union as was possible at all at the level of the Greek spirit." -- Hegel's philosophy of Mind

User avatar
andyprough
Astronaut
Astronaut
Posts: 688
Joined: 2020-05-31, 04:33

Re: Building Pale Moon without dbus, gconf, pulseaudio

Unread post by andyprough » 2022-06-09, 17:29

athenian200 wrote:
2022-06-09, 17:22
Oh yeah, I forgot and assumed if they weren't using PulseAudio they were using ALSA. But yeah, there is a compile-time flag to enable sndio, it was implemented specifically for Hyperbola so they could do IceWeasel I believe.
Oh, I should try it - is it simply 'ac_add_options --enable-sndio' do you recall?

User avatar
athenian200
Contributing developer
Contributing developer
Posts: 1480
Joined: 2018-10-28, 19:56
Location: Georgia

Re: Building Pale Moon without dbus, gconf, pulseaudio

Unread post by athenian200 » 2022-06-09, 17:33

andyprough wrote:
2022-06-09, 17:29
Oh, I should try it - is it simply 'ac_add_options --enable-sndio' do you recall?
That is correct, though I don't know if the development headers are available on all Linux distros. This is a big enough difference from mainstream Linux to potentially complicate building for Hyperbola on anything but Hyperbola. To make the point of how non-standard this is, even the audio system in Solaris/OpenSolaris is just a variant of OSS, which a ton of Unix-like platforms use, and its also what Linux itself used to use before ALSA. So my alternate OS is more "normal" in this regard.
"The Athenians, however, represent the unity of these opposites; in them, mind or spirit has emerged from the Theban subjectivity without losing itself in the Spartan objectivity of ethical life. With the Athenians, the rights of the State and of the individual found as perfect a union as was possible at all at the level of the Greek spirit." -- Hegel's philosophy of Mind

User avatar
jobbautista9
Keeps coming back
Keeps coming back
Posts: 780
Joined: 2020-11-03, 06:47
Location: Philippines
Contact:

Re: Building Pale Moon without dbus, gconf, pulseaudio

Unread post by jobbautista9 » 2022-06-10, 02:52

andyprough wrote:
2022-06-09, 17:07
I don't know, Hyperbola is very picky, and the fact it uses sndio instead of alsa may also complicate matters.
Hyperbola doesn't use alsa? That seems strange for a GNU/Linux distro. OSS is pretty much dead in Linux, and sndio is located in the userspace, not the kernel...

Btw if you use --enable-sndio without --disable-alsa, Pale Moon will always use alsa as its audio backend. There's no way to change this in runtime, even in about:config AFAIK. I thought about creating a new issue in the UXP repo, but looks like our libcubeb is not yet up-to-date with upstream, which seems kind of required if Pale Moon wants to implement some sort of media.cubeb.backend about:config option...
Image

merry mimas

XUL add-ons developer. You can find a list of add-ons I manage at http://rw.rs/~job/software.html.

Mima avatar by 絵虎. Pixiv post: https://www.pixiv.net/en/artworks/15431817

Image

User avatar
athenian200
Contributing developer
Contributing developer
Posts: 1480
Joined: 2018-10-28, 19:56
Location: Georgia

Re: Building Pale Moon without dbus, gconf, pulseaudio

Unread post by athenian200 » 2022-06-10, 04:34

jobbautista9 wrote:
2022-06-10, 02:52
Btw if you use --enable-sndio without --disable-alsa, Pale Moon will always use alsa as its audio backend. There's no way to change this in runtime, even in about:config AFAIK. I thought about creating a new issue in the UXP repo, but looks like our libcubeb is not yet up-to-date with upstream, which seems kind of required if Pale Moon wants to implement some sort of media.cubeb.backend about:config option...
Off-topic:
Yeah, my attempted update included that option. The libcubeb updates keep getting backed out because there is always something wrong with it that can only be detected on specific hardware/software configurations. For me, that rejected update worked flawlessly on every computer I had, with Windows and Linux. It didn't matter... people were getting random "no audio" issues on Windows that I can't reproduce. I figured out that the first time it was due to multichannel audio issues, I fixed those, and the people having complaints previously were satisfied. Then it broke on MC's machine, and now I'm stuck again.
"The Athenians, however, represent the unity of these opposites; in them, mind or spirit has emerged from the Theban subjectivity without losing itself in the Spartan objectivity of ethical life. With the Athenians, the rights of the State and of the individual found as perfect a union as was possible at all at the level of the Greek spirit." -- Hegel's philosophy of Mind

User avatar
andyprough
Astronaut
Astronaut
Posts: 688
Joined: 2020-05-31, 04:33

Re: Building Pale Moon without dbus, gconf, pulseaudio

Unread post by andyprough » 2022-06-13, 15:02

jobbautista9 wrote:
2022-06-10, 02:52
Hyperbola doesn't use alsa? That seems strange for a GNU/Linux distro. OSS is pretty much dead in Linux, and sndio is located in the userspace, not the kernel...

Btw if you use --enable-sndio without --disable-alsa, Pale Moon will always use alsa as its audio backend. There's no way to change this in runtime, even in about:config AFAIK. I thought about creating a new issue in the UXP repo, but looks like our libcubeb is not yet up-to-date with upstream, which seems kind of required if Pale Moon wants to implement some sort of media.cubeb.backend about:config option...
Thanks very much for this, I was able to do a sndio build on Hyperbola after a bit of trial and error. You are right, Hyperbola can use alsa, but the browser tends to crash on Hyperbola for me when using alsa. With alsa disabled and sndio enabled, I'm getting excellent stability.

Btw - you mentioned you are building Pale Moon for a sndio setup with Devuan in the AVX/AVX2 thread. Could you possibly share your .mozconfig? I'm trying to figure out if there are other options I should be trying for these builds I make on Hyperbola. If you prefer to email it, you can reach me at my screenname at disroot dot org. Thanks!

User avatar
jobbautista9
Keeps coming back
Keeps coming back
Posts: 780
Joined: 2020-11-03, 06:47
Location: Philippines
Contact:

Re: Building Pale Moon without dbus, gconf, pulseaudio

Unread post by jobbautista9 » 2022-06-13, 15:09

Here's my current mozconfig:

Code: Select all

export CC=gcc-12
export CXX=g++-12
mk_add_options PYTHON=/usr/bin/python2
mk_add_options AUTOCONF=/usr/bin/autoconf-2.13

# Clear this if not a 64bit build
_BUILD_64=1

# Set GTK Version to 2 or 3
_GTK_VERSION=3

# Set AVX version empty or 2
_AVX_VERSION=2

# obj dirname
export MOZ_PKG_SPECIAL=avx"$_AVX_VERSION"_gtk"$_GTK_VERSION"
mk_add_options MOZ_OBJDIR=obj-pm-x64-$MOZ_PKG_SPECIAL-release

# Standard build options for Pale Moon
ac_add_options --enable-application=palemoon
ac_add_options --enable-optimize="-O3 -mavx$_AVX_VERSION -march=native -w"
ac_add_options --enable-default-toolkit=cairo-gtk$_GTK_VERSION
ac_add_options --enable-phoenix-extensions
ac_add_options --enable-jemalloc
ac_add_options --enable-strip
ac_add_options --enable-devtools
ac_add_options --enable-av1
ac_add_options --enable-sndio
ac_add_options --disable-pulseaudio
ac_add_options --disable-alsa
ac_add_options --disable-gamepad
ac_add_options --disable-tests
ac_add_options --disable-debug
ac_add_options --disable-necko-wifi
ac_add_options --disable-updater
ac_add_options --disable-eme
ac_add_options --disable-webrtc
ac_add_options --with-pthreads

# Please see https://www.palemoon.org/redist.shtml for restrictions when using the official branding.
ac_add_options --enable-official-branding
export MC_OFFICIAL=1
export MOZILLA_OFFICIAL=1

ac_add_options --x-libraries=/usr/lib64
You'd probably want to change -O3 to -O2 (for stability, but -O3 actually is pretty stable to me so far and I do see it's a bit faster. I heard Mozilla does -O3 as well for their official builds of Firefox), and remove -march=native if you're going to do a generic AVX(2) build. You'd also notice I'm using GCC 12, which I tested just recently builds and runs fine for me. I don't know if Hyperbola uses version 12 as their GCC, so you might have to change that accordingly.
Image

merry mimas

XUL add-ons developer. You can find a list of add-ons I manage at http://rw.rs/~job/software.html.

Mima avatar by 絵虎. Pixiv post: https://www.pixiv.net/en/artworks/15431817

Image

User avatar
andyprough
Astronaut
Astronaut
Posts: 688
Joined: 2020-05-31, 04:33

Re: Building Pale Moon without dbus, gconf, pulseaudio

Unread post by andyprough » 2022-06-13, 15:19

jobbautista9 wrote:
2022-06-13, 15:09
You'd probably want to change -O3 to -O2 (for stability, but -O3 actually is pretty stable to me so far and I do see it's a bit faster. I heard Mozilla does -O3 as well for their official builds of Firefox), and remove -march=native if you're going to do a generic AVX(2) build. You'd also notice I'm using GCC 12, which I tested just recently builds and runs fine for me. I don't know if Hyperbola uses version 12 as their GCC, so you might have to change that accordingly.
Thank you very much! What is '--phoenix-extensions', do you mind telling me? My searches indicate it's something from mozilla, but I'm not sure what exactly.

User avatar
jobbautista9
Keeps coming back
Keeps coming back
Posts: 780
Joined: 2020-11-03, 06:47
Location: Philippines
Contact:

Re: Building Pale Moon without dbus, gconf, pulseaudio

Unread post by jobbautista9 » 2022-06-13, 15:28

Ah, that one's from Nuck-TH's mozconfig for their Linux AVX builds. Though digging deeper it seems to be an outdated option from PM 29, when legacy extensions that only targeted Firefox became disabled and required explicit Pale Moon support in the extension's install.rdf. The build option reverts that behavior, and I think this option might've been used for Basilisk. Obviously Pale Moon now supports Firefox-only legacy extensions again, so feel free to ignore that option.
Image

merry mimas

XUL add-ons developer. You can find a list of add-ons I manage at http://rw.rs/~job/software.html.

Mima avatar by 絵虎. Pixiv post: https://www.pixiv.net/en/artworks/15431817

Image

Locked