Skip to content

Commit 34f688d

Browse files
committed
remove pkg-config hack
1 parent 4f9ac23 commit 34f688d

File tree

1 file changed

+20
-37
lines changed

1 file changed

+20
-37
lines changed

ocaml/default.nix

Lines changed: 20 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,6 @@ oself: osuper:
3737
let
3838
nativeCairo = cairo;
3939
lmdb-pkg = lmdb;
40-
pkg-config-script =
41-
let
42-
pkg-config-pkg =
43-
if stdenv.cc.targetPrefix == ""
44-
then "${pkg-config}/bin/pkg-config"
45-
else "${stdenv.cc.targetPrefix}pkg-config";
46-
in
47-
writeScriptBin "pkg-config" ''
48-
#!${stdenv.shell}
49-
${pkg-config-pkg} $@
50-
'';
51-
5240
disableTests = d: d.overrideAttrs (_: { doCheck = false; });
5341
addBase = p: p.overrideAttrs (o: {
5442
propagatedBuildInputs = o.propagatedBuildInputs ++ [ oself.base ];
@@ -152,11 +140,19 @@ with oself;
152140
});
153141

154142
bigarray-overlap = osuper.bigarray-overlap.overrideAttrs (o: {
155-
nativeBuildInputs = o.nativeBuildInputs ++ [ pkg-config-script pkg-config ];
143+
postPatch = ''
144+
substituteInPlace ./freestanding/Makefile --replace "pkg-config" "\$(PKG_CONFIG)"
145+
'';
156146
});
157147

158148
bigstringaf = osuper.bigstringaf.overrideAttrs (o: {
159-
nativeBuildInputs = o.nativeBuildInputs ++ [ pkg-config-script pkg-config ];
149+
buildInputs = [ dune-configurator ];
150+
src = fetchFromGitHub {
151+
owner = "inhabitedtype";
152+
repo = "bigstringaf";
153+
rev = "0.9.1";
154+
hash = "sha256-SFp5QBb4GDcTzEzvgkGKCiuUUm1k8jlgjP6ndzcQBP8=";
155+
};
160156
});
161157

162158
binaryen = callPackage ./binaryen { };
@@ -227,7 +223,6 @@ with oself;
227223
url = https://github.com/mirage/checkseum/releases/download/v0.5.0/checkseum-0.5.0.tbz;
228224
sha256 = "0bnyzxvagc4cvpz0a434xngk9ra1mjjh67nhyv3qz5ghk5s6a5bv";
229225
};
230-
nativeBuildInputs = o.nativeBuildInputs ++ [ pkg-config-script ];
231226
});
232227

233228
coin = osuper.coin.overrideAttrs (_: {
@@ -403,9 +398,6 @@ with oself;
403398
];
404399
};
405400

406-
angstrom = osuper.angstrom.overrideAttrs (_: {
407-
doCheck = false;
408-
});
409401
cookie = callPackage ./cookie { };
410402
session-cookie = callPackage ./cookie/session.nix { };
411403
session-cookie-lwt = callPackage ./cookie/session-lwt.nix { };
@@ -429,7 +421,7 @@ with oself;
429421
sha256 = "sha256-YMaKJK8gqsUdYglB4xGdMUpTXbgUgZLLvUG/lSvJesE=";
430422
};
431423

432-
nativeBuildInputs = [ pkg-config pkg-config-script ];
424+
nativeBuildInputs = [ pkg-config ];
433425
buildInputs = [ dune-configurator ];
434426
propagatedBuildInputs = [ integers bigarray-compat libffi-oc.dev ];
435427

@@ -562,8 +554,8 @@ with oself;
562554
repo = "dune";
563555
# rev = "649031728346482a83441c26c0bbe06ecd89cce2";
564556
# hash = "sha256-IbvAumstRp7JE+UQDArrwYWyZtbe8q8bZo05eVzA/MU=";
565-
rev = "69bc73c86a45fb72408994e0cbd49e5314e5c2ff";
566-
hash = "sha256-SxCSQZZDHcu29ULdmQ+n9LAzxvUbzCj7IaiuB30zuZg=";
557+
rev = "1264b11fa71257acb4a396e74dd1a7b63d4f321f";
558+
hash = "sha256-t6qEDUrVlJcq0REjDMqmThPjejQIwPyg6MfIraYYP0I=";
567559
};
568560
nativeBuildInputs = o.nativeBuildInputs ++ [ makeWrapper ];
569561

