archi: install icon and desktop file (#383703)

This commit is contained in:
Aleksana
2025-04-19 20:16:33 +08:00
committed by GitHub
+27
View File
@@ -11,6 +11,8 @@
wrapGAppsHook3,
_7zz,
nixosTests,
copyDesktopItems,
makeDesktopItem,
}:
stdenv.mkDerivation rec {
@@ -48,6 +50,7 @@ stdenv.mkDerivation rec {
]
++ lib.optionals stdenv.hostPlatform.isLinux [
autoPatchelfHook
copyDesktopItems
];
sourceRoot = if stdenv.hostPlatform.isDarwin then "." else null;
@@ -55,6 +58,8 @@ stdenv.mkDerivation rec {
installPhase =
if stdenv.hostPlatform.system == "x86_64-linux" then
''
runHook preInstall
mkdir -p $out/bin $out/libexec
for f in configuration features p2 plugins Archi.ini; do
cp -r $f $out/libexec
@@ -70,13 +75,35 @@ stdenv.mkDerivation rec {
} \
--set WEBKIT_DISABLE_DMABUF_RENDERER 1 \
--prefix PATH : ${jdk}/bin
install -Dm444 icon.xpm $out/share/icons/hicolor/256x256/apps/archi.xpm
runHook postInstall
''
else
''
runHook preInstall
mkdir -p "$out/Applications"
mv Archi.app "$out/Applications/"
runHook postInstall
'';
desktopItems = [
(makeDesktopItem {
name = "archi";
desktopName = "Archi";
exec = "Archi";
type = "Application";
comment = meta.description;
icon = "archi";
categories = [
"Development"
];
})
];
passthru.updateScript = ./update.sh;
passthru.tests = { inherit (nixosTests) archi; };