From f5b0e7f64aff006c7fe839a83846c00e7f65294e Mon Sep 17 00:00:00 2001 From: Antonio Nuno Monteiro Date: Fri, 7 Jun 2024 21:25:13 -0700 Subject: [PATCH 1/2] add release shell, fix opam files --- flake.lock | 14 +++++++------- flake.nix | 8 +++++++- httpun-async.opam | 2 -- httpun-eio.opam | 1 - httpun-lwt-unix.opam | 1 - httpun-lwt.opam | 1 - shell.nix => nix/shell.nix | 17 ++++++++++++++--- 7 files changed, 28 insertions(+), 16 deletions(-) rename shell.nix => nix/shell.nix (69%) diff --git a/flake.lock b/flake.lock index 7528f42..7ee21e5 100644 --- a/flake.lock +++ b/flake.lock @@ -41,11 +41,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1716844469, - "narHash": "sha256-2Edbn0TOoBC7+AY0rQeoYPFRWK89lVVgrGZxwxYX9rU=", + "lastModified": 1717813629, + "narHash": "sha256-CyM8f1XZ3OaJH2Z4qSHwMTi1S40uzRzUD4Lh+eQLNFk=", "owner": "anmonteiro", "repo": "nix-overlays", - "rev": "cd34c0a555802e83b38196719c094c335a6c4f81", + "rev": "7fdbb404f573cc6ac77926cbd6de475accff5cf5", "type": "github" }, "original": { @@ -56,17 +56,17 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1716792620, - "narHash": "sha256-wQmXzee/veETYJv93TkRYsAQkEdt2QYCJeJil5SrJfg=", + "lastModified": 1717737457, + "narHash": "sha256-hqHp0W7ibfdu5DFc6EG3S3c+GSAbti7VUldFXSf/WiI=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "7d7cf1590c05d799745bf456f2b95b798f48d3bb", + "rev": "bf3faad723ca984fc4ea95c1cee1d975a8ca2a28", "type": "github" }, "original": { "owner": "NixOS", "repo": "nixpkgs", - "rev": "7d7cf1590c05d799745bf456f2b95b798f48d3bb", + "rev": "bf3faad723ca984fc4ea95c1cee1d975a8ca2a28", "type": "github" } }, diff --git a/flake.nix b/flake.nix index 72bfab0..eb1cf8c 100644 --- a/flake.nix +++ b/flake.nix @@ -16,6 +16,12 @@ rec { packages = pkgs.callPackage ./nix { nix-filter = nix-filter.lib; }; defaultPackage = packages.httpun; - devShell = pkgs.callPackage ./shell.nix { inherit packages; }; + devShells = { + default = pkgs.callPackage ./nix/shell.nix { inherit packages; }; + release = pkgs.callPackage ./nix/shell.nix { + inherit packages; + release-mode = true; + }; + }; }); } diff --git a/httpun-async.opam b/httpun-async.opam index 2a1bf35..439a7e3 100644 --- a/httpun-async.opam +++ b/httpun-async.opam @@ -1,5 +1,4 @@ opam-version: "2.0" -name: "httpun-async" maintainer: "Antonio Nuno Monteiro " authors: [ "Spiros Eliopoulos " @@ -16,7 +15,6 @@ build: [ depends: [ "ocaml" {>= "4.08.0"} "dune" {>= "3.0.0"} - "faraday-async" {>= "0.7.2"} "async" {>= "v0.16.0"} "httpun" {= version} "gluten-async" {>= "0.5.0"} diff --git a/httpun-eio.opam b/httpun-eio.opam index ed56fda..436f9b6 100644 --- a/httpun-eio.opam +++ b/httpun-eio.opam @@ -1,5 +1,4 @@ opam-version: "2.0" -name: "httpun-eio" maintainer: "Antonio Monteiro " authors: [ "Antonio Monteiro " ] license: "BSD-3-clause" diff --git a/httpun-lwt-unix.opam b/httpun-lwt-unix.opam index 2e580a8..e49a13b 100644 --- a/httpun-lwt-unix.opam +++ b/httpun-lwt-unix.opam @@ -1,5 +1,4 @@ opam-version: "2.0" -name: "httpun-lwt-unix" maintainer: "Antonio Nuno Monteiro " authors: [ "Anton Bachin " diff --git a/httpun-lwt.opam b/httpun-lwt.opam index 1640c78..78617c8 100644 --- a/httpun-lwt.opam +++ b/httpun-lwt.opam @@ -1,5 +1,4 @@ opam-version: "2.0" -name: "httpun-lwt" maintainer: "Antonio Nuno Monteiro " authors: [ "Anton Bachin " diff --git a/shell.nix b/nix/shell.nix similarity index 69% rename from shell.nix rename to nix/shell.nix index 27b79f9..0cd1466 100644 --- a/shell.nix +++ b/nix/shell.nix @@ -1,14 +1,25 @@ -{ pkgs, stdenv, lib }: +{ pkgs +, packages +, stdenv +, lib +, release-mode ? false +}: let - httpunPkgs = pkgs.recurseIntoAttrs (import ./nix { inherit pkgs; doCheck = false; }); - httpunDrvs = lib.filterAttrs (_: value: lib.isDerivation value) httpunPkgs; + httpunDrvs = lib.filterAttrs (_: value: lib.isDerivation value) packages; in with pkgs; (mkShell { OCAMLRUNPARAM = "b"; + nativeBuildInputs = + lib.optionals release-mode [ + cacert + curl + ocamlPackages.dune-release + git + ]; inputsFrom = lib.attrValues httpunDrvs; buildInputs = with ocamlPackages; [ merlin utop ]; }).overrideAttrs (o: { From 9b230ee8313e310834b70b4a9bc0510fcc847b1e Mon Sep 17 00:00:00 2001 From: Antonio Nuno Monteiro Date: Fri, 7 Jun 2024 21:44:02 -0700 Subject: [PATCH 2/2] fix opam files --- httpun-mirage.opam | 2 +- lib_test/dune | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/httpun-mirage.opam b/httpun-mirage.opam index 0f2dd13..cb4f9c5 100644 --- a/httpun-mirage.opam +++ b/httpun-mirage.opam @@ -12,7 +12,7 @@ build: [ depends: [ "ocaml" {>= "4.08.0"} "dune" {>= "3.0.0"} - "httpun" {= version} + "httpun-lwt" {= version} "gluten-mirage" {>= "0.5.0"} "mirage-flow" {>= "2.0.0"} "cstruct" diff --git a/lib_test/dune b/lib_test/dune index 01b4a1f..c4423d2 100644 --- a/lib_test/dune +++ b/lib_test/dune @@ -1,4 +1,5 @@ (test + (package httpun) (libraries bigstringaf httpun alcotest) (modules helpers