Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Trying to write first ebuild, only documentation is compiled
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
dartleader
Tux's lil' helper
Tux's lil' helper


Joined: 21 Apr 2019
Posts: 124

PostPosted: Thu Jun 27, 2024 2:51 am    Post subject: Trying to write first ebuild, only documentation is compiled Reply with quote

Hello everyone,

I'm trying my hand at writing my first ebuild; the program I would like to write an ebuild for is called sioyek.

I've been following the https://wiki.gentoo.org/wiki/Basic_guide_to_write_Gentoo_Ebuilds page, and I can get it to install, but nothing is actually compiling. It looks like it's only installing documentation. The only file installed following ebuild install is the "README.md.bz2" file.

How do I proceed from here? I think I need to get its dependencies properly figured out. From the website, it looks like harfbuzz and qmake are required: https://sioyek-documentation.readthedocs.io/en/latest/installation.html#linux

Here is my ebuild:

Code:

EAPI=8

DESCRIPTION="PDF viewer with a focus on technical books and research papers."

HOMEPAGE="https://sioyek.info"

# Point to any required sources; these will be automatically downloaded by
# Portage.
#EGIT_REPO_URI="https://github.com/ahrm/sioyek/sioyek.git"
SRC_URI="https://github.com/ahrm/sioyek/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"


LICENSE="GPL-3"

SLOT="0"


KEYWORDS="~amd64"

IUSE=""

RDEPEND="app-text/mupdf
"

DEPEND="${RDEPEND}"

BDEPEND="media-libs/harfbuzz
dev-qt/qtbase"



The contents of build_linux.sh, which is contained in sioyek's upstream git, is as follows:

Code:
#!/usr/bin/env bash
set -e

# Compile mupdf
cd mupdf
make USE_SYSTEM_HARFBUZZ=yes
cd ..

# Compile sioyek
if [ -f "/usr/bin/qmake-qt5" ];
then
   QMAKE="/usr/bin/qmake-qt5"
elif [ -f "/usr/bin/qmake" ];
then
   QMAKE="/usr/bin/qmake"
else
   QMAKE="qmake"
fi

$QMAKE "CONFIG+=linux_app_image" pdf_viewer_build_config.pro
make

# Copy files in build/ subdirectory
rm -rf build 2> /dev/null
mkdir build
mv sioyek build/sioyek
cp pdf_viewer/prefs.config build/prefs.config
cp pdf_viewer/prefs_user.config build/prefs_user.config
cp pdf_viewer/keys.config build/keys.config
cp pdf_viewer/keys_user.config build/keys_user.config
cp -r pdf_viewer/shaders build/shaders
cp tutorial.pdf build/tutorial.pdf


Last edited by dartleader on Thu Jun 27, 2024 3:15 am; edited 1 time in total
Back to top
View user's profile Send private message
rab0171610
Guru
Guru


Joined: 24 Dec 2022
Posts: 354

PostPosted: Thu Jun 27, 2024 3:01 am    Post subject: Reply with quote

Someone already wrote one:
https://gentoo.mahdi.cz/app-text:sioyek.html
Whether it works or is updated I don't know. The content of that ebuild for reference is as follows:
Code:
# Copyright 2023 Kirixetamine <revelation@krxt.dev
# Distributed under the terms of the ISC License

EAPI=8

inherit qmake-utils

DESCRIPTION="Sioyek is a PDF viewer with a focus on textbooks and research papers"
HOMEPAGE="https://sioyek.info/"

REPO_URI="https://github.com/ahrm/sioyek"

if [[ ${PV} == 9999 ]]; then
   inherit git-r3
   EGIT_REPO_URI="${REPO_URI}"
else
   SRC_URI="${REPO_URI}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
   S="${WORKDIR}/${P}"
fi

LICENSE="GPL-3"
SLOT="0"

BDEPEND="
   dev-qt/qtbase
   dev-qt/qt3d
   media-libs/harfbuzz
"

src_compile() {
   eqmake5 "CONFIG+=linux_app_image" pdf_viewer_build_config.pro
   emake
}
Back to top
View user's profile Send private message
dartleader
Tux's lil' helper
Tux's lil' helper


Joined: 21 Apr 2019
Posts: 124

PostPosted: Thu Jun 27, 2024 3:16 am    Post subject: Reply with quote

Thank you! I will check that out!
Back to top
View user's profile Send private message
dartleader
Tux's lil' helper
Tux's lil' helper


Joined: 21 Apr 2019
Posts: 124

PostPosted: Thu Jun 27, 2024 3:28 am    Post subject: Reply with quote

Hmmm, I tried copying that ebuild and qmake fails with the following:

Code:
Project ERROR: Unknown module(s) in QT: 3dinput


I'm assuming I'm missing a USE flag which supports this or something? This is my first foray into ebuilds, so I'm not entirely certain what I'm doing.
Back to top
View user's profile Send private message
rab0171610
Guru
Guru


Joined: 24 Dec 2022
Posts: 354

PostPosted: Thu Jun 27, 2024 4:48 am    Post subject: Reply with quote

From this bug report:
https://github.com/ahrm/sioyek/discussions/816
I believe the issue is the qt3d version mismatch. dev-qt/qt3d is slotted, dev-qt/qt3d:5 and dev-qt/qt3d:6. That ebuild installs version 6 but actually the program requires 5. So I removed the version that was installed by the ebuild:
Code:
emerge --depclean dev-qt/qt3d:6

