all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] gnu: Add perl-db_file.
@ 2016-07-26 15:35 Danny Milosavljevic
       [not found] ` <20160726183531.GA11804@solar>
  0 siblings, 1 reply; 4+ messages in thread
From: Danny Milosavljevic @ 2016-07-26 15:35 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/databases.scm (perl-db_file): New variable.

---
 gnu/packages/databases.scm | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm
index 86cf883..b5c6de0 100644
--- a/gnu/packages/databases.scm
+++ b/gnu/packages/databases.scm
@@ -1013,3 +1013,40 @@ trees (LSM), for sustained throughput under random insert workloads.")
     (license gpl3) ; or GPL-2
     ;; configure.ac: WiredTiger requires a 64-bit build.
     (supported-systems '("x86_64-linux" "mips64el-linux"))))
+
+(define-public perl-db_file
+ (package
+  (name "perl-db_file")
+  (version "1.838")
+  (source
+    (origin
+      (method url-fetch)
+      (uri (string-append
+             "mirror://cpan/authors/id/P/PM/PMQS/DB_File-"
+             version
+             ".tar.gz"))
+      (sha256
+        (base32
+          "0yp5d5zr8dk9g6xdh7ygi5bq63q7nxvhd58dk2i3ki4nb7yv2yh9"))))
+  (build-system perl-build-system)
+  (inputs `(("bdb" ,bdb)))
+  (native-inputs `(("perl-test-pod" ,perl-test-pod)))
+  (arguments
+     `(#:phases (modify-phases %standard-phases
+                  (add-before
+                   'configure 'replace-config.in
+                   (lambda* (#:key inputs #:allow-other-keys)
+                     (call-with-output-file "config.in"
+                       (lambda (port)
+                         (format port "
+INCLUDE = ~a/include
+LIB = ~:*~a/lib
+PREFIX = size_t
+HASH = u_int32_t
+"
+                                 (assoc-ref inputs "bdb")))))))))
+  (home-page "http://search.cpan.org/dist/DB_File")
+  (synopsis
+    "Perl5 access to Berkeley DB version 1.x")
+  (description "DB_File provides access to Berkeley DB version 1.x.")
+  (license (package-license perl))))

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] gnu: Add perl-db_file.
       [not found] ` <20160726183531.GA11804@solar>
@ 2016-07-26 19:01   ` Danny Milosavljevic
  2016-07-26 19:05     ` [PATCH v2] " Danny Milosavljevic
  2016-07-26 20:48     ` [PATCH] " Andreas Enge
  0 siblings, 2 replies; 4+ messages in thread
From: Danny Milosavljevic @ 2016-07-26 19:01 UTC (permalink / raw)
  To: Andreas Enge; +Cc: guix-devel, Danny Milosavljevic

Hi Andreas,

On Tue, 26 Jul 2016 20:35:31 +0200
Andreas Enge <andreas@enge.fr> wrote:

> > * gnu/packages/databases.scm (perl-db_file): New variable.  
> > The name should be "perl-db-file": we replace all special characters with "-".

The package name (not the variable name) was chosen by "guix import cpan". So it should probably be fixed in the CPAN importer, too.
 
> Here I would not rewrite the complete file, but instead use substitute* to
> replace "/usr/local/BerkeleyDB" with the assoc-ref. You will find many
> examples of this in the repository. 

Yeah, I thought about it but decided against it - there are very few options in that file, substitute* can't substitute entire lines (or only at the beginning of the line) or entire words (so it's not safe), the user is supposed to set PREFIX and HASH (it's just a coincidence we didn't have to change them) and if we did that then new versions of the package could sneak in new options we wouldn't notice but we should have changed. Better for it to fail instead of silently doing something strange.

But I will use substitute* in the next version of the patch - the unit tests should be able to fail for some of the errors.

> +  (description "DB_File provides access to Berkeley DB version 1.x.")
> 
> Maybe add "perl" somewhere in the description? "provides Perl bindings to..."
> or something like that?

