Unverified Commit 6803bb02 authored by isabel's avatar isabel Committed by GitHub
Browse files

hubstaff: create .desktop file (#483220)

parents 4483c851 d6f0aaa2
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -26,6 +26,8 @@
  writeShellScript,
  common-updater-scripts,
  xmlstarlet,
  makeDesktopItem,
  copyDesktopItems,
}:

let
@@ -67,6 +69,7 @@ stdenv.mkDerivation {
  nativeBuildInputs = [
    unzip
    makeWrapper
    copyDesktopItems
  ];

  unpackCmd = ''
@@ -81,7 +84,23 @@ stdenv.mkDerivation {

  dontBuild = true;

  # Upstream doesn't seem to have a desktop item out of the box
  desktopItems = [
    (makeDesktopItem {
      name = "netsoft-com.netsoft.hubstaff";
      desktopName = "Hubstaff";
      exec = "HubstaffClient";
      icon = "hubstaff";
      comment = "Time tracking software";
      categories = [
        "Office"
        "ProjectManagement"
      ];
    })
  ];

  installPhase = ''
    runHook preInstall
    # remove files for 32-bit arch to skip building for this arch
    # but add -f flag to not fail if files were not found (new versions dont provide 32-bit arch)
    rm -rf x86 x86_64/lib64
@@ -100,6 +119,7 @@ stdenv.mkDerivation {

    # Why is this needed? SEGV otherwise.
    ln -s $opt/data/resources $opt/x86_64/resources
    runHook postInstall
  '';

  # to test run: