package.nix (1476B)
1 { 2 lib, 3 stdenv, 4 fetchFromGitHub, 5 copyDesktopItems, 6 makeDesktopItem, 7 qt5, 8 }: 9 10 stdenv.mkDerivation (finalAttrs: { 11 pname = "qiec104"; 12 version = "1.1.1"; 13 14 src = fetchFromGitHub { 15 owner = "MicroKoder"; 16 repo = "QIEC104"; 17 tag = "v${finalAttrs.version}"; 18 hash = "sha256-/kIAWxeJATKSEqXfRA3/6+TbHVeaIWZqsMYumvj2OuU="; 19 }; 20 21 nativeBuildInputs = [ 22 qt5.qmake 23 qt5.wrapQtAppsHook 24 ] 25 ++ lib.optional stdenv.hostPlatform.isLinux copyDesktopItems; 26 27 desktopItems = [ 28 (makeDesktopItem { 29 name = "qiec104"; 30 desktopName = "Q104"; 31 comment = finalAttrs.meta.description; 32 exec = finalAttrs.meta.mainProgram; 33 icon = "Q104"; 34 terminal = false; 35 categories = [ "Utility" ]; 36 }) 37 ]; 38 39 installPhase = '' 40 runHook preInstall 41 42 ${lib.optionalString stdenv.hostPlatform.isLinux '' 43 install -Dm755 Q104 -t $out/bin 44 install -Dm644 icons/Q104.png -t $out/share/icons/hicolor/128x128/apps 45 ''} 46 47 ${lib.optionalString stdenv.hostPlatform.isDarwin '' 48 mkdir -p $out/{Applications,bin} 49 mv Q104.app $out/Applications 50 ln -s $out/Applications/Q104.app/Contents/MacOS/Q104 $out/bin/Q104 51 ''} 52 53 runHook postInstall 54 ''; 55 56 meta = { 57 description = "Small IEC104 client"; 58 homepage = "https://github.com/MicroKoder/QIEC104"; 59 license = lib.licenses.mit; 60 maintainers = [ lib.maintainers.sikmir ]; 61 platforms = lib.platforms.unix; 62 mainProgram = "Q104"; 63 }; 64 })
