|
| 1 | +# Template file for 'librewolf' |
| 2 | +pkgname=librewolf |
| 3 | +version=147.0.3.2 |
| 4 | +revision=1 |
| 5 | +archs="x86_64 aarch64" |
| 6 | +create_wrksrc=yes |
| 7 | +depends=" |
| 8 | + alsa-lib |
| 9 | + at-spi2-core |
| 10 | + cairo |
| 11 | + dbus |
| 12 | + ffmpeg |
| 13 | + fontconfig |
| 14 | + freetype |
| 15 | + gdk-pixbuf |
| 16 | + glib |
| 17 | + gtk+3 |
| 18 | + hicolor-icon-theme |
| 19 | + libX11 |
| 20 | + libXcomposite |
| 21 | + libXcursor |
| 22 | + libXdamage |
| 23 | + libXext |
| 24 | + libXfixes |
| 25 | + libXi |
| 26 | + libXrandr |
| 27 | + libXrender |
| 28 | + libxcb |
| 29 | + mime-types |
| 30 | + nspr |
| 31 | + nss |
| 32 | + pango |
| 33 | + pulseaudio |
| 34 | + startup-notification |
| 35 | + dejavu-fonts-ttf |
| 36 | +" |
| 37 | +short_desc="Community-maintained fork of Firefox, focused on privacy, security and freedom" |
| 38 | +maintainer="AmarBego <begovicamar@proton.me>" |
| 39 | +license="MPL-2.0" |
| 40 | +homepage="https://librewolf.net" |
| 41 | +# Binary repackage |
| 42 | +restricted=yes |
| 43 | +nopie=yes |
| 44 | +nostrip=yes |
| 45 | +noshlibprovides=yes |
| 46 | + |
| 47 | +# Version format: 147.0.3.2 = Firefox 147.0.3, LibreWolf release 2 |
| 48 | +# Extract Firefox version (first 3 parts) and LibreWolf version (4th part) |
| 49 | +_ffver="${version%.*}" |
| 50 | +_lwver="${version##*.}" |
| 51 | +# Remove trailing .0 from Firefox version for download URL (e.g., 147.0.0 -> 147.0) |
| 52 | +_ffver_short="${_ffver%.0}" |
| 53 | +_baseurl="https://codeberg.org/api/packages/librewolf/generic/librewolf/${_ffver_short}-${_lwver}" |
| 54 | + |
| 55 | +case "$XBPS_TARGET_MACHINE" in |
| 56 | + x86_64) |
| 57 | + _arch=x86_64 |
| 58 | + checksum=041ad95256c0e7af6692d8c331ac91e0d6f4e629616ec00d299eb26368d9677e |
| 59 | + ;; |
| 60 | + aarch64) |
| 61 | + _arch=arm64 |
| 62 | + checksum=9b812482eb65477420103560b4a998915be3ee3cda663974727d97e1427a1898 |
| 63 | + ;; |
| 64 | +esac |
| 65 | + |
| 66 | +distfiles="${_baseurl}/librewolf-${_ffver_short}-${_lwver}-linux-${_arch}-package.tar.xz" |
| 67 | + |
| 68 | +hostmakedepends="tar" |
| 69 | + |
| 70 | +do_install() { |
| 71 | + # Install to /usr/lib/librewolf |
| 72 | + # Tarball extracts to librewolf/ directory |
| 73 | + vmkdir usr/lib/librewolf |
| 74 | + vcopy "librewolf/*" usr/lib/librewolf |
| 75 | + |
| 76 | + # Create wrapper script |
| 77 | + cat > librewolf.sh <<EOF |
| 78 | +#!/bin/bash |
| 79 | +XDG_CONFIG_HOME=\${XDG_CONFIG_HOME:-~/.config} |
| 80 | + |
| 81 | +# Allow users to override command-line options |
| 82 | +if [[ -f \$XDG_CONFIG_HOME/librewolf-flags.conf ]]; then |
| 83 | + LIBREWOLF_USER_FLAGS="\$(sed 's/#.*//' \$XDG_CONFIG_HOME/librewolf-flags.conf | tr '\n' ' ')" |
| 84 | +fi |
| 85 | + |
| 86 | +exec /usr/lib/librewolf/librewolf "\$@" \$LIBREWOLF_USER_FLAGS |
| 87 | +EOF |
| 88 | + vbin librewolf.sh librewolf |
| 89 | + |
| 90 | + # Desktop file |
| 91 | + cat > librewolf.desktop <<EOF |
| 92 | +[Desktop Entry] |
| 93 | +Name=LibreWolf |
| 94 | +Comment=Community-maintained fork of Firefox, focused on privacy, security and freedom |
| 95 | +GenericName=Web Browser |
| 96 | +Exec=librewolf %u |
| 97 | +Icon=librewolf |
| 98 | +Type=Application |
| 99 | +StartupNotify=true |
| 100 | +StartupWMClass=librewolf |
| 101 | +Categories=Network;WebBrowser; |
| 102 | +MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;x-scheme-handler/http;x-scheme-handler/https; |
| 103 | +Actions=new-window;new-private-window; |
| 104 | + |
| 105 | +[Desktop Action new-window] |
| 106 | +Name=New Window |
| 107 | +Exec=librewolf --new-window |
| 108 | + |
| 109 | +[Desktop Action new-private-window] |
| 110 | +Name=New Private Window |
| 111 | +Exec=librewolf --private-window |
| 112 | +EOF |
| 113 | + vinstall librewolf.desktop 644 usr/share/applications |
| 114 | + |
| 115 | + # Icons - reference from source directory since it's easier than DESTDIR path |
| 116 | + for size in 16 32 48 64 128; do |
| 117 | + vinstall "librewolf/browser/chrome/icons/default/default${size}.png" 644 \ |
| 118 | + usr/share/icons/hicolor/${size}x${size}/apps librewolf.png |
| 119 | + done |
| 120 | + vinstall "librewolf/browser/chrome/icons/default/default128.png" 644 usr/share/pixmaps librewolf.png |
| 121 | + |
| 122 | + # Vendor preferences |
| 123 | + cat > vendor.js <<EOF |
| 124 | +// Use system-provided dictionaries |
| 125 | +pref("spellchecker.dictionary_path", "/usr/share/hunspell"); |
| 126 | +EOF |
| 127 | + vinstall vendor.js 644 usr/lib/librewolf/browser/defaults/preferences |
| 128 | + |
| 129 | + # Distribution info |
| 130 | + vmkdir usr/lib/librewolf/distribution |
| 131 | + cat > distribution.ini <<EOF |
| 132 | +[Global] |
| 133 | +id=io.gitlab.librewolf-community |
| 134 | +version=1.0 |
| 135 | +about=LibreWolf |
| 136 | + |
| 137 | +[Preferences] |
| 138 | +app.distributor="LibreWolf Community" |
| 139 | +app.distributor.channel=librewolf |
| 140 | +app.partner.librewolf=librewolf |
| 141 | +EOF |
| 142 | + vinstall distribution.ini 644 usr/lib/librewolf/distribution |
| 143 | +} |
0 commit comments