You are not logged in.
I'm just asking for help. I tried but it didn't work.
I'm new to the python world and I don't know how to pack an AUR app. I would ask you to point me to what I should pay attention to, considering that I don't understand git the best also...
So, my app is here:
https://github.com/Pyntux/TimerDown
a small app, but it's mine
I do not speak English, but I understand...
Offline
What did you try that didn't work? This should be trivial, so you probably just missed something small.
Last edited by Scimmia (2021-02-21 23:36:08)
Online
I tried to make PKGBUILd...
I do not know do I need to first package this following python instructions, then make PKGBUILD or just make PKGBUILD with git clone option? Can you point me to an example what to do?
I do not speak English, but I understand...
Offline
Post your PKGBUILD. You can browse existing python PKGBUILDs in the AUR or the official repos if you need more examples than /usr/share/pacman/PKGBUILD.proto
Last edited by graysky (2021-02-22 10:46:10)
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
pkgname=timerdown-git
pkgver=r75.g11ba12c
pkgrel=1
pkgdesc="A simple python & pyQT5 app to turn off your PC in 'X' minutes"
url="https://github.com/Pyntux/TimerDown"
arch=('any')
license=('GPL3')
depends=('python-pyqt5')
makedepends=('git')
provides=("${pkgname%-*}")
conflicts=("${pkgname%-*}")
source=("${pkgname%-*}::git+${url}.git")
sha256sums=('SKIP')
pkgver() {
cd "${pkgname%-*}"
printf "r%s.g%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
package() {
cd "${pkgname%-*}"
install -d "$pkgdir"/usr/{bin,share/timerdown}
cp -r {icons,TimerDown.py} "$pkgdir/usr/share/${pkgname%-*}"
echo "#!/bin/sh
python /usr/share/timerdown/TimerDown.py" >> "$pkgdir/usr/bin/${pkgname%-*}"
chmod +x "$pkgdir/usr/bin/${pkgname%-*}"
}
Offline
@metak
Great! Thank you very much!
Can you explain me about pkgver a bit? Where to get that info?
Everything else is cristal clear, except runing app from terminal "timerdown", which call bash script, starts app but without icons from icons dir in /usr/share/timerdown...
OK, I could make resources file for that...
Last edited by Pyntux (2021-02-22 15:09:29)
I do not speak English, but I understand...
Offline
Can you explain me about pkgver a bit? Where to get that info?
Offline
OK, thanks
I do not speak English, but I understand...
Offline
starts app but without icons from icons dir in /usr/share/timerdown...
That's an error in your code, not in the packaging. As written, your code assumes that the current working directory is next to the icon directory - that is a very bad assumption. Use absolute paths (constructed from the appropriate python variable for getting resource directories).
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
@Pyntux
As others have linked the wiki links for creating pkgbuild files you should check them out, because it's all in there.
Regarding the script, it's to make it integrate better so it's easier to launch. Missing icons are because the you're supposed to be in the same directory when launching the app.?
echo "#!/bin/sh
cd /usr/share/timerdown && python TimerDown.py" >> "$pkgdir/usr/bin/${pkgname%-*}"
Offline
Yes, app is not made to launch that way, noob mistake, I am very, very new in programing.... I gonna change code...
With resource file everything works great... So... git push....
##### EDIT:
I added timerdown.desktop, timerdown.ico for desktop file and resources file, and change code to use that resources file.... I will eventualy delete icons dir from git etc...
Here is PKGBUILD now:
pkgname=timerdown-git
pkgver=r82.gc2d001f
pkgrel=1
pkgdesc="A simple python & pyQT5 app to turn off your PC in 'X' minutes"
url="https://github.com/Pyntux/TimerDown"
arch=('any')
license=('GPL3')
depends=('python-pyqt5')
makedepends=('git')
provides=("${pkgname%-*}")
conflicts=("${pkgname%-*}")
source=("${pkgname%-*}::git+${url}.git")
sha256sums=('SKIP')
pkgver() {
cd "${pkgname%-*}"
printf "r%s.g%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
package() {
cd "${pkgname%-*}"
install -d "$pkgdir"/usr/{bin,share/timerdown,share/applications}
cp -r {resources.py,timerdown.ico,TimerDown.py} "$pkgdir/usr/share/${pkgname%-*}"
cp -r {TimerDown.desktop,} "$pkgdir/usr/share/applications/${pkgname%-*}.desktop"
echo "#!/bin/sh
python /usr/share/timerdown/TimerDown.py" >> "$pkgdir/usr/bin/${pkgname%-*}"
chmod +x "$pkgdir/usr/bin/${pkgname%-*}"
}
Last edited by Pyntux (2021-02-22 16:27:44)
I do not speak English, but I understand...
Offline
Congratulations! I ran makepkg and the package installed correctly. I would suggest simplifying your pkgver naming scheme that is easy to follow.
Some notes on the app:
You can't resize the window.
Default window too small (particularly on a 4K).
Would be nice to have an Enabled/Disabled button.
EDIT: And the reset button hangs.
Last edited by d_fajardo (2021-02-22 17:54:00)
Offline
@d_fajardo
First, thank you!
The application code is very rough, there is room for repairs ...I will pay attention to all your suggestions and as much as my modest knowledge allows, I will fix what I can ...
https://aur.archlinux.org/packages/timerdown-git/
Last edited by Pyntux (2021-02-22 21:38:53)
I do not speak English, but I understand...
Offline
pyrcc is removed in Qt6, I would not depend on it. For python modules, importlib.resources is the preferred solution on the python level so there is not much use for RCC and the PyQt developer dropped support.
However, I'm rather curious why you don't install TimerDown.py to /usr/bin/ and have it look in hardcoded /usr/share/timerdown, or possibly use a Makefile that sets this up via make PREFIX=...
Failing that, you should still NOT use cd and check in the current directory... you should have TimerDown.py look for the icon files in
os.path.join(os.path.dirname(__file__), 'icons')
Last edited by eschwartz (2021-03-02 00:46:29)
Managing AUR repos The Right Way -- aurpublish (now a standalone tool)
Offline
@eschwartz
I will setup script to look for icons in to / path or (and) look at "importlib.recources"... For everything else, my knowledge is small
I'm not a programmer, just a longtime Gnu/Linux user who has a desire to learn a little python.... My job is far from any use of a computer and it is a real miracle that I made this...
I appreciate that you drew my attention to the mistakes and gave me instructions, I will try to improve my knowledge, any help is welcome ....
os.path.join(os.path.dirname(__file__), 'icons')
I will try this...
Thank you!
Edit:
you were right about TimerDown.py in /usr/bin, that is way better.... Also i will change script to look for icons in /usr/share/timerdown/icons/, (without resources file) that can resolve some my problems... Like this:
pkgname=timerdown-git
pkgver=r8.g733d99e
pkgrel=1
pkgdesc="A simple python & pyQT5 app to turn off your PC in 'X' minutes"
url="https://github.com/Pyntux/TimerDown"
arch=('any')
license=('GPL3')
depends=('python-pyqt5')
makedepends=('git')
provides=("${pkgname%-*}")
conflicts=("${pkgname%-*}")
source=("${pkgname%-*}::git+${url}.git")
sha256sums=('SKIP')
pkgver() {
cd "${pkgname%-*}"
printf "r%s.g%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
package() {
cd "${pkgname%-*}"
install -d "$pkgdir"/usr/{bin,share/timerdown,share/applications}
cp -r {icons,timerdown.ico} "$pkgdir/usr/share/${pkgname%-*}"
cp -r {TimerDown.py,} "$pkgdir/usr/bin/${pkgname%-*}"
cp -r {TimerDown.desktop,} "$pkgdir/usr/share/applications/${pkgname%-*}.desktop"
chmod +x "$pkgdir/usr/bin/${pkgname%-*}"
}
Last edited by Pyntux (2021-03-02 22:48:28)
I do not speak English, but I understand...
Offline
Nice!
You may also want to add a small Makefile, so it's clear to people how to use the software on any distro:
install:
install -d '$(DESTDIR)'/usr/bin/
install -m755 TimerDown.py '$(DESTDIR)'/usr/bin/timerdown
install -d '$(DESTDIR)'/usr/share/timerdown/
cp -r icons/ timerdown.ico '$(DESTDIR)'/usr/share/timerdown/
install -d '$(DESTDIR)'/usr/share/applications/
cp TimerDown.desktop '$(DESTDIR)'/usr/share/applications/timerdown.desktop
Then change the PKGBUILD to install like this:
package() {
cd "${pkgname%-*}"
make install DESTDIR="$pkgdir"
}
Last edited by eschwartz (2021-03-03 00:50:02)
Managing AUR repos The Right Way -- aurpublish (now a standalone tool)
Offline
Great!
I really appreciate the help, thank you very much!!!
I will change today PKGBUILD for both packages in AUR after my daily job
Edit:
Summary:
I added "Makefile" to git repo based on your instructions... Now, PKGBUILD (for timerdown "no git version") looks like this:
# Maintainer: Pyntux <pyntux@gmail.com>
pkgname=timerdown
pkgver=0.2.1
pkgrel=1
pkgdesc="A simple python & pyQT5 app to turn off your Linux PC in "X" minutes or "X" hours, or at specified time."
url="https://github.com/Pyntux/TimerDown"
arch=('any')
license=('GPL3')
depends=('python-pyqt5')
makedepends=('git')
provides=("${pkgname%-*}")
conflicts=("${pkgname%-*}")
source=("$pkgname::git+$url.git#tag=v$pkgver")
sha256sums=('SKIP')
package() {
cd "${pkgname%-*}"
make install DESTDIR="$pkgdir"
}
Same is for git version + git version control code etc...
.... simple and clean...
Also, do I need to copy GPL3 licence somewhere or not? And, do I need to add something more to PKGBUILD? And, is there any way to get shorter pkgver number for git version?
Thank you!
Last edited by Pyntux (2021-03-03 09:45:47)
I do not speak English, but I understand...
Offline