mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
flatpak: remove references to systemd unit
Replaces #7676 When building as a flatpak, don't install the systemd user services since flatpaks can't use them. Remove references to the systemd service from the DBus service. Also, customize the app metadata depending on the debug mode. Co-authored-by: Leorize <leorize+oss@disroot.org>
This commit is contained in:

committed by
Mitchell Hashimoto

parent
81403f59ce
commit
ddada2fb3f
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<component type="desktop-application">
|
<component type="desktop-application">
|
||||||
<id>com.mitchellh.ghostty</id>
|
<id>com.mitchellh.ghostty@@DEBUG@@</id>
|
||||||
<launchable type="desktop-id">com.mitchellh.ghostty.desktop</launchable>
|
<launchable type="desktop-id">com.mitchellh.ghostty@@DEBUG@@.desktop</launchable>
|
||||||
<name>Ghostty</name>
|
<name>Ghostty</name>
|
||||||
<url type="homepage">https://ghostty.org</url>
|
<url type="homepage">https://ghostty.org</url>
|
||||||
<url type="help">https://ghostty.org/docs</url>
|
<url type="help">https://ghostty.org/docs</url>
|
||||||
|
@ -6,11 +6,7 @@ sdk-extensions:
|
|||||||
- org.freedesktop.Sdk.Extension.ziglang
|
- org.freedesktop.Sdk.Extension.ziglang
|
||||||
default-branch: tip
|
default-branch: tip
|
||||||
command: ghostty
|
command: ghostty
|
||||||
# Integrate the rename into zig build, maybe?
|
|
||||||
rename-desktop-file: com.mitchellh.ghostty.desktop
|
|
||||||
rename-appdata-file: com.mitchellh.ghostty.metainfo.xml
|
|
||||||
rename-icon: com.mitchellh.ghostty
|
rename-icon: com.mitchellh.ghostty
|
||||||
desktop-file-name-suffix: " (Debug)"
|
|
||||||
finish-args:
|
finish-args:
|
||||||
# 3D rendering
|
# 3D rendering
|
||||||
- --device=dri
|
- --device=dri
|
||||||
|
@ -258,6 +258,7 @@ pub fn init(b: *std.Build, cfg: *const Config) !GhosttyResources {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
// systemd user service
|
// systemd user service
|
||||||
|
if (!cfg.flatpak)
|
||||||
try steps.append(
|
try steps.append(
|
||||||
formatService(
|
formatService(
|
||||||
b,
|
b,
|
||||||
@ -277,10 +278,22 @@ pub fn init(b: *std.Build, cfg: *const Config) !GhosttyResources {
|
|||||||
);
|
);
|
||||||
|
|
||||||
// AppStream metainfo so that application has rich metadata within app stores
|
// AppStream metainfo so that application has rich metadata within app stores
|
||||||
try steps.append(&b.addInstallFile(
|
try steps.append(
|
||||||
|
formatService(
|
||||||
|
b,
|
||||||
|
cfg,
|
||||||
b.path("dist/linux/com.mitchellh.ghostty.metainfo.xml"),
|
b.path("dist/linux/com.mitchellh.ghostty.metainfo.xml"),
|
||||||
"share/metainfo/com.mitchellh.ghostty.metainfo.xml",
|
b.fmt(
|
||||||
).step);
|
"share/metainfo/com.mitchellh.ghostty{s}.metainfo.xml",
|
||||||
|
.{
|
||||||
|
switch (cfg.optimize) {
|
||||||
|
.Debug, .ReleaseSafe => "-debug",
|
||||||
|
.ReleaseFast, .ReleaseSmall => "",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
// Right click menu action for Plasma desktop
|
// Right click menu action for Plasma desktop
|
||||||
try steps.append(&b.addInstallFile(
|
try steps.append(&b.addInstallFile(
|
||||||
@ -360,7 +373,7 @@ pub fn formatService(b: *std.Build, cfg: *const Config, src: std.Build.LazyPath,
|
|||||||
"-e s!@@NAME@@!{s}!g",
|
"-e s!@@NAME@@!{s}!g",
|
||||||
.{
|
.{
|
||||||
switch (cfg.optimize) {
|
switch (cfg.optimize) {
|
||||||
.Debug, .ReleaseSafe => " Debug",
|
.Debug, .ReleaseSafe => " (Debug)",
|
||||||
.ReleaseFast, .ReleaseSmall => "",
|
.ReleaseFast, .ReleaseSmall => "",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -378,6 +391,8 @@ pub fn formatService(b: *std.Build, cfg: *const Config, src: std.Build.LazyPath,
|
|||||||
"-e s!@@GHOSTTY@@!{s}/bin/ghostty!g",
|
"-e s!@@GHOSTTY@@!{s}/bin/ghostty!g",
|
||||||
.{b.install_prefix},
|
.{b.install_prefix},
|
||||||
));
|
));
|
||||||
|
if (cfg.flatpak)
|
||||||
|
cmd.addArg("-e /^SystemdService=/d");
|
||||||
|
|
||||||
return &b.addInstallFile(output, dest).step;
|
return &b.addInstallFile(output, dest).step;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user