Skip to content

Commit

Permalink
Prepare for releasing
Browse files Browse the repository at this point in the history
  • Loading branch information
anmonteiro committed Feb 4, 2021
1 parent 6fa96ae commit 0552d04
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 29 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
0.1.0 2021-02-03
--------------

- Initial public release
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ in OCaml.

## Installation

Piaf is currently unreleased.
Piaf is released to OPAM.

You can depend on it via [esy](esy) resolutions or `opam pin`
You can depend on it via [esy](esy) or by running `opam install piaf`.

_Note_: make sure to mirror Piaf's own resolutions located in the [opam
file](./piaf.opam).
Expand All @@ -25,12 +25,12 @@ open Piaf
let get_sync url =
let open Lwt_result.Syntax in
Lwt_main.run begin
print_endline("Sending request...");
let* response = Client.Oneshot.get (Uri.of_string url) in
if (Status.is_successful response.status) then
Body.to_string response.body
else
Expand Down
29 changes: 14 additions & 15 deletions nix/sources.nix
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
{ ocamlVersion ? "4_11" }:

let
overlays =
builtins.fetchTarball
https://github.com/anmonteiro/nix-overlays/archive/1871871.tar.gz;
/Users/anmonteiro/projects/nix-overlays;
# builtins.fetchTarball
# https://github.com/anmonteiro/nix-overlays/archive/1871871.tar.gz;

in
import "${overlays}/sources.nix" {
overlays = [
(import overlays)
(self: super: {
ocamlPackages = super.ocaml-ng."ocamlPackages_${ocamlVersion}";

import "${overlays}/sources.nix" {
overlays = [
(import overlays)
(self: super: {
ocamlPackages = super.ocaml-ng."ocamlPackages_${ocamlVersion}";

pkgsCross.musl64 = super.pkgsCross.musl64 // {
ocamlPackages = super.pkgsCross.musl64.ocaml-ng."ocamlPackages_${ocamlVersion}";
};
})
];
}
pkgsCross.musl64 = super.pkgsCross.musl64 // {
ocamlPackages = super.pkgsCross.musl64.ocaml-ng."ocamlPackages_${ocamlVersion}";
};
})
];
}
2 changes: 2 additions & 0 deletions piaf.opam
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,5 @@ depends: [
]
synopsis:
"An HTTP library with HTTP/2 support written entirely in OCaml"
description:
"Piaf is an HTTP library and webserver written entirely in OCaml."
27 changes: 18 additions & 9 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{ release-mode ? false }:
let
pkgs = import ./nix/sources.nix {};
pkgs = import ./nix/sources.nix { };
inherit (pkgs) lib;
piafPkgs = pkgs.recurseIntoAttrs (import ./nix { inherit pkgs; }).native;
piafDrvs = lib.filterAttrs (_: value: lib.isDerivation value) piafPkgs;
Expand All @@ -15,12 +16,20 @@ let
inputs;

in
with pkgs;
with pkgs;

(mkShell {
inputsFrom = lib.attrValues piafDrvs;
buildInputs = with ocamlPackages; [ merlin ocamlformat utop ];
}).overrideAttrs (o : {
propagatedBuildInputs = filterDrvs o.propagatedBuildInputs;
buildInputs = filterDrvs o.buildInputs;
})
(mkShell {
inputsFrom = lib.attrValues piafDrvs;
buildInputs =
(if release-mode then [
cacert
curl
ocamlPackages.dune-release
git
opam
] else [ ]) ++
(with ocamlPackages; [ merlin ocamlformat utop ]);
}).overrideAttrs (o: {
propagatedBuildInputs = filterDrvs o.propagatedBuildInputs;
buildInputs = filterDrvs o.buildInputs;
})

0 comments on commit 0552d04

Please sign in to comment.