Skip to content

Commit

Permalink
fix sharkey package: use pnpm_9
Browse files Browse the repository at this point in the history
  • Loading branch information
sodiboo committed Jan 18, 2025
1 parent dadd40f commit e99b0ad
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions sharkey/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
vips,
moreutils,
cacert,
nodePackages,
pnpm_9,
nodejs,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "sharkey";
Expand All @@ -29,17 +30,15 @@ stdenv.mkDerivation (finalAttrs: {
fetchSubmodules = true;
};

# NOTE: This requires pnpm 8.10.0 or newer
# https://github.com/pnpm/pnpm/pull/7214
pnpmDeps = assert lib.versionAtLeast nodePackages.pnpm.version "8.10.0";
pnpmDeps =
stdenv.mkDerivation {
pname = "${finalAttrs.pname}-pnpm-deps";
inherit (finalAttrs) src version;

nativeBuildInputs = [
jq
moreutils
nodePackages.pnpm
pnpm_9
cacert
];

Expand Down Expand Up @@ -67,8 +66,8 @@ stdenv.mkDerivation (finalAttrs: {

nativeBuildInputs = [
copyDesktopItems
nodePackages.pnpm
nodePackages.nodejs
pnpm_9
nodejs
makeWrapper
python3
pkg-config
Expand All @@ -85,7 +84,7 @@ stdenv.mkDerivation (finalAttrs: {
export HOME=$(mktemp -d)
export STORE_PATH=$(mktemp -d)
export npm_config_nodedir=${nodePackages.nodejs}
export npm_config_nodedir=${nodejs}
cp -Tr "$pnpmDeps" "$STORE_PATH"
chmod -R +w "$STORE_PATH"
Expand Down Expand Up @@ -126,8 +125,8 @@ stdenv.mkDerivation (finalAttrs: {

binPath = lib.makeBinPath [
bash
nodePackages.pnpm
nodePackages.nodejs
pnpm_9
nodejs
];
in ''
runHook preInstall
Expand All @@ -140,7 +139,7 @@ stdenv.mkDerivation (finalAttrs: {
# https://gist.github.com/MikaelFangel/2c36f7fd07ca50fac5a3255fa1992d1a
makeWrapper ${nodePackages.pnpm}/bin/pnpm $out/bin/sharkey \
makeWrapper ${lib.getExe pnpm_9} $out/bin/sharkey \
--chdir $out/Sharkey \
--prefix PATH : ${binPath} \
--prefix LD_LIBRARY_PATH : ${libPath}
Expand Down

0 comments on commit e99b0ad

Please sign in to comment.