[PATCH] gnu: Add guile-sly.

2015-11-13 Thread David Thompson
>From 3b02add7830f8d1bcd8e0a7a693d4650635fb246 Mon Sep 17 00:00:00 2001
From: David Thompson 
Date: Fri, 13 Nov 2015 18:07:21 -0500
Subject: [PATCH] gnu: Add guile-sly.

* gnu/packages/guile.scm (guile-sly): New variable.
---
 gnu/packages/guile.scm | 39 +++
 1 file changed, 39 insertions(+)

diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm
index 82776e6..8714332 100644
--- a/gnu/packages/guile.scm
+++ b/gnu/packages/guile.scm
@@ -41,6 +41,10 @@
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages databases)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages gl)
+  #:use-module (gnu packages sdl)
+  #:use-module (gnu packages maths)
+  #:use-module (gnu packages image)
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module (guix git-download)
@@ -802,4 +806,39 @@ whitespace-significant language.  It may be easier on the eyes for some
 users and in some situations.")
 (license gpl3+)))
 
+(define-public guile-sly
+  (package
+(name "guile-sly")
+(version "0.1")
+(source (origin
+  (method url-fetch)
+  (uri (string-append "http://files.dthompson.us/sly/sly-";
+  version ".tar.gz"))
+  (sha256
+   (base32
+"1svzlbz2vripmyq2kjh0rig16bsrnbkwbsm558pjln9l65mcl4qq"
+(build-system gnu-build-system)
+(arguments
+ '(#:configure-flags
+   (list (string-append "--with-libfreeimage-prefix="
+(assoc-ref %build-inputs "freeimage"))
+ (string-append "--with-libgslcblas-prefix="
+(assoc-ref %build-inputs "gsl")
+(native-inputs
+ `(("pkg-config" ,pkg-config)))
+(propagated-inputs
+ `(("guile" ,guile-2.0)
+   ("guile-sdl" ,guile-sdl)
+   ("guile-opengl" ,guile-opengl)))
+(inputs
+ `(("gsl" ,gsl)
+   ("freeimage" ,freeimage)
+   ("mesa" ,mesa)))
+(synopsis "2D/3D game engine for GNU Guile")
+(description "Sly is a 2D/3D game engine written in Guile Scheme.  Sly
+features a functional reactive programming interface and live coding
+capabilities.")
+(home-page "http://dthompson.us/pages/software/sly.html";)
+(license gpl3+)))
+
 ;;; guile.scm ends here
-- 
2.5.0


-- 
David Thompson
GPG Key: 0FF1D807


Re: emacs.scm: Suggest add emacs-next or emacs-snapshot

2015-11-13 Thread Ricardo Wurmus

Feng Shu  writes:

> l...@gnu.org (Ludovic Courtès) writes:
>
>> Currently you have to do:
>>
>>   guix package -i $(guix build emacs --with-source=…/emacs-2015.tar.gz)
>>
>> Not as convenient as one would like.  I guess we could add --with-source
>> directly in ‘guix package’.
>
> I agree and suggest add a way which can override name and verison, for
> example:
>
>   guix package -i emacs-snapshot --with-source=/path/to/emacs.git 
> --override-name=emacs-snapshot --override-version=2015

I don’t like to add override-name and override-version flags.  They
don’t seem very useful.  After all, every different build gets its own
directory in the store, so “override-version” seems to be useless.

“override-name” just duplicates the package name, so I fail to see how
it would be an improvement.

I do agree that it would be a little nicer if we could build and install
a package from a directory, rather than just from a tarball.

~~ Ricardo



Re: [PATCH] build: pull: Compile .scm files in one process.

2015-11-13 Thread Taylan Ulrich Bayırlı/Kammer
l...@gnu.org (Ludovic Courtès) writes:

> taylanbayi...@gmail.com (Taylan Ulrich "Bayırlı/Kammer") skribis:
>
>> From 0eaf7d4c264dc531718a4c0b933323f48ea91930 Mon Sep 17 00:00:00 2001
>> From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?=
>>  
>> Date: Thu, 5 Nov 2015 23:43:20 +0100
>> Subject: [PATCH] build: pull: Compile .scm files in one process.
>>
>> * guix/build/pull.scm (call-with-process): Removed procedure.
>> (report-build-progress): Removed procedure.
>> (p-for-each): Removed procedure.
>
> Rather:
>
> … (call-with-process, report-build-progress, p-for-each): Remove.

Done.

>> +(let ((mutex (make-mutex))
>> +  (completed 0))
>> +  (par-for-each
>> +   (lambda (file)
>> + (with-mutex mutex
>> +   (display #\cr log-port)
>> +   (format log-port "compiling...\t~5,1f% of ~d files" ;FIXME: 
>> i18n
>> +   (* 100. (/ completed total)) total)
>> +   (force-output log-port)
>> +   (format debug-port "~%compiling '~a'...~%" file))
>> + (let ((go (string-append (string-drop-right file 4) ".go")))
>> +   (compile-file file
>> + #:output-file go
>> + #:opts %auto-compilation-options))
>> + (with-mutex mutex
>> +   (set! completed (+ 1 completed
>> +   files)
>
> Does it actually work reliably?  :-)
>
> I think we’re in trouble if DEBUG-PORT is a real port because ports
> aren’t thread-safe in 2.0, and ‘compile-file’ might write to it.  Void
> ports seem to be OK because their ‘write’ method doesn’t do anything.
>
> So I think we have to do things sequentially when DEBUG-PORT is
> non-void.
>
> I’m also concerned about modules accessed by concurrent calls to
> ‘compile-file’ because modules and hash tables aren’t thread-safe
> either.
>
> WDYT?
>
> Thanks to the two of you!  Sounds like we’ll soon have a less slow or
> even a fast ‘guix pull’.  ;-)

Hmm, how about this one?  I guess it could still garble output if
'compile-file' writes things in small pieces that belong together, but
at least it's sure not to crash.  Compile-file doesn't seem to write a
lot either; one probably won't see much garbled output in practice.
Maybe the speed gain makes this acceptable.

Re. modules, AFAIUI compile-file shouldn't do any further mutations on
modules, since we load them in advance.  Maybe Andy can tell how safe
this is.

>From 78be6d09d2d4c0a563be14c66ac2a1a345ff9b1d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?=
 
Date: Thu, 5 Nov 2015 23:43:20 +0100
Subject: [PATCH] build: pull: Compile .scm files in one process.

* guix/build/pull.scm (call-with-process, report-build-progress)
(p-for-each): Remove.
(thread-safe-port): New procedure.
(build-guix): Load and compile files in one process.
---
 guix/build/pull.scm | 147 +++-
 1 file changed, 54 insertions(+), 93 deletions(-)

diff --git a/guix/build/pull.scm b/guix/build/pull.scm
index 281be23..75bce7c 100644
--- a/guix/build/pull.scm
+++ b/guix/build/pull.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2013, 2014 Ludovic Courtès 
+;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer 
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -22,6 +23,7 @@
   #:use-module (ice-9 ftw)
   #:use-module (ice-9 match)
   #:use-module (ice-9 format)
+  #:use-module (ice-9 threads)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-11)
   #:use-module (srfi srfi-26)
@@ -33,75 +35,18 @@
 ;;;
 ;;; Code:
 
-(define (call-with-process thunk)
-  "Run THUNK in a separate process that will return 0 if THUNK terminates
-normally, and 1 if an exception is raised."
-  (match (primitive-fork)
-(0
- (catch #t
-   (lambda ()
- (thunk)
- (primitive-exit 0))
-   (lambda (key . args)
- (print-exception (current-error-port) #f key args)
- (primitive-exit 1
-(pid
- #t)))
-
-(define* (report-build-progress total completed cont
-#:optional (log-port (current-error-port)))
-  "Report that COMPLETED out of TOTAL files have been completed, and call
-CONT."
-  (display #\cr log-port)
-  (format log-port "compiling...\t~5,1f% of ~d files" ;FIXME: i18n
-  (* 100. (/ completed total)) total)
-  (force-output log-port)
-  (cont))
-
-(define* (p-for-each proc lst
- #:optional (max-processes (current-processor-count))
- #:key (progress report-build-progress))
-  "Invoke PROC for each element of LST in a separate process, using up to
-MAX-PROCESSES processes in parallel.  Call PROGRESS at each step, passing it
-the continuation.  Raise an error if one of the processes exit with non-zero."
-  (define total
-(length lst))
-
-  (define (wait-for-one-process)
-(match (waitpid WAIT_ANY)
-  ((_ . s

[PATCH] Add jpegoptim

2015-11-13 Thread Amirouche Boubekki
From 571d55ef3270adfcd2c8cf80d400aec5e12528ab Mon Sep 17 00:00:00 2001
From: Amirouche Boubekki 
Date: Fri, 13 Nov 2015 15:09:08 +0100
Subject: [PATCH] gnu: images: Add jpegoptim 1.4.3

* gnu/packages/images.scm (jpegoptim): New variable jpegoptim
---
 gnu/packages/image.scm | 24 
 1 file changed, 24 insertions(+)

diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm
index bde327c..52717e7 100644
--- a/gnu/packages/image.scm
+++ b/gnu/packages/image.scm
@@ -4,6 +4,7 @@
 ;;; Copyright © 2014, 2015 Alex Kost 
 ;;; Copyright © 2014 Ricardo Wurmus 
 ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer 
+;;; Copyright © 2015 Amirouche Boubekki 
 ;;; Copyright © 2014 John Darrington 
 ;;;
 ;;; This file is part of GNU Guix.
@@ -104,6 +105,29 @@ image files in PBMPLUS PPM/PGM, GIF, BMP, and Targa file formats.")
 (sha256 (base32
  "1cz0dy05mgxqdgjf52p54yxpyy95rgl30cnazdrfmw7hfca9n0h0"))
 
+(define-public jpegoptim
+  (package
+   (name "jpegoptim")
+   (version "1.4.3")
+   (source (origin
+(method url-fetch)
+(uri (string-append "http://www.kokkonen.net/tjko/src/jpegoptim-";
+version ".tar.gz"))
+(sha256 (base32
+ "0k53q7dc8w5ashz8v261x2b5vvz7gdvg8w962rz9gjvkjbh4lg93"
+   (build-system gnu-build-system)
+   (inputs `(("libjpeg" ,libjpeg)))
+   (arguments
+;; no tests
+'(#:tests? #f))
+   (synopsis "Optimize JPEG images")
+   (description
+"jpegoptim provides lossless optimization (based on optimizing
+the Huffman tables) and \"lossy\" optimization based on setting 
+maximum quality factor.")
+   (license license:gpl2)
+   (home-page "http://www.kokkonen.net/tjko/projects.html#jpegoptim";)))
+
 (define-public libtiff
   (package
(name "libtiff")
-- 
2.4.3



Re: emacs.scm: Suggest add emacs-next or emacs-snapshot

2015-11-13 Thread Feng Shu
l...@gnu.org (Ludovic Courtès) writes:

> Currently you have to do:
>
>   guix package -i $(guix build emacs --with-source=…/emacs-2015.tar.gz)
>
> Not as convenient as one would like.  I guess we could add --with-source
> directly in ‘guix package’.

I agree and suggest add a way which can override name and verison, for
example:

  guix package -i emacs-snapshot --with-source=/path/to/emacs.git 
--override-name=emacs-snapshot --override-version=2015



-- 




Re: emacs.scm: Suggest add emacs-next or emacs-snapshot

2015-11-13 Thread Feng Shu
l...@gnu.org (Ludovic Courtès) writes:

> tumashu  skribis:
>
>> Suggest add emacs-next or emacs-snapshot and let guile-emacs inherit it, The 
>> reason is that
>> user can use it build emacs from emacs.git conveniently, for example:
>>
>> guix build emacs-snapshot --with-source=./emacs-snapshot-2015.tar.gz
>
> To use --with-source, all you need to do is to rename the tarball to
> ‘emacs-2015.tar.gz’; after that, you can run:
>
>   guix build emacs --with-source=emacs-2015.tar.gz
>
> That’s because --with-source expects the tarball name to match the
> package name (info "(guix) Invoking guix build").

I don't think it is a flexible way, i like the below:

guix build emacs --with-source=~/my-own-emacs-dir --override-name=emacs 
--override-version=2015

>
> Now, it might make sense to also provide an ‘emacs-snapshot’ package,
> built from a Git checkout and regularly updated.  Would you like to try
> that?
>
> I think the package would simply inherit from ‘guile-emacs’ and provide
> a different ‘name’, ‘version’, and ‘source’.
>
> Thanks,
> Ludo’.

-- 




Re: [PATCH] tk: Hardcode path to TK_LIBRARY.

2015-11-13 Thread 宋文武
l...@gnu.org (Ludovic Courtès) writes:

> 宋文武  skribis:
>
>> From 6c9ea521e88d36bd1ce990a561477ec0e2950017 Mon Sep 17 00:00:00 2001
>> From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= 
>> Date: Thu, 12 Nov 2015 13:31:19 +0800
>> Subject: [PATCH] tk: Hardcode path to TK_LIBRARY.
>>
>> Fixes .
>>
>> * gnu/packages/patches/tk-find-library.patch: New patch.
>> * gnu-system.am (dist_patch_DATA): Add it.
>> * gnu/packages/tcl.scm (tk)[source]: Add patch.
>
> [...]
>
>> +++ b/gnu/packages/patches/tk-find-library.patch
>> @@ -0,0 +1,30 @@
>> +This patch hardcode where Tk found its script library during package
>  ^^  
> “This patch hard-codes the Tk library directory during package
> initialization.”
>
> OK with this change.  Thanks for providing a quick fix!  :-)
>
> Could you commit it in a new ‘tk-update’ branch?
Done.
>
> At the same time, I think we should move tkinter*.so to a separate
> output of the Python packages; I think it’s a matter of moving the .so
> to a separate output, literally.  Would you like to give it a try?
I don't know much about python, so I'd like to leave it for others :-)




Test failure when building libarchive-3.1.2

2015-11-13 Thread Jan Synáček
Hello,

I have a relatively recent guix version (ran guix pull yesterday) and I
can't build emacs, as libarchive, one of its dependencies, fails to build.
Here is a snippet of the error message:

"
Reference files will be read from:
/tmp/nix-build-libarchive-3.1.2.drv-0/libarchive-3.1.2/tar/test
Running tests on:
"/tmp/nix-build-libarchive-3.1.2.drv-0/libarchive-3.1.2/./bsdtar"
Exercising: bsdtar 3.1.2 - libarchive 3.1.2

  0: test_0ok
  1: test_basicok
  2: test_copy ok
  3: test_empty_mtree  ok
  4: test_extract_tar_bz2  ok
  5: test_extract_tar_grz  ok
  6: test_extract_tar_gz   ok
  7: test_extract_tar_lrz  ok
  8: test_extract_tar_lz   ok
  9: test_extract_tar_lzma ok
 10: test_extract_tar_lzo  ok
 11: test_extract_tar_xz   ok
 12: test_extract_tar_Zok
 13: test_format_newc  ok
 14: test_help ok
 15: test_option_a ok
 16: test_option_b64encode ok
 17: test_option_b FAIL
 18: test_option_C_upper   ok
 19: test_option_exclude   ok
 20: test_option_gid_gname ok
 21: test_option_grzip ok
 22: test_option_H_upper   ok
 23: test_option_j ok
 24: test_option_k ok
 25: test_option_keep_newer_files  ok
 26: test_option_lrzip ok
 27: test_option_L_upper   ok
 28: test_option_lzma  ok
 29: test_option_lzop  ok
 30: test_option_n ok
 31: test_option_newer_thanok
 32: test_option_nodumpok
 33: test_option_older_thanok
 34: test_option_O_upper   ok
 35: test_option_q ok
 36: test_option_r ok
 37: test_option_s ok
 38: test_option_T_upper   ok
 39: test_option_uid_uname ok
 40: test_option_uuencode  ok
 41: test_option_U_upper   ok
 42: test_option_X_upper   ok
 43: test_option_xzok
 44: test_option_z ok
 45: test_patterns ok
 46: test_print_longpath   ok
 47: test_stdiook
 48: test_strip_components ok
 49: test_symlink_dir  ok
 50: test_version  ok
 51: test_windows  ok

Totals:
  Tests run:   52
  Tests failed: 1
  Assertions checked:7715
  Assertions failed:2
  Skips reported:   6

Failing tests:
  17: test_option_b (2 failures)

Details for failing tests:
/tmp/nix-build-libarchive-3.1.2.drv-0/bsdtar_test.2015-11-13T09.52.46-000

phase `check' failed after 77.9 seconds
builder for
`/gnu/store/671ccl9qibwzzaizq3g9rjdinisqspiz-libarchive-3.1.2.drv' failed
with exit code 1
cannot build derivation
`/gnu/store/laphmpnyxy3aiwn6s2s2hmk6a2kb110l-cmake-3.3.2.drv': 1
dependencies couldn't be built
cannot build derivation
`/gnu/store/aw9721lq55hzgy3ld8hw0jvxq04pc7mn-graphite2-1.3.3.drv': 1
dependencies couldn't be built
cannot build derivation
`/gnu/store/p2yxxb0xn8yrmrnbh3y1v6crlx8bxxjc-openjpeg-1.5.2.drv': 1
dependencies couldn't be built
cannot build derivation
`/gnu/store/rsbdafy8zjb8iyx035cd35x28pd295lk-emacs-24.5.drv': 1
dependencies couldn't be built
cannot build derivation
`/gnu/store/w6ifcj7iq7g23rx8xy55325kxavpp65y-gtk+-3.18.2.drv': 1
dependencies couldn't be built
cannot build derivation
`/gnu/store/sbamsn3qcwc6ny09ix51swagczd6wmrl-profile.drv': 1 dependencies
couldn't be built
guix package: error: build failed: build of
`/gnu/store/sbamsn3qcwc6ny09ix51swagczd6wmrl-profile.drv' failed
"

Let me know if I can provide more details. I'm running guix on Fedora 23.

-- 
Jan Synáček


Re: emacs.scm: Suggest add emacs-next or emacs-snapshot

2015-11-13 Thread Ludovic Courtès
tumashu   skribis:

> By the way, when I use the below command:
>  
>guix build emacs-snapshot --with-source=./emacs-snapshot-2015.tar.gz
>
> to build a new emacs-snapshot, How can i install it?  I can't find any help 
> on manual

Currently you have to do:

  guix package -i $(guix build emacs --with-source=…/emacs-2015.tar.gz)

Not as convenient as one would like.  I guess we could add --with-source
directly in ‘guix package’.

Ludo’.



Re: The problem of "guix build emacs --with-source=./emacs"

2015-11-13 Thread Ludovic Courtès
Jeff Mickey  skribis:

> Forgot to CC the list...
>
> * Ludovic Courtès  [2015-11-12 04:49]:
>> tumashu  skribis:
>>
>>> When I use the below command to build emacs from emacs.git
>>>
>>> guix build emacs --with-source=./emacs   (emacs dir is git 
>>> repo)
>>>
>>> Build fail, after i remove the .git, build success.
>>
>> Could you explain how it fails exactly, and post the tail of the
>> build log?
>>
>>> The repo of emacs.git is 1.5G, is it the reason?
>>
>> I don’t think so.  That certainly makes it a bad option, though.
>>
>> Thanks,
>> Ludo’.
>
> Isn't the emacs/.git dir is included in the hash calculation if it's
> left in there?

Yes.

> I believe that guix calculates these hashes without the .git dir
> IIRC. Not sure of great ways to work around this without moving the
> './emacs/.git' dir outside of ./emacs during your build, as .git dirs
> contain all kinds of non-reproducible state on disk

Correct.  So keeping the .git directory indeed makes the thing
“unreproducible” in the sense that nobody else will get the same .git
directory.  But it may be acceptable if all you want is to make a
one-off build.

Thanks,
Ludo’.



Broken URLs

2015-11-13 Thread Federico Beffa
l...@gnu.org (Ludovic Courtès) writes:

> As discussed today on IRC, commit bd7e1ff adds a timeout on connection
> attempts made by ‘guix lint’ for the ‘source’ and ‘home-page’ checkers.
>
> Along with the previous commits, it’s allowed me to run a whole-distro
> check with:
>
>   guix lint -c source,home-page
>
> It seems to work nicely (it still leaks FDs due to
>  but that’s OK since these are eventually
> GC’d.)
>
> After letting it run for ~20mn, I’ve collected a whole bunch of URL
> issues (below) that I’m sure everyone will rush to fix.  :-)

...

> gnu/packages/maths.scm:1645:15: atlas-3.10.2: URI
> http://math-atlas.sourceforge.net/ unreachable: Connection timed out

I can reach this URL without problems.

Regards,
Fede



Re: emacs.scm: Suggest add emacs-next or emacs-snapshot

2015-11-13 Thread Ricardo Wurmus

tumashu  writes:
> By the way, when I use the below command:
>  
>guix build emacs-snapshot --with-source=./emacs-snapshot-2015.tar.gz
>
> to build a new emacs-snapshot, How can i install it?  I can't find any help 
> on manual

“guix build” will print a store item path at the very end.  You can ask
Guix to install that path directly:

guix package -i /gnu/store/

(I’m not sure about this but I remember doing something like this in the
recent past.)

~~ Ricardo