unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] Add googletest
@ 2016-05-30 20:44 Lukas Gradl
  2016-05-31 13:53 ` Lukas Gradl
  0 siblings, 1 reply; 13+ messages in thread
From: Lukas Gradl @ 2016-05-30 20:44 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 371 bytes --]


Hello Guix,

This patch adds googletest, a native-input for the c/c++ version of
msgpack (coming soon).

There is no "install" target.  At the moment the patch copies the build
results to out/lib and the include directory of the source tree to
out/include.  I am not sure if this is enough or if something else needs
to be installed.  Opinions are welcome!

Thank you!


[-- Attachment #2: 0001-gnu-check-Add-googletest.patch --]
[-- Type: text/x-patch, Size: 2863 bytes --]

From 0560038dd1c529cca46e31c6afbb5cd16808db43 Mon Sep 17 00:00:00 2001
From: Lukas Gradl <lgradl@openmailbox.org>
Date: Mon, 30 May 2016 15:35:10 -0500
Subject: [PATCH] gnu: check: Add googletest.

* gnu/packages/check.scm (googletest): New variable.
---
 gnu/packages/check.scm | 41 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
index 9eef7a9..f6b586a 100644
--- a/gnu/packages/check.scm
+++ b/gnu/packages/check.scm
@@ -5,6 +5,7 @@
 ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
+;;; Copyright © 2016 Lukas Gradl <lgradl@openmailbox.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -24,6 +25,7 @@
 (define-module (gnu packages check)
   #:use-module (gnu packages)
   #:use-module (gnu packages autotools)
+  #:use-module (gnu packages python)
   #:use-module (guix licenses)
   #:use-module (guix packages)
   #:use-module (guix download)
@@ -193,3 +195,42 @@ in the code.  Cppcheck primarily detects the types of bugs that the compilers
 normally do not detect.  The goal is to detect only real errors in the code
 (i.e. have zero false positives).")
     (license gpl3+)))
+
+(define-public googletest
+  (package
+    (name "googletest")
+    (version "1.7.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri
+        (string-append
+         "https://github.com/google/googletest/archive/release-"
+         version ".tar.gz"))
+       (sha256
+        (base32
+         "1k0nf1l9cb3prdmsvaajl5i31bx86c1mw0d5jgzykz7rzm36afpp"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("python-2" ,python-2)))
+    (arguments
+     `(#:tests? #f
+       ;#:configure-flags '("-Dgtest_build_tests=ON")
+       #:phases (modify-phases %standard-phases
+                  (replace 'install
+                    (lambda _
+                      (let ((out (assoc-ref %outputs "out")))
+                        (and
+                         (mkdir-p (string-append out "/lib"))
+                         (mkdir-p (string-append out "/include"))
+                         (zero? (system* "cp" "libgtest.a" "libgtest_main.a"
+                                         (string-append out "/lib")))
+                         (system* "ls")
+                         (zero? (system* "ls" "..")))))))))
+    (home-page "https://github.com/google/googletest/")
+    (synopsis "Test discovery and XUnit test framework")
+    (description "Google Test features an XUnit test framework, automated test
+discovery, death tests, assertions, parameterized tests and XML test report
+generation.")
+    (license bsd-3)))
+               
-- 
2.7.4


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

* Re: [PATCH] Add googletest
  2016-05-30 20:44 [PATCH] Add googletest Lukas Gradl
@ 2016-05-31 13:53 ` Lukas Gradl
  2016-05-31 21:44   ` Leo Famulari
  0 siblings, 1 reply; 13+ messages in thread
From: Lukas Gradl @ 2016-05-31 13:53 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 165 bytes --]


Hello,

Sorry, I accidently attached the wrong patch.  Please disregard the
patch in my previous email, attached is an updated one.

Sorry about that!
Best,
Lukas


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-check-Add-googletest.patch --]
[-- Type: text/x-patch, Size: 2633 bytes --]

From f5f229eafcf2ebf24703e6becc291b8378dff2e0 Mon Sep 17 00:00:00 2001
From: Lukas Gradl <lgradl@openmailbox.org>
Date: Tue, 31 May 2016 08:48:29 -0500
Subject: [PATCH] gnu: check: Add googletest.

* gnu/packages/check.scm (googletest): New variable.
---
 gnu/packages/check.scm | 42 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
index 9eef7a9..fca2e98 100644
--- a/gnu/packages/check.scm
+++ b/gnu/packages/check.scm
@@ -24,6 +24,7 @@
 (define-module (gnu packages check)
   #:use-module (gnu packages)
   #:use-module (gnu packages autotools)
+  #:use-module (gnu packages python)
   #:use-module (guix licenses)
   #:use-module (guix packages)
   #:use-module (guix download)
@@ -193,3 +194,44 @@ in the code.  Cppcheck primarily detects the types of bugs that the compilers
 normally do not detect.  The goal is to detect only real errors in the code
 (i.e. have zero false positives).")
     (license gpl3+)))
