286.1. texstudio-4.9.8
LaTeX editor — completion, live PDF preview with SyncTeX, spelling and grammar checking
| Version | 4.9.8, release 1 |
| Shelf | doctools — Documentation toolchains, man pages, markup converters and TeX typesetting |
| Phase | 44_apps (Applications), 63 of 422 in build order |
| Licence | GPL-3.0-only |
| Homepage | https://www.texstudio.org/ |
| Build time | 18.0 SBU |
| Installed size | 57.6 MiB in 253 files |
| Recipe | ports/core/doctools/texstudio/kpkgbuild |
About
TeXstudio is an editor for LaTeX documents: command and reference completion, a structure view, spelling and grammar checking, and a built-in PDF viewer kept in step with the source through SyncTeX. It runs the compilers of texlive, which is in depends for that reason. It is a Qt 6 application.
Sources
texstudio-4.9.8.tar.gz(115.5 MiB)
sha256c056891b90f565350c88c1c7504bab979f8de55e035ae29203a7544001d4fd4e
upstream: https://github.com/texstudio-org/texstudio/archive/refs/tags/4.9.8.tar.gz
archive copy: sources-1/doctools--texstudio-4.9.8.tar.gz
Dependencies
Depends on: cmake, ninja, qt6-qtbase, qt6-qtsvg, qt6-qtdeclarative, qt6-qttools, qt6-qtmultimedia, qt6-qtwayland, poppler, quazip, hunspell, zlib, libX11, librsvg, texlive.
Required by: no port names it.
Patches
build.sh applies these; kpkg applies nothing by itself.
no-update-check.patch— insrc/configmanager.cpp, changes the default of theUpdate/AutoChecksetting fromtruetofalse, so TeXstudio does not check for a newer release on its own; the check stays available in its preferences, where the user can turn it on.
Installation
From the repository root, inside the build container, this is the line kdosbuild runs for the port:
script/chroot/exec.sh bash -c 'source script/phases/44_apps/phase.env && kpkg install texstudio'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/doctools/texstudio.
1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.
cd /ports/core/doctools/texstudio
echo 'c056891b90f565350c88c1c7504bab979f8de55e035ae29203a7544001d4fd4e texstudio-4.9.8.tar.gz' | sha256sum -c -
2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.
SRC_ROOT=/var/cache/kpkg/work/texstudio
SRC=$SRC_ROOT/texstudio-4.9.8
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf texstudio-4.9.8.tar.gz -C "$SRC" --strip-components=1
Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.
3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:
patch -p1 -i "$PORT_SRC/no-update-check.patch"
cmake -S . -B build -G Ninja \
-D CMAKE_POLICY_VERSION_MINIMUM=3.5 \
-D CMAKE_BUILD_TYPE=Release \
-D CMAKE_INSTALL_PREFIX=/usr \
-D CMAKE_INSTALL_LIBDIR=lib \
-D QT_VERSION_MAJOR=6 \
-D CMAKE_REQUIRE_FIND_PACKAGE_Hunspell=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_QuaZip-Qt6=ON \
-D CMAKE_DISABLE_FIND_PACKAGE_QTermWidget=ON \
-D TEXSTUDIO_ENABLE_MEDIAPLAYER=ON \
-D TEXSTUDIO_ENABLE_TESTS=OFF \
-Wno-dev
grep -q '^POPPLER_FOUND:INTERNAL=1' build/CMakeCache.txt || {
echo 'texstudio: poppler-qt6 was not found; the PDF viewer would be missing' >&2
exit 1
}
cmake --build build
DESTDIR=$PKG cmake --install build
for f in "$PKG"/usr/share/texstudio/*; do
[ -f "$f" ] || continue
case $(basename "$f") in
*.qm) rm -f "$f" ;;
en_* | th_en_* | hyph_en_* | README_others.txt) ;;
*.aff | *.dic | *.stopWords* | *.badWords | th_* | hyph_* | README_*) rm -f "$f" ;;
esac
done
for s in 48 64 128; do
install -d "$PKG/usr/share/icons/hicolor/${s}x$s/apps"
rsvg-convert -w $s -h $s -o "$PKG/usr/share/icons/hicolor/${s}x$s/apps/texstudio.png" \
utilities/texstudio.svg
done
cat > "$PKG/usr/share/applications/texstudio.desktop" <<'DESKTOP'
[Desktop Entry]
Type=Application
Name=TeXstudio
GenericName=LaTeX Editor
Comment=Write LaTeX documents with a live PDF preview
Exec=texstudio %F
Icon=texstudio
Terminal=false
StartupNotify=false
StartupWMClass=texstudio
MimeType=text/x-tex;
Categories=Qt;Office;Publishing;
Keywords=tex;latex;pdflatex;xelatex;lualatex;bibtex;editor;
DESKTOP
chmod 644 "$PKG/usr/share/applications/texstudio.desktop"
The switches, and why each is set:
-D QT_VERSION_MAJOR=6— build against Qt 6. Left unset, upstream looks for Qt 6 and then Qt 5, and builds against the first it finds.-D CMAKE_REQUIRE_FIND_PACKAGE_Hunspell=ON— make a missing system hunspell a configure error. Upstream looks for it quietly and compiles its own copy undersrc/hunspellwhen it is absent.-D CMAKE_REQUIRE_FIND_PACKAGE_QuaZip-Qt6=ON— likewise for quazip. WithoutQuaZip-Qt6TeXstudio looks for an olderQuaZippackage and, failing that, compiles its bundled copy undersrc/quazipand links it statically.-D CMAKE_DISABLE_FIND_PACKAGE_QTermWidget=ON— skip the search for QTermWidget, the library behind the optional built-in terminal panel, which the tree does not carry.-D TEXSTUDIO_ENABLE_MEDIAPLAYER=ON— play videos embedded in PDF files in the viewer, through Qt Multimedia. Off by default upstream.-D TEXSTUDIO_ENABLE_TESTS=OFF— no internal tests; upstream’s default, named.
The common switches of each build system are explained in the Flag glossary.
4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/texstudio, prunes what the image does not ship, lints the tree and rolls it reproducibly:
tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
--mtime=@$SOURCE_DATE_EPOCH \
--use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
-cf texstudio-4.9.8-1.tar.xz -C "$PKG" .
5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/texstudio, and runs the triggers its paths call for.
Contents
Installed programs: texstudio.
Installed directories: /usr/share/doc/texstudio, /usr/share/licenses/texstudio, /usr/share/texstudio.
Notes
The PDF viewer exists only when the configure finds poppler, poppler-cpp and poppler-qt6 through pkg-config; without them upstream compiles TeXstudio with NO_POPPLER_PREVIEW and no error. build.sh therefore reads CMakeCache.txt after the configure and stops unless POPPLER_FOUND is set, so a TeXstudio with no PDF preview cannot be packaged.
After the install, build.sh removes every file in /usr/share/texstudio that belongs to a language other than English: the translation catalogues (*.qm) and the spelling dictionaries, thesauri, hyphenation patterns and grammar word lists upstream ships for other languages, keeping the en_*, th_en_* and hyph_en_* files. The HTML manual under /usr/share/doc/texstudio stays: the Help menu opens it, and the tree’s HTML prune exempts that directory.