about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/misc/cutecom/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/tools/misc/cutecom/default.nix')
-rw-r--r--nixpkgs/pkgs/tools/misc/cutecom/default.nix21
1 files changed, 14 insertions, 7 deletions
diff --git a/nixpkgs/pkgs/tools/misc/cutecom/default.nix b/nixpkgs/pkgs/tools/misc/cutecom/default.nix
index b3d412b8fda0..1d264926fd7c 100644
--- a/nixpkgs/pkgs/tools/misc/cutecom/default.nix
+++ b/nixpkgs/pkgs/tools/misc/cutecom/default.nix
@@ -1,6 +1,6 @@
-{ mkDerivation, lib, fetchFromGitLab, qtbase, qtserialport, cmake }:
+{ stdenv, lib, fetchFromGitLab, qtserialport, cmake, wrapQtAppsHook }:
 
-mkDerivation rec {
+stdenv.mkDerivation rec {
   pname = "cutecom";
   version = "0.51.0+patch";
 
@@ -11,10 +11,17 @@ mkDerivation rec {
     sha256 = "X8jeESt+x5PxK3rTNC1h1Tpvue2WH09QRnG2g1eMoEE=";
   };
 
-  buildInputs = [ qtbase qtserialport ];
-  nativeBuildInputs = [ cmake ];
+  postPatch = ''
+    substituteInPlace CMakeLists.txt \
+      --replace "/Applications" "$out/Applications"
+  '';
+
+  buildInputs = [ qtserialport ];
+  nativeBuildInputs = [ cmake wrapQtAppsHook ];
 
-  postInstall = ''
+  postInstall = if stdenv.isDarwin then ''
+    mkdir -p $out/Applications
+  '' else ''
     cd ..
     mkdir -p "$out"/share/{applications,icons/hicolor/scalable/apps,man/man1}
     cp cutecom.desktop "$out/share/applications"
@@ -25,8 +32,8 @@ mkDerivation rec {
   meta = with lib; {
     description = "A graphical serial terminal";
     homepage = "https://gitlab.com/cutecom/cutecom/";
-    license = licenses.gpl3;
+    license = licenses.gpl3Plus;
     maintainers = with maintainers; [ bennofs ];
-    platforms = platforms.linux;
+    platforms = platforms.unix;
   };
 }