about summary refs log tree commit diff
path: root/pkgs/by-name/re
diff options
context:
space:
mode:
authorMario Rodas <marsam@users.noreply.github.com>2024-02-13 16:41:24 -0500
committerGitHub <noreply@github.com>2024-02-13 16:41:24 -0500
commit3891b2df99ab8834acab6a62e605ebd6672dd534 (patch)
treee04ee37756082c61fd7c8e06eb1d9b95ae3cf31b /pkgs/by-name/re
parent27ca7f6a0439d8b71e24c6527fa763c5bdf02887 (diff)
parent51e17ae1d21a35c77ffabc5cdd31fa9b4646333f (diff)
downloadnixlib-3891b2df99ab8834acab6a62e605ebd6672dd534.tar
nixlib-3891b2df99ab8834acab6a62e605ebd6672dd534.tar.gz
nixlib-3891b2df99ab8834acab6a62e605ebd6672dd534.tar.bz2
nixlib-3891b2df99ab8834acab6a62e605ebd6672dd534.tar.lz
nixlib-3891b2df99ab8834acab6a62e605ebd6672dd534.tar.xz
nixlib-3891b2df99ab8834acab6a62e605ebd6672dd534.tar.zst
nixlib-3891b2df99ab8834acab6a62e605ebd6672dd534.zip
Merge pull request #285231 from tobim/pkgs/restinio-0.7.1
restinio: 0.6.19 -> 0.7.1, refactor, adopt
Diffstat (limited to 'pkgs/by-name/re')
-rw-r--r--pkgs/by-name/re/restinio/package.nix102
1 files changed, 102 insertions, 0 deletions
diff --git a/pkgs/by-name/re/restinio/package.nix b/pkgs/by-name/re/restinio/package.nix
new file mode 100644
index 000000000000..ad892070b2f0
--- /dev/null
+++ b/pkgs/by-name/re/restinio/package.nix
@@ -0,0 +1,102 @@
+{
+  lib,
+  stdenv,
+  fetchFromGitHub,
+  fetchpatch,
+  cmake,
+  asio,
+  boost,
+  expected-lite,
+  fmt,
+  llhttp,
+  openssl,
+  pcre2,
+  zlib,
+  catch2_3,
+  # Build with the asio library bundled in boost instead of the standalone asio package.
+  with_boost_asio ? false,
+}:
+
+assert with_boost_asio -> boost != null;
+assert !with_boost_asio -> asio != null;
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "restinio";
+  version = "0.7.1";
+
+  src = fetchFromGitHub {
+    owner = "Stiffstream";
+    repo = "restinio";
+    rev = "v.${finalAttrs.version}";
+    hash = "sha256-XodG+dVW4iBgFx0Aq0+/pZyCLyqTBtW7e9r69y176Ro=";
+  };
+
+  patches = let
+    useCommit = {id, name, hash}:
+    fetchpatch {
+      inherit name hash;
+      url = "https://github.com/Stiffstream/restinio/commit/${id}.patch";
+    };
+  in [
+    (useCommit {
+      id = "57e6ae3f73a03a5120feb80a7bb5dca27179fa38";
+      name = "restinio-unvendor-catch2_part1.patch";
+      hash = "sha256-2Htt9WTP6nrh+1y7y2xleFj568IpnSEn9Qhb1ObLam8=";
+    })
+    (useCommit {
+      id = "0060e493b99f03c38dda519763f6d6701bc18112";
+      name = "restinio-unvendor-catch2_part2.patch";
+      hash = "sha256-Eg/VNxPwNtEYmalP5myn+QvqwU6wln9v0vxbRelRHA8=";
+    })
+    (useCommit {
+      id = "05bea25f82917602a49b72b8ea10eeb43984762f";
+      name = "restinio-unvendor-catch2_part3.patch";
+      hash = "sha256-fA+U/Y7FyrxDRiWSVXCy9dMF4gmfDLag7gBWoY74In0=";
+    })
+  ];
+
+  strictDeps = true;
+
+  nativeBuildInputs = [ cmake ];
+
+  propagatedBuildInputs = [
+    expected-lite
+    fmt
+    llhttp
+    openssl
+    pcre2
+    zlib
+  ] ++ (if with_boost_asio then [
+    boost
+  ] else [
+    asio
+  ]);
+
+  checkInputs = [
+    catch2_3
+  ];
+
+  cmakeDir = "../dev";
+  cmakeFlags = [
+    "-DRESTINIO_TEST=ON"
+    "-DRESTINIO_SAMPLE=OFF"
+    "-DRESTINIO_BENCHMARK=OFF"
+    "-DRESTINIO_WITH_SOBJECTIZER=OFF"
+    "-DRESTINIO_ASIO_SOURCE=${if with_boost_asio then "boost" else "standalone"}"
+    "-DRESTINIO_DEP_EXPECTED_LITE=find"
+    "-DRESTINIO_DEP_FMT=find"
+    "-DRESTINIO_DEP_LLHTTP=find"
+    "-DRESTINIO_DEP_CATCH2=find"
+  ];
+
+  doCheck = true;
+  enableParallelChecking = false;
+
+  meta = with lib; {
+    description = "Cross-platform, efficient, customizable, and robust asynchronous HTTP(S)/WebSocket server C++ library";
+    homepage = "https://github.com/Stiffstream/restinio";
+    license = licenses.bsd3;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ tobim ];
+  };
+})