You are not logged in.

#1 2021-08-24 20:27:32

cloverskull
Member
Registered: 2018-09-30
Posts: 79

Silly question - any simple howto for creating an AUR package?

Hey everyone, I'd like to create an AUR PKGBUILD for Apple-Music-Electron. There's an out-of-date AUR PKGBUILD for this that doesn't work and I'd like to make a new one that pulls directly from the application's GitHub.

Is there a quick down and dirty anywhere for putting this together? Or should I just trawl through the wiki and figure this out myself?

Thanks!

Offline

#2 2021-08-24 20:30:35

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 29,733
Website

Re: Silly question - any simple howto for creating an AUR package?

No need to trawl: there's a page for this
https://wiki.archlinux.org/title/Creating_packages


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Online

#3 2021-08-24 20:43:21

loqs
Member
Registered: 2014-03-06
Posts: 14,222

Re: Silly question - any simple howto for creating an AUR package?

Does apple-music-electron work with the changes below?  (build tested only)

diff --git a/PKGBUILD b/PKGBUILD
index 08c8a9d..9fb0806 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,14 +1,14 @@
 # Maintainer: GiantDwarf <17hoehbr@gmail.com>
 pkgname=apple-music-electron
 _pkgname=Apple-Music-Electron
-pkgver=2.3.0
+pkgver=2.4.1
 pkgrel=1
 pkgdesc="Electron wrapper for Apple Music"
 arch=("aarch64" "armv7h" "i686" "x86_64")
 url="https://github.com/cryptofyre/${_pkgname}"
 license=("MIT")
 depends=('libxss')
