Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions mods/pkgs/mdctl-alpha/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ let
json = fromJSON (readFile ./package.json);
pname = replaceStrings [ "@" "/" ] [ "" "-" ] (head (attrNames json.dependencies));
version = head (attrValues json.dependencies);
keytarRuntimeLibs = lib.optionals stdenv.isLinux [
libsecret
glib
stdenv.cc.cc.lib
zlib
openssl
libffi
pcre2
];
linuxRpath = lib.makeLibraryPath keytarRuntimeLibs;
modules = (yarn2nix.mkYarnModules {
inherit version;
pname = "${pname}-modules";
Expand All @@ -19,6 +29,7 @@ let
] ++ lib.optionals stdenv.isLinux [
libsecret
glib
patchelf
] ++ osSpecific;
};
sqlite3.buildInputs = [ python3 pkg-config ];
Expand All @@ -30,6 +41,19 @@ let
'';
}).overrideAttrs (old: {
NODE_EXTRA_CA_CERTS = "${cacert}/etc/ssl/certs/ca-bundle.crt";
postFixup = (old.postFixup or "") + lib.optionalString pkgs.stdenv.isLinux ''
echo "Patching RPATH for native addons -> ${linuxRpath}"
while IFS= read -r -d "" f; do
if file "$f" | grep -q ELF; then
old_rpath="$(patchelf --print-rpath "$f" 2>/dev/null || true)"
if [ -n "$old_rpath" ]; then
patchelf --set-rpath "${linuxRpath}:$old_rpath" "$f" || true
else
patchelf --set-rpath "${linuxRpath}" "$f" || true
fi
fi
done < <(find "$out/node_modules" -type f -name '*.node' -print0)
'';
});
in
stdenv.mkDerivation {
Expand Down
24 changes: 24 additions & 0 deletions mods/pkgs/mdctl/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ let
json = fromJSON (readFile ./package.json);
pname = replaceStrings [ "@" "/" ] [ "" "-" ] (head (attrNames json.dependencies));
version = head (attrValues json.dependencies);
keytarRuntimeLibs = lib.optionals stdenv.isLinux [
libsecret
glib
stdenv.cc.cc.lib
zlib
openssl
libffi
pcre2
];
linuxRpath = lib.makeLibraryPath keytarRuntimeLibs;
modules = (yarn2nix.mkYarnModules {
inherit version;
pname = "${pname}-modules";
Expand All @@ -19,6 +29,7 @@ let
] ++ lib.optionals stdenv.isLinux [
libsecret
glib
patchelf
] ++ osSpecific;
};
sqlite3.buildInputs = [ python3 pkg-config ];
Expand All @@ -30,6 +41,19 @@ let
'';
}).overrideAttrs (old: {
NODE_EXTRA_CA_CERTS = "${cacert}/etc/ssl/certs/ca-bundle.crt";
postFixup = (old.postFixup or "") + lib.optionalString pkgs.stdenv.isLinux ''
echo "Patching RPATH for native addons -> ${linuxRpath}"
while IFS= read -r -d "" f; do
if file "$f" | grep -q ELF; then
old_rpath="$(patchelf --print-rpath "$f" 2>/dev/null || true)"
if [ -n "$old_rpath" ]; then
patchelf --set-rpath "${linuxRpath}:$old_rpath" "$f" || true
else
patchelf --set-rpath "${linuxRpath}" "$f" || true
fi
fi
done < <(find "$out/node_modules" -type f -name '*.node' -print0)
'';
});
in
stdenv.mkDerivation {
Expand Down