mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-07 21:43:32 +00:00
571c71e6f7
We are migrating packages that meet below requirements: 1. using `callPackage` 2. called path is a directory 3. overriding set is empty (`{ }`) 4. not containing path expressions other than relative path (to makenixpkgs-vet happy) 5. not referenced by nix files outside of the directory, other than`pkgs/top-level/all-packages.nix` 6. not referencing nix files outside of the directory 7. not referencing `default.nix` (since it's changed to `package.nix`) 8. `outPath` doesn't change after migration The tool is here: https://github.com/Aleksanaa/by-name-migrate.
49 lines
1.1 KiB
Nix
49 lines
1.1 KiB
Nix
{ lib
|
|
, mkYarnPackage
|
|
, fetchFromGitHub
|
|
, fetchYarnDeps
|
|
}:
|
|
|
|
mkYarnPackage rec {
|
|
pname = "asar";
|
|
version = "3.2.4";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "electron";
|
|
repo = "asar";
|
|
rev = "v${version}";
|
|
hash = "sha256-12FP8VRDo1PQ+tiN4zhzkcfAx9zFs/0MU03t/vFo074=";
|
|
};
|
|
|
|
packageJSON = ./package.json;
|
|
|
|
offlineCache = fetchYarnDeps {
|
|
yarnLock = "${src}/yarn.lock";
|
|
hash = "sha256-/fV3hd98pl46+fgmiMH9sDQrrZgdLY1oF9c3TaIxRSg=";
|
|
};
|
|
|
|
doDist = false;
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
|
|
mkdir -p "$out/lib/node_modules"
|
|
mv deps/@electron "$out/lib/node_modules"
|
|
rm "$out/lib/node_modules/@electron/asar/node_modules"
|
|
mv node_modules "$out/lib/node_modules/@electron/asar"
|
|
|
|
mkdir "$out/bin"
|
|
ln -s "$out/lib/node_modules/@electron/asar/bin/asar.js" "$out/bin/asar"
|
|
|
|
runHook postInstall
|
|
'';
|
|
|
|
meta = {
|
|
description = "Simple extensive tar-like archive format with indexing";
|
|
homepage = "https://github.com/electron/asar";
|
|
license = lib.licenses.mit;
|
|
mainProgram = "asar";
|
|
maintainers = with lib.maintainers; [ xvapx ];
|
|
};
|
|
}
|