You are not logged in.

#1 2023-08-03 20:21:34

neeshie0
Member
Registered: 2022-10-11
Posts: 3

AUR Package works with makepkg -si, but not with AUR helpers like yay.

I'm writing an AUR package (https://aur.archlinux.org/packages/lunar-client-qt2), but I'm struggling with making it work with AUR helpers. When I use makepkg -si, the application successfully installs a binary to /usr/bin/ and also installs a desktop entry to /usr/share/applications/. Then, I can launch the app from gnome's app launcher, or from the command line. With AUR helpers, the files still appear in /usr/bin/ and /usr/share/applications/, but I can't run the binary from the command line and the desktop entry doesn't show up in the app launcher.

Has anyone had this issue before? I'm thinking it might be a permissions issue, but I don't know what would make it work with makepkg -si.

Offline

#2 2023-08-03 20:30:06

loqs
Member
Registered: 2014-03-06
Posts: 18,817

Re: AUR Package works with makepkg -si, but not with AUR helpers like yay.

    ln -sf "${pkgdir}/opt/lcqt2/Lunar Client Qt" "${pkgdir}/usr/bin/lunarclientqt2"

Remove ${pkgdir} from the links target.

Offline

#3 2023-08-03 20:34:55

twelveeighty
Member
Registered: 2011-09-04
Posts: 1,434

Re: AUR Package works with makepkg -si, but not with AUR helpers like yay.

Please do not do this in your PKGBUILD, this completely by-passes the purpose and security of checksums. I do not use AUR helpers myself, so I don't know for sure, but it wouldn't surprise me if this is what breaks them.

prepare(){

    # I know this shouldn't go here, but it breaks when I put it in the sources section for some reason.
    wget "https://github.com/Nilsen84/lcqt2/releases/download/v${pkgver}/linux-portable.tar.gz"
...

Offline

#4 2023-08-03 20:40:54

loqs
Member
Registered: 2014-03-06
Posts: 18,817

Re: AUR Package works with makepkg -si, but not with AUR helpers like yay.

diff of changes to remove prepare and fix symlink

diff --git a/PKGBUILD b/PKGBUILD
index d375ed2..4a3673c 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,37 +3,29 @@
 pkgname=lunar-client-qt2
 pkgver=2.3.0
 pkgrel=2
-source=("https://cdn.discordapp.com/icons/1134376256750755890/0d129e0190943de0d230cac3a5c79a2c.png?size=4096", "https://gist.githubusercontent.com/anemovva/141e7b3c76ba3065ea1beacf6d8680f5/raw/b18cf377fa108a6899685afbec4bc4dfb4f183bc/lcqt2.desktop")
+source=("lcqt2.png::https://cdn.discordapp.com/icons/1134376256750755890/0d129e0190943de0d230cac3a5c79a2c.png?size=4096"
+        "https://gist.githubusercontent.com/anemovva/141e7b3c76ba3065ea1beacf6d8680f5/raw/b18cf377fa108a6899685afbec4bc4dfb4f183bc/lcqt2.desktop"
+        "https://github.com/Nilsen84/lcqt2/releases/download/v${pkgver}/linux-portable.tar.gz")
 depends=(lunar-client)
 license=(unknown)
 pkgdesc="Lunar Client QT2 is a program that adds features to the popular PvP client Lunar Client."
 arch=('x86_64')
 url=https://github.com/Nilsen84/lcqt2
-sha256sums=('ec5d32867c9ece0bfa9c7813f2cc0f07feec6f108e5ad5a475151850f0b77ba8'
-            'e5e5610cc8f07722b00fbc78da8157671d86d9ca932102260f1ae252c0524505')
-
-prepare(){
-
-    # I know this shouldn't go here, but it breaks when I put it in the sources section for some reason.
-    wget "https://github.com/Nilsen84/lcqt2/releases/download/v${pkgver}/linux-portable.tar.gz"
-    tar -xzf "linux-portable.tar.gz"
-    rm linux-portable.tar.gz
-    mv "0d129e0190943de0d230cac3a5c79a2c.png?size=4096," lcqt2.png
-    chmod +x "Lunar Client Qt"
-}
+sha256sums=('943e3a2b10516e05dc603b194792e7bebd5dd4f00c9a651ba22c94ef1aba1572'
+            'e5e5610cc8f07722b00fbc78da8157671d86d9ca932102260f1ae252c0524505'
+            '91aac343e4f0dc6e7f424b0fd248bc637ce2afde13ca53cd2598f649bae73fa9')
 
 package(){
 
-    install -D "${srcdir}/gui.asar" "${pkgdir}/opt/lcqt2/gui.asar"
-    install -D "${srcdir}/agent.jar" "${pkgdir}/opt/lcqt2/agent.jar"
-    install -D "${srcdir}/Lunar Client Qt" "${pkgdir}/opt/lcqt2/Lunar Client Qt"
-    install -D "${srcdir}/lcqt2.png" "${pkgdir}/opt/lcqt2/lcqt2.png"
+    install -D "gui.asar" "${pkgdir}/opt/lcqt2/gui.asar"
+    install -D "agent.jar" "${pkgdir}/opt/lcqt2/agent.jar"
+    install -D "Lunar Client Qt" "${pkgdir}/opt/lcqt2/Lunar Client Qt"
+    install -D "lcqt2.png" "${pkgdir}/opt/lcqt2/lcqt2.png"
 
     install -Dm644 "${srcdir}/lcqt2.desktop" "${pkgdir}/usr/share/applications/${pkgname}.desktop"
 
     install -d "${pkgdir}/usr/bin/"
 
     # rm "${pkgdir}/usr/bin/lunarclientqt2"
-    ln -sf "${pkgdir}/opt/lcqt2/Lunar Client Qt" "${pkgdir}/usr/bin/lunarclientqt2"
+    ln -sf "/opt/lcqt2/Lunar Client Qt" "${pkgdir}/usr/bin/lunarclientqt2"
 }
-

Offline

#5 2023-08-03 20:51:23

neeshie0
Member
Registered: 2022-10-11
Posts: 3

Re: AUR Package works with makepkg -si, but not with AUR helpers like yay.

Sorry for not replying earlier, but I got some help on discord and fixed the sources issue, as well as removed the ${pkgdir} from in front of the symlink. However, it still doesn't function with AUR helpers for me.

Offline

#6 2023-08-03 20:53:44

neeshie0
Member
Registered: 2022-10-11
Posts: 3

Re: AUR Package works with makepkg -si, but not with AUR helpers like yay.

Nevermind, I had to clear my yay cache and now it works. Thanks for the help guys.

Offline

#7 2023-08-03 20:55:49

loqs
Member
Registered: 2014-03-06
Posts: 18,817

Re: AUR Package works with makepkg -si, but not with AUR helpers like yay.

Please also consider building the package from source and adding the custom license even if it does not allow for any use that is the current license.

Offline

Board footer

Powered by FluxBB