unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCHES] Add love and devil
@ 2015-11-15  0:58 David Thompson
  2015-11-16  8:58 ` Ludovic Courtès
  2015-11-16 20:55 ` Ricardo Wurmus
  0 siblings, 2 replies; 3+ messages in thread
From: David Thompson @ 2015-11-15  0:58 UTC (permalink / raw)
  To: guix-devel

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

Yes, these are real software packages!  LÖVE is a neat game framework
that uses Lua and depends on DevIL for image loading.


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

From fa226c57a531436e387055440f71d04c1b73a7aa Mon Sep 17 00:00:00 2001
From: David Thompson <dthompson2@worcester.edu>
Date: Sat, 14 Nov 2015 13:56:40 -0500
Subject: [PATCH 1/2] gnu: Add devil.

* gnu/packages/image.scm (devil): New variable.
* gnu/packages/patches/devil-fix-libpng.patch: New file.
* gnu-system.am (dist_patch_DATA): Add it.
---
 gnu-system.am                               |  1 +
 gnu/packages/image.scm                      | 52 +++++++++++++++++++++++++++++
 gnu/packages/patches/devil-fix-libpng.patch | 36 ++++++++++++++++++++
 3 files changed, 89 insertions(+)
 create mode 100644 gnu/packages/patches/devil-fix-libpng.patch

diff --git a/gnu-system.am b/gnu-system.am
index c80f086..ec9f778 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -432,6 +432,7 @@ dist_patch_DATA =						\
   gnu/packages/patches/cursynth-wave-rand.patch			\
   gnu/packages/patches/dbus-helper-search-path.patch		\
   gnu/packages/patches/dealii-p4est-interface.patch		\
+  gnu/packages/patches/devil-fix-libpng.patch			\
   gnu/packages/patches/diffutils-gets-undeclared.patch		\
   gnu/packages/patches/dfu-programmer-fix-libusb.patch		\
   gnu/packages/patches/doxygen-test.patch			\
diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm
index bde327c..a564ada8 100644
--- a/gnu/packages/image.scm
+++ b/gnu/packages/image.scm
@@ -627,3 +627,55 @@ channels.")
     (description
      "Libmng is the MNG (Multiple-image Network Graphics) reference library.")
     (license license:bsd-3)))
