Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

format-specific configuration #28

Open
yakubin opened this issue Oct 17, 2020 · 1 comment
Open

format-specific configuration #28

yakubin opened this issue Oct 17, 2020 · 1 comment

Comments

@yakubin
Copy link
Contributor

yakubin commented Oct 17, 2020

Currently all configuration in pkg.toml applies to all formats. This is problematic for dependencies (requires, provides, conflicts, replaces), because some dependencies are named differently on different distros. For example, applications written in Rust depend on a library which is packaged as libgcc1 on Debian, as libgcc on Fedora, and as gcc-libs on Arch Linux. Thus, if one wants to package an application that requires such a library, one needs to either use a macro system (such as m4), write a shell script using cat to concatenate different files into a single pkg.toml, or write a completely different pkg.toml for each distro (with a lot of duplicated parts which need to be updated in the future, laying ground for a slip-up). None of those seem particularly appealing to me.

Additionally, I'm planning on implementing a way to change the value for repo section for Debian packages. Currently it's hardcoded to misc. It applies only to Debian packages, so it would make sense to place it in a Debian-only section.

I think that some format-specific configuration could be useful. I'm thinking of something like this:

[package]
name    = "example-package"
version = "1.2.5"
epoch   = 2
release = 3
description = "An example package"
author      = "Jane Doe <[email protected]>"
requires    = [ "common-requires >= 2.0" ]
provides    = [ "common-provides = 1.2" ]
conflicts   = [ "common-conflicts" ]
replaces    = [ "common-replaces" ]

[package.debian]
requires    = [ "additional-debian-requires >= 2.0" ]
provides    = [ "additional-debian-provides = 1.2" ]
conflicts   = [ "additional-debian-conflicts" ]
replaces    = [ "additional-debian-replaces" ]
section     = "utils"

[package.rpm]
requires    = [ "additional-rpm-requires >= 2.0" ]
provides    = [ "additional-rpm-provides = 1.2" ]
conflicts   = [ "additional-rpm-conflicts" ]
replaces    = [ "additional-rpm-replaces" ]

[package.pacman]
requires    = [ "additional-pacman-requires >= 2.0" ]
provides    = [ "additional-pacman-provides = 1.2" ]
conflicts   = [ "additional-pacman-conflicts" ]
replaces    = [ "additional-pacman-replaces" ]

This way holo-build could produce packages with the following dependencies, depending on the output format:

Format Requires
Debian [ "common-requires >= 2.0", "additional-debian-requires >= 2.0" ]
RPM [ "common-requires >= 2.0", "additional-rpm-requires >= 2.0" ]
Pacman [ "common-requires >= 2.0", "additional-pacman-requires >= 2.0" ]
Format Provides
Debian [ "common-provides = 1.2", "additional-debian-provides = 1.2" ]
RPM [ "common-provides = 1.2", "additional-rpm-provides = 1.2" ]
Pacman [ "common-provides = 1.2", "additional-pacman-provides = 1.2" ]
Format Conflicts
Debian [ "common-conflicts", "additional-debian-conflicts" ]
RPM [ "common-conflicts", "additional-debian-conflicts" ]
Pacman [ "common-conflicts", "additional-debian-conflicts" ]
Format Replaces
Debian [ "common-replaces", "additional-debian-replaces" ]
RPM [ "common-replaces", "additional-rpm-replaces" ]
Pacman [ "common-replaces", "additional-pacman-replaces" ]

And the section key is placed in Debian's section, as it's a Debian-specific option.

Is that acceptable?

@yakubin
Copy link
Contributor Author

yakubin commented Nov 18, 2020

Any updates? Does starting work on this feature make sense?

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

No branches or pull requests

1 participant