+
+
+(define-public googletest
+  (package
+    (name "googletest")
+    (version "1.7.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri
+        (string-append
+         "https://github.com/google/googletest/archive/release-"
+         version ".tar.gz"))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32
+         "1k0nf1l9cb3prdmsvaajl5i31bx86c1mw0d5jgzykz7rzm36afpp"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("python-2" ,python-2)))
+    (arguments
+     `(#:configure-flags '("-Dgtest_build_tests=ON")
+       #:phases (modify-phases %standard-phases
+                  (replace 'install
+                    (lambda _
+                      (let ((out (assoc-ref %outputs "out")))
+                        (and
+                         (mkdir-p (string-append out "/lib"))
+                         (mkdir-p (string-append out "/include"))
+                         (zero?
+                          (system* "cp" "-r"
+                                   "../googletest-release-1.7.0/include"
+                                   out))
+                         (zero? (system* "cp" "libgtest.a" "libgtest_main.a"
+                                         (string-append out "/lib"))))))))))
+    (home-page "https://github.com/google/googletest/")
+    (synopsis "Test discovery and XUnit test framework")
+    (description "Google Test (GTest) features an XUnit test framework,
+automated test discovery, death tests, assertions, parameterized tests and XML
+test report generation.")
+    (license bsd-3)))
-- 
2.7.4


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

* Re: [PATCH] Add googletest
  2016-05-31 13:53 ` Lukas Gradl
@ 2016-05-31 21:44   ` Leo Famulari
  2016-06-01  4:48     ` Efraim Flashner
                       ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Leo Famulari @ 2016-05-31 21:44 UTC (permalink / raw)
  To: Lukas Gradl; +Cc: guix-devel

On Tue, May 31, 2016 at 08:53:17AM -0500, Lukas Gradl wrote:
> * gnu/packages/check.scm (googletest): New variable.

Awesome, thanks for this patch!

> +    (build-system cmake-build-system)

I noticed in the README.md that upstream suggests use of GNU Make unless
building from a Git checkout. Did you try that?

> +    (native-inputs
> +     `(("python-2" ,python-2)))

The README also suggests that this is only necessary for building from
Git, although it's worth finding out what they mean by "re-generating
certain source files from templates". We prefer to re-build "generated"
source files since they are not really "source files" in many cases.

> +                  (replace 'install
> +                    (lambda _
> +                      (let ((out (assoc-ref %outputs "out")))
> +                        (and
> +                         (mkdir-p (string-append out "/lib"))
> +                         (mkdir-p (string-append out "/include"))
> +                         (zero?
> +                          (system* "cp" "-r"
> +                                   "../googletest-release-1.7.0/include"
> +                                   out))
> +                         (zero? (system* "cp" "libgtest.a" "libgtest_main.a"
> +                                         (string-append out "/lib"))))))))))

I think these uses of (system*) could be replaced by (copy-recursively)
and (install-file), respectively.

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

* Re: [PATCH] Add googletest
  2016-05-31 21:44   ` Leo Famulari
@ 2016-06-01  4:48     ` Efraim Flashner
  2016-06-02 13:51       ` Lukas Gradl
  2016-06-01  7:47     ` Ludovic Courtès
  2016-06-01 14:57     ` Lukas Gradl
  2 siblings, 1 reply; 13+ messages in thread
From: Efraim Flashner @ 2016-06-01  4:48 UTC (permalink / raw)
  To: Leo Famulari; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 2106 bytes --]

On Tue, May 31, 2016 at 05:44:00PM -0400, Leo Famulari wrote:
> On Tue, May 31, 2016 at 08:53:17AM -0500, Lukas Gradl wrote:
> > * gnu/packages/check.scm (googletest): New variable.
> 
> Awesome, thanks for this patch!
> 
> > +    (build-system cmake-build-system)
> 
> I noticed in the README.md that upstream suggests use of GNU Make unless
> building from a Git checkout. Did you try that?
> 
> > +    (native-inputs
> > +     `(("python-2" ,python-2)))
> 
> The README also suggests that this is only necessary for building from
> Git, although it's worth finding out what they mean by "re-generating
> certain source files from templates". We prefer to re-build "generated"
> source files since they are not really "source files" in many cases.
> 
> > +                  (replace 'install
> > +                    (lambda _
> > +                      (let ((out (assoc-ref %outputs "out")))
> > +                        (and
> > +                         (mkdir-p (string-append out "/lib"))
> > +                         (mkdir-p (string-append out "/include"))
> > +                         (zero?
> > +                          (system* "cp" "-r"
> > +                                   "../googletest-release-1.7.0/include"
> > +                                   out))
> > +                         (zero? (system* "cp" "libgtest.a" "libgtest_main.a"
> > +                                         (string-append out "/lib"))))))))))
> 
> I think these uses of (system*) could be replaced by (copy-recursively)
> and (install-file), respectively.
> 

I haven't tried building this package yet

(and -> you can probably switch this for a (begin

googletest-release-1.7.0 ->
(string-append "../google-release-" version "/include")

  (zero? (system* "cp" "libgtest.a" "libgtest_main.a"
won't this just copy libgtest.a to libgtest_main.a ?


-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH] Add googletest
  2016-05-31 21:44   ` Leo Famulari
  2016-06-01  4:48     ` Efraim Flashner
@ 2016-06-01  7:47     ` Ludovic Courtès
  2016-06-01 14:57     ` Lukas Gradl
  2 siblings, 0 replies; 13+ messages in thread
From: Ludovic Courtès @ 2016-06-01  7:47 UTC (permalink / raw)
  To: Leo Famulari; +Cc: guix-devel

Leo Famulari <leo@famulari.name> skribis:

> On Tue, May 31, 2016 at 08:53:17AM -0500, Lukas Gradl wrote:

[...]

>> +                  (replace 'install
>> +                    (lambda _
>> +                      (let ((out (assoc-ref %outputs "out")))
>> +                        (and
>> +                         (mkdir-p (string-append out "/lib"))
>> +                         (mkdir-p (string-append out "/include"))
>> +                         (zero?
>> +                          (system* "cp" "-r"
>> +                                   "../googletest-release-1.7.0/include"
>> +                                   out))
>> +                         (zero? (system* "cp" "libgtest.a" "libgtest_main.a"
>> +                                         (string-append out "/lib"))))))))))
>
> I think these uses of (system*) could be replaced by (copy-recursively)
> and (install-file), respectively.

s/could/should/ even  ;-)

Ludo’.

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

* Re: [PATCH] Add googletest
  2016-05-31 21:44   ` Leo Famulari
  2016-06-01  4:48     ` Efraim Flashner
  2016-06-01  7:47     ` Ludovic Courtès
@ 2016-06-01 14:57     ` Lukas Gradl
  2016-06-02  1:49       ` Leo Famulari
  2 siblings, 1 reply; 13+ messages in thread
From: Lukas Gradl @ 2016-06-01 14:57 UTC (permalink / raw)
  To: Leo Famulari; +Cc: guix-devel


Thank you for your review!

Leo Famulari <leo@famulari.name> writes:

> On Tue, May 31, 2016 at 08:53:17AM -0500, Lukas Gradl wrote:
>> * gnu/packages/check.scm (googletest): New variable.
>
> Awesome, thanks for this patch!
>
>> +    (build-system cmake-build-system)
>
> I noticed in the README.md that upstream suggests use of GNU Make unless
> building from a Git checkout. Did you try that?

I have not tried that.  Their README.md left me under the impression
that tests are not supported useing GNU Make, but I just looked at their
Makefile and there are test targets, so I can try using the
gnu-build-system, if that is preferred?

>
>> +    (native-inputs
>> +     `(("python-2" ,python-2)))
>
> The README also suggests that this is only necessary for building from
> Git, although it's worth finding out what they mean by "re-generating
> certain source files from templates". We prefer to re-build "generated"
> source files since they are not really "source files" in many cases.
>

It seems they generate c++ header files using pump.py.  I will look into
that more.  Python is also needed for tests.

>> +                  (replace 'install
>> +                    (lambda _
>> +                      (let ((out (assoc-ref %outputs "out")))
>> +                        (and
>> +                         (mkdir-p (string-append out "/lib"))
>> +                         (mkdir-p (string-append out "/include"))
>> +                         (zero?
>> +                          (system* "cp" "-r"
>> +                                   "../googletest-release-1.7.0/include"
>> +                                   out))
>> +                         (zero? (system* "cp" "libgtest.a" "libgtest_main.a"
>> +                                         (string-append out "/lib"))))))))))
>
> I think these uses of (system*) could be replaced by (copy-recursively)
> and (install-file), respectively.

These indeed sound very useful.  I will send an updated patch shortly.


Thank you!

Best,
Lukas

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

* Re: [PATCH] Add googletest
  2016-06-01 14:57     ` Lukas Gradl
@ 2016-06-02  1:49       ` Leo Famulari
  2016-06-02 15:44         ` Lukas Gradl
  0 siblings, 1 reply; 13+ messages in thread
From: Leo Famulari @ 2016-06-02  1:49 UTC (permalink / raw)
  To: Lukas Gradl; +Cc: guix-devel

On Wed, Jun 01, 2016 at 09:57:53AM -0500, Lukas Gradl wrote:
> Leo Famulari <leo@famulari.name> writes:
> > I noticed in the README.md that upstream suggests use of GNU Make unless
> > building from a Git checkout. Did you try that?
> 
> I have not tried that.  Their README.md left me under the impression
> that tests are not supported useing GNU Make, but I just looked at their
> Makefile and there are test targets, so I can try using the
> gnu-build-system, if that is preferred?

All else being equal, my personal preference is to use GNU tools. But
otherwise, we should use the build system that upstream supports most
fully. Especially, we should use the one that runs the tests.

> It seems they generate c++ header files using pump.py.  I will look into
> that more.  Python is also needed for tests.

Thanks for looking into that. If the header files are generated by other
code, then we prefer to build them ourselves rather than use the
"pre-compiled" headers.

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

* Re: [PATCH] Add googletest
  2016-06-01  4:48     ` Efraim Flashner
@ 2016-06-02 13:51       ` Lukas Gradl
  0 siblings, 0 replies; 13+ messages in thread
From: Lukas Gradl @ 2016-06-02 13:51 UTC (permalink / raw)
  To: Efraim Flashner; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 5099 bytes --]


Hi Efraim,

Thank you for your review!

Efraim Flashner <efraim@flashner.co.il> writes:

> On Tue, May 31, 2016 at 05:44:00PM -0400, Leo Famulari wrote:
>> On Tue, May 31, 2016 at 08:53:17AM -0500, Lukas Gradl wrote:
>> > * gnu/packages/check.scm (googletest): New variable.
>> 
>> Awesome, thanks for this patch!
>> 
>> > +    (build-system cmake-build-system)
>> 
>> I noticed in the README.md that upstream suggests use of GNU Make unless
>> building from a Git checkout. Did you try that?
>> 
>> > +    (native-inputs
>> > +     `(("python-2" ,python-2)))
>> 
>> The README also suggests that this is only necessary for building from
>> Git, although it's worth finding out what they mean by "re-generating
>> certain source files from templates". We prefer to re-build "generated"
>> source files since they are not really "source files" in many cases.
>> 
>> > +                  (replace 'install
>> > +                    (lambda _
>> > +                      (let ((out (assoc-ref %outputs "out")))
>> > +                        (and
>> > +                         (mkdir-p (string-append out "/lib"))
>> > +                         (mkdir-p (string-append out "/include"))
>> > +                         (zero?
>> > +                          (system* "cp" "-r"
>> > +                                   "../googletest-release-1.7.0/include"
>> > +                                   out))
>> > +                         (zero? (system* "cp" "libgtest.a" "libgtest_main.a"
>> > +                                         (string-append out "/lib"))))))))))
>> 
>> I think these uses of (system*) could be replaced by (copy-recursively)
>> and (install-file), respectively.
>> 
>
> I haven't tried building this package yet
>
> (and -> you can probably switch this for a (begin

OK, this is done.

> googletest-release-1.7.0 ->
> (string-append "../google-release-" version "/include")

I seem to have some trouble with that.  The package passes all phases
except for "install".  When it reaches install I get the following
error:

---8<--- cut here -------------------- start --->8---
      Start 40: gtest_xml_outfiles_test
40/41 Test #40: gtest_xml_outfiles_test ............   Passed    0.19 sec
      Start 41: gtest_xml_output_unittest
41/41 Test #41: gtest_xml_output_unittest ..........   Passed    0.12 sec

100% tests passed, 0 tests failed out of 41

Total Test time (real) =   4.68 sec
phase `check' succeeded after 6.7 seconds
starting phase `install'
Backtrace:
In ice-9/boot-9.scm:
 157: 13 [catch #t #<catch-closure 8c98e0> ...]
In unknown file:
   ?: 12 [apply-smob/1 #<catch-closure 8c98e0>]
In ice-9/boot-9.scm:
  63: 11 [call-with-prompt prompt0 ...]
In ice-9/eval.scm:
 432: 10 [eval # #]
In ice-9/boot-9.scm:
2401: 9 [save-module-excursion #<procedure 8e6880 at ice-9/boot-9.scm:4045:3 ()>]
4050: 8 [#<procedure 8e6880 at ice-9/boot-9.scm:4045:3 ()>]
1724: 7 [%start-stack load-stack #<procedure 8f9b20 at ice-9/boot-9.scm:4041:10 ()>]
1729: 6 [#<procedure 8fbc60 ()>]
In unknown file:
   ?: 5 [primitive-load "/gnu/store/yjwm79h6b6fswb9wdy2ak8b1bdz6s7hw-googletest-1.7.0-guile-builder"]
In ice-9/eval.scm:
 387: 4 [eval # ()]
In srfi/srfi-1.scm:
 830: 3 [every1 #<procedure d6fd80 at /gnu/store/915kgcfqqasrnf18rhznc77z96i01i6d-module-import/guix/build/gnu-build-system.scm:589:9 (expr)> ...]
In /gnu/store/915kgcfqqasrnf18rhznc77z96i01i6d-module-import/guix/build/gnu-build-system.scm:
 593: 2 [#<procedure d6fd80 at /gnu/store/915kgcfqqasrnf18rhznc77z96i01i6d-module-import/guix/build/gnu-build-system.scm:589:9 (expr)> #]
In ice-9/eval.scm:
 387: 1 [eval # #]
In unknown file:
   ?: 0 [string-append "../googletest-release-" #<procedure version ()> "/include"]

ERROR: In procedure string-append:
ERROR: In procedure string-append: Wrong type (expecting string): #<procedure version ()>
builder for `/gnu/store/ljnpvx73fqdg455nh1kj2ac2i3k9jy3r-googletest-1.7.0.drv' failed with exit code 1
@ build-failed /gnu/store/ljnpvx73fqdg455nh1kj2ac2i3k9jy3r-googletest-1.7.0.drv - 1 builder for `/gnu/store/ljnpvx73fqdg455nh1kj2ac2i3k9jy3r-googletest-1.7.0.drv' failed with exit code 1
guix build: error: build failed: build of `/gnu/store/ljnpvx73fqdg455nh1kj2ac2i3k9jy3r-googletest-1.7.0.drv' failed
lukas@serenity$ 
---8<--- cut here -------------------- end ----->8---

The patch that created this error is attached.  I am not sure what is
happening here.  Is all of the code in the argument of modify phases
executed in a different scope where "version" is something else?  I do
not quite understand this.

>   (zero? (system* "cp" "libgtest.a" "libgtest_main.a"
> won't this just copy libgtest.a to libgtest_main.a ?

I am not sure, but if it behaves like invoking "cp" on the command line,
then it should copy both of these to the directory that is on the next
line:
+                         (zero? (system* "cp" "libgtest.a" "libgtest_main.a"
+                                         (string-append out "/lib"))))))))))