+
+(define-public devil
+  (package
+    (name "devil")
+    (version "1.7.8")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "http://downloads.sourceforge.net/openil/"
+                                  "DevIL-" version ".tar.gz"))
+              (sha256
+               (base32
+                "1zd850nn7nvkkhasrv7kn17kzgslr5ry933v6db62s4lr0zzlbv8"))
+              ;; Backported from upstream:
+              ;; https://github.com/DentonW/DevIL/commit/724194d7a9a91221a564579f64bdd6f0abd64219.patch
+              (patches (list (search-patch "devil-fix-libpng.patch")))
+              (modules '((guix build utils)))
+              (snippet
+               ;; Fix old lcms include directives and lib flags.
+               '(substitute* '("configure" "src-IL/src/il_profiles.c")
+                  (("-llcms") "-llcms2")
+                  (("lcms/lcms\\.h") "lcms2/lcms2.h")
+                  (("lcms\\.h") "lcms2.h")))))
+    (build-system gnu-build-system)
+    (arguments
+     '(#:configure-flags '("--enable-ILUT=yes") ; build utility library
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'check 'fix-tests
+           (lambda* (#:key inputs #:allow-other-keys)
+             ;; Fix hard-coded /bin/bash reference.
+             (substitute* '("test/Makefile")
+               (("TESTS_ENVIRONMENT = /bin/bash")
+                (string-append "TESTS_ENVIRONMENT = "
+                               (assoc-ref inputs "bash")
+                               "/bin/bash")))
+             #t)))))
+    (native-inputs
+     `(("pkg-config" ,pkg-config)))
+    (inputs
+     `(("lcms" ,lcms)
+       ("libjpeg" ,libjpeg)
+       ("libmng" ,libmng)
+       ("libpng" ,libpng)
+       ("libtiff" ,libtiff)
+       ("openexr" ,openexr)
+       ("zlib" ,zlib)))
+    (synopsis "Library for manipulating many image formats")
+    (description "Developer's Image Library (DevIL) is a library to develop
+applications with support for many types of images.  DevIL can load, save,
+convert, manipulate, filter and display a wide variety of image formats.")
+    (home-page "http://openil.sourceforge.net")
+    (license license:lgpl2.1+)))
diff --git a/gnu/packages/patches/devil-fix-libpng.patch b/gnu/packages/patches/devil-fix-libpng.patch
new file mode 100644
index 0000000..a8e9033
--- /dev/null
+++ b/gnu/packages/patches/devil-fix-libpng.patch
@@ -0,0 +1,36 @@
+From 724194d7a9a91221a564579f64bdd6f0abd64219 Mon Sep 17 00:00:00 2001
+From: Noah Mayr <max96at@gmail.com>
+Date: Sun, 1 Mar 2015 10:10:56 +0100
+Subject: [PATCH] Fixed deprecated libpng API usage.
+
+---
+ src-IL/src/il_icon.c | 2 +-
+ src-IL/src/il_png.c  | 4 ++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src-IL/src/il_icon.c b/src-IL/src/il_icon.c
+index 2ccb1a3..fd9475d 100644
+--- a/src-IL/src/il_icon.c
++++ b/src-IL/src/il_icon.c
+@@ -525,7 +525,7 @@ ILboolean ico_readpng_get_image(ICOIMAGE *Icon, ILdouble display_exponent)
+
+ 	// Expand low-bit-depth grayscale images to 8 bits
+ 	if (ico_color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8) {
+-		png_set_gray_1_2_4_to_8(ico_png_ptr);
++		png_set_expand_gray_1_2_4_to_8(ico_png_ptr);
+ 	}
+
+ 	// Expand RGB images with transparency to full alpha channels
+diff --git a/src-IL/src/il_png.c b/src-IL/src/il_png.c
+index da9517d..2866508 100644
+--- a/src-IL/src/il_png.c
++++ b/src-IL/src/il_png.c
+@@ -277,7 +277,7 @@ ILboolean readpng_get_image(ILdouble display_exponent)
+
+ 	// Expand low-bit-depth grayscale images to 8 bits
+ 	if (png_color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8) {
+-		png_set_gray_1_2_4_to_8(png_ptr);
++		png_set_expand_gray_1_2_4_to_8(png_ptr);
+ 	}
+
+ 	// Expand RGB images with transparency to full alpha channels
-- 
2.5.0


[-- Attachment #3: 0002-gnu-Add-love.patch --]
[-- Type: text/x-patch, Size: 2218 bytes --]

From 19fd422aa7639dbc30745b0238c317a43fa55d8f Mon Sep 17 00:00:00 2001
From: David Thompson <dthompson2@worcester.edu>
Date: Sat, 14 Nov 2015 14:00:20 -0500
Subject: [PATCH 2/2] gnu: Add love.

* gnu/packages/game-development.scm (love): New variable.
---
 gnu/packages/game-development.scm | 36 +++++++++++++++++++++++++++++++++++-
 1 file changed, 35 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm
index fcebf2b..1e3854a 100644
--- a/gnu/packages/game-development.scm
+++ b/gnu/packages/game-development.scm
@@ -48,7 +48,9 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages sdl)
   #:use-module (gnu packages pkg-config)
-  #:use-module (gnu packages xiph))
+  #:use-module (gnu packages xiph)
+  #:use-module (gnu packages lua)
+  #:use-module (gnu packages mp3))
 
 (define-public bullet
   (package
@@ -260,3 +262,35 @@ files can be accessed in the same way as you access files directly on a disk,
 and it makes it easy to ship a new archive that will override a previous
 archive on a per-file basis.")
     (license license:zlib)))
+
+(define-public love
+  (package
+    (name "love")
+    (version "0.9.2")
+    (source (origin
+             (method url-fetch)
+             (uri (string-append "https://bitbucket.org/rude/love/downloads/"
+                                 "love-" version "-linux-src.tar.gz"))
+             (sha256
+              (base32
+               "0wn1npr5gal5b1idh4a5fwc3f5c36lsbjd4r4d699rqlviid15d9"))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("pkg-config" ,pkg-config)))
+    (inputs
+     `(("devil" ,devil)
+       ("freetype" ,freetype)
+       ("libmodplug" ,libmodplug)
+       ("libvorbis" ,libvorbis)
+       ("luajit" ,luajit)
+       ("mesa" ,mesa)
+       ("mpg123" ,mpg123)
+       ("openal" ,openal)
+       ("physfs" ,physfs)
+       ("sdl2" ,sdl2)
+       ("zlib" ,zlib)))
+    (synopsis "2D game framework for Lua")
+    (description "LÖVE is a framework for making 2D games in the Lua
+programming language.")
+    (home-page "https://love2d.org/")
+    (license license:zlib)))
-- 
2.5.0


[-- Attachment #4: Type: text/plain, Size: 38 bytes --]


-- 
David Thompson
GPG Key: 0FF1D807

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

* Re: [PATCHES] Add love and devil
  2015-11-15  0:58 [PATCHES] Add love and devil David Thompson
@ 2015-11-16  8:58 ` Ludovic Courtès
  2015-11-16 20:55 ` Ricardo Wurmus
  1 sibling, 0 replies; 3+ messages in thread
From: Ludovic Courtès @ 2015-11-16  8:58 UTC (permalink / raw)
  To: David Thompson; +Cc: guix-devel

David Thompson <dthompson2@worcester.edu> skribis:

> From fa226c57a531436e387055440f71d04c1b73a7aa Mon Sep 17 00:00:00 2001
> From: David Thompson <dthompson2@worcester.edu>
> Date: Sat, 14 Nov 2015 13:56:40 -0500
> Subject: [PATCH 1/2] gnu: Add devil.
>
> * gnu/packages/image.scm (devil): New variable.
> * gnu/packages/patches/devil-fix-libpng.patch: New file.
> * gnu-system.am (dist_patch_DATA): Add it.

LGTM.

> From 19fd422aa7639dbc30745b0238c317a43fa55d8f Mon Sep 17 00:00:00 2001
> From: David Thompson <dthompson2@worcester.edu>
> Date: Sat, 14 Nov 2015 14:00:20 -0500
> Subject: [PATCH 2/2] gnu: Add love.
>
> * gnu/packages/game-development.scm (love): New variable.

LGTM.

Thanks!

Ludo’.

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

* Re: [PATCHES] Add love and devil
  2015-11-15  0:58 [PATCHES] Add love and devil David Thompson
  2015-11-16  8:58 ` Ludovic Courtès
@ 2015-11-16 20:55 ` Ricardo Wurmus
  1 sibling, 0 replies; 3+ messages in thread
From: Ricardo Wurmus @ 2015-11-16 20:55 UTC (permalink / raw)
  To: David Thompson; +Cc: guix-devel


David Thompson <dthompson2@worcester.edu> writes:

> Yes, these are real software packages!  LÖVE is a neat game framework
> that uses Lua and depends on DevIL for image loading.

Yay for LÖVE!

> +(define-public devil
> +  (package
> +    (name "devil")

[...]

> +    (arguments
> +     '(#:configure-flags '("--enable-ILUT=yes") ; build utility library
> +       #:phases
> +       (modify-phases %standard-phases
> +         (add-before 'check 'fix-tests
> +           (lambda* (#:key inputs #:allow-other-keys)
> +             ;; Fix hard-coded /bin/bash reference.
> +             (substitute* '("test/Makefile")
> +               (("TESTS_ENVIRONMENT = /bin/bash")
> +                (string-append "TESTS_ENVIRONMENT = "
> +                               (assoc-ref inputs "bash")
> +                               "/bin/bash")))
> +             #t)))))

Could this be fixed by passing “TESTS_ENVIRONMENT” as a make-flag
instead?

Otherwise looks good to me (both this and the second patch).
Thank you!

~~ Ricardo

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

end of thread, other threads:[~2015-11-16 20:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-15  0:58 [PATCHES] Add love and devil David Thompson
2015-11-16  8:58 ` Ludovic Courtès
2015-11-16 20:55 ` Ricardo Wurmus

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).