Patchwork gnu: Add laby.

login
register
mail settings
Submitter Jan Nieuwenhuizen
Date Aug. 10, 2016, 3:10 p.m.
Message ID <8737mcvevp.fsf@gnu.org>
Download mbox | patch
Permalink /patch/14471/
State New
Headers show

Comments

Jan Nieuwenhuizen - Aug. 10, 2016, 3:10 p.m.
Jan Nieuwenhuizen writes:

Hi!

> I thought the svg loading problem in gtk+-2 was something that I
> introduced, but it turns out that no svg images load at all for
> me.  (I ran guix's emacs and turned-on emacs's toolbar.)
>
> So, I am kind of stuck and am waiting for more insight into the svg
> problem.  Meanwhile, find what works for me attached.  I intend to
> get rid of the png patch again when svg works.

Gtk now has librsvg working, so Laby works without the ugly png patch
hack.

Greetings,
Jan
=?utf-8?B?5a6L5paH5q2m?= - Aug. 11, 2016, 11:50 a.m.
Jan Nieuwenhuizen <janneke@gnu.org> writes:
> [...]
>
> Gtk now has librsvg working, so Laby works without the ugly png patch
> hack.
>
> From dcf2cde075cf59481ebfc98db18c6ca709bf5519 Mon Sep 17 00:00:00 2001
> From: Jan Nieuwenhuizen <janneke@gnu.org>
> Date: Sun, 7 Feb 2016 12:57:40 +0100
> Subject: [PATCH] gnu: Add laby.

Cool, applied, thanks!

Patch

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

* gnu/packages/patches/laby-make-install.patch: New file.
* gnu/local.mk (dist_patch_DATA): gnu-system.am: Add it.
* gnu/packages/games.scm (laby): New variable.
---
 gnu/local.mk                                 |  1 +
 gnu/packages/games.scm                       | 42 ++++++++++++++++++++++++++++
 gnu/packages/patches/laby-make-install.patch | 25 +++++++++++++++++
 3 files changed, 68 insertions(+)
 create mode 100644 gnu/packages/patches/laby-make-install.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index c7311a4..9e4af67 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -597,6 +597,7 @@  dist_patch_DATA =						\
   %D%/packages/patches/jbig2dec-ignore-testtest.patch		\
   %D%/packages/patches/khmer-use-libraries.patch                \
   %D%/packages/patches/kmod-module-directory.patch		\
+  %D%/packages/patches/laby-make-install.patch			\
   %D%/packages/patches/ldc-disable-tests.patch			\
   %D%/packages/patches/lftp-dont-save-unknown-host-fingerprint.patch \
   %D%/packages/patches/liba52-enable-pic.patch			\
diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index e467dbe..e243f42 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -22,6 +22,7 @@ 
 ;;; Copyright © 2016 Kei Kebreau <kei@openmailbox.org>
 ;;; Copyright © 2016 Alex Griffin <a@ajgrf.com>
 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il"
+;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -74,6 +75,7 @@ 
   #:use-module (gnu packages image)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages netpbm)
+  #:use-module (gnu packages ocaml)
   #:use-module (gnu packages python)
   #:use-module (gnu packages readline)
   #:use-module (gnu packages xorg)
@@ -2731,3 +2733,43 @@  in a style similar to the original Super Mario games covered under
 the GNU GPL.")
    (home-page "https://supertuxproject.org/")
    (license license:gpl3+)))
+
+(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 (search-patches "laby-make-install.patch"))))
+    (build-system gnu-build-system)
+    (inputs
+     `(("lablgtk" ,lablgtk)
+       ("ocaml" ,ocaml)
+       ("ocaml-findlib" ,ocaml-findlib)))
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         (delete 'configure)
+         (add-before
+             'build 'setenv
+           (lambda* (#:key inputs #: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")))
+    (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-
-- 
2.9.2