Palemoon with gtk3 depends on gtk2

Talk about code development, features, specific bugs, enhancements, patches, and similar things.
Forum rules
Please keep everything here strictly on-topic.
This board is meant for Pale Moon source code development related subjects only like code snippets, patches, specific bugs, git, the repositories, etc.

This is not for tech support! Please do not post tech support questions in the "Development" board!
Please make sure not to use this board for support questions. Please post issues with specific websites, extensions, etc. in the relevant boards for those topics.

Please keep things on-topic as this forum will be used for reference for Pale Moon development. Expect topics that aren't relevant as such to be moved or deleted.
User avatar
stefan11111
Apollo supporter
Apollo supporter
Posts: 30
Joined: 2023-08-13, 18:09

Palemoon with gtk3 depends on gtk2

Unread post by stefan11111 » 2023-08-29, 14:07

I was sent here from the gitea issue tracker: https://repo.palemoon.org/MoonchildProd ... ssues/1933

See: https://forums.gentoo.org/viewtopic-t-1164262.html
Palemoon checks for gtk2 when building with gtk3.
Is this intended?
As a workaround, I use this:
https://github.com/stefan11111/fake-gtk2

Build options:
USE="gtk3 jemalloc optimize threads -av1 -dbus -debug -devtools -gtk2 -jpegxl -necko-wifi -official-branding -pulseaudio -valgrind" CPU_FLAGS_X86="sse sse2"

0:42.39 js/src> running /var/tmp/portage/www-client/palemoon-32.3.1/work/palemoon-32.3.1/o/_virtualenv/bin/python /var/tmp/portage/www-client/palemoon-32.3.1/work/palemoon-32.3.1/platform/build/../configure.py --enable-project=js --target=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --disable-accessibility --disable-dbus --disable-gconf --disable-install-strip --disable-necko-wifi --enable-optimize=-O2 -msse2 -mfpmath=sse --disable-precompiled-startupcache --disable-pulseaudio --disable-updater --with-pthreads --disable-debug --without-toolchain-prefix --enable-debug-symbols --enable-jemalloc --without-linux-headers --disable-warnings-as-errors --disable-js-shell --disable-shared-js --disable-export-js --disable-instruments --disable-callgrind --disable-profiling --disable-vtune --disable-gc-trace --disable-perf --disable-more-deterministic --enable-ctypes --without-system-ffi --with-nspr-cflags=-I/var/tmp/portage/www-client/palemoon-32.3.1/work/palemoon-32.3.1/o/dist/include/nspr --with-nspr-libs=-L/var/tmp/portage/www-client/palemoon-32.3.1/work/palemoon-32.3.1/o/dist/bin -lnspr4 -lplc4 -lplds4 --prefix=/var/tmp/portage/www-client/palemoon-32.3.1/work/palemoon-32.3.1/o/dist JS_STANDALONE= --cache-file=/var/tmp/portage/www-client/palemoon-32.3.1/work/palemoon-32.3.1/o/config.cache

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35651
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: Palemoon with gtk3 depends on gtk2

Unread post by Moonchild » 2023-08-29, 16:28

From what I know of the Linux portion of our code base and past questions about it (on this forum), we need gtk2 because building support for NPAPI plugins requires gtk2. As long as we support NPAPI plugins (which is currently indefinitely, as in we have no deprecation plans at this time) we will need the gtk2 dependency.

Maybe someone with experience building on gentoo can provide additional insight.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
Night Wing
Knows the dark side
Knows the dark side
Posts: 5174
Joined: 2011-10-03, 10:19
Location: Piney Woods of Southeast Texas, USA

Re: Palemoon with gtk3 depends on gtk2

Unread post by Night Wing » 2023-08-29, 18:07

Moonchild wrote:
2023-08-29, 16:28
As long as we support NPAPI plugins (which is currently indefinitely, as in we have no deprecation plans at this time) we will need the gtk2 dependency.
I'm glad to see this. I much prefer Pale Moon builds in GTK2 rather than GTK3.
Linux Mint 21.3 (Virginia) Xfce w/ Linux Pale Moon, Linux Waterfox, Linux SeaLion, Linux Firefox
MX Linux 23.2 (Libretto) Xfce w/ Linux Pale Moon, Linux Waterfox, Linux SeaLion, Linux Firefox
Linux Debian 12.5 (Bookworm) Xfce w/ Linux Pale Moon, Linux Waterfox, Linux SeaLion, Linux Firefox

