void-linux / void-packages

The Void source packages collection
https://voidlinux.org
Other
2.57k stars 2.14k forks source link

Package Request: Palemoon & Seamonkey, work-in-progress #4130

Closed johnny-mac closed 5 years ago

johnny-mac commented 6 years ago

Here are two templates I am working on, anyone is free to take these & do what they want with them. You do not have to "credit" me for anything. Palemoon is a fork of Firefox that still supports NPAPI plugins, which if I am not mistaken are being phased out of firefox-esr eventually, if that hasn't already happened.

The palemoon template probably has more dependencies than it really needs, I still can't make it compile successfully but I've got a good rough draft for a template. What do you do when it tells you it needs a screen to output or "export" it on/to? I'll have the exact error posted soon, sorry.

# Template file for 'palemoon'
pkgname=palemoon
version=2018.09.27
revision=1
wrksrc="UXP-${version}"
hostmakedepends="pkg-config autoconf213 unzip zip yasm automake libtool python wget rust python3"
makedepends="libXt-devel alsa-lib-devel pulseaudio-devel dbus-glib-devel ffmpeg-devel GConf-devel gtk+-devel libXtst-devel startup-notification-devel 
sqlite-devel gtk+3-devel glib-devel libgomp-devel libglob-devel libexecinfo-devel python-devel hunspell-devel hyphen-devel libressl-devel bzip2-devel
 zlib-devel MesaLib-devel nss-devel libatomic-devel libevent-devel libSM-devel libXcomposite-devel libXt-devel libvpx-devel elfutils-devel libbsd-devel
 SDL2_gfx-devel aalib-devel libdom-devel python-dbus-devel libnotify-devel"
depends="mime-types desktop-file-utils shared-mime-info hicolor-icon-theme"
short_desc="Open-source web browser based on Firefox focusing on efficiency"
maintainer="Johnny-Mac <johnny-mac@linuxmail.org>"
license="LGPL-2.1-or-later MPL-2.0-or-later GPL-3.0-or-later"
homepage="https://www.palemoon.org"
distfiles="https://github.com/MoonchildProductions/UXP/archive/v${version}.tar.gz"
checksum=7b4a60f20a5fc629799aba1c3dd5a6f88e38d22aeced3cedcb45cdc3d28025d0
pre_configure() {
    cp -rup "${FILESDIR}/.mozconfig" "${wrksrc}"
    sed -i 's#xlocale#locale#' intl/icu/source/i18n/digitlst.cpp
}
do_build() {
    export MOZBUILD_STATE_PATH="mozbuild"
    export MOZCONFIG=".mozconfig"
    export CPPFLAGS="$CPPFLAGS -O2"
    python2 mach build
}
do_install() {
    install -d "$DESTDIR"/usr/{bin,lib}
}
# Template file for 'seamonkey'
pkgname=seamonkey
version=2.49.4
revision=1
hostmakedepends="pkg-config python yyasm autoconf213 python3 imake"
makedepends="gst-plugins-base1-devel gst-plugins-good1-devel gst-plugins-bad1-devel gst-plugins-ugly1-devel icu-devel wireless_tools-devel
 libXt-devel sqlite-devel pulseaudio-devel hunspell-devel libevent-devel libvpx-devel dbus-glib-devel alsa-lib-devel gtk+-devel gtk+3-devel
 nss-devel startup-notification-devel python3-devel"