I replaced all these statements with (install-file ...) and
(copy-recursively ...) as mentioned by Leo.

Thank you for your help!

Best,
Lukas


[-- Attachment #2: 0001-gnu-Add-googletest.patch --]
[-- Type: text/x-patch, Size: 2913 bytes --]

From c0cea38f6ccb281aa105aba00b3da3e4a5c8f7ef Mon Sep 17 00:00:00 2001
From: Lukas Gradl <lgradl@openmailbox.org>
Date: Thu, 2 Jun 2016 08:38:23 -0500
Subject: [PATCH] gnu: Add googletest.

* gnu/packages/check.scm (googletest): New variable.
---
 gnu/packages/check.scm | 44 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
index 9eef7a9..576ef61 100644
--- a/gnu/packages/check.scm
+++ b/gnu/packages/check.scm
@@ -5,6 +5,7 @@
 ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
+;;; Copyright © 2016 Lukas Gradl <lgradl@openmailbox.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -24,6 +25,7 @@
 (define-module (gnu packages check)
   #:use-module (gnu packages)
   #:use-module (gnu packages autotools)
+  #:use-module (gnu packages python)
   #:use-module (guix licenses)
   #:use-module (guix packages)
   #:use-module (guix download)
@@ -193,3 +195,45 @@ in the code.  Cppcheck primarily detects the types of bugs that the compilers
 normally do not detect.  The goal is to detect only real errors in the code
 (i.e. have zero false positives).")
     (license gpl3+)))
