Skip to content

Commit

Permalink
fix dream / gettext for ocaml 5.3 (#1787)
Browse files Browse the repository at this point in the history
  • Loading branch information
anmonteiro authored Nov 25, 2024
1 parent 6375a7d commit 9421b52
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 30 deletions.
8 changes: 6 additions & 2 deletions ocaml/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -976,6 +976,10 @@ with oself;

gettext-camomile = osuper.gettext-camomile.overrideAttrs (_: {
propagatedBuildInputs = [ camomile ocaml_gettext ];
postPatch = ''
substituteInPlace "src/lib/gettext-camomile/gettextCamomile.ml" --replace-fail \
"CamomileLibraryDefault." ""
'';
});

gluten = callPackage ./gluten { };
Expand Down Expand Up @@ -1825,8 +1829,8 @@ with oself;
src = fetchFromGitHub {
owner = "gildor478";
repo = "ocaml-gettext";
rev = "9fa474310f383abf3d4349a25c44955ee62410c1";
hash = "sha256-QYKWtHJMHVU86aWh9f6zlB4nuzgQYvignA01m3b54Kg=";
rev = "e827b7ab392e5cf48dd620537952bff43fbcbdf0";
hash = "sha256-13DWCYtKMSq1XzDMBuclKtjtzuBboG63AakZWITqucE=";
};
});

Expand Down
21 changes: 10 additions & 11 deletions ocaml/dream/default.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{ lib
, fetchFromGitHub
, buildDunePackage
, bigarray-compat
, camlp-streams
, caqti
, caqti-lwt
, cstruct
Expand Down Expand Up @@ -44,9 +41,17 @@ buildDunePackage rec {
pname = "dream";
inherit (dream-pure) src version;

postPatch = ''
substituteInPlace src/http/adapt.ml \
--replace-fail \
"Httpun.Body.Writer.flush body" \
"fun f -> Httpun.Body.Writer.flush body (fun _r -> f ())" \
--replace-fail \
"H2.Body.Writer.flush body" \
"fun f -> H2.Body.Writer.flush body (fun _r -> f ())"
'';

propagatedBuildInputs = [
bigarray-compat
camlp-streams
caqti
caqti-lwt
cstruct
Expand Down Expand Up @@ -88,13 +93,7 @@ buildDunePackage rec {
tyxml-ppx
];

dontDetectOcamlConflicts = true;
doCheck = !(lib.versionAtLeast ocaml.version "5.0");

preBuild = ''
rm -rf src/vendor
'';

meta = {
description = "Easy-to-use, feature-complete Web framework without boilerplate";
license = lib.licenses.mit;
Expand Down
18 changes: 6 additions & 12 deletions ocaml/dream/httpaf.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,9 @@
, lwt_ppx
, lwt_ssl
, ssl
, digestif
, faraday
, faraday-lwt-unix
, psq
, result
, ke
, h2-lwt-unix
, httpun-lwt-unix
, httpun-ws
}:

buildDunePackage rec {
Expand All @@ -24,12 +21,9 @@ buildDunePackage rec {
lwt_ssl
ssl

faraday
faraday-lwt-unix
digestif
ke
psq
result
httpun-lwt-unix
h2-lwt-unix
httpun-ws
];

doCheck = false;
Expand Down
7 changes: 2 additions & 5 deletions ocaml/dream/pure.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,8 @@ buildDunePackage rec {
src = fetchFromGitHub {
owner = "aantron";
repo = "dream";
rev = "1.0.0-alpha7";
hash = "sha256-Hguol70XNLRge843aFRcVBNucJFF08EdFVtzgA+nnlM=";
fetchSubmodules = true;
leaveDotGit = false;
deepClone = false;
rev = "deb4526387f72d3c5bb07f9a93b53ea38315b375";
hash = "sha256-ZFwxGr69Nr84KYTGgJnD/2/1cdb7p5Knb0sA82PKwBo=";
};

propagatedBuildInputs = [
Expand Down

0 comments on commit 9421b52

Please sign in to comment.