I changed the ebuild to read:
Code:
dev-qt/qt3d:5

I emerged sioyek again.
That showed progress but there is now a problem when building sioyek. Try for yourself and post back here with your errors.

*** You might have better luck with the 9999 version in the guru overlay. It depends on dev-qt/qtbase:6 and dev-qt/qt3d:6.***
Back to top
View user's profile Send private message
logrusx
Veteran
Veteran


Joined: 22 Feb 2018
Posts: 1833

PostPosted: Thu Jun 27, 2024 9:01 am    Post subject: Reply with quote

rab0171610 wrote:


*** You might have better luck with the 9999 version in the guru overlay. It depends on dev-qt/qtbase:6 and dev-qt/qt3d:6.***


Code:
>>> app-text/sioyek-9999 merged.

>>> Recording app-text/sioyek in "world" favorites file...

>>> Completed (3 of 3) app-text/sioyek-9999::guru


However a broken popup appears to ask if I wan to upgrade from 2.0.0 to iv/><div... you get what's going on and if you cancel, on Wayland no window appears and you should kill it manually and on XWayland a black screen appears. This thing is not keyworded for a reason and the older version is just old.

p.s.
rab0171610 wrote:
So I removed the version that was installed by the ebuild:
Code:
emerge --depclean dev-qt/qt3d:6


You didn't need to do that. qt3d is slotted, both versions can coexist.

p.s.2 this package is a mess. I wouldn't attempt to package it and it definitely is not for a newbie, at least you should be able to compile it manually before attempting to write an ebuild.

Best Regards,
Georgi


Last edited by logrusx on Thu Jun 27, 2024 9:34 am; edited 1 time in total
Back to top
View user's profile Send private message
rab0171610
Guru
Guru


Joined: 24 Dec 2022
Posts: 354

PostPosted: Thu Jun 27, 2024 9:34 am    Post subject: Reply with quote

logrusx wrote:
p.s.
rab0171610 wrote:
So I removed the version that was installed by the ebuild:
Code:
emerge --depclean dev-qt/qt3d:6


You didn't need to do that. qt3d is slotted, both versions can coexist.

Best Regards,
Georgi

Thank you for always trying to be so helpful in that special way.
I removed it because I don't need it installed. The only reason it was ever installed is because it was a dependency of this ebuild. So yes, I did with clear intention do exactly that.

Best Regards.
Back to top
View user's profile Send private message
rab0171610
Guru
Guru


Joined: 24 Dec 2022
Posts: 354

PostPosted: Thu Jun 27, 2024 10:21 am    Post subject: Reply with quote

dartleader,
I think it is important for users to experiment with ebuilds. I know that there are some users that feel all software should be managed by portage.
In this case though, the software is provided as an appimage.
https://github.com/ahrm/sioyek/releases/download/v2.0.0/sioyek-release-linux.zip
You could just download and extract it to somewhere in your home directory. The appimage works when run from the command line:
Code:
./Sioyek-x86_64.AppImage

I was able to browse to the nearest pdf file on my system and open it.

You could also create a .desktop file for it as well using the existing one as a template:
https://data.gpo.zugaina.org/guru/app-text/sioyek/files/sioyek.desktop

*** I am happy you brought this app to my attention. I have been looking for a simple fast pdf reader. This is ideal in that it supports both epub and pdf formats. It also renders very quickly.
Back to top
View user's profile Send private message
dartleader
Tux's lil' helper
Tux's lil' helper


Joined: 21 Apr 2019
Posts: 124

PostPosted: Thu Jun 27, 2024 3:12 pm    Post subject: Reply with quote

logrusx wrote:
p.s.2 this package is a mess. I wouldn't attempt to package it and it definitely is not for a newbie, at least you should be able to compile it manually before attempting to write an ebuild.


Humour me: how can you tell it's a mess already?

I've been trying to compile it using its provided build_linux.sh file, but this fails without qmake.

Thanks for your help everyone!
Back to top
View user's profile Send private message
logrusx
Veteran
Veteran


Joined: 22 Feb 2018
Posts: 1833

PostPosted: Thu Jun 27, 2024 3:31 pm    Post subject: Reply with quote

dartleader wrote:
logrusx wrote:
p.s.2 this package is a mess. I wouldn't attempt to package it and it definitely is not for a newbie, at least you should be able to compile it manually before attempting to write an ebuild.


Humour me: how can you tell it's a mess already?


By looking at it.

dartleader wrote:
I've been trying to compile it using its provided build_linux.sh file, but this fails without qmake.


It doesn't compile with qmake either.

No self respecting maintainer would take on this piece of crap for the value it provides. Try using it with flatpack or something. And perhaps don't waste your time trying to read something with it but just read that something.

Best Regards,
Georgi
Back to top
View user's profile Send private message
dartleader
Tux's lil' helper
Tux's lil' helper


Joined: 21 Apr 2019
Posts: 124

PostPosted: Thu Jun 27, 2024 3:50 pm    Post subject: Reply with quote

Hahaha thanks Giorgi; I'll just run it as an AppImage as rab suggested.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum