diff mbox series

[bug#67902,v3,13/96] gnu: Add php-egulias-email-validator.

Message ID 20241007000046.25625-13-ngraves@ngraves.fr
State New
Headers show
Series [bug#67902,v3,01/96] gnu: Add abnfgen. | expand

Commit Message

Nicolas Graves Oct. 6, 2024, 11:59 p.m. UTC
* gnu/packages/php-xyz.scm (php-egulias-email-validator): New variable.

Change-Id: I2a9df3ca79962aa01ce3a7a8e7d7da536350249a
---
 gnu/packages/php-xyz.scm | 47 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)
diff mbox series

Patch

diff --git a/gnu/packages/php-xyz.scm b/gnu/packages/php-xyz.scm
index a27098e18d..28e1e5cd4b 100644
--- a/gnu/packages/php-xyz.scm
+++ b/gnu/packages/php-xyz.scm
@@ -278,3 +278,50 @@  (define-public php-dms-phpunit-arraysubset-asserts
     (home-page "https://github.com/rdohms/phpunit-arraysubset-asserts")
     (license license:expat)))
 
+(define-public php-egulias-email-validator
+  (package
+    (name "php-egulias-email-validator")
+    (version "4.0.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/egulias/EmailValidator")
+             (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0nyqri3421gkiswn70f7f8cfz4vs1vcadxdyvwjykbgc4fz5skz2"))))
+    (build-system composer-build-system)
+    (arguments
+     (list
+      #:test-flags ''("--exclude" "skipTest") ; FIXME
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-before 'check 'deactivate-failing-tests
+            (lambda _
+              (substitute*
+                  "tests/EmailValidator/Validation/DNSCheckValidationTest.php"
+                (("(.*)@dataProvider validEmailsProvider" all blank)
+                 (string-append all "\n"
+                                blank "@group skipTest"))
+                (("(.*)public function testDomainAcceptsNoMailError\\(\\)" all blank)
+                 (string-append
+                  blank "/**\n"
+                  blank " * @group skipTest\n"
+                  blank " */\n"
+                  all))
+                (("(.*)public function testNoDNSError\\(\\)" all blank)
+                 (string-append
+                  blank "/**\n"
+                  blank " * @group skipTest\n"
+                  blank " */\n"
+                  all))))))))
+    (inputs
+     (list php-doctrine-lexer php-symfony-polyfill-intl-idn))
+    (native-inputs
+     (list php-phpunit-phpunit))
+    (synopsis "PHP email address validator")
+    (description "A library for validating emails against several RFCs")
+    (home-page "https://github.com/egulias/EmailValidator")
+    (license license:expat)))
+