hanzala123 / arch2appimage

This is a python script that downloads Arch Linux packages (Official/Chaotic AUR) and converts to an AppImage executable
GNU General Public License v3.0
342 stars 12 forks source link

AUR: Package not found. Please check the name and try again #3

Open olegantonyan opened 1 year ago

olegantonyan commented 1 year ago
$ python arch2appimage.py

Convert any Arch linux package (official/AUR) to AppImage!!
Loading Chaotic AUR package list...

Enter the name of the package (leave empty to quit)
[?] >>: mpz
Package not found. Please check the name and try again

Enter the name of the package (leave empty to quit)
[?] >>: 

This is my package and it exists in AUR: https://aur.archlinux.org/packages/mpz

config.py is unchanged:

import platform

USE_AUR = True # set to False to disable AUR Support

OUT_DIR = "out"
APP_DIR = "AppDir"
RES_DIR = "resources"

ARCH = platform.machine()

AUR_URL         = f"https://cdn-mirror.chaotic.cx/chaotic-aur/{ARCH}"
ARCH_URL        = "https://archlinux.org/packages/{repo}/{arch}/{pkg}/download"
ARCH_SEARCH_URL = "https://archlinux.org/packages/search/json/?name={pkg}"

LDP_URL          = "https://github.com/project-portable/libunionpreload/releases/download/amd64/libunionpreload.so"
APPIMAGETOOL_URL = f"https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-{ARCH}.AppImage"

Python 3.10.4

DomHeadroom commented 1 year ago

This issues can maybe be solved if instead of using "https://archlinux.org/packages/search/json/?name=" we replace it with the url the aur's wiki suggests to use right here, that would be "https://aur.archlinux.org/rpc/?v=5&type=search&arg=". Because with the url he is using inside the script right now you miss a lot of results! That instead are available with this new api.

olegantonyan commented 1 year ago

https://archlinux.org/packages/search/json/?name=mpz also returns empty result

$ curl 'https://archlinux.org/packages/search/json/?name=mpz'
{"version": 2, "limit": 250, "valid": true, "results": [], "num_pages": 1, "page": 1}
DomHeadroom commented 1 year ago

I'm not talking about using "https://archlinux.org/packages/search/json/?name=" because it's the reason you can't get the mpz package from the script. That's why we need to use "https://aur.archlinux.org/rpc/?v=5&type=search&arg=" instead. This one return this text:

{"resultcount":4,"results":[{"Description":"Extract All Forensic Interesting Information Of Firefox, Iceweasel And Seamonkey","FirstSubmitted":1527092483,"ID":918267,"LastModified":1623101417,"Maintainer":"GI_Jack","Name":"dumpzilla-git","NumVotes":1,"OutOfDate":null,"PackageBase":"dumpzilla-git","PackageBaseID":132736,"Popularity":0,"URL":"http://www.dumpzilla.org/","URLPath":"/cgit/aur.git/snapshot/dumpzilla-git.tar.gz","Version":"r44.ec337da-1"},{"Description":"Math::GMPz - perl interface to the GMP library's integer (mpz) functions.","FirstSubmitted":1451247980,"ID":1049802,"LastModified":1647086765,"Maintainer":"trizen","Name":"perl-math-gmpz","NumVotes":1,"OutOfDate":null,"PackageBase":"perl-math-gmpz","PackageBaseID":105167,"Popularity":0,"URL":"https://metacpan.org/release/Math-GMPz","URLPath":"/cgit/aur.git/snapshot/perl-math-gmpz.tar.gz","Version":"0.54-1"},{"Description":"Music player for the large local collections","FirstSubmitted":1601012446,"ID":1132072,"LastModified":1661711725,"Maintainer":"oleg_antonyan","Name":"mpz","NumVotes":3,"OutOfDate":null,"PackageBase":"mpz","PackageBaseID":158026,"Popularity":0.019543,"URL":"https://github.com/olegantonyan/mpz","URLPath":"/cgit/aur.git/snapshot/mpz.tar.gz","Version":"1.0.21-0"},{"Description":"Music player for the large local collections","FirstSubmitted":1645212997,"ID":1132073,"LastModified":1661711742,"Maintainer":"oleg_antonyan","Name":"mpz-qt6","NumVotes":1,"OutOfDate":null,"PackageBase":"mpz-qt6","PackageBaseID":176149,"Popularity":0.01951,"URL":"https://github.com/olegantonyan/mpz","URLPath":"/cgit/aur.git/snapshot/mpz-qt6.tar.gz","Version":"1.0.21-0"}],"type":"search","version":5}

The last one is your aur package!

hanzala123 commented 1 year ago

Hi, I am the original creator of this. The issue here is that the packages are not built from the AUR. Rather the pre-built packages are fetched from the Chaotic AUR. Thus this problem. A package could be in the AUR but not in the Chaotic AUR. Compiling apps directly from the AUR is something on the development roadmap.