Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Résolu] Besoin d'aide pour créer un ebuild (mkv-extractor)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index French
View previous topic :: View next topic  
Author Message
sdauth
Guru
Guru


Joined: 19 Sep 2018
Posts: 569
Location: Ásgarðr

PostPosted: Fri Aug 16, 2019 7:52 pm    Post subject: [Résolu] Besoin d'aide pour créer un ebuild (mkv-extractor) Reply with quote

EDIT 02/05/2023
ebuild pour dernière version ici -> https://forums.gentoo.org/viewtopic-p-8362754.html#8362754

Bonsoir,
J'essaie de créer un ebuild pour mkv-extractor-qt5 dans mon repo local.

Dépendances :

Code:
Requires Python 3.4 or higher.
Build dependencies: pyqt5-dev-tools qttools5-dev-tools
Runtime dependency: mkvtoolnix (http://www.bunkus.org/videotools/mkvtoolnix/)


Voici l'ebuild :

Code:
# Copyright 1999-2019 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=6

DESCRIPTION="Graphical MKV demultiplexer"
HOMEPAGE="http://forum.ubuntu-fr.org/viewtopic.php?id=1508741"
SRC_URI="https://github.com/darealshinji/mkv-extractor-qt5/releases/download/v${PV}/${PN}-${PV}.tar.xz"

LICENSE="GPL-3"
SLOT="0"
IUSE=""
KEYWORDS="~amd64 ~x86"

RDEPEND="
   >=media-video/mkvtoolnix-35.0.0
"
DEPEND="${RDEPEND}
        >=dev-lang/python-3.6.5
        >=dev-python/PyQt5-5.12.2
"


L'archive est bien récupérée, l'installation n'affiche pas d'erreur mais au final, rien n'est installé. :lol: J'ai bien tenté de lire la doc sur les ebuild mais c'est un sacré morceau et je suis un peu perdu. Qu'est-ce qu'il me manque pour qu'il s'installe correctement ?
Pour info, le logiciel fonctionne quand j'extrais l'archive et lance :

Code:
python mkv-extractor-qt5


Merci


Last edited by sdauth on Tue May 02, 2023 10:44 am; edited 5 times in total
Back to top
View user's profile Send private message
netfab
Veteran
Veteran


Joined: 03 Mar 2005
Posts: 1897
Location: 127.0.0.1

PostPosted: Sat Aug 17, 2019 11:52 am    Post subject: Reply with quote

Salut,

Comme çà, à froid, je dirais que, étant donné que tu n'utilises aucune eclass, et si le paquet n'utilise aucun système de configuration/compilation/installation habituel, tu devrais définir une fonction src_install ⁽¹⁾ custom.

1. https://devmanual.gentoo.org/ebuild-writing/functions/src_install/index.html
Back to top
View user's profile Send private message
netfab
Veteran
Veteran


Joined: 03 Mar 2005
Posts: 1897
Location: 127.0.0.1

PostPosted: Sat Aug 17, 2019 12:07 pm    Post subject: Reply with quote

Sinon, tu peux jeter un oeil ici pour avoir un exemple d'un ebuild que j'ai écrit :
- tu dois définir la variable PYTHON_COMPAT avec les versions compatibles de python, puis
- hériter de l'eclass python-r1
- utiliser exeinto avec doexe dans src_install
Back to top
View user's profile Send private message
sdauth
Guru
Guru


Joined: 19 Sep 2018
Posts: 569
Location: Ásgarðr

PostPosted: Sat Aug 17, 2019 2:17 pm    Post subject: Reply with quote

Bonjour netfab, je te remercie pour ton aide. Cela m'a permis de comprendre un peu mieux.

Du coup, voici le nouvel ebuild :
Code:
# Copyright 1999-2019 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=6

PYTHON_COMPAT=( python{3_5,3_6} )

inherit desktop python-r1 xdg-utils

DESCRIPTION="Graphical MKV demultiplexer"
HOMEPAGE="http://forum.ubuntu-fr.org/viewtopic.php?id=1508741"
SRC_URI="https://github.com/darealshinji/${PN}/releases/download/v${PV}/${PN}-${PV}.tar.xz"

LICENSE="GPL-3"
SLOT="0"
IUSE=""
KEYWORDS="~amd64 ~x86"

RDEPEND="
        media-video/mkvtoolnix
"
DEPEND="${RDEPEND}
        ${PYTHON_DEPS}
        dev-python/PyQt5
"

src_prepare() {
        default
}

src_install() {
        insinto "/usr/share/${PN}"
        doins *.py *.qm
        doins -r man QFileDialogCustom WhatsUp
        doicon mkv-extractor-qt5.svg

        domenu mkv-extractor-qt5.desktop

        doman man/mkv-extractor-qt5.1
        doman man/mkv-extractor-qt5.fr.1

        exeinto /usr/bin/
        doexe MKVExtractorQt5.py
        #newexe MKVExtractorQt5.py mkv-extractor-qt5
        dosym "/usr/share/${PN}"/MKVExtractorQt5.py "/usr/bin/${PN}"

}

pkg_postinst() {
        xdg_desktop_database_update
}

pkg_postrm() {
        xdg_desktop_database_update
}


Cette fois-ci, il s'installe bien dans /usr/share/mkv-extractor-qt5, j'ai ajouté la classe xdg-utils pour mettre à jour le fichier *.desktop.

Seul problème, il ne se lance pas, l'erreur est la suivante :

from QFileDialogCustom.QFileDialogCustom import QFileDialogCustom, ModuleNotFoundError: No module named 'QFileDialogCustom'

Le script est pourtant bien dans /usr/share/mkv-extractor-qt5/QFileDialogCustom/QFileDialogCustom.py
L'exécutable est bien dans /usr/bin/
Je l'ai renommé avec la fonction "newexe" en "mkv-extractor-qt5". Mais même avec "doexe MKVExtractorQt5.py" tout seul, l'erreur est la même.

Du coup, je ne pige pas là. :?

EDIT : "L'éxécutable" /usr/bin/mkv-extractor-qt5 ne devrait-il pas être plutôt un symlink vers /usr/share/mkv-extractor-qt5/MKVExtractorQt5.py afin de pouvoir accéder aux ressources du dossier "QFileDialogCustom" ?

EDIT2 : En effet, c'était bien cela.
Code:
exeinto /usr/bin/
doexe MKVExtractorQt5.py
dosym "/usr/share/${PN}"/MKVExtractorQt5.py "/usr/bin/${PN}"


Seul léger dernier problème, je suis obligé de rendre /usr/share/mkv-extractor-qt5/MKVExtractorQt5.py éxécutable manuellement avec chmod +x. Sinon cela fonctionne. Une idée pour le faire directement depuis l'ebuild ?


Last edited by sdauth on Tue May 02, 2023 10:42 am; edited 1 time in total
Back to top
View user's profile Send private message
sdauth
Guru
Guru


Joined: 19 Sep 2018
Posts: 569
Location: Ásgarðr

PostPosted: Sat Aug 17, 2019 11:20 pm    Post subject: Reply with quote

Cette fois-ci c'est la bonne 8)

EDIT 16/07/2020
ebuild mis à jour de 5.5.5 vers 5.5.8, le patch n'est plus nécessaire. L'auteur a réglé le problème avec qt.

EDIT 07/05/2021
ebuild mis à jour pour python3_9

EDIT 15/06/2022
ebuild mis à jour pour python3_10 (fonctionne) et python3_11 (pas encore testé)
+ quelques modifications maintenant que le paquet utilise la source officielle sur github

EDIT 06/112022
ebuild mis à jour de 5.5.10 vers 22.08.30

EDIT 02/05/2023
ebuild mis à jour de 22.08.30 vers 23.04.16

mkv-extractor-qt5-23.04.16
Code:
# Copyright 1999-2023 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=8

PYTHON_COMPAT=( python3_{10..11} )

inherit desktop optfeature python-single-r1 xdg-utils

DESCRIPTION="Graphical MKV demultiplexer"
HOMEPAGE="https://github.com/Hizoka76/MKV-Extractor-Qt5"
MY_PN="${PN}_v${PV}a"
SRC_URI="https://github.com/Hizoka76/MKV-Extractor-Qt5/releases/download/v${PV}/${MY_PN}.tar.gz"

LICENSE="GPL-3"
SLOT="0"
IUSE=""
KEYWORDS="~amd64 ~x86"

S="${WORKDIR}"

RDEPEND="
  dev-python/PyQt5
  media-video/mkvtoolnix"

DEPEND="${RDEPEND}"

src_prepare() {
  default
}

src_install() {
  insinto "/usr/share/${PN}"
  doins *.py
  doins -r Languages QFileDialogCustom WhatsUp

  doicon -s scalable icons/mkv-extractor-qt5.svg
  domenu mkv-extractor-qt5.desktop
  doman man/mkv-extractor-qt5.1
  doman man/mkv-extractor-qt5.fr.1

  exeinto "/usr/share/${PN}"
  doexe "MKVExtractorQt5.py"
  dosym "/usr/share/${PN}/MKVExtractorQt5.py" "/usr/bin/${PN}"
}

pkg_postinst() {
  xdg_desktop_database_update
  xdg_icon_cache_update
  elog ""
  optfeature "For converting sup to sub files" media-video/bdsup2sub
  optfeature "For optimization of matroska files" media-video/mkclean
  optfeature "To check the matroska files" media-video/mkvalidator
}

pkg_postrm() {
  xdg_desktop_database_update
}
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index French 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