%global jbig2dec_version 0.19 # Follow mupdf https://src.fedoraproject.org/rpms/mupdf/blob/rawhide/f/mupdf.spec %global debug_package %{nil} %global git_commit_full a620853bd03ce4d1707cd44948f3b15e4ec9100f %global git_commit_short a62085 Name: sioyek Version: 1.0.0 Release: 1%{?dist} Summary: Sioyek is a PDF viewer designed for reading research papers and technical books. License: AGPLv3 URL: https://sioyek.info/ #Source0: https://github.com/ahrm/sioyek/archive/refs/tags/v%{version}.tar.gz #Source0: sioyek-main.zip Source0: https://github.com/ahrm/sioyek/archive/%{git_commit_full}/ahrm-%{git_commit_short}.tar.gz # https://codeload.github.com/ahrm/sioyek/zip/1a5033159994c4322a4273da6564804b89fe9791 #Patch0: sioyek_default_new_instance.patch BuildRequires: mupdf mupdf-devel BuildRequires: freetype-devel gumbo-parser-devel harfbuzz-devel libjpeg-devel openjpeg2-devel BuildRequires: jbig2dec-devel = %{jbig2dec_version} BuildRequires: jbig2dec-libs = %{jbig2dec_version} Requires: jbig2dec-libs = %{jbig2dec_version} Requires: qt5-qt3d qt5-qtbase-devel qt5-qt3d-devel qt5-qtbase-static BuildRequires: qt5-qt3d qt5-qtbase-devel qt5-qt3d-devel qt5-qtbase-static # When trying to compile the 1.0.0 version, I hit /usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/11/../../../../lib64/libmupdf.a(tessocr.o): in function `tesseract::ResultIterator::~ResultIterator()': # (.text._ZN9tesseract14ResultIteratorD0Ev[_ZN9tesseract14ResultIteratorD5Ev]+0x7): undefined reference to `vtable for tesseract::ResultIterator' # /usr/bin/ld: (.text._ZN9tesseract14ResultIteratorD0Ev[_ZN9tesseract14ResultIteratorD5Ev]+0x17): undefined reference to `tesseract::LTRResultIterator::~LTRResultIterator()' # See https://src.fedoraproject.org/rpms/mupdf/c/3628ae07201fc4ad542855f8541b6b3a8bd9dc60?branch=rawhide Requires: leptonica-devel tesseract-devel BuildRequires: leptonica-devel tesseract-devel %description Sioyek is a PDF viewer designed for reading research papers and technical books.You can middle click on a reference/figure to go to the reference/figure (even if the PDF doesn't have links). You can middle click on a paper name in references to directly search it on google scholar. %prep %setup -n sioyek-%{git_commit_full} # %setup # git diff --patch-with-raw main pdf_viewer/main.cpp > ~/rpmbuild/SOURCES/sioyek_use_usr_share.patch # git diff --patch-with-raw main pdf_viewer/prefs.config > ~/rpmbuild/SOURCES/sioyek_default_new_instance.patch # /usr/bin/patch --no-backup-if-mismatch -p0 --fuzz=0 pdf_viewer/prefs.config < $RPM_SOURCE_DIR/sioyek_default_new_instance.patch sed -i -E 's/should_launch_new_instance[ \t]+0/should_launch_new_instance 1/' pdf_viewer/prefs.config # I havn't found lcms2mt.h for Fedora 34. Disable mupdf-thread # Fedora's mupdf is dynamically linked to several libraries. I need to add linking parameters manually sed -i 's/-lmupdf-third -lmupdf-threads -lharfbuzz/-lmupdf-third -lharfbuzz -lfreetype -lgumbo -ljbig2dec -lopenjp2 -ljpeg -ltesseract -llept/' pdf_viewer_build_config.pro %build qmake-qt5 pdf_viewer_build_config.pro DEFINES+="LINUX_STANDARD_PATHS" %make_build %install # Binary mkdir -p %{buildroot}%{_bindir} install -m 755 sioyek %{buildroot}%{_bindir} # Shaders mkdir -p %{buildroot}%{_datadir}/sioyek/shaders install pdf_viewer/shaders/* %{buildroot}%{_datadir}/sioyek/shaders # WARNING: ./usr/share/sioyek/shaders/highlight.fragment is executable but has no shebang, removing executable bit # FIXME fix permission # Config mkdir -p %{buildroot}%{_sysconfdir}/sioyek install pdf_viewer/prefs.config %{buildroot}%{_sysconfdir}/sioyek install pdf_viewer/keys.config %{buildroot}%{_sysconfdir}/sioyek # rpmbuild -bs ~/rpmbuild/SPECS/sioyek.spec && mock --enable-plugin=tmpfs --enable-plugin=yum_cache ~/rpmbuild/SRPMS/sioyek-1.0.0-1.fc35.src.rpm %clean rm -rf %{buildroot} %files %license LICENSE %doc README.md %{_bindir}/sioyek %{_datadir}/sioyek/shaders/* %{_sysconfdir}/sioyek/prefs.config %{_sysconfdir}/sioyek/keys.config %changelog * Tue Nov 30 2021 Zhenbo Li - 1.0.0-1 - Update to v1.0.0 release, git version %{git_commit_full} * Tue Oct 05 2021 Zhenbo Li - 0.31.6-7 - Use git version 6f2932a51415f0196e08ca7766451ed68c31a421 - Change standard_config_path to /etc/sioyek * Thu Sep 09 2021 Zhenbo Li - 0.31.6-6 - Use git version 6cb988ec8aece530b17e3201cee78e21fba44045 - Use new instances at same time by default * Sat Sep 04 2021 Zhenbo Li - 0.31.6-5 - Use git version eab2988dbd862257e13e4b6601b38532d1e43f3d - Disable checkboard * Sat Sep 04 2021 Zhenbo Li - 0.31.6-4 - Clean up spec file * Sat Sep 04 2021 Zhenbo Li - 0.31.6-3 - Use git version ecd653a61704f3c8c0c31a69ca08a33c3e6943aa - Move configure files and shader files to /usr/share/sioyek * Thu Sep 02 2021 Zhenbo Li - 0.31.6-2 - Fix issue - Switching to AGPLv3 because it links to mupdf - Put shaders to /use/bin (Hacky) * Wed Sep 01 2021 Zhenbo Li - 0.31.6-1 - Initial version of the package