User avatar
Pentium4User
Board Warrior
Board Warrior
Posts: 1138
Joined: 2019-04-24, 09:38

Re: Palemoon with gtk3 depends on gtk2

Unread post by Pentium4User » 2023-08-29, 18:44

Night Wing wrote:
2023-08-29, 18:07
Moonchild wrote:
2023-08-29, 16:28
As long as we support NPAPI plugins (which is currently indefinitely, as in we have no deprecation plans at this time) we will need the gtk2 dependency.
I'm glad to see this. I much prefer Pale Moon builds in GTK2 rather than GTK3.
I agree with that, I can only accept GTK3 PM with the MicroMoon theme.

But there is just one problem: There will be a point when Linux distributions don't provide GTK2 anymore.
The profile picture shows my Maico EC30 E ceiling fan.

mrnhmath
Fanatic
Fanatic
Posts: 122
Joined: 2017-06-21, 02:37

Re: Palemoon with gtk3 depends on gtk2

Unread post by mrnhmath » 2023-08-29, 19:09

Pentium4User wrote:
2023-08-29, 18:44
But there is just one problem: There will be a point when Linux distributions don't provide GTK2 anymore.
Then we should provide it ourselves, it's open source after all :D
Off-topic:
I really really think someone should fork gtk2. It's 2023 and the fact that some applications and users still rely on it just shows that it has not been completely replaced and will not be.

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

Re: Palemoon with gtk3 depends on gtk2

Unread post by athenian200 » 2023-08-30, 01:01

Well, technically it only needs the GTK2 headers when building Pale Moon. As far as the GTK3 binaries, you should be able to run Pale Moon just fine without GTK2 on the system.

Your workaround should actually be fine, because all the build environment really needs is a handful of standard GTK2 headers that are used to load in plugins compiled against GTK2. It's just easier to use a build environment that already has GTK2, than to work around this so that it builds in a pure GTK3 environment. I think there actually is a trick to getting it to compile without GTK2, though... it involves disabling GConf or something, and it was needed to get Pale Moon to compile on Tribblix. And if done this way, I believe NPAPI plugins will not work... in theory they could work if they were recompiled against GTK3, but all extant ones are compiled against the older toolkit.
Off-topic:
I believe on SunOS, we even still need Motif available on GTK2 systems because most plugins on there are compiled to work in both an older CDE Motif environment, and a GTK2 one, so that actually ends up being even more awkward. LOL. And yeah, if Motif is still around, I imagine it would take even longer for GTK2 to fade away.
"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
stefan11111
Apollo supporter
Apollo supporter
Posts: 30
Joined: 2023-08-13, 18:09

Re: Palemoon with gtk3 depends on gtk2

Unread post by stefan11111 » 2023-08-30, 09:12

athenian200 wrote:
2023-08-30, 01:01
I think there actually is a trick to getting it to compile without GTK2, though... it involves disabling GConf or something, and it was needed to get Pale Moon to compile on Tribblix. And if done this way, I believe NPAPI plugins will not work...
You mean [topic=26412]this[/topic]?
I am building with --disable-gconf and --disable-pulseaudio as he does, but the configure check is still there and the build fails if I bypass it.
How should I test whether or not NPAPI plugins work?
Off-topic:
Oftopic because this doesn't seem worthy of it's own thread.
There seem to be some flags that do nothing.
Whether or not I pass --enable-webrtc or --enable-project=js, the build seems the same.
I don't think it's possible to build palemoon with webrtc or without js, but the options are still there.
To build without --enable-project=js, I use this patch:

Code: Select all

--- a/platform/python/mozbuild/mozbuild/test/configure/test_moz_configure.py    2023-08-29 21:25:40.505674044 +0300
+++ b/platform/python/mozbuild/mozbuild/test/configure/test_moz_configure.py    2023-08-29 21:27:34.903987259 +0300
@@ -31,13 +31,6 @@
                           get_value_for(['--enable-application=browser',
                                          'MOZ_PROFILING=1']))

