sieve-editor-gui: support darwin

Fugi 44af9e1f 790bfe7a

+47 -9
+47 -9
pkgs/by-name/si/sieve-editor-gui/package.nix
··· 1 { 2 lib, 3 buildNpmPackage, 4 fetchFromGitHub, 5 electron, ··· 7 nodePackages, 8 makeDesktopItem, 9 copyDesktopItems, 10 }: 11 buildNpmPackage { 12 pname = "sieve-editor-gui"; 13 version = "0.6.1-unstable-2025-03-12"; ··· 24 25 nativeBuildInputs = [ 26 electron 27 - copyDesktopItems 28 nodePackages.gulp 29 - ]; 30 31 dontNpmBuild = true; 32 ··· 36 37 installPhase = '' 38 runHook preInstall 39 mv build/ $out 40 runHook postInstall 41 ''; 42 ··· 54 }) 55 ]; 56 57 - postInstall = '' 58 - makeWrapper ${lib.getExe electron} $out/bin/sieve-editor-gui \ 59 - --add-flags $out/electron/resources/main_esm.js 60 - ''; 61 - 62 meta = { 63 description = "Activate, edit, delete and add Sieve scripts with a convenient interface"; 64 homepage = "https://github.com/thsmi/sieve"; 65 license = lib.licenses.agpl3Only; 66 - maintainers = with lib.maintainers; [ Silver-Golden ]; 67 - platforms = lib.platforms.linux; 68 mainProgram = "sieve-editor-gui"; 69 }; 70 }
··· 1 { 2 lib, 3 + stdenv, 4 buildNpmPackage, 5 fetchFromGitHub, 6 electron, ··· 8 nodePackages, 9 makeDesktopItem, 10 copyDesktopItems, 11 + runCommand, 12 + zip, 13 }: 14 + 15 + let 16 + electronArch = if stdenv.hostPlatform.isAarch64 then "arm64" else "x64"; 17 + electronZip = 18 + runCommand "electronZip" 19 + { 20 + nativeBuildInputs = [ zip ]; 21 + } 22 + '' 23 + mkdir $out 24 + 25 + cp -r ${electron.dist} electron-dist 26 + chmod -R u+w electron-dist 27 + 28 + cd electron-dist 29 + zip -0Xqr $out/electron-v${electron.version}-darwin-${electronArch}.zip . 30 + ''; 31 + in 32 + 33 buildNpmPackage { 34 pname = "sieve-editor-gui"; 35 version = "0.6.1-unstable-2025-03-12"; ··· 46 47 nativeBuildInputs = [ 48 electron 49 nodePackages.gulp 50 + ] 51 + ++ lib.optionals stdenv.hostPlatform.isLinux [ copyDesktopItems ]; 52 53 dontNpmBuild = true; 54 ··· 58 59 installPhase = '' 60 runHook preInstall 61 + '' 62 + + lib.optionalString stdenv.hostPlatform.isLinux '' 63 mv build/ $out 64 + 65 + makeWrapper ${lib.getExe electron} $out/bin/sieve-editor-gui \ 66 + --add-flags $out/electron/resources/main_esm.js 67 + '' 68 + + lib.optionalString stdenv.hostPlatform.isDarwin '' 69 + npx electron-packager ./build/electron/resources \ 70 + --electron-zip-dir ${electronZip} \ 71 + --electron-version ${electron.version} \ 72 + --icon src/common/icons/mac.icns 73 + 74 + mkdir -p $out/Applications 75 + cp -r sieve-darwin-*/sieve.app $out/Applications/ 76 + 77 + makeWrapper $out/Applications/sieve.app/Contents/MacOS/Sieve $out/bin/sieve-editor-gui 78 + '' 79 + + '' 80 runHook postInstall 81 ''; 82 ··· 94 }) 95 ]; 96 97 meta = { 98 description = "Activate, edit, delete and add Sieve scripts with a convenient interface"; 99 homepage = "https://github.com/thsmi/sieve"; 100 license = lib.licenses.agpl3Only; 101 + maintainers = with lib.maintainers; [ 102 + Silver-Golden 103 + fugi 104 + ]; 105 mainProgram = "sieve-editor-gui"; 106 + inherit (electron.meta) platforms; 107 }; 108 }