berberman / nvfetcher

Generate nix sources expr for the latest version of packages
https://nvfetcher.torus.icu
MIT License
168 stars 14 forks source link

[feature] fetch.aur /fetch.archpkg #99

Closed Freed-Wu closed 1 year ago

Freed-Wu commented 1 year ago

Can we use fetch.aur or fetch.archpkg to get fetchurl from PKGBUILD's source? That is

PKGBUILD:

pkgname = "foo"
pkgver = "0.0.1"
source = "https://XXX"
...
[foo]
src.aur = "foo"
fetch.aur = "foo"

will generate

  foo = {
    pname = "foo";
    version = "0.0.1";
    src = fetchurl {
      url = "https://XXX";
      sha256 = "sha256-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX=";
    };
berberman commented 1 year ago

It's not clear how to extract the source from PKGBUILD, given that there might be multiple sources and local repositories e.g. "$pkgname"::"git+file:///path/to/repository". Moreover, if we get a url from source, then what to do with the hash? Should we prefetch the file, or use sha256sums which may not exist in PKGBUILD? And what would happen if the source was not a url? I think this functionality, or "nixify" the source in PKGBUILD, is beyond the scope of nvfetcher.

Freed-Wu commented 1 year ago

OK, I see :+1: