all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Jan Nieuwenhuizen <janneke@gnu.org>
To: Andreas Enge <andreas@enge.fr>
Cc: guix-devel@gnu.org
Subject: Re: [PATCH] gnu: Add laby.
Date: Sat, 13 Feb 2016 09:11:17 +0100	[thread overview]
Message-ID: <87pow19gii.fsf@gnu.org> (raw)
In-Reply-To: <20160212180905.GA8954@debian> (Andreas Enge's message of "Fri, 12 Feb 2016 19:09:05 +0100")

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

Andreas Enge writes:

>> +   (native-search-paths
>> +    (list (search-path-specification
>> +           (variable "OCAMLPATH")
>> +           (files (list (string-append "lib/ocaml"))))))
>
> I have doubts about this search path. Normally, a search path is registered
> with the program that needs it; for instance, gcc declares a LIBRARY_PATH,
> and then whenever a program is installed that provides libraries, these are
> added to the environment variable.

> What do you think? If yes, this should be split into two patches.

Ah yes, that makes sense.

> So I suppose the search path declaration should really be in the ocaml
> package, and if lablgtk provides files matching the pattern, they will be
> added and available for laby.

Nice!  New patch set attached.

Greetings,
Jan


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-Update-ocaml-set-search-path.patch --]
[-- Type: text/x-diff, Size: 912 bytes --]

From 73199e0de318a6b9c80060fe21f8d0667cb34df7 Mon Sep 17 00:00:00 2001
From: Jan Nieuwenhuizen <janneke@gnu.org>
Date: Sat, 13 Feb 2016 08:42:34 +0100
Subject: [PATCH 1/3] gnu: Update ocaml: set search path.

* gnu/packages/ocaml.scm (ocaml): Set OCAMLPATH for libraries like lablgtk.
---
 gnu/packages/ocaml.scm | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index 3baccf4..a584006 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -62,6 +62,10 @@
                (base32
                 "1qwwvy8nzd87hk8rd9sm667nppakiapnx4ypdwcrlnav2dz6kil3"))))
     (build-system gnu-build-system)
+    (native-search-paths
+     (list (search-path-specification
+            (variable "OCAMLPATH")
+            (files (list (string-append "lib/ocaml"))))))
     (native-inputs
      `(("perl" ,perl)
        ("pkg-config" ,pkg-config)))
-- 
2.1.4


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0002-gnu-Update-lablgtk-also-build-cmxa-libraries.patch --]
[-- Type: text/x-diff, Size: 868 bytes --]

From 9ff710f10bce9bf21b7b4b2f0703511c44343371 Mon Sep 17 00:00:00 2001
From: Jan Nieuwenhuizen <janneke@gnu.org>
Date: Thu, 11 Feb 2016 18:52:15 +0100
Subject: [PATCH 2/3] gnu: Update lablgtk: also build cmxa libraries.

* gnu/packages/ocaml.scm (lablgtk): Use "opt" to build *.cmxa files.
---
 gnu/packages/ocaml.scm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index a584006..8fc5c8a 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -477,6 +477,8 @@ provers.")
     (arguments
      `(#:tests? #f ; no check target
 
+       ;; opt: also install cmxa files
+       #:make-flags (list "all" "opt")
        ;; Occasionally we would get "Error: Unbound module GtkThread" when
        ;; compiling 'gtkThInit.ml', with 'make -j'.  So build sequentially.
        #:parallel-build? #f
-- 
2.1.4


[-- Attachment #4: 0003-gnu-Add-laby.patch --]
[-- Type: text/x-diff, Size: 6435 bytes --]

From a1b9a3a164a2c743066c6fdf59c5970980579ff4 Mon Sep 17 00:00:00 2001
From: Jan Nieuwenhuizen <janneke@gnu.org>
Date: Sun, 7 Feb 2016 12:57:40 +0100
Subject: [PATCH 3/3] gnu: Add laby.

* gnu/packages/patches/laby-make-install.patch: New file.
* gnu/packages/patches/laby-make-png.patch: New file.
* gnu-system.am (dist_patch_DATA): Add them.
* gnu/packages/games.scm (laby): New variable.
---
 gnu-system.am                                |  2 ++
 gnu/packages/games.scm                       | 45 ++++++++++++++++++++++++++++
 gnu/packages/patches/laby-make-install.patch | 25 ++++++++++++++++
 gnu/packages/patches/laby-make-png.patch     | 27 +++++++++++++++++
 4 files changed, 99 insertions(+)
 create mode 100644 gnu/packages/patches/laby-make-install.patch
 create mode 100644 gnu/packages/patches/laby-make-png.patch

diff --git a/gnu-system.am b/gnu-system.am
index eba7c4e..19f1244 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -540,6 +540,8 @@ dist_patch_DATA =						\
   gnu/packages/patches/jasper-CVE-2016-1867.patch		\
   gnu/packages/patches/jbig2dec-ignore-testtest.patch		\
   gnu/packages/patches/kmod-module-directory.patch		\
+  gnu/packages/patches/laby-make-png.patch			\
+  gnu/packages/patches/laby-make-install.patch			\
   gnu/packages/patches/ldc-disable-tests.patch			\
   gnu/packages/patches/lftp-dont-save-unknown-host-fingerprint.patch \
   gnu/packages/patches/liba52-enable-pic.patch			\
diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 7eb0e7a..aa74665 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -14,6 +14,7 @@
 ;;; Copyright © 2015, 2016 Alex Kost <alezost@gmail.com>
 ;;; Copyright © 2015 Paul van der Walt <paul@denknerd.org>
 ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
+;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -56,9 +57,11 @@
   #:use-module (gnu packages libcanberra)
   #:use-module (gnu packages libunwind)
   #:use-module (gnu packages haskell)
+  #:use-module (gnu packages imagemagick)
   #:use-module (gnu packages mp3)
   #:use-module (gnu packages image)
   #:use-module (gnu packages ncurses)
+  #:use-module (gnu packages ocaml)
   #:use-module (gnu packages python)
   #:use-module (gnu packages readline)
   #:use-module (gnu packages xorg)
@@ -1891,3 +1894,45 @@ and a game metadata scraper.")
     (description "The Emilia Pinball Project is a pinball simulator.  There
 are only two levels to play with, but they are very addictive.")
     (license license:gpl2)))
+
+(define-public laby
+  (package
+    (name "laby")
+    (version "0.6.4")
+    (source
+     (origin (method url-fetch)
+             (uri (string-append
+                   "https://github.com/sgimenez/laby/tarball/"
+                   name "-" version))
+             (file-name (string-append name "-" version ".tar.gz"))
+             (sha256
+              (base32
+               "113ip48308ps3lsw427xswgx3wdanils43nyal9n4jr6bcx1bj2j"))
+             (patches (list (search-patch "laby-make-install.patch")
+                            (search-patch "laby-make-png.patch")))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("imagemagick" ,imagemagick)))
+    (inputs
+     `(("lablgtk" ,lablgtk)
+       ("ocaml" ,ocaml)
+       ("ocaml-findlib" ,ocaml-findlib)))
+    (arguments
+     '(#:phases (modify-phases %standard-phases
+                  (delete 'configure)
+                  (add-before
+                   'build 'setenv
+                   (lambda* (#:key inputs outputs #:allow-other-keys)
+                     (let ((lablgtk (assoc-ref inputs "lablgtk")))
+                       (setenv "LD_LIBRARY_PATH"
+                               (string-append lablgtk "/lib/ocaml/stublibs"))))))
+       #:tests? #f ; no 'check' target
+       #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
+                          "all" "png")))
+    (home-page "https://sgimenez.github.io/laby/")
+    (synopsis "Programming game")
+    (description "Learn programming, playing with ants and spider webs ;-)
+Your robot ant can be programmed in many languages: OCaml, Python, C, C++,
+Java, Ruby, Lua, JavaScript, Pascal, Perl, Scheme, Vala, Prolog.  Experienced
+programmers may also add their own favorite language.")
+    (license license:gpl3+)))
diff --git a/gnu/packages/patches/laby-make-install.patch b/gnu/packages/patches/laby-make-install.patch
new file mode 100644
index 0000000..3e956be
--- /dev/null
+++ b/gnu/packages/patches/laby-make-install.patch
@@ -0,0 +1,25 @@
+From e9896b8951f9faf1f76a3b45be6e70d0aeb30a73 Mon Sep 17 00:00:00 2001
+From: Jan Nieuwenhuizen <janneke@gnu.org>
+Date: Sat, 15 Nov 2014 17:48:18 +0100
+Subject: [PATCH] Add make install.
+
+---
+ Makefile | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/Makefile b/Makefile
+index ca18c1e..65af31b 100644
+--- a/Makefile	2016-02-09 21:34:01.883660009 +0100
++++ b/Makefile	2016-02-09 21:34:30.672150679 +0100
+@@ -19,3 +19,11 @@
+ 	@git archive --prefix="$(PROJECT_ARCHIVE)/" HEAD \
+ 		 | gzip >_dist/"$(PROJECT_ARCHIVE)".tar.gz
+ 	@echo archive stored in "_dist/$(PROJECT_ARCHIVE).tar.gz"
++
++PREFIX=/usr/local
++install:
++	strip laby
++	mkdir -p $(PREFIX)/bin
++	cp laby $(PREFIX)/bin/laby
++	mkdir -p $(PREFIX)/share/laby
++	tar -C data -cf - . | tar -C $(PREFIX)/share/laby -xf-
diff --git a/gnu/packages/patches/laby-make-png.patch b/gnu/packages/patches/laby-make-png.patch
new file mode 100644
index 0000000..6851e4a
--- /dev/null
+++ b/gnu/packages/patches/laby-make-png.patch
@@ -0,0 +1,27 @@
+From 6d3c05e25f2b5f231abf5bb4af4bc0b06455b0e4 Mon Sep 17 00:00:00 2001
+From: Jan Nieuwenhuizen <janneke@gnu.org>
+Date: Thu, 11 Feb 2016 18:30:19 +0100
+Subject: [PATCH] Add make png.
+
+---
+ Makefile | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/Makefile b/Makefile
+index 5d9d733..f54d09b 100644
+--- a/Makefile
++++ b/Makefile
+@@ -27,3 +27,10 @@ install:
+ 	cp laby $(PREFIX)/bin/laby
+ 	mkdir -p $(PREFIX)/share/laby
+ 	tar -C data -cf - . | tar -C $(PREFIX)/share/laby -xf-
++
++SVG:=$(wildcard data/tiles/*.svg)
++PNG:=$(SVG:%.svg=%.png)
++png: $(PNG)
++
++%.png: %.svg
++	convert $^ $@
+-- 
+2.1.4
+
-- 
2.1.4


[-- Attachment #5: Type: text/plain, Size: 153 bytes --]



--
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar®  http://AvatarAcademy.nl

  reply	other threads:[~2016-02-13  8:11 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-09 20:27 [PATCH] gnu: Add laby Jan Nieuwenhuizen
2016-02-09 22:28 ` Christopher Allan Webber
2016-02-11 20:18   ` Efraim Flashner
2016-02-11 22:21     ` Jan Nieuwenhuizen
2016-02-12 18:09       ` Andreas Enge
2016-02-13  8:11         ` Jan Nieuwenhuizen [this message]
2016-02-13  8:43           ` Andreas Enge
2016-02-13 14:09             ` Jan Nieuwenhuizen
2016-02-13 14:16               ` Andreas Enge
2016-02-13 20:58                 ` Jan Nieuwenhuizen
2016-03-06 19:27                   ` Andreas Enge
2016-03-06 22:01                     ` Jan Nieuwenhuizen
2016-08-10 15:10                       ` Jan Nieuwenhuizen
2016-08-11 11:50                         ` 宋文武
2016-02-12 18:13       ` Andreas Enge
2016-02-12 20:43         ` Jan Nieuwenhuizen
2016-02-13  8:20           ` Andreas Enge
2016-02-13 13:08             ` Jan Nieuwenhuizen
2016-02-12 18:17       ` Andreas Enge
2016-02-12 18:30         ` Jan Nieuwenhuizen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pow19gii.fsf@gnu.org \
    --to=janneke@gnu.org \
    --cc=andreas@enge.fr \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.