You are not logged in.

#1 2021-06-07 04:40:02

feinedsquirrel
Member
Registered: 2020-12-11
Posts: 33

Request to verify my first PKGBUILD before submission to AUR

I've just finished creating my first PKGBUILD, along with a few supporting files (a patch, .install file, and systemd unit). I am wondering if anyone has any input if I've done something wrong, or if I've made a bad selection/choice with something.

I tried to run make "makerepropkg" on the pkg file, but it fails since there is a dependency from the aur? Is there a way to point to a built version on my local machine, like the -I option for "makechrootpkg".

Anyway, any input is appreciated. The current state is on github:

https://github.com/feinedsquirrel/aur_photoview

Thanks!

edit: Should I have placed this is in "Creating & Modifying Packages"?

edit 2: I'm pretty sure it should be in "Creating & Modifying Packages". Is there a way to move this, or do I just delete this and create this over there?

Last edited by feinedsquirrel (2021-06-07 04:47:20)

Offline

#2 2021-06-07 12:48:03

loqs
Member
Registered: 2014-03-06
Posts: 17,195

Re: Request to verify my first PKGBUILD before submission to AUR

source=(
  "git+${url}.git#commit=${_commit}"
  "${pkgname}.service"
  "${pkgname}.env.patch"
)
sha512sums=(
  'SKIP'
  'SKIP'
  'SKIP'
)

Please provide checksums for the none git entries.

  go build -v -o photoview .

Please see https://wiki.archlinux.org/title/Go_package_guidelines]Go_package_guidelines

Need to install the following packages:
  husky
Ok to proceed? (y) 

PKGBUILDs should not prompt.  Is there a way to stop this?

Offline

#3 2021-06-07 12:59:08

a821
Member
Registered: 2012-10-31
Posts: 381

Re: Request to verify my first PKGBUILD before submission to AUR

Upstream provides git tags; the source array could be replaced with

source=(
  "git+${url}.git#tag=v${pkgver}"
...

Offline

#4 2021-06-07 16:37:34

feinedsquirrel
Member
Registered: 2020-12-11
Posts: 33

Re: Request to verify my first PKGBUILD before submission to AUR

a821, I had a pull request accepted upstream that enabled building on distributions that don't bundle cblas with blas. Upstream has not yet provided a version number including the accepted changes. So, until a newer version tag is created, I need to use the commit. I was planning on changing it back to a tag as soon as upstream provides a newer tag. Is that acceptable?

loqs, I traced the prompt back to the call to "npm install" which is used for building the ui. I replaced it with "npm install --yes" and it no longer prompts. I apologize I missed this originally, I knew I was supposed to bypass all prompts, but with so many fixes that I found from reading the wiki pages for "Creating packages" and "Arch package guidelines", it slipped through the cracks. Also, I had 512sums for the included files and was iterating so often on them it was getting annoying to update those sums every time I wanted to test the pkgbuild in the chroot, that I removed them for the time being, during this early development phase. I've added them back now.

One question I had is about the "WorkingDirectory=". Ideally, should it be "/var/lib/photoview" as opposed to the current setting of "/usr/lib/photoview"? Currently the upstream code requires the "data/" (static models the program needs, that I placed in "/usr/lib/photoview") be in the current working directory. I can develop a pull request to configure the location of the data/ directory, but that will take some time. Reason I ask is because if the program does end up generating files in the current working directory (besides the cache which I've already configured), I would think they should 'just end up' in the "/var/lib/phtooview". Thoughts?

Also, I've committed the change for the prompt removal and shasums to the repo listed above.

Offline

#5 2021-06-07 16:41:53

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,463

Re: Request to verify my first PKGBUILD before submission to AUR

a821 wrote:

Upstream provides git tags; the source array could be replaced with

source=(
  "git+${url}.git#tag=v${pkgver}"
...

You'd be surprised how often upstreams change tags. You need to use the hash of the commit or the hash of the tag so you know when they do.

Offline

#6 2021-06-07 16:54:12

feinedsquirrel
Member
Registered: 2020-12-11
Posts: 33

Re: Request to verify my first PKGBUILD before submission to AUR

Scimmia, do you mean that once a new version is released I should still use a "#commit=<commit hash of current version release>"? I saw "#tag=v${pkgver}" in several pkgbuilds I was using as references. Is there a hard rule that applies, or just best practice?

Offline

#7 2021-06-07 16:58:02

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,463

Re: Request to verify my first PKGBUILD before submission to AUR

It's just best practice, there are still PKGBUILDs in the repos using that, but it's slowly being changed. As I said, it's amazing how often upstreams change their tags.

For the most part, though, just download a tarball once you get back on the releases.

Offline

#8 2021-06-07 17:05:35

feinedsquirrel
Member
Registered: 2020-12-11
Posts: 33

Re: Request to verify my first PKGBUILD before submission to AUR

Cool, sounds good. Thanks for the info. And once I'm using the tarballs, I'll add the 512sum for that.

Offline

#9 2021-06-07 18:25:12

feinedsquirrel
Member
Registered: 2020-12-11
Posts: 33

Re: Request to verify my first PKGBUILD before submission to AUR

Alright, I've now finished the alterations according to Go_package_guidelines. Anything else I need to change? Or tips, otherwise?

Offline

#10 2021-06-07 19:37:38

loqs
Member
Registered: 2014-03-06
Posts: 17,195

Re: Request to verify my first PKGBUILD before submission to AUR

Everything looks good,  apart from one thing I just spotted:

  ln -s "/usr/lib/${_pkgname}/${_pkgname}" "${pkgdir}/usr/bin"

Creates /usr/bin where bin is a symlink to /usr/lib/photoview/photoview

Offline

#11 2021-06-07 19:46:49

feinedsquirrel
Member
Registered: 2020-12-11
Posts: 33

Re: Request to verify my first PKGBUILD before submission to AUR

Oh, good catch, thanks. I've changed it to:

  install -d "${pkgdir}/usr/bin"
  ln -s "/usr/lib/${_pkgname}/${_pkgname}" "${pkgdir}/usr/bin/"

Is that better? I've read "install" is preferred over mkdir and cp, but not sure if it applies in this case.

Last edited by feinedsquirrel (2021-06-07 19:59:02)

Offline

#12 2021-06-07 20:55:47

loqs
Member
Registered: 2014-03-06
Posts: 17,195

Re: Request to verify my first PKGBUILD before submission to AUR

That fixed it.  install can not perform symlinks so there is no issue with using ln to create them.

Offline

#13 2021-06-07 21:32:17

feinedsquirrel
Member
Registered: 2020-12-11
Posts: 33

Re: Request to verify my first PKGBUILD before submission to AUR

Awesome, thanks for verifying my theory.

Thank you everyone! Hopefully I'll get around to submitting it later this evening.

Offline

Board footer

Powered by FluxBB