Subject: [bug#68312] [PATCH 044/156] gnu: Add rust-diesel-2.

From: Wilko Meyer <[email-masked]>
Date: Mon, 8 Jan 2024 02:52:21 +0100

* gnu/packages/crates-io.scm (rust-diesel-2): New variable.
(rust-diesel-1): Inherit from rust-diesel-2.

Change-Id: I42b1cbc4e5816e0d64f98711ef404b1cd2c62ce9
---
 gnu/packages/crates-io.scm | 52 ++++++++++++++++++++++++++++++++++++--
 1 file changed, 50 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm
index e4abfd9d771..2cab9822ebb 100644
--- a/gnu/packages/crates-io.scm
+++ b/gnu/packages/crates-io.scm
@@ -21130,8 +21130,56 @@ (define-public rust-dialoguer-0.10
         ("rust-tempfile" ,rust-tempfile-3)
         ("rust-zeroize" ,rust-zeroize-1))))))
 
+(define-public rust-diesel-2
+  (package
+    (name "rust-diesel")
+    (version "2.1.4")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (crate-uri "diesel" version))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32 "1n1ihxd5zfqg94zy01zf85ml716fqmsivj7pxiw8qzzi8bwgrik2"))))
+    (build-system cargo-build-system)
+    (arguments
+     `(#:cargo-test-flags
+       '("--release"
+         "--features" "sqlite"
+         "--"
+         "--skip=expression::count::count")
+       #:cargo-inputs (("rust-bigdecimal" ,rust-bigdecimal-0.3)
+                       ("rust-bitflags" ,rust-bitflags-2)
+                       ("rust-byteorder" ,rust-byteorder-1)
+                       ("rust-chrono" ,rust-chrono-0.4)
+                       ("rust-diesel-derives" ,rust-diesel-derives-2)
+                       ("rust-ipnet" ,rust-ipnet-2)
+                       ("rust-ipnetwork" ,rust-ipnetwork-0.17)
+                       ("rust-itoa" ,rust-itoa-1)
+                       ("rust-libc" ,rust-libc-0.2)
+                       ("rust-libsqlite3-sys" ,rust-libsqlite3-sys-0.26)
+                       ("rust-mysqlclient-sys" ,rust-mysqlclient-sys-0.2)
+                       ("rust-num-bigint" ,rust-num-bigint-0.4)
+                       ("rust-num-integer" ,rust-num-integer-0.1)
+                       ("rust-num-traits" ,rust-num-traits-0.2)
+                       ("rust-percent-encoding" ,rust-percent-encoding-2)
+                       ("rust-pq-sys" ,rust-pq-sys-0.4)
+                       ("rust-quickcheck" ,rust-quickcheck-1)
+                       ("rust-r2d2" ,rust-r2d2-0.8)
+                       ("rust-serde-json" ,rust-serde-json-1)
+                       ("rust-time" ,rust-time-0.3)
+                       ("rust-url" ,rust-url-2)
+                       ("rust-uuid" ,rust-uuid-1))))
+    (native-inputs (list sqlite))
+    (home-page "https://diesel.rs")
+    (synopsis "Safe, extensible ORM and Query Builder")
+    (description "This package provides a safe, extensible ORM and Query
+Builder for PostgreSQL, SQLite, and MySQL.")
+    (license (list license:expat license:asl2.0))))
+
 (define-public rust-diesel-1
   (package
+    (inherit rust-diesel-2)
     (name "rust-diesel")
     (version "1.4.6")
     (source
@@ -21143,7 +21191,6 @@ (define-public rust-diesel-1
        (sha256
         (base32
          "0hpmwrc0zx3zvpgwp9zrm6wj8d8i8q8990grlrnfzlivbi6zqyq4"))))
-    (build-system cargo-build-system)
     (arguments
      `(#:cargo-test-flags
        '("--release"
@@ -21176,7 +21223,8 @@ (define-public rust-diesel-1
         ("rust-dotenv" ,rust-dotenv-0.10)
         ("rust-quickcheck" ,rust-quickcheck-0.4)
         ("rust-tempdir" ,rust-tempdir-0.3))))
-    (native-inputs (list sqlite))
+    (native-inputs (list sqlite))))
+
     (home-page "https://diesel.rs")
     (synopsis "Safe, extensible ORM and Query Builder")
     (description "This package provides a safe, extensible ORM and Query
-- 
2.41.0