Skip to content

Commit 1df25b1

Browse files
committed
fix: use the correct libquery_engine name for darwin
1 parent fed7917 commit 1df25b1

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

prisma.nix

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ rec {
2222
hostname = "binaries.prisma.sh";
2323
channel = "all_commits";
2424
binaryTarget = binaryTargetBySystem.${nixpkgs.system};
25-
target = "${binaryTarget}-openssl-${opensslVersion}";
25+
isDarwin = nixpkgs.lib.strings.hasPrefix "darwin" binaryTarget;
26+
target = if isDarwin then
27+
binaryTarget
28+
else
29+
"${binaryTarget}-openssl-${opensslVersion}";
2630
baseUrl = "https://${hostname}/${channel}";
2731
files =
2832
[
@@ -39,7 +43,10 @@ rec {
3943
variable = "PRISMA_QUERY_ENGINE_BINARY";
4044
}
4145
{
42-
name = "libquery_engine.so.node";
46+
name = if isDarwin then
47+
"libquery_engine.dylib.node"
48+
else
49+
"libquery_engine.so.node";
4350
hash = libquery-engine-hash;
4451
path = "lib/libquery_engine.node";
4552
variable = "PRISMA_QUERY_ENGINE_LIBRARY";
@@ -104,10 +111,11 @@ rec {
104111
pname = "prisma-bin";
105112
version = commit;
106113
nativeBuildInputs = [
107-
nixpkgs.autoPatchelfHook
108114
nixpkgs.zlib
109115
openssl
110116
nixpkgs.stdenv.cc.cc.lib
117+
] ++ nixpkgs.lib.optionals (!isDarwin) [
118+
nixpkgs.autoPatchelfHook
111119
];
112120
phases = [
113121
"buildPhase"

tests.nix

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ let
1414
libquery-engine-hash = "sha256-oalG9QKuxURtdgs5DgJZZtyWMz3ZpywHlov+d1ct2vA=";
1515
schema-engine-hash = "sha256-5bp8iiq6kc9c37G8dNKVHKWJHvaxFaetR4DOR/0/eWs=";
1616
};
17+
aarch64-darwin = {
18+
prisma-fmt-hash = "sha256-UPig7U2zXOccalIUE0j07xJdmqAUJ7cpXFTo+2Gbsc8=";
19+
query-engine-hash = "sha256-ihP1BEAvXQ+5XXHEXCYAVTnuETpfxmdtsIGRTljKtS0=";
20+
libquery-engine-hash = "sha256-4T63O+OyoEIJ0TLKoOoil06whd+41QxiXXg+0cgpX/8=";
21+
schema-engine-hash = "sha256-+O4IelHbZt4X+6UWol8TpL+BBDTS5JT+0hQR7ELVmZc=";
22+
};
1723
};
1824
test-npm =
1925
let

0 commit comments

Comments
 (0)