OK!

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2] gnu: Add perl-db_file.
  2016-07-26 19:01   ` Danny Milosavljevic
@ 2016-07-26 19:05     ` Danny Milosavljevic
  2016-07-26 20:48     ` [PATCH] " Andreas Enge
  1 sibling, 0 replies; 4+ messages in thread
From: Danny Milosavljevic @ 2016-07-26 19:05 UTC (permalink / raw)
  To: Andreas Enge; +Cc: guix-devel

* gnu/packages/databases.scm (perl-db_file): New variable.
---
 gnu/packages/databases.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm
index 86cf883..abda97b 100644
--- a/gnu/packages/databases.scm
+++ b/gnu/packages/databases.scm
@@ -1013,3 +1013,35 @@ trees (LSM), for sustained throughput under random insert workloads.")
     (license gpl3) ; or GPL-2
     ;; configure.ac: WiredTiger requires a 64-bit build.
     (supported-systems '("x86_64-linux" "mips64el-linux"))))
+
+(define-public perl-db-file
+ (package
+  (name "perl-db-file")
+  (version "1.838")
+  (source
+    (origin
+      (method url-fetch)
+      (uri (string-append
+             "mirror://cpan/authors/id/P/PM/PMQS/DB_File-"
+             version
+             ".tar.gz"))
+      (sha256
+        (base32
+          "0yp5d5zr8dk9g6xdh7ygi5bq63q7nxvhd58dk2i3ki4nb7yv2yh9"))))
+  (build-system perl-build-system)
+  (inputs `(("bdb" ,bdb)))
+  (native-inputs `(("perl-test-pod" ,perl-test-pod)))
+  (arguments
+     `(#:phases (modify-phases %standard-phases
+                  (add-before
+                   'configure 'modify-config.in
+                   (lambda* (#:key inputs #:allow-other-keys)
+                     (substitute* "config.in"
+                       (("/usr/local/BerkeleyDB") (assoc-ref inputs "bdb")))
+                     #t)))))
+  (home-page "http://search.cpan.org/dist/DB_File")
+  (synopsis
+    "Perl5 access to Berkeley DB version 1.x")
+  (description
+    "DB::File provides Perl bindings to Berkeley DB version 1.x.")
+  (license (package-license perl))))

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] gnu: Add perl-db_file.
  2016-07-26 19:01   ` Danny Milosavljevic
  2016-07-26 19:05     ` [PATCH v2] " Danny Milosavljevic
@ 2016-07-26 20:48     ` Andreas Enge
  1 sibling, 0 replies; 4+ messages in thread
From: Andreas Enge @ 2016-07-26 20:48 UTC (permalink / raw)
  To: Danny Milosavljevic; +Cc: guix-devel, Danny Milosavljevic

Hello,

On Tue, Jul 26, 2016 at 09:01:38PM +0200, Danny Milosavljevic wrote:
> Yeah, I thought about it but decided against it - there are very few options in that file, substitute* can't substitute entire lines (or only at the beginning of the line) or entire words (so it's not safe), the user is supposed to set PREFIX and HASH (it's just a coincidence we didn't have to change them) and if we did that then new versions of the package could sneak in new options we wouldn't notice but we should have changed. Better for it to fail instead of silently doing something strange.

well, substitute* is closer to a diff - it makes it easy to see what actually
changes. And I would make the converse argument of you - for the next version,
if more things change (an option is added to the file, for instance), then
the substitute* still has a chance to get a working package. Imagine that
someone without knowledge of the package might be the one to update it, for
instance.

I pushed with tiny changes to the description.

Thanks!

Andreas

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-07-26 20:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-26 15:35 [PATCH] gnu: Add perl-db_file Danny Milosavljevic
     [not found] ` <20160726183531.GA11804@solar>
2016-07-26 19:01   ` Danny Milosavljevic
2016-07-26 19:05     ` [PATCH v2] " Danny Milosavljevic
2016-07-26 20:48     ` [PATCH] " Andreas Enge

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.