Skip to content

feat: add pkgbuild manager (Arch Linux PKGBUILD)#39466

Open
M0Rf30 wants to merge 1 commit intorenovatebot:mainfrom
M0Rf30:feat/pkgbuild-manager
Open

feat: add pkgbuild manager (Arch Linux PKGBUILD)#39466
M0Rf30 wants to merge 1 commit intorenovatebot:mainfrom
M0Rf30:feat/pkgbuild-manager

Conversation

@M0Rf30
Copy link
Copy Markdown

@M0Rf30 M0Rf30 commented Nov 22, 2025

Summary

Adds a new manager for Arch Linux PKGBUILD files. Automatically detects new versions, updates pkgver, resets pkgrel, downloads source archives, computes checksums, and creates pull requests.

What it does

  • Automatically detects new versions from source URLs
  • Updates pkgver to the new version
  • Resets pkgrel to 1 (Arch convention)
  • Downloads new source archive and computes checksums programmatically
  • Updates sha256sums, sha512sums, b2sums, md5sums
  • Creates a pull request with all changes

Supported package sources

GitHub

  • Archive and release URLs

GitLab

  • gitlab.com and self-hosted instances

PyPI (Python)

  • files.pythonhosted.org, pypi.org

npm (Node.js)

  • Regular and scoped packages (@org/package)

CPAN (Perl)

  • cpan.metacpan.org

Packagist (PHP)

  • packagist.org

Gitea

  • gitea.com, codeberg.org, and self-hosted

Forgejo

  • code.forgejo.org and self-hosted

Generic Git repositories

  • Any git hosting with archive URLs or .git URLs

Repology (fallback)

  • Used automatically for unknown sources
  • Can be manually configured: # renovate: repology=repo/package

Additional features

  • Variable expansion: ${pkgver}, $pkgver, ${_pkgver}, $_pkgver
  • Architecture-specific checksums: sha256sums_x86_64, sha256sums_aarch64, etc.
  • Multi-source arrays (updates all sources that use ${pkgver})
  • Handles multiple archive formats: .tar.gz, .tar.bz2, .tar.xz, .zip, .tgz

What it doesn't support

  • VCS sources (git+https://...)
  • -git packages that track HEAD/latest commit
  • Packages with dynamic pkgver() functions

Example

pkgname=example
pkgver=1.2.3
pkgrel=1
source=("https://github.com/owner/repo/archive/v${pkgver}.tar.gz")
sha256sums=('abc123...')

Renovate detects GitHub, updates pkgver, resets pkgrel, downloads new tarball, computes new checksum.

Context

  • I accept the risk that this PR may be closed if maintainers disagree

AI assistance disclosure

  • Yes — minimal assistance

Documentation

  • I have updated documentation

How I've tested my work

  • Unit tests + real repository

@M0Rf30 M0Rf30 changed the title feat: add pkgbuild manager (Arch Linux PKGBUILD) - v2 feat: add pkgbuild manager (Arch Linux PKGBUILD) Nov 22, 2025
@M0Rf30 M0Rf30 changed the title feat: add pkgbuild manager (Arch Linux PKGBUILD) feat: add pkgbuild manager (Arch Linux PKGBUILD) Nov 22, 2025
@M0Rf30 M0Rf30 force-pushed the feat/pkgbuild-manager branch 2 times, most recently from bd3da39 to 029575d Compare November 24, 2025 11:26
@M0Rf30 M0Rf30 force-pushed the feat/pkgbuild-manager branch from 029575d to db3f29d Compare November 25, 2025 12:40
@M0Rf30 M0Rf30 force-pushed the feat/pkgbuild-manager branch from db3f29d to 2217fad Compare December 5, 2025 13:53
Copy link
Copy Markdown
Collaborator

@RahulGautamSingh RahulGautamSingh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

I have done a half-review..and will review again after changes are applied.

Please, use the review request feature for notifying.

Comment thread lib/modules/manager/pkgbuild/readme.md Outdated
Comment thread lib/modules/manager/pkgbuild/extract.ts Outdated
Comment thread lib/modules/manager/pkgbuild/extract.ts Outdated
Comment thread lib/modules/manager/pkgbuild/extract.ts Outdated
@M0Rf30 M0Rf30 force-pushed the feat/pkgbuild-manager branch 2 times, most recently from aff9917 to 5a4d5d8 Compare December 9, 2025 13:00
Comment thread lib/modules/manager/pkgbuild/update.ts Fixed
@M0Rf30 M0Rf30 force-pushed the feat/pkgbuild-manager branch 2 times, most recently from b54a48b to 52592ef Compare December 9, 2025 16:27
@M0Rf30 M0Rf30 force-pushed the feat/pkgbuild-manager branch 2 times, most recently from 84e697c to 3d76b8b Compare January 27, 2026 20:07
@M0Rf30
Copy link
Copy Markdown
Author

M0Rf30 commented Jan 27, 2026

Thanks for the PR!

I have done a half-review..and will review again after changes are applied.

Please, use the review request feature for notifying.

@RahulGautamSingh I think it's ready now. I'm writing here because I requested a review some time ago. Some time has passed, and here we are 😄

@M0Rf30 M0Rf30 force-pushed the feat/pkgbuild-manager branch 4 times, most recently from ba03359 to 91a0559 Compare January 29, 2026 03:17
Comment thread lib/modules/manager/pkgbuild/index.ts Outdated
Comment thread lib/modules/manager/pkgbuild/update.ts Outdated
Comment thread lib/modules/manager/pkgbuild/update.ts Outdated
Comment thread lib/modules/manager/pkgbuild/update.ts Outdated
@M0Rf30 M0Rf30 force-pushed the feat/pkgbuild-manager branch 2 times, most recently from d417b81 to b0f6ffb Compare February 2, 2026 20:20
@M0Rf30 M0Rf30 requested a review from viceice February 3, 2026 02:04
@M0Rf30 M0Rf30 force-pushed the feat/pkgbuild-manager branch from b0f6ffb to bb48672 Compare February 3, 2026 02:08
@D3vil0p3r
Copy link
Copy Markdown

D3vil0p3r commented Feb 5, 2026

@M0Rf30 does your change include also the updpkgsums to have the updated hashes and at the end the creation of a PR?

Does it work also with -git packages to retrieve the latest commit version in PKGBUILD?
Does it work also with Python PyPI libs versioning update?

@M0Rf30
Copy link
Copy Markdown
Author

M0Rf30 commented Feb 5, 2026

@M0Rf30 does your change include also the updpkgsums to have the updated hashes and at the end the creation of a PR?

Does it work also with -git packages to retrieve the latest commit version in PKGBUILD? Does it work also with Python PyPI libs versioning update?

@M0Rf30 does your change include also the updpkgsums to have the updated hashes and at the end the creation of a PR?

Does it work also with -git packages to retrieve the latest commit version in PKGBUILD? Does it work also with Python PyPI libs versioning update?

PyPI is fully supported

The implementation downloads the source archive directly and computes all checksums programmatically using Node's crypto module. It automatically calculates all checksum types present in the PKGBUILD (sha256, sha512, b2, md5).

This manager is designed for versioned releases, not VCS sources. Git packages (like -git AUR packages that track HEAD) use git+ URLs and have dynamic pkgver() functions rather than static versions, so they're fundamentally incompatible with this approach. The manager only handles versioned tarballs/archives from known sources.

@D3vil0p3r
Copy link
Copy Markdown

D3vil0p3r commented Feb 5, 2026

Grande! For git versioning I'll try to look for another bot if existing. For this PR, is there something additional you need to add on the code, or it needs only to be reviewed and merged?

Also svc stable sources are supported?

@M0Rf30 M0Rf30 force-pushed the feat/pkgbuild-manager branch from bb48672 to 227440c Compare February 5, 2026 19:43
@M0Rf30 M0Rf30 force-pushed the feat/pkgbuild-manager branch 3 times, most recently from 8ab6f98 to a7e2456 Compare March 9, 2026 17:33
@M0Rf30 M0Rf30 requested a review from viceice March 9, 2026 17:36
@M0Rf30 M0Rf30 force-pushed the feat/pkgbuild-manager branch 2 times, most recently from d802086 to 2c8e0f3 Compare March 9, 2026 18:06
Copy link
Copy Markdown
Member

@viceice viceice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use named capture groups

Comment thread lib/modules/manager/pkgbuild/extract/cpan.ts Outdated
Comment thread lib/modules/manager/pkgbuild/extract/forgejo.ts Outdated
Comment thread lib/modules/manager/pkgbuild/extract/generic-git.ts Outdated
Comment thread lib/modules/manager/pkgbuild/extract/generic-git.ts Outdated
Comment thread lib/modules/manager/pkgbuild/extract/gitea.ts Outdated
Comment thread lib/modules/manager/pkgbuild/hash.ts Outdated
Comment thread lib/modules/manager/pkgbuild/index.ts Outdated
Comment thread lib/modules/manager/pkgbuild/readme.md Outdated
Comment thread lib/modules/manager/pkgbuild/readme.md Outdated
Comment thread lib/modules/manager/pkgbuild/update.ts Outdated
@M0Rf30 M0Rf30 force-pushed the feat/pkgbuild-manager branch 4 times, most recently from ff1fee4 to 2ad8b40 Compare March 13, 2026 19:55
@M0Rf30 M0Rf30 requested a review from viceice March 13, 2026 20:00
Copy link
Copy Markdown
Collaborator

@RahulGautamSingh RahulGautamSingh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

 pkgver=1.2.3
  _pkgver=1.2.3
  source=("https://example.com/releases/example-${_pkgver}.tar.gz")

test fails: after bumping to 1.2.4, the updater rewrites pkgver, but _pkgver stays at 1.2.3

Is this expected?

@M0Rf30 M0Rf30 force-pushed the feat/pkgbuild-manager branch from 2ad8b40 to 5ed521c Compare March 20, 2026 13:10
@M0Rf30 M0Rf30 requested a review from RahulGautamSingh March 21, 2026 10:06
Copy link
Copy Markdown
Collaborator

@RahulGautamSingh RahulGautamSingh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Waiting for reply for: #39466 (review)

@M0Rf30
Copy link
Copy Markdown
Author

M0Rf30 commented Mar 24, 2026

 pkgver=1.2.3
  _pkgver=1.2.3
  source=("https://example.com/releases/example-${_pkgver}.tar.gz")

test fails: after bumping to 1.2.4, the updater rewrites pkgver and resets pkgrel, but _pkgver stays at 1.2.3

Is this expected?

Not expected, so I fixed the error. Now custom variables expansion is done correctly in assignments (pkgver="${_pkgver}")

@M0Rf30 M0Rf30 force-pushed the feat/pkgbuild-manager branch from 5ed521c to 733edde Compare April 1, 2026 14:57
Copy link
Copy Markdown
Collaborator

@RahulGautamSingh RahulGautamSingh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lint failure

@M0Rf30 M0Rf30 force-pushed the feat/pkgbuild-manager branch from 733edde to 832226d Compare April 4, 2026 22:00
@M0Rf30 M0Rf30 requested a review from RahulGautamSingh April 4, 2026 22:04
Comment thread lib/modules/manager/pkgbuild/extract/npm.ts Outdated
Comment thread lib/modules/manager/pkgbuild/extract/index.ts Outdated
Comment thread lib/modules/manager/pkgbuild/extract/utils.ts
Comment thread lib/modules/manager/pkgbuild/extract/index.ts Outdated
@RahulGautamSingh
Copy link
Copy Markdown
Collaborator

RahulGautamSingh commented Apr 20, 2026

A couple more spots that should switch to named capture groups, matching what github.ts / gitlab.ts / cpan.ts etc. now use:

  • lib/modules/manager/pkgbuild/extract/pypi.ts:23 — capture name and version by name
  • lib/modules/manager/pkgbuild/extract/packagist.ts:33 — same

@M0Rf30 M0Rf30 force-pushed the feat/pkgbuild-manager branch from 832226d to 4da704f Compare April 25, 2026 10:27
@M0Rf30 M0Rf30 requested a review from RahulGautamSingh April 25, 2026 10:30
Copy link
Copy Markdown
Collaborator

@RahulGautamSingh RahulGautamSingh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM overall.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants