blob: aa09e73a15a29f4a32ef6338acc8fc9b9a23eb45 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
|
name=librewolf
version=137.0.3
_ver=${version%.*}
_sion=${version##*.}
_version=${_ver}-${_sion}
release=1
source="https://gitlab.com/api/v4/projects/32320088/packages/generic/librewolf-source/${_version}/librewolf-${_version}.source.tar.gz
visibility.patch
fix-rust-target.patch"
build() {
cat > mozconfig << EOF
ac_add_options --prefix=/usr
ac_add_options --libdir=/usr/lib
ac_add_options --with-app-name=$name
ac_add_options --with-branding=browser/branding/$name
export MOZ_APP_REMOTINGNAME=$name
ac_add_options --enable-release
ac_add_options --enable-audio-backends=alsa
ac_add_options --enable-install-strip
ac_add_options --enable-optimize
ac_add_options --enable-hardening
ac_add_options --with-system-ffi
ac_add_options --with-system-jpeg
ac_add_options --with-system-libvpx
ac_add_options --with-system-nspr
ac_add_options --with-system-nss
ac_add_options --with-system-pixman
ac_add_options --with-system-png
ac_add_options --with-system-webp
ac_add_options --with-system-zlib
ac_add_options --without-wasm-sandboxed-libraries
ac_add_options --disable-eme
#ac_add_options --disable-dbus
ac_add_options --disable-bootstrap
ac_add_options --disable-tests
ac_add_options --disable-vtune
ac_add_options --disable-updater
ac_add_options --disable-jemalloc
ac_add_options --disable-elf-hack
ac_add_options --disable-callgrind
ac_add_options --disable-profiling
ac_add_options --disable-necko-wifi
ac_add_options --disable-crashreporter
ac_add_options --disable-accessibility
ac_add_options --disable-debug
ac_add_options --disable-debug-symbols
ac_add_options --disable-parental-controls
ac_add_options --disable-system-extension-dirs
EOF
if [ -f $SPM_PKGDB/libx11 ] && [ ! -f $SPM_PKGDB/wayland ]; then
echo "ac_add_options --enable-default-toolkit=cairo-gtk3-x11-only" >> mozconfig
elif [ -f $SPM_PKGDB/wayland ] && [ ! -f $SPM_PKGDB/libx11 ]; then
echo "ac_add_options --enable-default-toolkit=cairo-gtk3-wayland-only" >> mozconfig
fi
if [ -e '/usr/bin/ccache' ]; then
echo 'ac_add_options --enable-ccache' >> mozconfig
PATH=$(echo ${PATH} | awk -v RS=: -v ORS=: '/ccache/ {next} {print}' | sed 's/:*$//')
fi
export MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=none
export MOZBUILD_STATE_PATH=${PWD}/mozbuild
export RUST_TARGET=x86_64-unknown-linux-musl
export CFLAGS="$CFLAGS -w"
export CXXFLAGS="$CXXFLAGS -w"
export LDFLAGS="$LDFLAGS -Wl,-rpath=/usr/lib/$name,--enable-new-dtags"
export CXXSTDLIB=c++
./mach build
./mach install
mkdir -pv $PKG/usr/share/applications
mkdir -pv $PKG/usr/share/pixmaps
cat > $PKG/usr/share/applications/$name.desktop << EOF
[Desktop Entry]
Encoding=UTF-8
Name=Librewolf
Comment=Browse the World Wide Web
GenericName=Web Browser
Exec=librewolf %u
Terminal=false
Type=Application
Icon=librewolf
Categories=GNOME;GTK;Network;WebBrowser;
MimeType=text/xml;text/mml;text/html;application/xhtml+xml;application/vnd.mozilla.xul+xml;x-scheme-handler/http;x-scheme-handler/https
StartupNotify=true
EOF
mkdir -p $PKG/usr/share/pixmaps
ln -sfv /usr/lib/$name/browser/chrome/icons/default/default128.png \
$PKG/usr/share/pixmaps/$name.png
rm $PKG/usr/lib/$name/$name-bin
}
|