-makedepends=('yarn' 'git')
+makedepends=('yarn' 'git' 'python')
 source=(
   "${_pkgname}-${pkgver}.tar.gz::$url/archive/v${pkgver}.tar.gz"
   "${_pkgname}.desktop"
@@ -33,8 +33,8 @@ package() {
   install -dm755 "${pkgdir}/opt" "${pkgdir}/usr/bin"
   cp -r --preserve=mode "${srcdir}/${_pkgname}-${pkgver}/dist/linux-unpacked" "${pkgdir}/opt/${pkgname}"
   install -Dm644 "${srcdir}/${_pkgname}.desktop" "${pkgdir}/usr/share/applications/${pkgname}.desktop"
-  install -Dm644 "${srcdir}/${_pkgname}-${pkgver}/assets/icon.png" "${pkgdir}/usr/share/icons/hicolor/256x256/apps/${pkgname}.png"
+  install -Dm644 "${srcdir}/${_pkgname}-${pkgver}/resources/icons/icon.png" "${pkgdir}/usr/share/icons/hicolor/256x256/apps/${pkgname}.png"
   ln -sf "/opt/${pkgname}/${pkgname}" "${pkgdir}/usr/bin/${pkgname}"
 }
-sha256sums=('3a86cfb39ee26f6cce893f4b9c3ad84743099736b2ce775e5c38a17a2d0fe9c0'
+sha256sums=('4af2fa083e4f48c11e8caa8f9216ac5ab852564d7de2c523ac2da4c7a2bd2bc8'
             '27c22a9c93cca671e5abf6467c21e192560f0100634399105d89ccee42a682df')

Last edited by loqs (2021-08-24 20:50:20)

Offline

#4 2021-08-24 20:46:51

cloverskull
Member
Registered: 2018-09-30
Posts: 79

Re: Silly question - any simple howto for creating an AUR package?

Splendid, thanks.

Offline

#5 2021-08-24 21:27:16

cloverskull
Member
Registered: 2018-09-30
Posts: 79

Re: Silly question - any simple howto for creating an AUR package?

It builds but doesn't work (sorry for my previous comment, looks like I got that one in a bit late). It fails at the authentication step.

To make authentication work, you need to build against the latest cut of master in the github repo. So what I was hoping to do was make an apple-music-electron-git package to do just that.

Offline

#6 2021-08-24 22:14:21

loqs
Member
Registered: 2014-03-06
Posts: 14,222

Re: Silly question - any simple howto for creating an AUR package?

pkgname=apple-music-electron-git
_pkgname=Apple-Music-Electron
pkgver=v2.5.0.r62.gcab189e
pkgrel=1
pkgdesc="Electron wrapper for Apple Music (git version)"
arch=("aarch64" "armv7h" "i686" "x86_64")
url="https://github.com/cryptofyre/${_pkgname}"
license=("MIT")
depends=('libxss')
makedepends=('yarn' 'git' 'npm')
conflicts=('apple-music-electron')
provides=('apple-music-electron')
source=(
  "${_pkgname}::git+$url"
  "${_pkgname}.desktop"
)
sha256sums=('SKIP'
            '27c22a9c93cca671e5abf6467c21e192560f0100634399105d89ccee42a682df')

pkgver() {
  cd "${_pkgname}"
  git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
  cd "${_pkgname}"
  yarn install --non-interactive --pure-lockfile --cache-folder "${srcdir}/yarn-cache"
  if [[ ${CARCH} == "aarch64" ]]; then
    yarn electron-builder build --arm64 --linux dir
  elif [[ ${CARCH} == "armv7h" ]]; then
    yarn electron-builder build --armv7l --linux dir
  elif [[ ${CARCH} == "i686" ]]; then
    yarn electron-builder build --ia32 --linux dir
  elif [[ ${CARCH} == "x86_64" ]]; then
    yarn electron-builder build --x64 --linux dir
  fi
}

package() {
  cd "${_pkgname}"
  install -dm755 "${pkgdir}/opt" "${pkgdir}/usr/bin"
  cp -r --preserve=mode dist/linux-unpacked "${pkgdir}/opt/${pkgname}"
  install -Dm644 "${srcdir}/${_pkgname}.desktop" "${pkgdir}/usr/share/applications/${pkgname}.desktop"
  install -Dm644 resources/icons/icon.png "${pkgdir}/usr/share/icons/hicolor/256x256/apps/${pkgname}.png"
  ln -sf "/opt/${pkgname}/${pkgname%-git}" "${pkgdir}/usr/bin/${pkgname%-git}"
}

Well the above builds using the HEAD of the default branch.  Electron_package_guidelines#Using_the_system_electron not attempted and dependencies not adjusted.  Not fixed missing custom license file.
Would also see if yarn or npm are both needed.

Offline

#7 2021-08-26 02:10:25

cloverskull
Member
Registered: 2018-09-30
Posts: 79

Re: Silly question - any simple howto for creating an AUR package?

The above PKGBUILD fails on the .desktop file, and frankly I haven't poked around at it much. I assume it's something simple. I also can confirm that removing the desktop file portion _does_ allow things to build correctly, even if I remove the npm dependency as well. However that .desktop file is pretty useful so it probably makes sense to fix that issue as well.

Offline

#8 2021-08-26 04:49:56

loqs
Member
Registered: 2014-03-06
Posts: 14,222

Re: Silly question - any simple howto for creating an AUR package?

What is the error message?  The desktop file has no changes from apple-music-electron.  Does Apple-Music-Electron.desktop exist with the contents:

#!/usr/bin/env xdg-open
[Desktop Entry]
Type=Application
Name=Apple Music
Comment=Electron wrapper for Apple Music
GenericName=Apple Music
Exec=apple-music-electron
Icon=apple-music-electron
Categories=AudioVideo;Audio;
Terminal=false
StartupNotify=true
Version=2.3.0

Offline

#9 2021-08-26 06:36:52

cloverskull
Member
Registered: 2018-09-30
Posts: 79

Re: Silly question - any simple howto for creating an AUR package?

The error is that it can't find the .desktop file (sorry, posting from another computer).

It is trying to pull https://aur.archlinux.org/cgit/aur.git/ … c-electron - if I replace the ?h= to use the apple-music-electron-git package that we're trying to build, it won't work. Sorry for being lame and not understanding AUR fully smile

The .desktop file is /not/ in the source anywhere, it pulls from AUR directly.

Offline

#10 2021-08-26 08:27:06

Raynman
Member
Registered: 2011-10-22
Posts: 1,337

Re: Silly question - any simple howto for creating an AUR package?

With the way it's listed in the source array, you should put the .desktop file in the same directory as the PKGBUILD before running makepkg. When it comes to the AUR, the file would then also be uploaded and downloaded/cloned along with the PKGBUILD.

Btw, the $url redirects to https://github.com/Apple-Music-Electron … c-Electron and there I also see a .desktop file in the resources directory. It's not identical, but you could check it out and/or file a request to improve that one if necessary.

Last edited by Raynman (2021-08-26 08:30:17)

Offline

Board footer

Powered by FluxBB