yaak: added darwin support; fix version (#409672)
This commit is contained in:
commit
a9a7f9afce
@ -19,6 +19,7 @@
|
|||||||
perl,
|
perl,
|
||||||
makeWrapper,
|
makeWrapper,
|
||||||
nix-update-script,
|
nix-update-script,
|
||||||
|
stdenv,
|
||||||
}:
|
}:
|
||||||
|
|
||||||
rustPlatform.buildRustPackage (finalAttrs: {
|
rustPlatform.buildRustPackage (finalAttrs: {
|
||||||
@ -54,31 +55,46 @@ rustPlatform.buildRustPackage (finalAttrs: {
|
|||||||
makeWrapper
|
makeWrapper
|
||||||
];
|
];
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs =
|
||||||
|
[
|
||||||
glib
|
glib
|
||||||
gtk3
|
gtk3
|
||||||
openssl
|
openssl
|
||||||
webkitgtk_4_1
|
|
||||||
pango
|
pango
|
||||||
cairo
|
cairo
|
||||||
pixman
|
pixman
|
||||||
|
]
|
||||||
|
++ lib.optionals stdenv.hostPlatform.isLinux [
|
||||||
|
webkitgtk_4_1
|
||||||
];
|
];
|
||||||
|
|
||||||
env.ELECTRON_SKIP_BINARY_DOWNLOAD = "1";
|
env.ELECTRON_SKIP_BINARY_DOWNLOAD = "1";
|
||||||
|
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
substituteInPlace src-tauri/tauri.conf.json \
|
substituteInPlace src-tauri/tauri.conf.json \
|
||||||
--replace-fail '"createUpdaterArtifacts": "v1Compatible"' '"createUpdaterArtifacts": false'
|
--replace-fail '"createUpdaterArtifacts": "v1Compatible"' '"createUpdaterArtifacts": false' \
|
||||||
|
--replace-fail '"0.0.0"' '"${finalAttrs.version}"'
|
||||||
substituteInPlace package.json \
|
substituteInPlace package.json \
|
||||||
--replace-fail '"bootstrap:vendor-node": "node scripts/vendor-node.cjs",' "" \
|
--replace-fail '"bootstrap:vendor-node": "node scripts/vendor-node.cjs",' "" \
|
||||||
--replace-fail '"bootstrap:vendor-protoc": "node scripts/vendor-protoc.cjs",' ""
|
--replace-fail '"bootstrap:vendor-protoc": "node scripts/vendor-protoc.cjs",' ""
|
||||||
'';
|
'';
|
||||||
|
|
||||||
preBuild = ''
|
preBuild =
|
||||||
|
let
|
||||||
|
archPlatforms =
|
||||||
|
{
|
||||||
|
"aarch64-darwin" = "aarch64-apple-darwin";
|
||||||
|
"x86_64-darwin" = "x86_64-apple-darwin";
|
||||||
|
"aarch64-linux" = "aarch64-unknown-linux-gnu";
|
||||||
|
"x86_64-linux" = "x86_64-unknown-linux-gnu";
|
||||||
|
}
|
||||||
|
.${stdenv.hostPlatform.system};
|
||||||
|
in
|
||||||
|
''
|
||||||
mkdir -p src-tauri/vendored/node
|
mkdir -p src-tauri/vendored/node
|
||||||
ln -s ${nodejs}/bin/node src-tauri/vendored/node/yaaknode-x86_64-unknown-linux-gnu
|
ln -s ${nodejs}/bin/node src-tauri/vendored/node/yaaknode-${archPlatforms}
|
||||||
mkdir -p src-tauri/vendored/protoc
|
mkdir -p src-tauri/vendored/protoc
|
||||||
ln -s ${protobuf}/bin/protoc src-tauri/vendored/protoc/yaakprotoc-x86_64-unknown-linux-gnu
|
ln -s ${protobuf}/bin/protoc src-tauri/vendored/protoc/yaakprotoc-${archPlatforms}
|
||||||
ln -s ${protobuf}/include src-tauri/vendored/protoc/include
|
ln -s ${protobuf}/include src-tauri/vendored/protoc/include
|
||||||
'';
|
'';
|
||||||
|
|
||||||
@ -90,7 +106,7 @@ rustPlatform.buildRustPackage (finalAttrs: {
|
|||||||
|
|
||||||
postInstall = "popd";
|
postInstall = "popd";
|
||||||
|
|
||||||
postFixup = ''
|
postFixup = lib.optionalString stdenv.hostPlatform.isLinux ''
|
||||||
wrapProgram $out/bin/yaak-app \
|
wrapProgram $out/bin/yaak-app \
|
||||||
--inherit-argv0 \
|
--inherit-argv0 \
|
||||||
--set-default WEBKIT_DISABLE_DMABUF_RENDERER 1
|
--set-default WEBKIT_DISABLE_DMABUF_RENDERER 1
|
||||||
@ -105,6 +121,11 @@ rustPlatform.buildRustPackage (finalAttrs: {
|
|||||||
license = lib.licenses.mit;
|
license = lib.licenses.mit;
|
||||||
maintainers = with lib.maintainers; [ redyf ];
|
maintainers = with lib.maintainers; [ redyf ];
|
||||||
mainProgram = "yaak";
|
mainProgram = "yaak";
|
||||||
platforms = [ "x86_64-linux" ];
|
platforms = [
|
||||||
|
"x86_64-linux"
|
||||||
|
"aarch64-linux"
|
||||||
|
"x86_64-darwin"
|
||||||
|
"aarch64-darwin"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user