@@ -940,10 +932,6 @@ with oself;
940932
propagatedBuildInputs = [ lev-fiber csexp ];
941933
} else null;
942934

943-
digestif = osuper.digestif.overrideAttrs (o: {
944-
nativeBuildInputs = o.nativeBuildInputs ++ [ pkg-config-script pkg-config ];
945-
});
946-
947935
lmdb = buildDunePackage {
948936
pname = "lmdb";
949937
version = "1.0";
@@ -953,7 +941,7 @@ with oself;
953941
rev = "1.0";
954942
sha256 = "sha256-NbiM7xNpuihzqAMiAaYXVeItspWufnr1/e3WZEkMhsA=";
955943
};
956-
nativeBuildInputs = [ pkg-config-script pkg-config ];
944+
nativeBuildInputs = [ pkg-config ];
957945
buildInputs = [ lmdb-pkg dune-configurator ];
958946
propagatedBuildInputs = [ bigstringaf ];
959947
};
@@ -993,9 +981,7 @@ with oself;
993981
sha256 = "sha256-QIxKQEoA5EOGqhwCKdIWQ09RhPKYoleTWdbT1GI397o=";
994982
};
995983

996-
nativeBuildInputs = o.nativeBuildInputs ++ [ pkg-config-script pkg-config cppo ];
997984
propagatedBuildInputs = [ libev-oc ocplib-endian ];
998-
999985
postPatch = ''
1000986
substituteInPlace src/unix/dune --replace "bigarray" ""
1001987
'';
@@ -1025,12 +1011,6 @@ with oself;
10251011
sha256 = "176dywi6d1s1jn1g1c8f9bznj1r6ajgqp5g196fgszld52598dfq";
10261012
};
10271013
});
1028-
mirage-crypto = osuper.mirage-crypto.overrideAttrs (o: {
1029-
nativeBuildInputs = o.nativeBuildInputs ++ [ pkg-config-script pkg-config ];
1030-
});
1031-
mirage-crypto-ec = osuper.mirage-crypto-ec.overrideAttrs (o: {
1032-
nativeBuildInputs = o.nativeBuildInputs ++ [ pkg-config-script pkg-config ];
1033-
});
10341014
mirage-crypto-pk = osuper.mirage-crypto-pk.override { gmp = gmp-oc; };
10351015

10361016
# `mirage-fs` needs to be updated to match `mirage-kv`'s new interface
@@ -1194,7 +1174,11 @@ with oself;
11941174
ocamlformat-rpc-lib = callPackage ./ocamlformat/rpc-lib.nix { };
11951175

11961176
ocaml_sqlite3 = osuper.ocaml_sqlite3.overrideAttrs (o: {
1197-
nativeBuildInputs = o.nativeBuildInputs ++ [ pkg-config-script pkg-config ];
1177+
postPatch = ''
1178+
substituteInPlace "src/config/discover.ml" --replace \
1179+
'let cmd = pkg_export ^ " pkg-config ' \
1180+
'let cmd = let pkg_config = match Sys.getenv "PKG_CONFIG" with | s -> s | exception Not_found -> "pkg-config" in pkg_export ^ " " ^ pkg_config ^ " '
1181+
'';
11981182
});
11991183

12001184
odep = buildDunePackage {
@@ -1331,7 +1315,7 @@ with oself;
13311315
sha256 = "0n621cxb9012pj280c7821qqsdhypj8qy9qgrah79dkh6a8h2py6";
13321316
};
13331317

1334-
nativeBuildInputs = [ pkg-config-script pkg-config ocaml findlib ];
1318+
nativeBuildInputs = [ pkg-config ocaml findlib ];
13351319
propagatedBuildInputs = [ curl lwt ];
13361320
createFindlibDestdir = true;
13371321
};
@@ -1450,7 +1434,6 @@ with oself;
14501434
postPatch = ''
14511435
substituteInPlace src/dune --replace " bigarray" ""
14521436
'';
1453-
nativeBuildInputs = o.nativeBuildInputs ++ [ pkg-config-script pkg-config ];
14541437
propagatedBuildInputs = [ libpq ];
14551438
});
14561439

0 commit comments

Comments
 (0)