PKGBUILDs/extra/thunderbird/PKGBUILD
2023-04-12 14:49:56 +00:00

318 lines
17 KiB
Bash

# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Contributor: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Contributor: Ionut Biru <ibiru@archlinux.org>
# Contributor: Alexander Baldeck <alexander@archlinux.org>
# Contributor: Dale Blount <dale@archlinux.org>
# Contributor: Anders Bostrom <anders.bostrom@home.se>
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
# - mozconfig changes for ARM
# - disable rust lto for v7
highmem=1
pkgbase=thunderbird
pkgname=(thunderbird)
pkgver=102.10.0
pkgrel=1
pkgdesc='Standalone mail and news reader from mozilla.org'
url='https://www.mozilla.org/thunderbird/'
arch=(x86_64)
license=(MPL GPL LGPL)
depends=(
glibc gtk3 libgdk-3.so libgtk-3.so mime-types dbus libdbus-1.so dbus-glib
alsa-lib nss hunspell sqlite ttf-font libvpx libvpx.so zlib bzip2 libbz2.so
botan libwebp libwebp.so libwebpdemux.so libevent libjpeg-turbo libffi
libffi.so nspr gcc-libs libx11 libxrender libxfixes libxext libxcomposite
libxdamage pango libpango-1.0.so cairo gdk-pixbuf2 icu libicui18n.so
libicuuc.so freetype2 libfreetype.so fontconfig libfontconfig.so glib2
libglib-2.0.so pixman libpixman-1.so gnupg json-c
)
makedepends=(
unzip zip diffutils python nasm mesa libpulse libice libsm
rust clang llvm cbindgen nodejs lld
gawk perl findutils libotr
)
options=(!emptydirs !makeflags !lto)
source=(https://archive.mozilla.org/pub/thunderbird/releases/$pkgver/source/thunderbird-$pkgver.source.tar.xz{,.asc}
thunderbird.desktop
vendor-prefs.js
distribution.ini
mozconfig.cfg
metainfo.patch
rustc_version-0.4.0.patch)
validpgpkeys=(
14F26682D0916CDD81E37B6D61B7B526D98F0353 # Mozilla Software Releases <release@mozilla.com>
4360FE2109C49763186F8E21EBE41E90F6F12F6D # Mozilla Software Releases <release@mozilla.com>
)
# Google API keys (see http://www.chromium.org/developers/how-tos/api-keys)
# Note: These are for Arch Linux use ONLY. For your own distribution, please
# get your own set of keys. Feel free to contact foutrelis@archlinux.org for
# more information.
_google_api_key=AIzaSyDwr302FpOSkGRpLlUpPThNTDPbXcIn_FM
# Mozilla API keys (see https://location.services.mozilla.com/api)
# Note: These are for Arch Linux use ONLY. For your own distribution, please
# get your own set of keys. Feel free to contact heftig@archlinux.org for
# more information.
_mozilla_api_key=16674381-f021-49de-8622-3021c5942aff
prepare() {
cd $pkgname-$pkgver
echo "${noextract[@]}"
local src
for src in "${source[@]}"; do
src="${src%%::*}"
src="${src##*/}"
[[ $src = *.patch ]] || continue
msg2 "Applying patch $src..."
patch -Np1 < "../$src"
done
printf "%s" "$_google_api_key" >google-api-key
printf "%s" "$_mozilla_api_key" >mozilla-api-key
cp ../mozconfig.cfg .mozconfig
sed "s|@PWD@|${PWD@Q}|g" -i .mozconfig
if [[ $CARCH == "armv7h" ]]; then
echo "ac_add_options --disable-elf-hack" >> .mozconfig
MAKEFLAGS="-j4"
# disable hard-coded LTO
sed -i '/cargo_rustc_flags += -Clto/d' config/makefiles/rust.mk
sed -i '/RUSTFLAGS += -Cembed-bitcode=yes/d' config/makefiles/rust.mk
# increase codegen-units due to RAM constraints
sed -i 's/codegen-units=1/codegen-units=16/' config/makefiles/rust.mk
fi
echo 'ac_add_options --enable-optimize="-g0 -O2"' >> .mozconfig
echo "mk_add_options MOZ_MAKE_FLAGS=\"${MAKEFLAGS}\"" >> .mozconfig
export MOZ_DEBUG_FLAGS=" "
export CFLAGS+=" -g0"
export CXXFLAGS+=" -g0"
#export LDFLAGS+=" -Wl,--no-keep-memory -Wl,--reduce-memory-overheads"
export LDFLAGS+=" -Wl,--no-keep-memory"
export RUSTFLAGS="-Cdebuginfo=0"
CFLAGS=${CFLAGS/-fstack-clash-protection}
CXXFLAGS=${CXXFLAGS/-fstack-clash-protection}
}
build() {
cd $pkgname-$pkgver
if [[ -n "${SOURCE_DATE_EPOCH}" ]]; then
export MOZ_BUILD_DATE=$(date --date "@${SOURCE_DATE_EPOCH}" "+%Y%m%d%H%M%S")
fi
export MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=none
export MOZBUILD_STATE_PATH="${srcdir}/mozbuild"
./mach configure
./mach build
./mach buildsymbols
}
package_thunderbird() {
optdepends=(
'libotr: OTR support for active one-to-one chats'
'libnotify: Notification integration'
)
cd $pkgname-$pkgver
DESTDIR="$pkgdir" ./mach install
install -Dm 644 ../vendor-prefs.js -t "$pkgdir/usr/lib/$pkgname/defaults/pref"
install -Dm 644 ../distribution.ini -t "$pkgdir/usr/lib/$pkgname/distribution"
install -Dm 644 ../thunderbird.desktop -t "$pkgdir/usr/share/applications"
install -Dm 644 comm/mail/branding/thunderbird/net.thunderbird.Thunderbird.appdata.xml \
"$pkgdir/usr/share/metainfo/net.thunderbird.Thunderbird.appdata.xml"
for i in 16 22 24 32 48 64 128 256; do
install -Dm644 comm/mail/branding/thunderbird/default${i}.png \
"$pkgdir/usr/share/icons/hicolor/${i}x${i}/apps/$pkgname.png"
done
install -Dm644 comm/mail/branding/thunderbird/TB-symbolic.svg \
"$pkgdir/usr/share/icons/hicolor/symbolic/apps/thunderbird-symbolic.svg"
# Use system-provided dictionaries
ln -Ts /usr/share/hunspell "$pkgdir/usr/lib/$pkgname/dictionaries"
ln -Ts /usr/share/hyphen "$pkgdir/usr/lib/$pkgname/hyphenation"
# Install a wrapper to avoid confusion about binary path
install -Dm755 /dev/stdin "$pkgdir/usr/bin/$pkgname" <<END
#!/bin/sh
exec /usr/lib/$pkgname/thunderbird "\$@"
END
# Replace duplicate binary with wrapper
# https://bugzilla.mozilla.org/show_bug.cgi?id=658850
ln -srf "$pkgdir/usr/bin/$pkgname" \
"$pkgdir/usr/lib/$pkgname/thunderbird-bin"
}
_package_i18n() {
pkgdesc="$2 language pack for Thunderbird"
depends=("thunderbird>=$pkgver")
install -Dm644 thunderbird-i18n-$pkgver-$1.xpi \
"$pkgdir/usr/lib/thunderbird/extensions/langpack-$1@thunderbird.mozilla.org.xpi"
}
_languages=(
'af "Afrikaans"'
'ar "Arabic"'
'ast "Asturian"'
'be "Belarusian"'
'bg "Bulgarian"'
'br "Breton"'
'ca "Catalan"'
'cak "Kaqchikel"'
'cs "Czech"'
'cy "Welsh"'
'da "Danish"'
'de "German"'
'dsb "Lower Sorbian"'
'el "Greek"'
'en-GB "English (British)"'
'en-US "English (US)"'
'es-AR "Spanish (Argentina)"'
'es-ES "Spanish (Spain)"'
'et "Estonian"'
'eu "Basque"'
'fi "Finnish"'
'fr "French"'
'fy-NL "Frisian"'
'ga-IE "Irish"'
'gd "Gaelic (Scotland)"'
'gl "Galician"'
'he "Hebrew"'
'hr "Croatian"'
'hsb "Upper Sorbian"'
'hu "Hungarian"'
'hy-AM "Armenian"'
'id "Indonesian"'
'is "Icelandic"'
'it "Italian"'
'ja "Japanese"'
'ka "Georgian"'
'kab "Kabyle"'
'kk "Kazakh"'
'ko "Korean"'
'lt "Lithuanian"'
'ms "Malay"'
'nb-NO "Norwegian (Bokmål)"'
'nl "Dutch"'
'nn-NO "Norwegian (Nynorsk)"'
'pa-IN "Punjabi (India)"'
'pl "Polish"'
'pt-BR "Portuguese (Brazilian)"'
'pt-PT "Portuguese (Portugal)"'
'rm "Romansh"'
'ro "Romanian"'
'ru "Russian"'
'sk "Slovak"'
'sl "Slovenian"'
'sq "Albanian"'
'sr "Serbian"'
'sv-SE "Swedish"'
'th "Thai"'
'tr "Turkish"'
'uk "Ukrainian"'
'uz "Uzbek"'
'vi "Vietnamese"'
'zh-CN "Chinese (Simplified)"'
'zh-TW "Chinese (Traditional)"'
)
_url=https://archive.mozilla.org/pub/thunderbird/releases/$pkgver/linux-x86_64/xpi
for _lang in "${_languages[@]}"; do
_locale=${_lang%% *}
_pkgname=thunderbird-i18n-${_locale,,}
pkgname+=($_pkgname)
source+=("thunderbird-i18n-$pkgver-$_locale.xpi::$_url/$_locale.xpi")
eval "package_$_pkgname() {
_package_i18n $_lang
}"
done
# Don't extract languages
noextract=()
for _src in "${source[@]%%::*}"; do
case "$_src" in
*.xpi) noextract+=("$_src") ;;
esac
done
sha512sums=('08d7908cbef48cffac2fbab857f8aceb9a7abd7c72d5e9c9dae8d3a3871846b6f0cf562c5b646ad27a0d79ac04b8605b123c5e1929f92afee4501344d1fbc5cf'
'SKIP'
'a0061fcb2a7f66061e336a8d95948592f56f4752e56467f14ba63846720ebf845cce7511d1a2637e3b80d5a1ffdaa2fb783fa37195103425ef65222d45372012'
'6918c0de63deeddc6f53b9ba331390556c12e0d649cf54587dfaabb98b32d6a597b63cf02809c7c58b15501720455a724d527375a8fb9d757ccca57460320734'
'5cd3ac4c94ef6dcce72fba02bc18b771a2f67906ff795e0e3d71ce7db6d8a41165bd5443908470915bdbdb98dddd9cf3f837c4ba3a36413f55ec570e6efdbb9f'
'a34dd97954f415a5ffe956ca1f10718bd164950566ceba328805c2ccbb54ed9081df07f2e063479bf932c4a443bb5b7443cca2f82eea3914465ed6e4863e0c0e'
'7e43b1f25827ddae615ad43fc1e11c6ba439d6c2049477dfe60e00188a70c0a76160c59a97cc01d1fd99c476f261c7cecb57628b5be48874be7cf991c22db290'
'36d9662fc94cbf7dcf371adc13a9cda679bc75df961d86de019d3c8ebb0be3062d5ef762d175fab58696db74758100a65de45d7832e0e2bd4e15c901f72d8349'
'a634335728a4774e0eb8f9d4d4832d283c7a3e9f25b1b0c1c7fe2610c7f1772d9896d1c0fbeef57d4d0d6285a9151b4122a324e3e1624889950a7d7c7a03ec1d'
'd04cedeb000a028faad9a6e68bed0f83fff48a7bbef229ffb119b82eccc9199e3981adcb2fc34ca85e2a38b25ce2b163cc56d923d71e7a835aedabb2c50d5d15'
'68db8dd191eceb4e3721242dafaf3f1de1cf371cc22804fc07ad0e8f114a0402941cd2b3e3eeebd52d9a3dc8335593189f8ce080afdb04a87db615364b1f3372'
'e80f7e9facc58730b7bc1a9991b9aa5efcbe032f73808a34c11f61d47d4e443d6e1512c4bec25e83ca560560acb5a89e46b226fba4f93de786b02a40db53b28c'
'592aa1661385148741073f7ef29aad344ef0abbeb5d973c55b1f0f958467fd0b927a3aa600d9270cb2130962ca403b18679a2adc69070c9a0d8eafd9359d553b'
'826ca679084a3401af1055352334f8685c2840b2a768c8bac4236d779eba420a480b65932fcf795e72733ef85c0dc7006b69d3646a5a47f50577da6297228ea1'
'21f60f67e1daa2dca6f0b7926475adea8a81df16b38be8662ed8df802163d5bbbe5fe4de2e7a77e4ac8a4b394f23c8595643902800a176378fd6e92312e250d3'
'0117728de5e5ed3c1312532c7e6704e33c705f8901527a75d52c1cde1173f58e23ece58bd45d6fe0d68e607eda98a302801819e43ced0d262e9eb110e3bcdb08'
'3ed996481b5fddcf1d5c972e37b49bea298454cfe7e72339c632a7afe91fab722ea4e91c9d3a646c91f3f0474a403f6a4f9a8c83e523528123c93e7918b96fe3'
'9869539f57fa3f9d93432c414e0679e3e4329919c86459cf1a57e1ddc6f464a0d7f2edac90a9a53e6e40a64baf2b30cb5c551e3784e4244913ff17b3245df1d3'
'a03e05972af42b16383d63c951e65b76b6d9d8ffc3d5f773d2961bfe31fff1bcfc0650aba1a7fc877b1b8ac596726b021b664405700c0d274827606d2084b2fb'
'453ac36023ae212c51be9a3553091ede9625934261400f705d6079aec24f6e14fe61a52e12162447509ec036e40c5b2f3151cf1b69179078dab3b0294df4db85'
'5978f189069ca5303272f91ed857d391cffdb5fa87370f53c7c3a3d41cfcf274740ac6c3131e9d7a700a642837886145d91756cc5a42291e9840ef333af41399'
'ce30c946b0e5168513fbe2bf51b801039c2587189985964e210bed120dec2a096b0c8728e581d3371455c0f7b7c2ece435b86a4204d9438c94553dddff577d8c'
'724264d6d1819e38763c751734cd8b7650249ac6b518b9878ba50a69e76b587c39582512de948fb58acd21be560d143b7a89c8608c7ec6813631e9b2847f6b80'
'344431b2ade8dc5cb6ff7e369b2be134520c1637494cb6a162e301097f90a1edbd1c852ebc433ea9b05d697e65835cc9349456aea966f9d18c2f09b5c1062d4e'
'0420d74ff4042cd7061be9a582442df3aba70e40e7312e8a818a8cd16a41a855441b3fbfd3deb15b8825497055b569067a9287d1ac74f544a7e3af443deb698c'
'e633ef6bc2f04ee7c67b06ea7236e17d9918d8fbb8d532104f7f1fcce1e51534692ce4718765c9bc098e3d783c925a01947eab29953a23687b7d71655cfc3c58'
'cfee195f369cc310f56dbd9e860a853760df3053c1acda5d63f1eb6dedb590fd81d99d7a456520e568a4a686f1549118cedc7d97d001661350062715ff95e8e6'
'ca149b4d8ec53a859cd4f998f90af0dc9301bf92833b3ec7ed5fab2bd0b8e70d365b88f298a4af265799f07f0f12f7f6d68eda2c507163217432d1a67138c3bf'
'9ae093446f47e33c260eca78f6bbc446f938aca8ede5e90c967e4a61016cca7c770483044c7a1e6dae00deba83e7164bf6f3eaaa6878a90043c9d5ec4fa7a2b8'
'47994ec8029d400ad2b510b57b18c3765a86e7976974d0512807b977c3f166a5def83e9477f66f8750dc32c75c93f9ca7b5fe1e7a9eddc730d8b3b01a679c881'
'3cead47c6b0cf1f65e772c3896929078e33bb3c7b998a6087948f3ccf1e28543e05abdc8f8ecac054b8d5f7a86a6803d5bb7aec9388c6e50a87672abb577587b'
'e03b4fa6a74b5f116f2e202257895bbec7b04316d959d48f8c8f5ecebdbc6127f05ef6f31886ac17783a49d2459fdd0817b5e1f9bb4a291458a2cb2a17d5df17'
'f9fd0b8ce36d3aec929c64220fc571f439290d623f17918765b73494add3170617f26105303bce86256bcdcd5c987a4c29d94971c7bafe032ad0ddd96cdea7c5'
'b915dd0055435bc30e6acac9112fb199b30fa542dde3814c0df8229d2a8061cbef8ac875c0f0d2550e414160e55b0cb1058da78861bc5ad3891f19c2fbaefd66'
'7e40c76423637162b321fbe61d742301bb1815ca949ba4faef27500608c1190179b9541cf6e38e904639154af0a13ad203dfd542f6e5e4a7d5257cf4db111edd'
'c71e8ba49aae3a7e866fde49fe4120b0d32a5ed307a358d0bf7f88fb66d86834ae8c30db1b5d3b813f302457723193b7dbfe63569cde4639960c1c8a6943530c'
'd394cc8ca5019c019f7b7e361836b27bcffc5189f8e464b8c435731b7031443e7102e47f36ad332335001ac4b3f329b74518aabe096a5e88b6edb5a9344f9d3a'
'4d3ef3bf16686c81b1334dba1a43f723743f8d0362d5dc669e75d201d0de5260a6532b25e40a8754c7ffcf3040fc86f027ab9e5cb54d5e62092c32448a2c9ae2'
'2c657de5d1cb8164cb3e91df8b4bf4c49f3137ddc9b4ce3947b721298a66ff3cb6eac03e6b78860a0ac5cd94b508d48a4373937135836984ba229d6287180a7c'
'0239bfea414aa1b0432c00a191d5f3c226a677b95a568536713c7f215c176dbbc2666f0dac6a92bbf357f3634b00993193c9fe4096aaf6a4a71d78324fd09c8c'
'515d60602497e8ad7296d57893176ef762cd56fed38c560da09a5631ff3c2075d022476b154bb1fa29c425426b8f911b038c6c4b295f015207b3aef7255ac8fa'
'dedfedca6073e343f4aeb0fc61d5b0eaf283c4d66bff54c454c050a410e6ebe3417a25f70314627e72e5dd67f7d14c5a7b4ffa3ca2f8acd9127e610522562458'
'6b2a6ea08fd5f30ef9b658f15a630a1023d2c0110dfe08247a6ff7546c7cfd3944575fe3d9e86bc8cd06be28f2cdba1d7752574c2c091110eaa7527215fae8d1'
'0d6356a8a52c72a91dd69582b3fd762b4054281fdf724f42e0cd11b02a7d90c443870547e81291431fe152772a6c212c6dcb397ff16c634040eb0619a77aaed1'
'95473fef8d000aa827028b6c9bc92e2a375e3cd9462604beadbb11b697419f93fe541e26248cc300380aa38d8654c4de9dbf269865a053e09a27021d225d2b4c'
'358550d17acb79696a16880231893db8f56b509d7400090395d5f831dac5f06ceef85e784fc51da1bd1ed1bf824530ea9fe18ea75b2da3895d53796cdd483d00'
'd4ad8230089064261cdd713544d490ab2442d04a4f912d3bbc8be49458dbfbe20056c6cc7040cb8ce7dffd3c3c7f8011a9ee371a5dec1f21c20e585f4d5306c3'
'19b0fdde2fc29883f09ed44903ca79098dc7ef2d767bf79efb120f0454431a52998727a8d352ee3c9a7e0eea6b75bf6bae3f7ab2ddbeaa9590fc04b775db613e'
'2be7ed9b8f89ba16a957541fb527f057a6d01565926774d9c471c1d5a697d74f022ad6925ffe11718e042fcfb63414eda9046a04f61d47b7dab43801eaa68bb2'
'7e372d82a8ea99ead60274895c7d0a38b77a5490c600aaa04fe2ff881349acddb7550ddf3f431e233d14d116d254c021567c623ca009b97756cc56c274c8ab45'
'c97455e12ca132b1541a04cbf6ddc1c255c52b9245976a2a3a819d9caaca31e47ca143e984e70154e7f116be7e9d3bf131b818fc2fb8a75bd50e9f0dc5fd635f'
'3f114db0be45124b685c577951b6407722bad3abb17dde28e0a9e198cc11100573d9bc58f8649e8035ee46a44a6ac8a418b64fb6e78cc2e1d257be6fbcbdd5aa'
'df6d62b22ecb6a0b83ff2bcb415e24486f9e7ecd169884d7136eea584f123b83b8081469206dbcb9aaec1f6be0abd381a5a050ae69c7a26c0414f15032c758ae'
'40c98f5557d4a3d5648b5d65cf6df5207217483a817f35c8ba974f8ebe4032e045c4e6cb51d72f26fbd38a6cea179e3ab404cc02de3aa0f8690d9587198025f4'
'bb04def5d8f595734a09a95ecbaaf4c92e4e354133a19635ab81c2fc4ddaabc8f4655bda3a08a7c849b1aedc363aa553f8ad1a37e5c590d6ec0afe4d3ef76dbe'
'aa69f8d68051c0bec50ac1b171b1e5c21b6030463b5b4d1aab63fe53e02d5c8a599669c780d69a020652aea130ac5fcf9c24fd9a7c6a4a4475f46e60b33a8e3c'
'318a2a2e62bd8494d217fc528c27ba4753ee45e99a655483f9fb25c7a13cdac8365be77a9ea4183ea263f4ee3946e0807c827ddd0d55eb9383f9f56fc864a17a'
'fe9a06a1865f4a624997e0a85fad8462dc49e46876f85d3b4458b965e7dee32e82dc657db99916598348533560b3ee387ad2e1a6fd693da7af7e9f20516af9d1'
'71926f5692e3b51ce77e4718739111427a0f32796f1383342fb0feaa7c7130ea3a1ad46941265140421a82999f3f7934b029904b67768b6c0c7b3a1f8c66564d'
'178a87ea1dfe0817072967feb0c57e2dee4acae9df2f0c2edc5c4d006b5c4c12db82238a17958292beb72fd515d6ff7555422a92cf9130f588ea4c3dc37faedf'
'ba88434111304ccbabcb33dc77f111d9c890054a1c485d8296642aa48e7e3f7d1c504f7870fc2fc57d302462f909cb4f4cef74dbf7b45b618ef89730dfb6be0e'
'89828bcdde5382f1ba2c72d02a2e3bc27a8e8a99f7da92694acdf301f10a5766ca5e1ef8f675df9bd1c4a6e8748a91f6dece7e432e0225368805ba6c91610a0b'
'82e28f06b4cb75a4eb85fa0a6a8187cd9751d4b4a7c9460e1e2de302c5d8bf36bd616dd47c380dc652965a85cc53689dbc4f4864e2f19db87ccf3fcd07aeef35'
'baa8fc6b38ccffa33f64e237ca69a834651f5da7626f5a86efe16caaecae5eaa1b85ab954c28fc94b3f4b17dc7cbccfdfd00ccdf2ce84783cd2f5d709727e4c8'
'f3bbf9a12044866ce91325df2ab55687924e9fc67b3a3e89c99d4dde57489fdda8fe36902356422d496419fb7a557aa1cd1f8c51a9c477fc0dc93d863e2ecbbc'
'f9d75ba7a9be0fe4822eb3fafb5db4f5f404655591a13cb5612e11daed962c69d3957e443ef967794322e7cebda75973d2a966cfde3ef8f3a46091a5b5f1d1aa'
'6276b2271b5c358848eb8b6238b80cce91a2341942a4dd8bf1d6cb34fdfbc9c04d10210dd0e9b7380b1d6d8dcd3199f2967645cde923c4cb1a6f3e789c1b7153'
'b46dc4197fd5eea0bc108b65b78e64adfb006642e228e8aa09a93cb657080055c92fbd3c59374688b678b8f29f33669b26cf9e04f029d500815f0a13daf678c1'
'6989f7e63af1db69653cbcc81755470a8092761903340d5480bf00dc58b0252df55024ce55215d7ecff9ce6779673798e1cfe9580d7de554ce9b16aa004b953b'
'1758de279cea6ebe4418de5fdeb01d627aaa7527ebfe7042677c33820f029b1219bdc56aa16b4879e65ed7022b3382152fb160189f0ff8a9537e6412d07b63df'
'cba5d31b6163fa7c5826931b91361332f05bb4c693e62756217b141aa6784bdf995889dd55b0c9f3fafd05452dd7a91135dc0a3c7db5c33365f9fc52fa515372')
# vim:set sw=2 et: