yaak: added darwin support; fix version (#409672)

authored by Aleksana and committed by GitHub a9a7f9af fd2e9003

+40 -19
+40 -19
pkgs/by-name/ya/yaak/package.nix
··· 19 19 perl, 20 20 makeWrapper, 21 21 nix-update-script, 22 + stdenv, 22 23 }: 23 24 24 25 rustPlatform.buildRustPackage (finalAttrs: { ··· 54 55 makeWrapper 55 56 ]; 56 57 57 - buildInputs = [ 58 - glib 59 - gtk3 60 - openssl 61 - webkitgtk_4_1 62 - pango 63 - cairo 64 - pixman 65 - ]; 58 + buildInputs = 59 + [ 60 + glib 61 + gtk3 62 + openssl 63 + pango 64 + cairo 65 + pixman 66 + ] 67 + ++ lib.optionals stdenv.hostPlatform.isLinux [ 68 + webkitgtk_4_1 69 + ]; 66 70 67 71 env.ELECTRON_SKIP_BINARY_DOWNLOAD = "1"; 68 72 69 73 postPatch = '' 70 74 substituteInPlace src-tauri/tauri.conf.json \ 71 - --replace-fail '"createUpdaterArtifacts": "v1Compatible"' '"createUpdaterArtifacts": false' 75 + --replace-fail '"createUpdaterArtifacts": "v1Compatible"' '"createUpdaterArtifacts": false' \ 76 + --replace-fail '"0.0.0"' '"${finalAttrs.version}"' 72 77 substituteInPlace package.json \ 73 78 --replace-fail '"bootstrap:vendor-node": "node scripts/vendor-node.cjs",' "" \ 74 79 --replace-fail '"bootstrap:vendor-protoc": "node scripts/vendor-protoc.cjs",' "" 75 80 ''; 76 81 77 - preBuild = '' 78 - mkdir -p src-tauri/vendored/node 79 - ln -s ${nodejs}/bin/node src-tauri/vendored/node/yaaknode-x86_64-unknown-linux-gnu 80 - mkdir -p src-tauri/vendored/protoc 81 - ln -s ${protobuf}/bin/protoc src-tauri/vendored/protoc/yaakprotoc-x86_64-unknown-linux-gnu 82 - ln -s ${protobuf}/include src-tauri/vendored/protoc/include 83 - ''; 82 + preBuild = 83 + let 84 + archPlatforms = 85 + { 86 + "aarch64-darwin" = "aarch64-apple-darwin"; 87 + "x86_64-darwin" = "x86_64-apple-darwin"; 88 + "aarch64-linux" = "aarch64-unknown-linux-gnu"; 89 + "x86_64-linux" = "x86_64-unknown-linux-gnu"; 90 + } 91 + .${stdenv.hostPlatform.system}; 92 + in 93 + '' 94 + mkdir -p src-tauri/vendored/node 95 + ln -s ${nodejs}/bin/node src-tauri/vendored/node/yaaknode-${archPlatforms} 96 + mkdir -p src-tauri/vendored/protoc 97 + ln -s ${protobuf}/bin/protoc src-tauri/vendored/protoc/yaakprotoc-${archPlatforms} 98 + ln -s ${protobuf}/include src-tauri/vendored/protoc/include 99 + ''; 84 100 85 101 # Permission denied (os error 13) 86 102 # write to src-tauri/vendored/protoc/include ··· 90 106 91 107 postInstall = "popd"; 92 108 93 - postFixup = '' 109 + postFixup = lib.optionalString stdenv.hostPlatform.isLinux '' 94 110 wrapProgram $out/bin/yaak-app \ 95 111 --inherit-argv0 \ 96 112 --set-default WEBKIT_DISABLE_DMABUF_RENDERER 1 ··· 105 121 license = lib.licenses.mit; 106 122 maintainers = with lib.maintainers; [ redyf ]; 107 123 mainProgram = "yaak"; 108 - platforms = [ "x86_64-linux" ]; 124 + platforms = [ 125 + "x86_64-linux" 126 + "aarch64-linux" 127 + "x86_64-darwin" 128 + "aarch64-darwin" 129 + ]; 109 130 }; 110 131 })