Skip to content
This repository was archived by the owner on Aug 10, 2025. It is now read-only.

Commit f823802

Browse files
committed
fix: packaging: don't install desktop files manually
1 parent babbea3 commit f823802

File tree

2 files changed

+26
-17
lines changed

2 files changed

+26
-17
lines changed

build/arch/PKGBUILD

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ build() {
5555

5656
package() {
5757
mkdir -p $pkgdir/usr/bin
58+
mkdir -p $pkgdir/usr/share
59+
mkdir -p $pkgdir/usr/share/applications
5860
mkdir -p $pkgdir/usr/share/licenses
5961
mkdir -p $pkgdir/usr/share/licenses/$pkgname
6062

@@ -63,4 +65,7 @@ package() {
6365

6466
install -Dm644 "equinox/LICENSE" $pkgdir/usr/share/licenses/$pkgname/LICENSE
6567
install -Dm644 "equinox/README.md" $pkgdir/usr/share/licenses/$pkgname/README.md
68+
69+
install -Dm644 "equinox/src/gui/equinox.desktop" $pkgdir/usr/share/applications/equinox.desktop
70+
install -Dm644 "equinox/src/gui/equinox_shell.desktop" $pkgdir/usr/share/applications/equinox_shell.desktop
6671
}

src/gui/desktop_files.nim

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import std/[logging, os, strutils]
2+
import ./envparser
23

34
const
45
MimeTemplate =
@@ -36,26 +37,29 @@ Exec=$1 shell
3637
"""
3738

3839
proc ensureDirsExist*(): string {.sideEffect.} =
39-
var buf = newStringOfCap(32)
40-
buf &= getHomeDir()
40+
if equinoxBin.len < 1:
41+
var buf = newStringOfCap(32)
42+
buf &= getHomeDir()
4143

42-
for path in [".local", "share", "applications"]:
43-
buf &= '/' & path
44-
discard existsOrCreateDir(buf)
44+
for path in [".local", "share", "applications"]:
45+
buf &= '/' & path
46+
discard existsOrCreateDir(buf)
4547

46-
ensureMove(buf)
48+
return ensureMove(buf)
4749

4850
proc createMimeHandlerEntry*() =
49-
debug "desktop_files: creating MIME handler entry"
50-
writeFile(
51-
ensureDirsExist() / "equinox-mime.desktop", MimeTemplate % [getAppFilename()]
52-
)
51+
if equinoxBin.len < 1:
52+
debug "desktop_files: creating MIME handler entry"
53+
writeFile(
54+
ensureDirsExist() / "equinox-mime.desktop", MimeTemplate % [getAppFilename()]
55+
)
5356

5457
proc createDesktopEntries*() =
55-
debug "desktop_files: creating desktop entry for equinox"
56-
writeFile(
57-
ensureDirsExist() / "equinox.desktop", DesktopEntryTemplate % [getAppFilename()]
58-
)
59-
writeFile(
60-
ensureDirsExist() / "equinox_shell.desktop", DesktopEntryShell % [getAppFilename()]
61-
)
58+
if equinoxBin.len < 1:
59+
debug "desktop_files: creating desktop entry for equinox"
60+
writeFile(
61+
ensureDirsExist() / "equinox.desktop", DesktopEntryTemplate % [getAppFilename()]
62+
)
63+
writeFile(
64+
ensureDirsExist() / "equinox_shell.desktop", DesktopEntryShell % [getAppFilename()]
65+
)

0 commit comments

Comments
 (0)