+
+(define-public googletest
+  (package
+    (name "googletest")
+    (version "1.7.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri
+        (string-append
+         "https://github.com/google/googletest/archive/release-"
+         version ".tar.gz"))
+       (sha256
+        (base32
+         "1k0nf1l9cb3prdmsvaajl5i31bx86c1mw0d5jgzykz7rzm36afpp"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("python-2" ,python-2)))
+    (arguments
+     `(#:configure-flags
+       '("-Dgtest_build_tests=ON")
+       #:phases
+       (modify-phases %standard-phases
+         (replace 'install
+           (lambda _
+             (let ((out (assoc-ref %outputs "out"))
+                   (version version))
+               (begin
+                 (mkdir-p (string-append out "/lib"))
+                 (mkdir-p (string-append out "/include"))
+                 (install-file "libgtest.a" (string-append out "/lib"))
+                 (install-file "libgtest_main.a" (string-append out "/lib"))
+                 (copy-recursively
+                  (string-append "../googletest-release-" version "/include")
+                  (string-append out "/lib")))))))))
+    (home-page "https://github.com/google/googletest/")
+    (synopsis "Test discovery and XUnit test framework")
+    (description "Google Test features an XUnit test framework, automated test
+discovery, death tests, assertions, parameterized tests and XML test report
+generation.")
+    (license bsd-3)))
+               
-- 
2.7.4


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

* Re: [PATCH] Add googletest
  2016-06-02  1:49       ` Leo Famulari
@ 2016-06-02 15:44         ` Lukas Gradl
  2016-06-05 13:12           ` Efraim Flashner
  0 siblings, 1 reply; 13+ messages in thread
From: Lukas Gradl @ 2016-06-02 15:44 UTC (permalink / raw)
  To: Leo Famulari; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 1627 bytes --]


Hi Leo,

Leo Famulari <leo@famulari.name> writes:

> On Wed, Jun 01, 2016 at 09:57:53AM -0500, Lukas Gradl wrote:
>> Leo Famulari <leo@famulari.name> writes:
>> > I noticed in the README.md that upstream suggests use of GNU Make unless
>> > building from a Git checkout. Did you try that?
>> 
>> I have not tried that.  Their README.md left me under the impression
>> that tests are not supported useing GNU Make, but I just looked at their
>> Makefile and there are test targets, so I can try using the
>> gnu-build-system, if that is preferred?
>
> All else being equal, my personal preference is to use GNU tools. But
> otherwise, we should use the build system that upstream supports most
> fully. Especially, we should use the one that runs the tests.

Sounds good.  I switched to the gnu-build-system + autotools.  This also
made the "install" phase somewhat easier.

>> It seems they generate c++ header files using pump.py.  I will look into
>> that more.  Python is also needed for tests.
>
> Thanks for looking into that. If the header files are generated by other
> code, then we prefer to build them ourselves rather than use the
> "pre-compiled" headers.

The tool "pump.py" is distributed with the Googletest source.  It
appears to be a part of the source rather than a bundeled dependency and
the only reference to it that I found was in Googletest, so I would
assume it is a part of Googletest.  Therefore I did not create a
seperate package for that, but used the one provided in the Googletest
source tree.  With that, the pre-generated headers can be reproduced.
The attached patch does that.

Thank you!



[-- Attachment #2: 0001-gnu-Add-googletest.patch --]
[-- Type: text/x-patch, Size: 3952 bytes --]

From 7d4aaba39821130ba824c4b2f8bd236e0d1f1639 Mon Sep 17 00:00:00 2001
From: Lukas Gradl <lgradl@openmailbox.org>
Date: Thu, 2 Jun 2016 10:36:17 -0500
Subject: [PATCH] gnu: Add googletest.

* gnu/packages/check.scm (googletest): New variable.
---
 gnu/packages/check.scm | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 64 insertions(+)

diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
index 9eef7a9..4971c71 100644
--- a/gnu/packages/check.scm
+++ b/gnu/packages/check.scm
@@ -5,6 +5,7 @@
 ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
+;;; Copyright © 2016 Lukas Gradl <lgradl@openmailbox.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -24,6 +25,7 @@
 (define-module (gnu packages check)
   #:use-module (gnu packages)
   #:use-module (gnu packages autotools)
+  #:use-module (gnu packages python)
   #:use-module (guix licenses)
   #:use-module (guix packages)
   #:use-module (guix download)
@@ -193,3 +195,65 @@ in the code.  Cppcheck primarily detects the types of bugs that the compilers
 normally do not detect.  The goal is to detect only real errors in the code
 (i.e. have zero false positives).")
     (license gpl3+)))
+
+(define-public googletest
+  (package
+    (name "googletest")
+    (version "1.7.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri
+        (string-append
+         "https://github.com/google/googletest/archive/release-"
+         version ".tar.gz"))
+       (sha256
+        (base32
+         "1k0nf1l9cb3prdmsvaajl5i31bx86c1mw0d5jgzykz7rzm36afpp"))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("python-2" ,python-2)
+       ("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)))
+    (arguments
+     `( #:phases
+       (modify-phases %standard-phases
+         (add-before 'configure 'autoconf
+                      (lambda _
+                        (zero? (system* "autoreconf" "-vfi"))))
+         (add-before 'autoconf 'generate-headers
+           (lambda _
+             (begin
+               (delete-file "include/gtest/gtest-param-test.h")
+               (system* "python2" "scripts/pump.py"
+                        "include/gtest/gtest-param-test.h.pump")
+               (delete-file "include/gtest/internal/gtest-tuple.h")
+               (system* "python2" "scripts/pump.py"
+                        "include/gtest//internal/gtest-tuple.h.pump")
+               (delete-file
+                "include/gtest/internal/gtest-param-util-generated.h")
+               (system*
+                "python2" "scripts/pump.py"
+                "include/gtest/internal/gtest-param-util-generated.h.pump")
+               (delete-file "include/gtest/internal/gtest-type-util.h")
+               (system* "python2" "scripts/pump.py"
+                        "include/gtest/internal/gtest-type-util.h.pump"))))
+         (replace 'install
+           (lambda _
+             (let ((out (assoc-ref %outputs "out"))
+                   (version version))
+               (begin
+                 (install-file "lib/.libs/libgtest_main.a"
+                               (string-append out "/lib"))
+                 (install-file "lib/.libs/libgtest.a"
+                               (string-append out "/lib"))
+                 (copy-recursively
+                  (string-append "include")
+                  (string-append out "/include")))))))))
+    (home-page "https://github.com/google/googletest/")
+    (synopsis "Test discovery and XUnit test framework")
+    (description "Google Test features an XUnit test framework, automated test
+discovery, death tests, assertions, parameterized tests and XML test report
+generation.")
+    (license bsd-3)))
-- 
2.7.4


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

* Re: [PATCH] Add googletest
  2016-06-02 15:44         ` Lukas Gradl
@ 2016-06-05 13:12           ` Efraim Flashner
  2016-06-05 21:09             ` Lukas Gradl
  0 siblings, 1 reply; 13+ messages in thread
From: Efraim Flashner @ 2016-06-05 13:12 UTC (permalink / raw)
  To: Lukas Gradl; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 5193 bytes --]

On Thu, Jun 02, 2016 at 10:44:58AM -0500, Lukas Gradl wrote:
> 
> Hi Leo,
> 
...
>
> The tool "pump.py" is distributed with the Googletest source.  It
> appears to be a part of the source rather than a bundeled dependency and
> the only reference to it that I found was in Googletest, so I would
> assume it is a part of Googletest.  Therefore I did not create a
> seperate package for that, but used the one provided in the Googletest
> source tree.  With that, the pre-generated headers can be reproduced.
> The attached patch does that.
> 
> Thank you!
> 

A couple last things I found, otherwise it looks great.

> From 7d4aaba39821130ba824c4b2f8bd236e0d1f1639 Mon Sep 17 00:00:00 2001
> From: Lukas Gradl <lgradl@openmailbox.org>
> Date: Thu, 2 Jun 2016 10:36:17 -0500
> Subject: [PATCH] gnu: Add googletest.
> 
> * gnu/packages/check.scm (googletest): New variable.
> ---
>  gnu/packages/check.scm | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 64 insertions(+)
> 
> diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
> index 9eef7a9..4971c71 100644
> --- a/gnu/packages/check.scm
> +++ b/gnu/packages/check.scm
> @@ -5,6 +5,7 @@
>  ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
>  ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
>  ;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
> +;;; Copyright © 2016 Lukas Gradl <lgradl@openmailbox.org>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -24,6 +25,7 @@
>  (define-module (gnu packages check)
>    #:use-module (gnu packages)
>    #:use-module (gnu packages autotools)
> +  #:use-module (gnu packages python)
>    #:use-module (guix licenses)
>    #:use-module (guix packages)
>    #:use-module (guix download)
> @@ -193,3 +195,65 @@ in the code.  Cppcheck primarily detects the types of bugs that the compilers
>  normally do not detect.  The goal is to detect only real errors in the code
>  (i.e. have zero false positives).")
>      (license gpl3+)))
> +
> +(define-public googletest
> +  (package
> +    (name "googletest")
> +    (version "1.7.0")
> +    (source
> +     (origin
> +       (method url-fetch)
> +       (uri
> +        (string-append
> +         "https://github.com/google/googletest/archive/release-"
> +         version ".tar.gz"))

add:    (file-name (string-append name "-" version ".tar.gz"))

> +       (sha256
> +        (base32
> +         "1k0nf1l9cb3prdmsvaajl5i31bx86c1mw0d5jgzykz7rzm36afpp"))))
> +    (build-system gnu-build-system)
> +    (native-inputs
> +     `(("python-2" ,python-2)
> +       ("autoconf" ,autoconf)
> +       ("automake" ,automake)
> +       ("libtool" ,libtool)))
> +    (arguments
> +     `( #:phases
> +       (modify-phases %standard-phases
> +         (add-before 'configure 'autoconf
> +                      (lambda _
> +                        (zero? (system* "autoreconf" "-vfi"))))
> +         (add-before 'autoconf 'generate-headers
> +           (lambda _
> +             (begin
> +               (delete-file "include/gtest/gtest-param-test.h")
> +               (system* "python2" "scripts/pump.py"
> +                        "include/gtest/gtest-param-test.h.pump")
> +               (delete-file "include/gtest/internal/gtest-tuple.h")
> +               (system* "python2" "scripts/pump.py"
> +                        "include/gtest//internal/gtest-tuple.h.pump")
> +               (delete-file
> +                "include/gtest/internal/gtest-param-util-generated.h")
> +               (system*
> +                "python2" "scripts/pump.py"
> +                "include/gtest/internal/gtest-param-util-generated.h.pump")
> +               (delete-file "include/gtest/internal/gtest-type-util.h")
> +               (system* "python2" "scripts/pump.py"
> +                        "include/gtest/internal/gtest-type-util.h.pump"))))
> +         (replace 'install
> +           (lambda _
> +             (let ((out (assoc-ref %outputs "out"))
> +                   (version version))
                                      ^
you don't actually use this variable --

> +               (begin
> +                 (install-file "lib/.libs/libgtest_main.a"
> +                               (string-append out "/lib"))
> +                 (install-file "lib/.libs/libgtest.a"
> +                               (string-append out "/lib"))
> +                 (copy-recursively
> +                  (string-append "include")

don't need the string-append above

> +                  (string-append out "/include")))))))))
> +    (home-page "https://github.com/google/googletest/")
> +    (synopsis "Test discovery and XUnit test framework")
> +    (description "Google Test features an XUnit test framework, automated test
> +discovery, death tests, assertions, parameterized tests and XML test report
> +generation.")
> +    (license bsd-3)))
> -- 
> 2.7.4
> 


-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH] Add googletest
  2016-06-05 13:12           ` Efraim Flashner
@ 2016-06-05 21:09             ` Lukas Gradl
  2016-06-09 18:40               ` Efraim Flashner
  0 siblings, 1 reply; 13+ messages in thread
From: Lukas Gradl @ 2016-06-05 21:09 UTC (permalink / raw)
  To: Efraim Flashner; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 5377 bytes --]

Efraim Flashner <efraim@flashner.co.il> writes:

> On Thu, Jun 02, 2016 at 10:44:58AM -0500, Lukas Gradl wrote:
>> 
>> Hi Leo,
>> 
> ...
>>
>> The tool "pump.py" is distributed with the Googletest source.  It
>> appears to be a part of the source rather than a bundeled dependency and
>> the only reference to it that I found was in Googletest, so I would
>> assume it is a part of Googletest.  Therefore I did not create a
>> seperate package for that, but used the one provided in the Googletest
>> source tree.  With that, the pre-generated headers can be reproduced.
>> The attached patch does that.
>> 
>> Thank you!
>> 
>
> A couple last things I found, otherwise it looks great.
>
>> From 7d4aaba39821130ba824c4b2f8bd236e0d1f1639 Mon Sep 17 00:00:00 2001
>> From: Lukas Gradl <lgradl@openmailbox.org>
>> Date: Thu, 2 Jun 2016 10:36:17 -0500
>> Subject: [PATCH] gnu: Add googletest.
>> 
>> * gnu/packages/check.scm (googletest): New variable.
>> ---
>>  gnu/packages/check.scm | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++
>>  1 file changed, 64 insertions(+)
>> 
>> diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
>> index 9eef7a9..4971c71 100644
>> --- a/gnu/packages/check.scm
>> +++ b/gnu/packages/check.scm
>> @@ -5,6 +5,7 @@
>>  ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
>>  ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
>>  ;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
>> +;;; Copyright © 2016 Lukas Gradl <lgradl@openmailbox.org>
>>  ;;;
>>  ;;; This file is part of GNU Guix.
>>  ;;;
>> @@ -24,6 +25,7 @@
>>  (define-module (gnu packages check)
>>    #:use-module (gnu packages)
>>    #:use-module (gnu packages autotools)
>> +  #:use-module (gnu packages python)
>>    #:use-module (guix licenses)
>>    #:use-module (guix packages)
>>    #:use-module (guix download)
>> @@ -193,3 +195,65 @@ in the code.  Cppcheck primarily detects the types of bugs that the compilers
>>  normally do not detect.  The goal is to detect only real errors in the code
>>  (i.e. have zero false positives).")
>>      (license gpl3+)))
>> +
>> +(define-public googletest
>> +  (package
>> +    (name "googletest")
>> +    (version "1.7.0")
>> +    (source
>> +     (origin
>> +       (method url-fetch)
>> +       (uri
>> +        (string-append
>> +         "https://github.com/google/googletest/archive/release-"
>> +         version ".tar.gz"))
>
> add:    (file-name (string-append name "-" version ".tar.gz"))

I added it.

>
>> +       (sha256
>> +        (base32
>> +         "1k0nf1l9cb3prdmsvaajl5i31bx86c1mw0d5jgzykz7rzm36afpp"))))
>> +    (build-system gnu-build-system)
>> +    (native-inputs
>> +     `(("python-2" ,python-2)
>> +       ("autoconf" ,autoconf)
>> +       ("automake" ,automake)
>> +       ("libtool" ,libtool)))
>> +    (arguments
>> +     `( #:phases
>> +       (modify-phases %standard-phases
>> +         (add-before 'configure 'autoconf
>> +                      (lambda _
>> +                        (zero? (system* "autoreconf" "-vfi"))))
>> +         (add-before 'autoconf 'generate-headers
>> +           (lambda _
>> +             (begin
>> +               (delete-file "include/gtest/gtest-param-test.h")
>> +               (system* "python2" "scripts/pump.py"
>> +                        "include/gtest/gtest-param-test.h.pump")
>> +               (delete-file "include/gtest/internal/gtest-tuple.h")
>> +               (system* "python2" "scripts/pump.py"
>> +                        "include/gtest//internal/gtest-tuple.h.pump")
>> +               (delete-file
>> +                "include/gtest/internal/gtest-param-util-generated.h")
>> +               (system*
>> +                "python2" "scripts/pump.py"
>> +                "include/gtest/internal/gtest-param-util-generated.h.pump")
>> +               (delete-file "include/gtest/internal/gtest-type-util.h")
>> +               (system* "python2" "scripts/pump.py"
>> +                        "include/gtest/internal/gtest-type-util.h.pump"))))
>> +         (replace 'install
>> +           (lambda _
>> +             (let ((out (assoc-ref %outputs "out"))
>> +                   (version version))
>                                       ^
> you don't actually use this variable --
>

Oh, Sorry about that.  This is a leftover from a previous attemt that I
forgot to remove.

>> +               (begin
>> +                 (install-file "lib/.libs/libgtest_main.a"
>> +                               (string-append out "/lib"))
>> +                 (install-file "lib/.libs/libgtest.a"
>> +                               (string-append out "/lib"))
>> +                 (copy-recursively
>> +                  (string-append "include")
>
> don't need the string-append above
>

Same here.

>> +                  (string-append out "/include")))))))))
>> +    (home-page "https://github.com/google/googletest/")
>> +    (synopsis "Test discovery and XUnit test framework")
>> +    (description "Google Test features an XUnit test framework, automated test
>> +discovery, death tests, assertions, parameterized tests and XML test report
>> +generation.")
>> +    (license bsd-3)))
>> -- 
>> 2.7.4
>> 


Thank you for your review!

An updated patch is attached.

Best,
Lukas



[-- Attachment #2: 0001-gnu-Add-googletest.patch --]
[-- Type: text/x-patch, Size: 3940 bytes --]

From 54223517c0c05b5c5bfcca055c8b12cb650c8b40 Mon Sep 17 00:00:00 2001
From: Lukas Gradl <lgradl@openmailbox.org>
Date: Sun, 5 Jun 2016 16:03:56 -0500
Subject: [PATCH] gnu: Add googletest.

* gnu/packages/check.scm (googletest): New variable.
---
 gnu/packages/check.scm | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 63 insertions(+)

diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
index 9eef7a9..64b5006 100644
--- a/gnu/packages/check.scm
+++ b/gnu/packages/check.scm
@@ -5,6 +5,7 @@
 ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
+;;; Copyright © 2016 Lukas Gradl <lgradl@openmailbox.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -24,6 +25,7 @@
 (define-module (gnu packages check)
   #:use-module (gnu packages)
   #:use-module (gnu packages autotools)
+  #:use-module (gnu packages python)
   #:use-module (guix licenses)
   #:use-module (guix packages)
   #:use-module (guix download)
@@ -193,3 +195,64 @@ in the code.  Cppcheck primarily detects the types of bugs that the compilers
 normally do not detect.  The goal is to detect only real errors in the code
 (i.e. have zero false positives).")
     (license gpl3+)))
+
+(define-public googletest
+  (package
+    (name "googletest")
+    (version "1.7.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri
+        (string-append
+         "https://github.com/google/googletest/archive/release-"
+         version ".tar.gz"))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32
+         "1k0nf1l9cb3prdmsvaajl5i31bx86c1mw0d5jgzykz7rzm36afpp"))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("python-2" ,python-2)
+       ("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)))
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-before 'configure 'autoconf
+                      (lambda _
+                        (zero? (system* "autoreconf" "-vfi"))))
+         (add-before 'autoconf 'generate-headers
+           (lambda _
+             (begin
+               (delete-file "include/gtest/gtest-param-test.h")
+               (system* "python2" "scripts/pump.py"
+                        "include/gtest/gtest-param-test.h.pump")
+               (delete-file "include/gtest/internal/gtest-tuple.h")
+               (system* "python2" "scripts/pump.py"
+                        "include/gtest//internal/gtest-tuple.h.pump")
+               (delete-file
+                "include/gtest/internal/gtest-param-util-generated.h")
+               (system*
+                "python2" "scripts/pump.py"
+                "include/gtest/internal/gtest-param-util-generated.h.pump")
+               (delete-file "include/gtest/internal/gtest-type-util.h")
+               (system* "python2" "scripts/pump.py"
+                        "include/gtest/internal/gtest-type-util.h.pump"))))
+         (replace 'install
+           (lambda _
+             (let ((out (assoc-ref %outputs "out")))
+               (begin
+                 (install-file "lib/.libs/libgtest_main.a"
+                               (string-append out "/lib"))
+                 (install-file "lib/.libs/libgtest.a"
+                               (string-append out "/lib"))
+                 (copy-recursively "include"
+                  (string-append out "/include")))))))))
+    (home-page "https://github.com/google/googletest/")
+    (synopsis "Test discovery and XUnit test framework")
+    (description "Google Test features an XUnit test framework, automated test
+discovery, death tests, assertions, parameterized tests and XML test report
+generation.")
+    (license bsd-3)))
-- 
2.7.4


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

* Re: [PATCH] Add googletest
  2016-06-05 21:09             ` Lukas Gradl
@ 2016-06-09 18:40               ` Efraim Flashner
  2016-06-09 22:17                 ` Lukas Gradl
  0 siblings, 1 reply; 13+ messages in thread
From: Efraim Flashner @ 2016-06-09 18:40 UTC (permalink / raw)
  To: Lukas Gradl; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 10107 bytes --]

On Sun, Jun 05, 2016 at 04:09:28PM -0500, Lukas Gradl wrote:
> Efraim Flashner <efraim@flashner.co.il> writes:
> 
> > On Thu, Jun 02, 2016 at 10:44:58AM -0500, Lukas Gradl wrote:
> >> 
> >> Hi Leo,
> >> 
> > ...
> >>
> >> The tool "pump.py" is distributed with the Googletest source.  It
> >> appears to be a part of the source rather than a bundeled dependency and
> >> the only reference to it that I found was in Googletest, so I would
> >> assume it is a part of Googletest.  Therefore I did not create a
> >> seperate package for that, but used the one provided in the Googletest
> >> source tree.  With that, the pre-generated headers can be reproduced.
> >> The attached patch does that.
> >> 
> >> Thank you!
> >> 
> >
> > A couple last things I found, otherwise it looks great.
> >
> >> From 7d4aaba39821130ba824c4b2f8bd236e0d1f1639 Mon Sep 17 00:00:00 2001
> >> From: Lukas Gradl <lgradl@openmailbox.org>
> >> Date: Thu, 2 Jun 2016 10:36:17 -0500
> >> Subject: [PATCH] gnu: Add googletest.
> >> 
> >> * gnu/packages/check.scm (googletest): New variable.
> >> ---
> >>  gnu/packages/check.scm | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++
> >>  1 file changed, 64 insertions(+)
> >> 
> >> diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
> >> index 9eef7a9..4971c71 100644
> >> --- a/gnu/packages/check.scm
> >> +++ b/gnu/packages/check.scm
> >> @@ -5,6 +5,7 @@
> >>  ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
> >>  ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
> >>  ;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
> >> +;;; Copyright © 2016 Lukas Gradl <lgradl@openmailbox.org>
> >>  ;;;
> >>  ;;; This file is part of GNU Guix.
> >>  ;;;
> >> @@ -24,6 +25,7 @@
> >>  (define-module (gnu packages check)
> >>    #:use-module (gnu packages)
> >>    #:use-module (gnu packages autotools)
> >> +  #:use-module (gnu packages python)
> >>    #:use-module (guix licenses)
> >>    #:use-module (guix packages)
> >>    #:use-module (guix download)
> >> @@ -193,3 +195,65 @@ in the code.  Cppcheck primarily detects the types of bugs that the compilers
> >>  normally do not detect.  The goal is to detect only real errors in the code
> >>  (i.e. have zero false positives).")
> >>      (license gpl3+)))
> >> +
> >> +(define-public googletest
> >> +  (package
> >> +    (name "googletest")
> >> +    (version "1.7.0")
> >> +    (source
> >> +     (origin
> >> +       (method url-fetch)
> >> +       (uri
> >> +        (string-append
> >> +         "https://github.com/google/googletest/archive/release-"
> >> +         version ".tar.gz"))
> >
> > add:    (file-name (string-append name "-" version ".tar.gz"))
> 
> I added it.
> 
> >
> >> +       (sha256
> >> +        (base32
> >> +         "1k0nf1l9cb3prdmsvaajl5i31bx86c1mw0d5jgzykz7rzm36afpp"))))
> >> +    (build-system gnu-build-system)
> >> +    (native-inputs
> >> +     `(("python-2" ,python-2)
> >> +       ("autoconf" ,autoconf)
> >> +       ("automake" ,automake)
> >> +       ("libtool" ,libtool)))
> >> +    (arguments
> >> +     `( #:phases
> >> +       (modify-phases %standard-phases
> >> +         (add-before 'configure 'autoconf
> >> +                      (lambda _
> >> +                        (zero? (system* "autoreconf" "-vfi"))))
> >> +         (add-before 'autoconf 'generate-headers
> >> +           (lambda _
> >> +             (begin
> >> +               (delete-file "include/gtest/gtest-param-test.h")
> >> +               (system* "python2" "scripts/pump.py"
> >> +                        "include/gtest/gtest-param-test.h.pump")
> >> +               (delete-file "include/gtest/internal/gtest-tuple.h")
> >> +               (system* "python2" "scripts/pump.py"
> >> +                        "include/gtest//internal/gtest-tuple.h.pump")
> >> +               (delete-file
> >> +                "include/gtest/internal/gtest-param-util-generated.h")
> >> +               (system*
> >> +                "python2" "scripts/pump.py"
> >> +                "include/gtest/internal/gtest-param-util-generated.h.pump")
> >> +               (delete-file "include/gtest/internal/gtest-type-util.h")
> >> +               (system* "python2" "scripts/pump.py"
> >> +                        "include/gtest/internal/gtest-type-util.h.pump"))))
> >> +         (replace 'install
> >> +           (lambda _
> >> +             (let ((out (assoc-ref %outputs "out"))
> >> +                   (version version))
> >                                       ^
> > you don't actually use this variable --
> >
> 
> Oh, Sorry about that.  This is a leftover from a previous attemt that I
> forgot to remove.
> 
> >> +               (begin
> >> +                 (install-file "lib/.libs/libgtest_main.a"
> >> +                               (string-append out "/lib"))
> >> +                 (install-file "lib/.libs/libgtest.a"
> >> +                               (string-append out "/lib"))
> >> +                 (copy-recursively
> >> +                  (string-append "include")
> >
> > don't need the string-append above
> >
> 
> Same here.
> 
> >> +                  (string-append out "/include")))))))))
> >> +    (home-page "https://github.com/google/googletest/")
> >> +    (synopsis "Test discovery and XUnit test framework")
> >> +    (description "Google Test features an XUnit test framework, automated test
> >> +discovery, death tests, assertions, parameterized tests and XML test report
> >> +generation.")
> >> +    (license bsd-3)))
> >> -- 
> >> 2.7.4
> >> 
> 
> 
> Thank you for your review!
> 
> An updated patch is attached.
> 
> Best,
> Lukas
> 
> 

> From 54223517c0c05b5c5bfcca055c8b12cb650c8b40 Mon Sep 17 00:00:00 2001
> From: Lukas Gradl <lgradl@openmailbox.org>
> Date: Sun, 5 Jun 2016 16:03:56 -0500
> Subject: [PATCH] gnu: Add googletest.
> 
> * gnu/packages/check.scm (googletest): New variable.
> ---
>  gnu/packages/check.scm | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 63 insertions(+)
> 
> diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
> index 9eef7a9..64b5006 100644
> --- a/gnu/packages/check.scm
> +++ b/gnu/packages/check.scm
> @@ -5,6 +5,7 @@
>  ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
>  ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
>  ;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
> +;;; Copyright © 2016 Lukas Gradl <lgradl@openmailbox.org>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -24,6 +25,7 @@
>  (define-module (gnu packages check)
>    #:use-module (gnu packages)
>    #:use-module (gnu packages autotools)
> +  #:use-module (gnu packages python)
>    #:use-module (guix licenses)
>    #:use-module (guix packages)
>    #:use-module (guix download)
> @@ -193,3 +195,64 @@ in the code.  Cppcheck primarily detects the types of bugs that the compilers
>  normally do not detect.  The goal is to detect only real errors in the code
>  (i.e. have zero false positives).")
>      (license gpl3+)))
> +
> +(define-public googletest
> +  (package
> +    (name "googletest")
> +    (version "1.7.0")
> +    (source
> +     (origin
> +       (method url-fetch)
> +       (uri
> +        (string-append
> +         "https://github.com/google/googletest/archive/release-"
> +         version ".tar.gz"))
> +       (file-name (string-append name "-" version ".tar.gz"))
> +       (sha256
> +        (base32
> +         "1k0nf1l9cb3prdmsvaajl5i31bx86c1mw0d5jgzykz7rzm36afpp"))))
> +    (build-system gnu-build-system)
> +    (native-inputs
> +     `(("python-2" ,python-2)
> +       ("autoconf" ,autoconf)
> +       ("automake" ,automake)
> +       ("libtool" ,libtool)))
> +    (arguments
> +     `(#:phases
> +       (modify-phases %standard-phases
> +         (add-before 'configure 'autoconf
> +                      (lambda _
> +                        (zero? (system* "autoreconf" "-vfi"))))
> +         (add-before 'autoconf 'generate-headers
> +           (lambda _
> +             (begin
> +               (delete-file "include/gtest/gtest-param-test.h")
> +               (system* "python2" "scripts/pump.py"
> +                        "include/gtest/gtest-param-test.h.pump")
> +               (delete-file "include/gtest/internal/gtest-tuple.h")
> +               (system* "python2" "scripts/pump.py"
> +                        "include/gtest//internal/gtest-tuple.h.pump")
> +               (delete-file
> +                "include/gtest/internal/gtest-param-util-generated.h")
> +               (system*
> +                "python2" "scripts/pump.py"
> +                "include/gtest/internal/gtest-param-util-generated.h.pump")
> +               (delete-file "include/gtest/internal/gtest-type-util.h")
> +               (system* "python2" "scripts/pump.py"
> +                        "include/gtest/internal/gtest-type-util.h.pump"))))
> +         (replace 'install
> +           (lambda _
> +             (let ((out (assoc-ref %outputs "out")))
> +               (begin
> +                 (install-file "lib/.libs/libgtest_main.a"
> +                               (string-append out "/lib"))
> +                 (install-file "lib/.libs/libgtest.a"
> +                               (string-append out "/lib"))
> +                 (copy-recursively "include"
> +                  (string-append out "/include")))))))))
> +    (home-page "https://github.com/google/googletest/")
> +    (synopsis "Test discovery and XUnit test framework")
> +    (description "Google Test features an XUnit test framework, automated test
> +discovery, death tests, assertions, parameterized tests and XML test report
> +generation.")
> +    (license bsd-3)))
> -- 
> 2.7.4
> 

Patch pushed!


-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH] Add googletest
  2016-06-09 18:40               ` Efraim Flashner
@ 2016-06-09 22:17                 ` Lukas Gradl
  0 siblings, 0 replies; 13+ messages in thread
From: Lukas Gradl @ 2016-06-09 22:17 UTC (permalink / raw)
  To: Efraim Flashner; +Cc: guix-devel

Efraim Flashner <efraim@flashner.co.il> writes:

> On Sun, Jun 05, 2016 at 04:09:28PM -0500, Lukas Gradl wrote:
>> Efraim Flashner <efraim@flashner.co.il> writes:
>> 
>> > On Thu, Jun 02, 2016 at 10:44:58AM -0500, Lukas Gradl wrote:
>> >> 
>> >> Hi Leo,
>> >> 
>> > ...
>> >>
>> >> The tool "pump.py" is distributed with the Googletest source.  It
>> >> appears to be a part of the source rather than a bundeled dependency and
>> >> the only reference to it that I found was in Googletest, so I would
>> >> assume it is a part of Googletest.  Therefore I did not create a
>> >> seperate package for that, but used the one provided in the Googletest
>> >> source tree.  With that, the pre-generated headers can be reproduced.
>> >> The attached patch does that.
>> >> 
>> >> Thank you!
>> >> 
>> >
>> > A couple last things I found, otherwise it looks great.
>> >
>> >> From 7d4aaba39821130ba824c4b2f8bd236e0d1f1639 Mon Sep 17 00:00:00 2001
>> >> From: Lukas Gradl <lgradl@openmailbox.org>
>> >> Date: Thu, 2 Jun 2016 10:36:17 -0500
>> >> Subject: [PATCH] gnu: Add googletest.
>> >> 
>> >> * gnu/packages/check.scm (googletest): New variable.
>> >> ---
>> >>  gnu/packages/check.scm | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++
>> >>  1 file changed, 64 insertions(+)
>> >> 
>> >> diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
>> >> index 9eef7a9..4971c71 100644
>> >> --- a/gnu/packages/check.scm
>> >> +++ b/gnu/packages/check.scm
>> >> @@ -5,6 +5,7 @@
>> >>  ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
>> >>  ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
>> >>  ;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
>> >> +;;; Copyright © 2016 Lukas Gradl <lgradl@openmailbox.org>
>> >>  ;;;
>> >>  ;;; This file is part of GNU Guix.
>> >>  ;;;
>> >> @@ -24,6 +25,7 @@
>> >>  (define-module (gnu packages check)
>> >>    #:use-module (gnu packages)
>> >>    #:use-module (gnu packages autotools)
>> >> +  #:use-module (gnu packages python)
>> >>    #:use-module (guix licenses)
>> >>    #:use-module (guix packages)
>> >>    #:use-module (guix download)
>> >> @@ -193,3 +195,65 @@ in the code.  Cppcheck primarily detects the types of bugs that the compilers
>> >>  normally do not detect.  The goal is to detect only real errors in the code
>> >>  (i.e. have zero false positives).")
>> >>      (license gpl3+)))
>> >> +
>> >> +(define-public googletest
>> >> +  (package
>> >> +    (name "googletest")
>> >> +    (version "1.7.0")
>> >> +    (source
>> >> +     (origin
>> >> +       (method url-fetch)
>> >> +       (uri
>> >> +        (string-append
>> >> +         "https://github.com/google/googletest/archive/release-"
>> >> +         version ".tar.gz"))
>> >
>> > add:    (file-name (string-append name "-" version ".tar.gz"))
>> 
>> I added it.
>> 
>> >
>> >> +       (sha256
>> >> +        (base32
>> >> +         "1k0nf1l9cb3prdmsvaajl5i31bx86c1mw0d5jgzykz7rzm36afpp"))))
>> >> +    (build-system gnu-build-system)
>> >> +    (native-inputs
>> >> +     `(("python-2" ,python-2)
>> >> +       ("autoconf" ,autoconf)
>> >> +       ("automake" ,automake)
>> >> +       ("libtool" ,libtool)))
>> >> +    (arguments
>> >> +     `( #:phases
>> >> +       (modify-phases %standard-phases
>> >> +         (add-before 'configure 'autoconf
>> >> +                      (lambda _
>> >> +                        (zero? (system* "autoreconf" "-vfi"))))
>> >> +         (add-before 'autoconf 'generate-headers
>> >> +           (lambda _
>> >> +             (begin
>> >> +               (delete-file "include/gtest/gtest-param-test.h")
>> >> +               (system* "python2" "scripts/pump.py"
>> >> +                        "include/gtest/gtest-param-test.h.pump")
>> >> +               (delete-file "include/gtest/internal/gtest-tuple.h")
>> >> +               (system* "python2" "scripts/pump.py"
>> >> +                        "include/gtest//internal/gtest-tuple.h.pump")
>> >> +               (delete-file
>> >> +                "include/gtest/internal/gtest-param-util-generated.h")
>> >> +               (system*
>> >> +                "python2" "scripts/pump.py"
>> >> +                "include/gtest/internal/gtest-param-util-generated.h.pump")
>> >> +               (delete-file "include/gtest/internal/gtest-type-util.h")
>> >> +               (system* "python2" "scripts/pump.py"
>> >> +                        "include/gtest/internal/gtest-type-util.h.pump"))))
>> >> +         (replace 'install
>> >> +           (lambda _
>> >> +             (let ((out (assoc-ref %outputs "out"))
>> >> +                   (version version))
>> >                                       ^
>> > you don't actually use this variable --
>> >
>> 
>> Oh, Sorry about that.  This is a leftover from a previous attemt that I
>> forgot to remove.
>> 
>> >> +               (begin
>> >> +                 (install-file "lib/.libs/libgtest_main.a"
>> >> +                               (string-append out "/lib"))
>> >> +                 (install-file "lib/.libs/libgtest.a"
>> >> +                               (string-append out "/lib"))
>> >> +                 (copy-recursively
>> >> +                  (string-append "include")
>> >
>> > don't need the string-append above
>> >
>> 
>> Same here.
>> 
>> >> +                  (string-append out "/include")))))))))
>> >> +    (home-page "https://github.com/google/googletest/")
>> >> +    (synopsis "Test discovery and XUnit test framework")
>> >> +    (description "Google Test features an XUnit test framework, automated test
>> >> +discovery, death tests, assertions, parameterized tests and XML test report
>> >> +generation.")
>> >> +    (license bsd-3)))
>> >> -- 
>> >> 2.7.4
>> >> 
>> 
>> 
>> Thank you for your review!
>> 
>> An updated patch is attached.
>> 
>> Best,
>> Lukas
>> 
>> 
>
>> From 54223517c0c05b5c5bfcca055c8b12cb650c8b40 Mon Sep 17 00:00:00 2001
>> From: Lukas Gradl <lgradl@openmailbox.org>
>> Date: Sun, 5 Jun 2016 16:03:56 -0500
>> Subject: [PATCH] gnu: Add googletest.
>> 
>> * gnu/packages/check.scm (googletest): New variable.
>> ---
>>  gnu/packages/check.scm | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++
>>  1 file changed, 63 insertions(+)
>> 
>> diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
>> index 9eef7a9..64b5006 100644
>> --- a/gnu/packages/check.scm
>> +++ b/gnu/packages/check.scm
>> @@ -5,6 +5,7 @@
>>  ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
>>  ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
>>  ;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
>> +;;; Copyright © 2016 Lukas Gradl <lgradl@openmailbox.org>
>>  ;;;
>>  ;;; This file is part of GNU Guix.
>>  ;;;
>> @@ -24,6 +25,7 @@
>>  (define-module (gnu packages check)
>>    #:use-module (gnu packages)
>>    #:use-module (gnu packages autotools)
>> +  #:use-module (gnu packages python)
>>    #:use-module (guix licenses)
>>    #:use-module (guix packages)
>>    #:use-module (guix download)
>> @@ -193,3 +195,64 @@ in the code.  Cppcheck primarily detects the types of bugs that the compilers
>>  normally do not detect.  The goal is to detect only real errors in the code
>>  (i.e. have zero false positives).")
>>      (license gpl3+)))
>> +
>> +(define-public googletest
>> +  (package
>> +    (name "googletest")
>> +    (version "1.7.0")
>> +    (source
>> +     (origin
>> +       (method url-fetch)
>> +       (uri
>> +        (string-append
>> +         "https://github.com/google/googletest/archive/release-"
>> +         version ".tar.gz"))
>> +       (file-name (string-append name "-" version ".tar.gz"))
>> +       (sha256
>> +        (base32
>> +         "1k0nf1l9cb3prdmsvaajl5i31bx86c1mw0d5jgzykz7rzm36afpp"))))
>> +    (build-system gnu-build-system)
>> +    (native-inputs
>> +     `(("python-2" ,python-2)
>> +       ("autoconf" ,autoconf)
>> +       ("automake" ,automake)
>> +       ("libtool" ,libtool)))
>> +    (arguments
>> +     `(#:phases
>> +       (modify-phases %standard-phases
>> +         (add-before 'configure 'autoconf
>> +                      (lambda _
>> +                        (zero? (system* "autoreconf" "-vfi"))))
>> +         (add-before 'autoconf 'generate-headers
>> +           (lambda _
>> +             (begin
>> +               (delete-file "include/gtest/gtest-param-test.h")
>> +               (system* "python2" "scripts/pump.py"
>> +                        "include/gtest/gtest-param-test.h.pump")
>> +               (delete-file "include/gtest/internal/gtest-tuple.h")
>> +               (system* "python2" "scripts/pump.py"
>> +                        "include/gtest//internal/gtest-tuple.h.pump")
>> +               (delete-file
>> +                "include/gtest/internal/gtest-param-util-generated.h")
>> +               (system*
>> +                "python2" "scripts/pump.py"
>> +                "include/gtest/internal/gtest-param-util-generated.h.pump")
>> +               (delete-file "include/gtest/internal/gtest-type-util.h")
>> +               (system* "python2" "scripts/pump.py"
>> +                        "include/gtest/internal/gtest-type-util.h.pump"))))
>> +         (replace 'install
>> +           (lambda _
>> +             (let ((out (assoc-ref %outputs "out")))
>> +               (begin
>> +                 (install-file "lib/.libs/libgtest_main.a"
>> +                               (string-append out "/lib"))
>> +                 (install-file "lib/.libs/libgtest.a"
>> +                               (string-append out "/lib"))
>> +                 (copy-recursively "include"
>> +                  (string-append out "/include")))))))))
>> +    (home-page "https://github.com/google/googletest/")
>> +    (synopsis "Test discovery and XUnit test framework")
>> +    (description "Google Test features an XUnit test framework, automated test
>> +discovery, death tests, assertions, parameterized tests and XML test report
>> +generation.")
>> +    (license bsd-3)))
>> -- 
>> 2.7.4
>> 
>
> Patch pushed!

Thank you!

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

end of thread, other threads:[~2016-06-09 22:17 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-30 20:44 [PATCH] Add googletest Lukas Gradl
2016-05-31 13:53 ` Lukas Gradl
2016-05-31 21:44   ` Leo Famulari
2016-06-01  4:48     ` Efraim Flashner
2016-06-02 13:51       ` Lukas Gradl
2016-06-01  7:47     ` Ludovic Courtès
2016-06-01 14:57     ` Lukas Gradl
2016-06-02  1:49       ` Leo Famulari
2016-06-02 15:44         ` Lukas Gradl
2016-06-05 13:12           ` Efraim Flashner
2016-06-05 21:09             ` Lukas Gradl
2016-06-09 18:40               ` Efraim Flashner
2016-06-09 22:17                 ` Lukas Gradl

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).