From 1e96f804bd9b632cea8c0ce320127dbebc3fd758 Mon Sep 17 00:00:00 2001 From: gabry Date: Tue, 23 Dec 2025 14:09:52 +0100 Subject: [PATCH] feat: add firefox --- firefox.recipe.py | 41 ++++++++++++++++++++++++++++++++++ index.txt | 2 ++ startup-notification.recipe.py | 30 +++++++++++++++++++++++++ 3 files changed, 73 insertions(+) create mode 100644 firefox.recipe.py create mode 100644 startup-notification.recipe.py diff --git a/firefox.recipe.py b/firefox.recipe.py new file mode 100644 index 0000000..c9b5380 --- /dev/null +++ b/firefox.recipe.py @@ -0,0 +1,41 @@ +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}" +] diff --git a/index.txt b/index.txt index a7c88d7..4961d9d 100644 --- a/index.txt +++ b/index.txt @@ -81,6 +81,7 @@ ffmpeg.recipe.py fftw.recipe.py file.recipe.py findutils.recipe.py +firefox.recipe.py fish.recipe.py flatpak.recipe.py flatpost.recipe.py @@ -362,6 +363,7 @@ spirv-tools.recipe.py sqlite.recipe.py ssh.recipe.py starship.recipe.py +startup-notification.recipe.py sudo.recipe.py SVT-AV1.recipe.py swappy.recipe.py diff --git a/startup-notification.recipe.py b/startup-notification.recipe.py new file mode 100644 index 0000000..94976c5 --- /dev/null +++ b/startup-notification.recipe.py @@ -0,0 +1,30 @@ +pkgname = "startup-notification" +pkgver = "0.12" +source = f"https://rocketleaguechatp.duckdns.org/startup-notification-{pkgver}.tar.gz" +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" + +deps = ["xcb-util", "xorg-libs"] + +build = [ + # Extract + f"mkdir -p {fembuilddir} && cd {fembuilddir} && tar -xvf /var/lib/fempkg/pkgs/{pkgname}-{pkgver}.tar.gz", + + # 64-bit build + f"cd {builddir} && ./configure --prefix=/usr --disable-static", + f"cd {builddir} && make -j$(nproc)", + f"cd {builddir} && make DESTDIR={destdir} install", + + f"install -v -d -m755 {destdir}/usr/share/licenses/{pkgname}/", + f"install -v -m644 {builddir}/COPYING {destdir}/usr/share/licenses/{pkgname}/LICENSE", + + # 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}" +]