depends="desktop-file-utils mime-types"
short_desc="SeaMonkey internet suite"
maintainer="Johnny-Mac <johnny-mac@linuxmail.org>"
license="MPL"
homepage="https://www.seamonkey-project.org/"
distfiles="https://github.com/johnny-mac/${pkgname}/archive/v${version}.tar.gz"
checksum=c8a66774d0a3525698b559fa2c41397186f2de99c5733e35b8eafb0ae5ccc4ee
pre_configure() {
    sed -i '/^MOZ_PKG_FATAL_WARNINGS/s@= 1@= 0@' suite/installer/Makefile.in
    sed -i '/ac_cpp=/s/$CPPFLAGS/& -O2/' configure
    sed -i 's/$(MOZ_ZLIB_CFLAGS)/& $(MOZ_PIXMAN_CFLAGS)/' config/config.mk
    sed -i "s/'crmf',//" mozilla/security/manager/ssl/moz.build
    sed -i 's/^.*-lcrmf/#&/' mozilla/config/external/nss/crmf/moz.build
    sed -i 's/ -lcrmf"/"/' mozilla/old-configure.in.orig
    sed -i 's/ -lcrmf"/"/' mozilla/old-configure
    sed -i 's/SDK_LIBS = crmf/SDK_LIBS = /' mozilla/config/external/nss/Makefile.in
}
do_build() {
    export LDFLAGS="$LDFLAGS -Wl,-rpath,/usr/lib/${pkgname}-${version}"
    export MOZ_MAKE_FLAGS="$MAKEFLAGS"
    unset MAKEFLAGS
    unset CPPFLAGS
    CFLAGS+=" -fno-delete-null-pointer-checks -fno-lifetime-dse -fno-schedule-insns2"
    CXXFLAGS+=" -fno-delete-null-pointer-checks -fno-lifetime-dse -fno-schedule-insns2"
    make -j4 -f client.mk build
}
do_install() {
    make -j4 -f client.mk DESTDIR="$DESTDIR" INSTALL_SDK= install
    ln -s /usr/share/hyphen "${DESTDIR}/usr/lib/${pkgname}-${version}/hyphenation"
    vinstall suite/branding/nightly/icons/gtk/seamonkey.png 644 "${DESTDIR}/usr/share/pixmaps/seamonkey.png"
    vinstall mozilla/toolkit/mozapps/installer/linux/rpm/mozilla.desktop 644 "${DESTDIR}/usr/share/applications/seamonkey.desktop"
    sed -i 's/@MOZ_APP_DISPLAYNAME@/SeaMonkey internet suite/' "${DESTDIR}/usr/share/applications/seamonkey.desktop"
    sed -i 's/@MOZ_APP_NAME@/seamonkey/' "${DESTDIR}/usr/share/applications/seamonkey.desktop"
    rm -f "${DESTDIR}/usr/lib/pkgconfig/"seamonkey-ns{s,pr}.pc
}
sineemore commented 5 years ago

@johnny-mac, could you provide a relevant .mozconfig file for palemoon?

johnny-mac commented 5 years ago

Sorry I forgot about that Sineemore, here you go! It probably doesn't work as-is, you may have to switch enable-application= to 'suite' or 'browser', I still haven't managed to get this package going.

mk_add_options AUTOCLOBBER=1
mk_add_options MOZ_OBJDIR=pmbuild
ac_add_options --enable-application=palemoon

ac_add_options --enable-optimize="-O2"

ac_add_options --enable-official-branding
export MOZILLA_OFFICIAL=1

ac_add_options --enable-default-toolkit=cairo-gtk2
ac_add_options --enable-jemalloc
ac_add_options --enable-strip
ac_add_options --with-pthreads

ac_add_options --disable-tests
ac_add_options --disable-eme
ac_add_options --disable-parental-controls
ac_add_options --disable-accessibility
ac_add_options --disable-webrtc
ac_add_options --disable-gamepad
ac_add_options --disable-necko-wifi
ac_add_options --disable-updater

ac_add_options --x-libraries=/usr/lib

# Use python2
mk_add_options PYTHON=/usr/bin/python2

# uncomment the following to limit the number of parallel build jobs
# remember to run updpkgsums after, or you'll get a checksum failure
mk_add_options MOZ_MAKE_FLAGS="-j4"
sineemore commented 5 years ago

@johnny-mac, thanks for the .mozconfig file!

https://github.com/MoonchildProductions/UXP/archive/v2018.11.07.tar.gz I guess it is not Pale Moon sources, but a Basilisk project. Check their releases page.

sineemore commented 5 years ago

@johnny-mac, I've successfully built palemoon. Now I'm stuck a bit on packaging it in a sane way.

I'll provide relevant template and .mozconfig a bit later. (or ping me, if you need them ASAP)

sineemore commented 5 years ago

https://github.com/voidlinux/void-packages/issues/2387#issuecomment-361580616 I guess we won't have Pale Moon in the repos for now.

sineemore commented 5 years ago

srcpkgs/palemoon/template

# Template file for 'palemoon'
pkgname=palemoon
version=28.2.1
revision=1
homepage="https://www.palemoon.org"
short_desc="Open-source web browser based on Firefox focusing on efficiency"
license="LGPL-2.1-or-later MPL-2.0-or-later GPL-3.0-or-later"
distfiles="https://github.com/MoonchildProductions/UXP/archive/PM${version}_Release.tar.gz"
checksum="bfa9517681faaa6c882a361e6854864a0668a03f42599da0d43457f0e696b9ed"
wrksrc="UXP-PM${version}_Release"
hostmakedepends="autoconf213 perl pkg-config python unzip yasm zip"
makedepends="GConf-devel alsa-lib-devel bzip2-devel dbus-glib-devel gtk+-devel libXt-devel libressl-devel pango-devel pulseaudio-devel sqlite-devel zlib-devel"
depends="nss"

pre_configure() {
    cp -- "${FILESDIR}/mozconfig" "${wrksrc}/.mozconfig"

    # This one must be in a patch file?
    sed -i 's#xlocale#locale#' intl/icu/source/i18n/digitlst.cpp
}

do_build() {
    MOZBUILD_STATE_PATH="mozbuild" ./mach build
}

do_install() {
    MOZBUILD_STATE_PATH="mozbuild" DESTDIR="$DESTDIR" ./mach install

    # Remove headers, archives and .idl files
    rm -rf -- ${DESTDIR}/usr/{include,share}
    rm -rf -- ${DESTDIR}/usr/palemoon-devel-${version}
}

srcpkgs/palemoon/files/mozconfig

ac_add_options --prefix=/usr
ac_add_options --libdir=/usr/lib

mk_add_options AUTOCLOBBER=1
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/pmbuild/
ac_add_options --enable-application=palemoon

ac_add_options --enable-optimize="-O2"

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

ac_add_options --enable-default-toolkit=cairo-gtk2
ac_add_options --enable-jemalloc
ac_add_options --enable-strip
ac_add_options --with-pthreads

ac_add_options --disable-tests
ac_add_options --disable-eme
ac_add_options --disable-parental-controls
ac_add_options --disable-accessibility
ac_add_options --disable-webrtc
ac_add_options --disable-gamepad
ac_add_options --disable-necko-wifi
ac_add_options --disable-updater

Looks like Pale Moon project isn't going to drop their addiction to glibc in anytime soon.

ghost commented 5 years ago

@sineemore Is it an "addiction"? IMO Moonchild's decision to close the issue is reasonable as musl is still quite obscure, though I don't think a PR to support it would be downright refused.

Johnnynator commented 5 years ago

@mrnhmath The problem isn't only musl, also we would have to rebrand it once we deviate a single bit (aka not their binary release probably) from upstream.

sineemore commented 5 years ago

@mrnhmath, forum thread on musl support.

@Johnnynator, I don't think rebranding is an issue here, palemoon supports alternative branding, something like "New Moon", IIRC. The issue is, palemoon requires you to use their patched libraries and system ones are a second tier goal for them.

johnny-mac commented 5 years ago

I found some of the patches used by alpine linux. https://github.com/tanertas/aports/tree/palemoon/testing/palemoon

@sineemore can you please provide me with all of the patch files you used? And are you not using MUSL??? :/

johnny-mac commented 5 years ago

@mrnhmath it looks like Alpine Linux uses it w/ MUSL...

johnny-mac commented 5 years ago

If we need to rebrand it, we'll rebrand it, even though I think its really silly & very tedious for the devs to require this sort of thing.... Let's make sure we have it working before we re-brand it though :)

sineemore commented 5 years ago

@johnny-mac, palemoon already supports alternative branding, you can disable the official one in mozconfig file.

ac_add_options --enable-official-branding

I haven't done any modifications to source tree and used the bundled libraries. I think the palemoon forum and Alpine ports are nice places to start porting palemoon to musl.

But I'm not sure if it worth the trouble. Porting software and keeping up with updates is hardly a pleasant job.

johnny-mac commented 5 years ago

Okay, but what about the patches? Can you provide those?

sineemore commented 5 years ago

@johnny-mac, sorry for late response.

As I've written above:

I haven't done any modifications to source tree and used the bundled libraries.

Only template and mozconfig, see https://github.com/void-linux/void-packages/issues/4130#issuecomment-440128163

That's enough to build palemoon with glibc. Put the files in appropriate locations, and run ./xbps-src pkg palemoon, then xbps-install -R hostdir/binpkgs/ palemoon.