1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-09-11 15:08:33 +01:00

kiwitalk: use pnpm.fetchDeps

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
Sefa Eyeoglu 2024-05-05 12:34:40 +02:00
parent 3b2e68d242
commit 18b124840f
No known key found for this signature in database
GPG key ID: E13DFD4B47127951
2 changed files with 12 additions and 50 deletions

View file

@ -2,7 +2,6 @@
, fetchFromGitHub
, copyDesktopItems
, stdenv
, stdenvNoCC
, rustc
, rustPlatform
, cargo
@ -12,20 +11,18 @@
, webkitgtk
, pkg-config
, makeDesktopItem
, jq
, moreutils
, nodePackages
, cacert
, pnpm
, nodejs
}:
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "kiwitalk";
version = "0.5.1";
src = fetchFromGitHub {
owner = "KiwiTalk";
repo = "KiwiTalk";
rev = "v${version}";
rev = "v${finalAttrs.version}";
hash = "sha256-Th8q+Zbc102fIk2v7O3OOeSriUV/ydz60QwxzmS7AY8=";
};
@ -34,43 +31,9 @@ stdenv.mkDerivation rec {
--replace "libayatana-appindicator3.so.1" "${libayatana-appindicator}/lib/libayatana-appindicator3.so.1"
'';
pnpm-deps = stdenvNoCC.mkDerivation {
pname = "${pname}-pnpm-deps";
inherit src version;
nativeBuildInputs = [
jq
moreutils
nodePackages.pnpm
cacert
];
installPhase = ''
export HOME=$(mktemp -d)
pnpm config set store-dir $out
# This version of the package has different versions of esbuild as a dependency.
# You can use the command below to get esbuild binaries for a specific platform and calculate hashes for that platforms. (linux, darwin for os, and x86, arm64, ia32 for cpu)
# cat package.json | jq '.pnpm.supportedArchitectures += { "os": ["linux"], "cpu": ["arm64"] }' | sponge package.json
pnpm install --frozen-lockfile --ignore-script
# Remove timestamp and sort the json files.
rm -rf $out/v3/tmp
for f in $(find $out -name "*.json"); do
sed -i -E -e 's/"checkedAt":[0-9]+,//g' $f
jq --sort-keys . $f | sponge $f
done
'';
dontBuild = true;
dontFixup = true;
outputHashMode = "recursive";
outputHash = {
x86_64-linux = "sha256-LJPjWNpVfdUu8F5BMhAzpTo/h6ax7lxY2EESHj5P390=";
aarch64-linux = "sha256-N1K4pV5rbWmO/KonvYegzBoWa6TYQIqhQyxH/sWjOJQ=";
i686-linux = "sha256-/Q7VZahYhLdKVFB25CanROYxD2etQOcRg+4bXZUMqTc=";
x86_64-darwin = "sha256-9biFAbFD7Bva7KPKztgCvcaoX8E6AlJBKkjlDQdP6Zw=";
aarch64-darwin = "sha256-to5Y0R9tm9b7jUQAK3eBylLhpu+w5oDd63FbBCBAvd8=";
}.${stdenv.system} or (throw "Unsupported system: ${stdenv.system}");
pnpmDeps = pnpm.fetchDeps {
inherit (finalAttrs) pname version src;
hash = "sha256-gf3vmKUta8KksUOxyhQS4UO6ycAJDfEicyXVGMW8+4c=";
};
cargoDeps = rustPlatform.importCargoLock {
@ -86,7 +49,8 @@ stdenv.mkDerivation rec {
cargo
rustc
cargo-tauri
nodePackages.pnpm
nodejs
pnpm.configHook
copyDesktopItems
pkg-config
];
@ -98,10 +62,6 @@ stdenv.mkDerivation rec {
];
preBuild = ''
export HOME=$(mktemp -d)
pnpm config set store-dir ${pnpm-deps}
pnpm install --offline --frozen-lockfile --ignore-script
pnpm rebuild
cargo tauri build -b deb
'';
@ -131,4 +91,4 @@ stdenv.mkDerivation rec {
platforms = platforms.linux ++ platforms.darwin;
mainProgram = "kiwi-talk";
};
}
})

View file

@ -32126,6 +32126,8 @@ with pkgs;
kitsas = libsForQt5.callPackage ../applications/office/kitsas { };
kiwitalk = callPackage ../by-name/ki/kiwitalk/package.nix { pnpm = pnpm_8; };
kiwix = libsForQt5.callPackage ../applications/misc/kiwix { };
kiwix-tools = callPackage ../applications/misc/kiwix/tools.nix { };