The URL generator allows you to generate a package from a static URL.

Its input object looks like this:

{
    "name": "prjname",
    "url-generator": 
    {
        "url": "https://example.com",
        "hash-locks": [ "hash1", "hash2" ],
        "version": "1.0.0.0",
        "transforms": 
        [
            [ "https.*tag/v", "" ],
        ],
        "headers": 
        {
            "User-Agent": "My user agent"
        }
    }
}

The fields do the following:

  1. url - The URL to download the source code. It can be templated with the following variables:
    • {version} - The contents of the version field if it was defined in the schema, otherwise an empty string
    • {pkgname} - The name of the package
  2. hash-locks - Optional: A list of hashes used to verify the integrity of a locked artifact. It supports all default checksum algorithms(SHA1, SHA2, SHA3 and BLAKE2 families + MD5)
  3. version - A version lock for the artifact in case there is no way to retrieve a version from its URL automatically. Must not exist together with the transforms field.
  4. transforms - An array of pairs(2-member JSON arrays) that do regex find and replace on the URL string after templating. This is so that users can extract the version out of a URL like https://example.com/package-1.0.0.0.tar.xz. The first element of a pair is the find pattern, while the second is the replace string. Must not exist together with the transforms field.
  5. headers - An optional JSON object of HTTP header pairs. By default it is set up with a browser user agent: User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0.1 Safari/605.1.15