42 lines
2.4 KiB
Python
42 lines
2.4 KiB
Python
pkgname = "firefox"
|
|
pkgver = "140.6.0esr"
|
|
Pkgver = pkgver[:7]
|
|
source = f"https://archive.mozilla.org/pub/firefox/releases/{pkgver}/source/firefox-{pkgver}.source.tar.xz"
|
|
builddir = f"/tmp/fempkg/build/{pkgname}/{pkgname}-{Pkgver}"
|
|
fembuilddir = f"/tmp/fempkg/build/{pkgname}"
|
|
outputdir = "/home/gabry/lfs-repo/binpkg"
|
|
manifestdir = "/home/gabry/lfs-repo/manifests"
|
|
destdir = f"{fembuilddir}/DESTDIR"
|
|
exports = "export MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=none && export MOZBUILD_STATE_PATH=${PWD}/mozbuild"
|
|
|
|
deps = ["cbindgen", "gtk3", "llvm", "libnotify", "libarchive", "nodejs",
|
|
"pulseaudio", "startup-notification", "dav1d", "icu", "libaom", "libwebp",
|
|
"nasm", "NSS", "curl", "ffmpeg", "geoclue", "wget"]
|
|
|
|
build = [
|
|
# Extract
|
|
f"mkdir -p {fembuilddir} && cd {fembuilddir} && tar -xvf /var/lib/fempkg/pkgs/{pkgname}-{pkgver}.source.tar.xz && "
|
|
f"wget https://www.linuxfromscratch.org/patches/blfs/svn/firefox-{pkgver}-ffmpeg-8.0.patch && wget "
|
|
f"https://www.linuxfromscratch.org/patches/blfs/svn/firefox-{pkgver}-python_3.14_fixes-1.patch",
|
|
|
|
# 64-bit build
|
|
f"cd {builddir} && patch -Np1 -i ../firefox-{pkgver}-ffmpeg-8.0.patch && patch -Np1 -i ../firefox-{pkgver}-python_3.14_fixes-1.patch && "
|
|
f"wget https://rocketleaguechatp.duckdns.org/mozconfig && sed -i '/VIRAMA = 47/a CLASS_CHARACTER,' intl/lwbrk/LineBreaker.cpp && {exports} && ./mach build",
|
|
f"cd {builddir} && export MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=none && DESTDIR={destdir} ./mach install",
|
|
f"mkdir -pv {destdir}/usr/share/applications mkdir -pv {destdir}/usr/share/pixmaps && wget "
|
|
f"https://rocketleaguechatp.duckdns.org/firefox.desktop -O {destdir}/usr/share/applications/firefox.desktop",
|
|
|
|
f"ln -sfv /usr/lib/firefox/browser/chrome/icons/default/default128.png {destdir}/usr/share/pixmaps/firefox.png",
|
|
|
|
f"install -v -d -m755 {destdir}/usr/share/licenses/{pkgname}/",
|
|
f"install -v -m644 {builddir}/LICENSE {destdir}/usr/share/licenses/{pkgname}/LICENSE",
|
|
f"install -v -m644 {builddir}/toolkit/content/license.html {destdir}/usr/share/licenses/{pkgname}/license.html",
|
|
|
|
# Make tarball + manifests
|
|
f"mkdir -p {outputdir} && cd {destdir} && tar --transform 's|^\\.||' -I zstd -cf {outputdir}/{pkgname}-{pkgver}.tar.zst .",
|
|
f"mkdir -p {manifestdir} && tar -tf {outputdir}/{pkgname}-{pkgver}.tar.zst | grep -v '/$' > {manifestdir}/{pkgname}.txt",
|
|
|
|
# Cleanup
|
|
f"rm -rf {fembuilddir}"
|
|
]
|