-        value = get_value_for(
-            environ={'MOZ_PROFILING': '1'},
-            mozconfig='ac_add_options --enable-project=js')
-
-        self.assertEquals('--enable-project=js MOZ_PROFILING=1',
-                          value)
-
         # --disable-js-shell is the default, so it's filtered out.
         self.assertEquals('--enable-application=browser',
                           get_value_for(['--enable-application=browser',
--- a/platform/js/src/configure.in      2023-08-29 21:25:27.409200482 +0300
+++ b/platform/js/src/configure.in      2023-08-29 21:26:33.831554428 +0300
@@ -22,6 +22,6 @@
 TOPSRCDIR="$SRCDIR"/../..
 export OLD_CONFIGURE="$SRCDIR"/old-configure

-set -- "$@" --enable-project=js
+set -- "$@"

 which python2.7 > /dev/null && exec python2.7 "$TOPSRCDIR/configure.py" "$@" || exec python "$TOPSRCDIR/configure.py" "$@"
--- a/platform/build/subconfigure.py    2023-08-29 21:24:50.939738219 +0300
+++ b/platform/build/subconfigure.py    2023-08-29 21:26:11.801879253 +0300
@@ -317,7 +317,6 @@
             command = [
                 sys.executable,
                 os.path.join(os.path.dirname(__file__), '..', 'configure.py'),
-                '--enable-project=js',
             ]
             data['env']['OLD_CONFIGURE'] = os.path.join(
                 os.path.dirname(configure), 'old-configure')
Also, There seem to be 2 redundant copies of palemoon installed on my system, palemoon and palemoon-bin:

Code: Select all

$ ls /usr/lib64/palemoon/palemoon* -lah
-rwxr-xr-x 1 root root 199K Aug 29 22:32 /usr/lib64/palemoon/palemoon
-rwxr-xr-x 1 root root 199K Aug 29 22:32 /usr/lib64/palemoon/palemoon-bin
-rw-r--r-- 1 root root 4.1M Aug 29 22:30 /usr/lib64/palemoon/palemoon.res
And diff says they are the same.
Would a symlink not have worked?

User avatar
Pentium4User
Board Warrior
Board Warrior
Posts: 1138
Joined: 2019-04-24, 09:38

Re: Palemoon with gtk3 depends on gtk2

Unread post by Pentium4User » 2023-08-30, 13:47

Motif is great. Building Pale Moon on Motif would be nice.
The profile picture shows my Maico EC30 E ceiling fan.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35651
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: Palemoon with gtk3 depends on gtk2

Unread post by Moonchild » 2023-08-30, 14:20

stefan11111 wrote:
2023-08-30, 09:12
I don't think it's possible to build palemoon with webrtc or without js, but the options are still there.
I'm not sure in what way you think Pale Moon should be built, but you're definitely not doing it the way we build ;)
I suggest you take a few moments to read the build instructions on https://developer.palemoon.org/build/linux/
To pass options to the configuration, you use .mozconfig, not USE flags.

Also, building "without JS" is not possible because the front-end and browser runtime is driven with JavaScript and without the JS engine the application literally cannot run. You can, however, disable JS for web content with a preference (javascript.enabled) once built, if you really want to break the web, that is.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
stefan11111
Apollo supporter
Apollo supporter
Posts: 30
Joined: 2023-08-13, 18:09

Re: Palemoon with gtk3 depends on gtk2

Unread post by stefan11111 » 2023-08-30, 18:49

Moonchild wrote:
2023-08-30, 14:20
stefan11111 wrote:
2023-08-30, 09:12
I don't think it's possible to build palemoon with webrtc or without js, but the options are still there.
I'm not sure in what way you think Pale Moon should be built, but you're definitely not doing it the way we build ;)
I suggest you take a few moments to read the build instructions on https://developer.palemoon.org/build/linux/
To pass options to the configuration, you use .mozconfig, not USE flags.
I build it on gentoo.
The overlay with the ebuild and relevant eclass are here:
https://github.com/deu/palemoon-overlay

I took a look at the .mozconfig you listed.
There is --disable-webrtc in it. What does that do? AFAIK, there is no way to build palemoon with webrtc support. In that case why pass that configure option?
Also, disabling all warnings in the default build configuration is... interesting.

Here is the generated .mozconfig. There are probably other options somewhere, like that --enable-project=js.

Code: Select all

ac_add_options --enable-application=palemoon
ac_add_options --disable-updater
ac_add_options --disable-install-strip
ac_add_options --disable-accessibility
ac_add_options --disable-gconf
ac_add_options --enable-optimize="-O2 -msse2 -mfpmath=sse"
ac_add_options --with-pthreads
ac_add_options --enable-jemalloc
ac_add_options --disable-dbus
ac_add_options --enable-default-toolkit="cairo-gtk3"
ac_add_options --disable-necko-wifi
ac_add_options --disable-pulseaudio
ac_add_options --disable-precompiled-startupcache
mk_add_options PYTHON=/usr/bin/python2
mk_add_options AUTOCONF=/usr/bin/autoconf-2.13
mk_add_options MOZ_MAKE_FLAGS="-j4"
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/o
Also, in case someone is interested, this is the resulting about:buildconfig, along with CFLAGS:

Code: Select all

Build tools
Compiler 	Version 	Compiler flags
/usr/bin/gcc -std=gnu99 	13.2.1 	-Wall -Wempty-body -Wignored-qualifiers -Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code -Wno-error=maybe-uninitialized -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=multistatement-macros -flifetime-dse=1 -O3 -pipe -march=native -ftree-vectorize -funswitch-loops -fuse-linker-plugin -flto=4 -fdevirtualize-at-ltrans -fno-plt -fno-semantic-interposition -fno-common -falign-functions=32 -fgraphite-identity -floop-nest-optimize -fno-strict-aliasing -fno-math-errno -pipe -msse2 -mfpmath=sse -pthread
/usr/bin/g++ -std=gnu++14 	13.2.1 	-Wall -Wempty-body -Wignored-qualifiers -Woverloaded-virtual -Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code -Wwrite-strings -Wno-invalid-offsetof -Wc++1z-compat -Wimplicit-fallthrough -Wno-error=maybe-uninitialized -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=multistatement-macros -fno-sized-deallocation -flifetime-dse=1 -O3 -pipe -march=native -ftree-vectorize -funswitch-loops -fuse-linker-plugin -flto=4 -fdevirtualize-at-ltrans -fno-plt -fno-semantic-interposition -fno-common -falign-functions=32 -fgraphite-identity -floop-nest-optimize -fno-exceptions -fno-strict-aliasing -fno-rtti -fno-exceptions -fno-math-errno -pipe -msse2 -mfpmath=sse -pthread -g -O2 -msse2 -mfpmath=sse -fomit-frame-pointer
Configure options

--enable-application=palemoon --with-external-source-dir=/var/tmp/portage/www-client/palemoon-32.3.1/work/palemoon-32.3.1 --enable-jemalloc --enable-default-toolkit=cairo-gtk3 MAKE=/usr/bin/gmake XARGS=/usr/bin/xargs --disable-accessibility --disable-dbus --disable-gconf --disable-install-strip --disable-necko-wifi '--enable-optimize=-O2 -msse2 -mfpmath=sse' --disable-precompiled-startupcache --disable-pulseaudio --disable-updater --with-pthreads
Moonchild wrote: Also, building "without JS" is not possible because the front-end and browser runtime is driven with JavaScript and without the JS engine the application literally cannot run. You can, however, disable JS for web content with a preference (javascript.enabled) once built, if you really want to break the web, that is.
Thanks for pointing out.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35651
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: Palemoon with gtk3 depends on gtk2

Unread post by Moonchild » 2023-08-30, 21:25

stefan11111 wrote:
2023-08-30, 18:49
There is --disable-webrtc in it. What does that do? AFAIK, there is no way to build palemoon with webrtc support. In that case why pass that configure option?
Just because Pale Moon (the application) doesn't use it, doesn't meant he platform (UXP) doesn't have it. For example, Basilisk builds with WebRTC.
Passing the configure option just ensures that no matter the platform default, Pale Moon will never have the WebRTC support files built.

As for using the overlay, if you have an issue with that you should send a message to deu who maintains the overlay you're using. I have very little (at least recent) experience with Gentoo, and even our Linux folks tend to use the binaries we officially build. Building from source inherently mean there's going to be some issues we can't immediately address, especially on a from scratch distro like Gentoo.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite