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

feat(pacman): Add support for Arch Linux Packaging #137

Merged
merged 18 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changes/add-pacman-support.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"cargo-packager": minor
"@crabnebula/packager": minor
---

Add Arch Linux package manager, `pacman` support for cargo packager.
64 changes: 2 additions & 62 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

77 changes: 76 additions & 1 deletion bindings/packager/nodejs/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,17 @@
}
]
},
"pacman": {
"description": "Pacman configuration.",
"anyOf": [
{
"$ref": "#/definitions/PacmanConfig"
},
{
"type": "null"
}
]
},
"wix": {
"description": "WiX configuration.",
"anyOf": [
Expand Down Expand Up @@ -434,6 +445,13 @@
"enum": [
"appimage"
]
},
{
"description": "The Linux Pacman bundle (PKGBUILD)",
"type": "string",
"enum": [
"pacman"
]
}
]
},
Expand Down Expand Up @@ -723,7 +741,7 @@
]
},
"section": {
"description": "Define the section in Debian Control file. See : https://www.debian.org/doc/debian-policy/ch-archive.html#s-subsections",
"description": "Define the section in Debian Control file. See : <https://www.debian.org/doc/debian-policy/ch-archive.html#s-subsections>",
"type": [
"string",
"null"
Expand Down Expand Up @@ -796,6 +814,63 @@
},
"additionalProperties": false
},
"PacmanConfig": {
"description": "The Linux pacman configuration.",
"type": "object",
"properties": {
"depends": {
"description": "List of Pacman dependencies.",
"type": [
"array",
"null"
],
"items": {
"type": "string"
}
},
"provides": {
"description": "Additional packages that are provided by this app.",
"type": [
"array",
"null"
],
"items": {
"type": "string"
}
},
"conflicts": {
"description": "Packages that conflict with the app.",
"type": [
"array",
"null"
],
"items": {
"type": "string"
}
},
"replaces": {
"description": "Only use if this app replaces some obsolete packages",
"type": [
"array",
"null"
],
"items": {
"type": "string"
}
},
"source": {
"description": "Source of the package to be stored at PKGBUILD. PKGBUILD is a bash script, so version can be referred as ${pkgver}",
"type": [
"array",
"null"
],
"items": {
"type": "string"
}
}
},
"additionalProperties": false
},
"WixConfig": {
"description": "The wix format configuration",
"type": "object",
Expand Down
35 changes: 32 additions & 3 deletions bindings/packager/nodejs/src-ts/config.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export type LogLevel = "error" | "warn" | "info" | "debug" | "trace";
/**
* The type of the package we're packaging.
*/
export type PackageFormat = "all" | "default" | "app" | "dmg" | "wix" | "nsis" | "deb" | "appimage";
export type PackageFormat = "all" | "default" | "app" | "dmg" | "wix" | "nsis" | "deb" | "appimage" | "pacman";
/**
* The possible app categories. Corresponds to `LSApplicationCategoryType` on macOS and the GNOME desktop categories on Debian.
*/
Expand Down Expand Up @@ -264,6 +264,10 @@ export interface Config {
* AppImage configuration.
*/
appimage?: AppImageConfig | null;
/**
* Pacman configuration.
*/
pacman?: PacmanConfig | null;
/**
* WiX configuration.
*/
Expand Down Expand Up @@ -408,11 +412,11 @@ export interface DebianConfig {
*/
desktopTemplate?: string | null;
/**
* Define the section in Debian Control file. See : https://www.debian.org/doc/debian-policy/ch-archive.html#s-subsections
* Define the section in Debian Control file. See : <https://www.debian.org/doc/debian-policy/ch-archive.html#s-subsections>
*/
section?: string | null;
/**
* Change the priority of the Debian Package. By default, it is set to `optional`. Recognized Priorities as of now are : `required`, `important`, `standard`, `optional`, extra
* Change the priority of the Debian Package. By default, it is set to `optional`. Recognized Priorities as of now are : `required`, `important`, `standard`, `optional`, `extra`
*/
priority?: string | null;
/**
Expand Down Expand Up @@ -447,6 +451,31 @@ export interface AppImageConfig {
[k: string]: string;
} | null;
}
/**
* The Linux pacman configuration.
*/
export interface PacmanConfig {
/**
* List of Pacman dependencies.
*/
depends?: string[] | null;
/**
* Additional packages that are provided by this app.
*/
provides?: string[] | null;
/**
* Packages that conflict with the app.
*/
conflicts?: string[] | null;
/**
* Only use if this app replaces some obsolete packages
*/
replaces?: string[] | null;
/**
* Source of the package to be stored at PKGBUILD. PKGBUILD is a bash script, so version can be referred as ${pkgver}
*/
source?: string[] | null;
}
/**
* The wix format configuration
*/
Expand Down
2 changes: 1 addition & 1 deletion crates/packager/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ walkdir = "2"
os_pipe = "1"
minisign = "0.7"
tar = { workspace = true }
libflate = "2.0"
flate2 = "1.0"
strsim = "0.10"
schemars = { workspace = true, optional = true }
native-tls = { version = "0.2", optional = true }
Expand Down
Loading
Loading