You are not logged in.

#1 2021-02-21 22:36:06

Pyntux
Member
From: Serbia
Registered: 2008-12-21
Posts: 320

Can somebody please help me to make AUR package of my app? :)

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 smile


I do not speak English, but I understand...

Offline

#2 2021-02-21 23:35:54

Scimmia
Bug Wrangler
Registered: 2012-09-01
Posts: 8,325

Re: Can somebody please help me to make AUR package of my app? :)

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)

Offline

#3 2021-02-22 10:09:22

Pyntux
Member
From: Serbia
Registered: 2008-12-21
Posts: 320

Re: Can somebody please help me to make AUR package of my app? :)

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

#4 2021-02-22 10:28:40

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,206
Website

Re: Can somebody please help me to make AUR package of my app? :)

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 packagesZsh and other configs

Offline

#5 2021-02-22 13:38:23

metak
Member
Registered: 2009-09-27
Posts: 194

Re: Can somebody please help me to make AUR package of my app? :)

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

#6 2021-02-22 15:06:57

Pyntux
Member
From: Serbia
Registered: 2008-12-21
Posts: 320

Re: Can somebody please help me to make AUR package of my app? :)

@metak

Great! Thank you very much! big_smile

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

#7 2021-02-22 15:19:19

d_fajardo
Member
Registered: 2017-07-28
Posts: 1,052

Re: Can somebody please help me to make AUR package of my app? :)

Can you explain me about pkgver a bit? Where to get that info?

https://wiki.archlinux.org/index.php/PKGBUILD

Offline

#8 2021-02-22 15:36:41

Pyntux
Member
From: Serbia
Registered: 2008-12-21
Posts: 320

Re: Can somebody please help me to make AUR package of my app? :)

OK, thanks


I do not speak English, but I understand...

Offline

#9 2021-02-22 15:39:53

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 25,096
Website

Re: Can somebody please help me to make AUR package of my app? :)

Pyntux wrote:

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

#10 2021-02-22 15:42:25

metak
Member
Registered: 2009-09-27
Posts: 194

Re: Can somebody please help me to make AUR package of my app? :)

@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

#11 2021-02-22 15:55:03

Pyntux
Member
From: Serbia
Registered: 2008-12-21
Posts: 320

Re: Can somebody please help me to make AUR package of my app? :)

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.... smile

##### 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

#12 2021-02-22 17:51:50

d_fajardo
Member
Registered: 2017-07-28
Posts: 1,052

Re: Can somebody please help me to make AUR package of my app? :)

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

#13 2021-02-22 19:00:21

Pyntux
Member
From: Serbia
Registered: 2008-12-21
Posts: 320

Re: Can somebody please help me to make AUR package of my app? :)

@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

Board footer

Powered by FluxBB