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: allow specifying recommended dependencies for deb target #7558

Merged
merged 3 commits into from
Apr 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/sixty-paws-rush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"app-builder-lib": minor
---

Add ability to specify recommended deb dependencies
14 changes: 14 additions & 0 deletions packages/app-builder-lib/scheme.json
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,20 @@
}
]
},
"recommends": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"description": "The [recommended package dependencies](https://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps).."
},
"synopsis": {
"description": "The [short description](https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Description).",
"type": [
Expand Down
5 changes: 5 additions & 0 deletions packages/app-builder-lib/src/options/linuxOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ export interface DebOptions extends LinuxTargetSpecificOptions {
*/
readonly depends?: Array<string> | null

/**
* The [recommended package dependencies](https://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps)..
*/
readonly recommends?: Array<string> | null

/**
* The [package category](https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Section).
*/
Expand Down
10 changes: 9 additions & 1 deletion packages/app-builder-lib/src/targets/FpmTarget.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { path7za } from "7zip-bin"
import { Arch, executeAppBuilder, getArchSuffix, log, TmpDir, toLinuxArchString, use, serializeToYaml } from "builder-util"
import { Arch, executeAppBuilder, getArchSuffix, log, TmpDir, toLinuxArchString, use, serializeToYaml, asArray } from "builder-util"
import { unlinkIfExists } from "builder-util/out/fs"
import { outputFile, stat } from "fs-extra"
import { mkdir, readFile } from "fs/promises"
Expand Down Expand Up @@ -196,6 +196,13 @@ export default class FpmTarget extends Target {
}
}

if (target === "deb") {
const recommends = (options as DebOptions).recommends
if (recommends) {
fpmConfiguration.customRecommends = asArray(recommends)
}
}

t3chguy marked this conversation as resolved.
Show resolved Hide resolved
use(packager.info.metadata.license, it => args.push("--license", it))
use(appInfo.buildNumber, it =>
args.push(
Expand Down Expand Up @@ -274,6 +281,7 @@ interface FpmConfiguration {
target: string
args: Array<string>
customDepends?: Array<string>
customRecommends?: Array<string>
compression?: string | null
}

Expand Down