unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] gnu: Add openttd
@ 2016-04-11 22:41 Albin
  2016-04-12  1:09 ` Leo Famulari
  0 siblings, 1 reply; 14+ messages in thread
From: Albin @ 2016-04-11 22:41 UTC (permalink / raw)
  To: guix-devel


[-- Attachment #1.1.1: Type: text/plain, Size: 245 bytes --]

Hi!

This is my first package for the Guix project.  I've done my best to
follow all the guidelines.

As you can see, I had to make use of quite few tricks to make it work.

To the people in #guix: thanks a lot for your help!


Albin

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.1.2: 0001-gnu-Add-openttd.patch --]
[-- Type: text/x-patch; name="0001-gnu-Add-openttd.patch", Size: 4473 bytes --]

From 061be49f0b39370541320984fc9eb53c2f2076c2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Albin=20S=C3=B6derqvist?= <albin@fripost.org>
Date: Tue, 12 Apr 2016 00:13:08 +0200
Subject: [PATCH] gnu: Add openttd.

---
 gnu/packages/games.scm | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 69 insertions(+)

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 653e0c7..8ae59c7 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -17,6 +17,7 @@
 ;;; Copyright © 2016 Rodger Fox <thylakoid@openmailbox.org>
 ;;; Copyright © 2016 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
 ;;; Copyright © 2016 Nils Gillmann <niasterisk@grrlz.net>
+;;; Copyright © 2016 Albin Söderqvist <albin@fripost.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -61,6 +62,7 @@
   #:use-module (gnu packages libunwind)
   #:use-module (gnu packages haskell)
   #:use-module (gnu packages mp3)
+  #:use-module (gnu packages icu4c)
   #:use-module (gnu packages image)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages python)
@@ -1859,6 +1861,73 @@ and a game metadata scraper.")
     (home-page "http://www.emulationstation.org")
     (license license:expat)))
 
+(define-public openttd
+  (package
+    (name "openttd")
+    (version "1.6.0")
+    (source
+     (origin (method url-fetch)
+             ;; The official download URL is
+             ;; http://binaries.openttd.org/releases/1.6.0/openttd-1.6.0-source.tar.xz
+             ;; but it doesn't work with `guix download`.  However, it
+             ;; redirects to the one below (and the SHA sums match).
+             (uri (string-append "http://ftp.snt.utwente.nl/pub/games"
+                                 "/openttd/binaries/releases/" version
+                                 "/openttd-" version "-source.tar.xz"))
+             (sha256
+              (base32
+               "1cjf9gz7d0sn7893wv9d00q724sxv3d81bgb0c5f5ppz2ssyc4jc"))
+             (modules '((guix build utils)))
+             (snippet
+              '(begin
+                 ;; The DOS port contains proprietary software, thus:
+                 (delete-file-recursively "os/dos")
+                 ;; GNU's not Unix so let's modify the exit dialog.
+                 (substitute* (find-files "src/lang/" "\\.txt")
+                   ((":Unix") ":GNU"))))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f ;; no "check" target.
+       #:phases
+       (modify-phases %standard-phases
+         (replace 'configure
+           (lambda* (#:key outputs #:allow-other-keys)
+             ;; The build scripts don't understand the option
+             ;; `--enable-fast-install'.
+             (let ((out (assoc-ref outputs "out")))
+               (zero?
+                (system* "./configure"
+                         ;; At the moment, `lzo' must be disabled
+                         ;; because the `config.lib' script cannot
+                         ;; find it.  It is only necessary for loading
+                         ;; saved games generated by early versions of
+                         ;; OpenTTD.
+                         (string-append "--prefix=" out)
+                         "--without-liblzo2"
+                         ;; Put the binary in `bin' instead of `games'
+                         "--binary-dir=bin"))))))))
+    (native-inputs `(("pkg-config" ,pkg-config)))
+    (inputs
+     `(("allegro" ,allegro-4)
+       ("fontconfig" ,fontconfig)
+       ("freetype" ,freetype)
+       ("icu4c" ,icu4c)
+       ("libpng" ,libpng)
+       ;; ("lzo" ,lzo) disabled for the time being (see above).
+       ("sdl" ,sdl)
+       ("xz" ,xz)
+       ("zlib" ,zlib)))
+    (synopsis "Transportation economics simulator")
+    (description "OpenTTD is a game in which you transport goods and
+passengers by land, water and air.  It is a free implementation of
+Transport Tycoon Deluxe but with many enhancements including
+multiplayer mode, internationalization support, conditional orders and
+the ability to clone, autoreplace and autoupdate vehicles.")
+    (home-page "http://openttd.org/")
+    ;; The software contains an in-game downloader from which the user
+    ;; may find non-functional data licensed under different terms.
+    (license license:gpl2)))
+
 (define-public pinball
   (package
     (name "pinball")
-- 
2.6.3


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [PATCH] gnu: Add openttd
  2016-04-11 22:41 [PATCH] gnu: Add openttd Albin
@ 2016-04-12  1:09 ` Leo Famulari
  2016-04-12  8:30   ` Alex Kost
  2016-04-12 14:55   ` Albin
  0 siblings, 2 replies; 14+ messages in thread
From: Leo Famulari @ 2016-04-12  1:09 UTC (permalink / raw)
  To: Albin; +Cc: guix-devel

On Tue, Apr 12, 2016 at 12:41:58AM +0200, Albin wrote:
> Hi!
> 
> This is my first package for the Guix project.  I've done my best to
> follow all the guidelines.

Thanks for the patch!

> Subject: [PATCH] gnu: Add openttd.

Can you add the "changelog" to the commit message? See commit 6dc609985
for a recent example of the desired format.

> +    (source
> +     (origin (method url-fetch)
> +             ;; The official download URL is
> +             ;; http://binaries.openttd.org/releases/1.6.0/openttd-1.6.0-source.tar.xz
> +             ;; but it doesn't work with `guix download`.  However, it
> +             ;; redirects to the one below (and the SHA sums match).

Is it a problem with `guix download` or with the remote server? Even if
we don't fix the issue, it would be nice to say what the problem is in
this comment.

> +             (snippet
> +              '(begin
> +                 ;; The DOS port contains proprietary software, thus:
> +                 (delete-file-recursively "os/dos")

Okay.

> +                 ;; GNU's not Unix so let's modify the exit dialog.
> +                 (substitute* (find-files "src/lang/" "\\.txt")
> +                   ((":Unix") ":GNU"))))))

I don't think this is necessary.

> +           (lambda* (#:key outputs #:allow-other-keys)
> +             ;; The build scripts don't understand the option
> +             ;; `--enable-fast-install'.
> +             (let ((out (assoc-ref outputs "out")))
> +               (zero?
> +                (system* "./configure"
> +                         ;; At the moment, `lzo' must be disabled
> +                         ;; because the `config.lib' script cannot
> +                         ;; find it.  It is only necessary for loading
> +                         ;; saved games generated by early versions of
> +                         ;; OpenTTD.
> +                         (string-append "--prefix=" out)
> +                         "--without-liblzo2"
> +                         ;; Put the binary in `bin' instead of `games'
> +                         "--binary-dir=bin"))))))))

I see this option in `./configure --help`:

--with-liblzo2[=liblzo2.a]     enables liblzo2 support

Does it work to provide the path to that option? Our lzo package does
build a static library, if that is what OpenTTD requires.

> +    (description "OpenTTD is a game in which you transport goods and
> +passengers by land, water and air.  It is a free implementation of
> +Transport Tycoon Deluxe but with many enhancements including
> +multiplayer mode, internationalization support, conditional orders and
> +the ability to clone, autoreplace and autoupdate vehicles.")

All software in Guix is free software, so I don't think it's necessary
to call this a "free implementation". How about "re-implementation"?

> +    ;; The software contains an in-game downloader from which the user
> +    ;; may find non-functional data licensed under different terms.

I don't know the significance of this. Hopefully somebody else will
comment on this subject.

Upon starting the program, I was prompted to download something related
to graphics. I agreed, and the game seemed to download OpenGFX [0] and
launch correctly, although it also warned me about needed to download
some sound files.

> +    (license license:gpl2)))

Section 10.0 of 'readme.txt' describes the licensing of 3rd party
components. If any of those are included, be sure to add them to a list
here.

[0]
http://dev.openttdcoop.org/projects/opengfx

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

* Re: [PATCH] gnu: Add openttd
  2016-04-12  1:09 ` Leo Famulari
@ 2016-04-12  8:30   ` Alex Kost
  2016-04-12 13:09     ` Albin
  2016-04-12 14:55   ` Albin
  1 sibling, 1 reply; 14+ messages in thread
From: Alex Kost @ 2016-04-12  8:30 UTC (permalink / raw)
  To: Leo Famulari; +Cc: guix-devel

Leo Famulari (2016-04-12 04:09 +0300) wrote:

> On Tue, Apr 12, 2016 at 12:41:58AM +0200, Albin wrote:
>> Subject: [PATCH] gnu: Add openttd.
>
> Can you add the "changelog" to the commit message? See commit 6dc609985
> for a recent example of the desired format.

Leo means the commit message should look like this:

--8<---------------cut here---------------start------------->8---
gnu: Add openttd.

* gnu/packages/games.scm (openttd): New variable.
--8<---------------cut here---------------end--------------->8---


>> +    (source
>> +     (origin (method url-fetch)
>> +             ;; The official download URL is
>> +             ;; http://binaries.openttd.org/releases/1.6.0/openttd-1.6.0-source.tar.xz
>> +             ;; but it doesn't work with `guix download`.  However, it
>> +             ;; redirects to the one below (and the SHA sums match).
>
> Is it a problem with `guix download` or with the remote server? Even if
> we don't fix the issue, it would be nice to say what the problem is in
> this comment.

It is not only 'guix download', the same happens with 'guix build'.
I've reported it at <http://bugs.gnu.org/23275>.  Thanks for this useful
comment!.

-- 
Alex

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

* Re: [PATCH] gnu: Add openttd
  2016-04-12  8:30   ` Alex Kost
@ 2016-04-12 13:09     ` Albin
  0 siblings, 0 replies; 14+ messages in thread
From: Albin @ 2016-04-12 13:09 UTC (permalink / raw)
  To: Alex Kost, Leo Famulari; +Cc: guix-devel


[-- Attachment #1.1: Type: text/plain, Size: 1503 bytes --]

Den 2016-04-12 kl. 10:30, skrev Alex Kost:
> Leo Famulari (2016-04-12 04:09 +0300) wrote:
> 
>> On Tue, Apr 12, 2016 at 12:41:58AM +0200, Albin wrote:
>>> Subject: [PATCH] gnu: Add openttd.
>>
>> Can you add the "changelog" to the commit message? See commit 6dc609985
>> for a recent example of the desired format.
> 
> Leo means the commit message should look like this:
> 
> --8<---------------cut here---------------start------------->8---
> gnu: Add openttd.
> 
> * gnu/packages/games.scm (openttd): New variable.
> --8<---------------cut here---------------end--------------->8---

Thanks!

> 
> 
>>> +    (source
>>> +     (origin (method url-fetch)
>>> +             ;; The official download URL is
>>> +             ;; http://binaries.openttd.org/releases/1.6.0/openttd-1.6.0-source.tar.xz
>>> +             ;; but it doesn't work with `guix download`.  However, it
>>> +             ;; redirects to the one below (and the SHA sums match).
>>
>> Is it a problem with `guix download` or with the remote server? Even if
>> we don't fix the issue, it would be nice to say what the problem is in
>> this comment.
> 
> It is not only 'guix download', the same happens with 'guix build'.
> I've reported it at <http://bugs.gnu.org/23275>.  Thanks for this useful
> comment!.
> 

I see that you've already prepared a patch for this bug so I guess that
I should wait for it to be merged, change to the official URL and then
submit a new openttd patch.

Albin


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [PATCH] gnu: Add openttd
  2016-04-12  1:09 ` Leo Famulari
  2016-04-12  8:30   ` Alex Kost
@ 2016-04-12 14:55   ` Albin
  2016-04-12 17:26     ` Alex Kost
  2016-04-12 18:23     ` [PATCH] gnu: Add openttd Leo Famulari
  1 sibling, 2 replies; 14+ messages in thread
From: Albin @ 2016-04-12 14:55 UTC (permalink / raw)
  To: Leo Famulari; +Cc: guix-devel

Thank you Leo for taking the time to inspect and install the package.

Den 2016-04-12 kl. 03:09, skrev Leo Famulari:
> On Tue, Apr 12, 2016 at 12:41:58AM +0200, Albin wrote:
>> +                 ;; GNU's not Unix so let's modify the exit dialog.
>> +                 (substitute* (find-files "src/lang/" "\\.txt")
>> +                   ((":Unix") ":GNU"))))))
> 
> I don't think this is necessary.

Maybe not.  I just wanted to exercise my freedom a little.  The above
snippet lets you see this dialog box:

"Are you sure you want to exit OpenTTD and return to GNU" ...instead of
"...Unix", which I thought would make the Guix users happy.

It works for 54 language versions, but not Arabic, Esperanto, Hebrew and
Urdu where "Unix" is called something else.

I'm not going to insist on keeping it, but remember that the "Words to
avoid" article (https://www.gnu.org/philosophy/words-to-avoid.html)
states: "To call the whole system 'Linux' is both unfair and confusing."
Isn't it likewise wrong to call "GNU" "Unix"?

> 
>> +           (lambda* (#:key outputs #:allow-other-keys)
>> +             ;; The build scripts don't understand the option
>> +             ;; `--enable-fast-install'.
>> +             (let ((out (assoc-ref outputs "out")))
>> +               (zero?
>> +                (system* "./configure"
>> +                         ;; At the moment, `lzo' must be disabled
>> +                         ;; because the `config.lib' script cannot
>> +                         ;; find it.  It is only necessary for loading
>> +                         ;; saved games generated by early versions of
>> +                         ;; OpenTTD.
>> +                         (string-append "--prefix=" out)
>> +                         "--without-liblzo2"
>> +                         ;; Put the binary in `bin' instead of `games'
>> +                         "--binary-dir=bin"))))))))
> 
> I see this option in `./configure --help`:
> 
> --with-liblzo2[=liblzo2.a]     enables liblzo2 support

Nice!

> Does it work to provide the path to that option? Our lzo package does
> build a static library, if that is what OpenTTD requires.

Yes, I could make it work by first installing 'lzo' and then add
`--with-liblzo2=/gnu/store/[...]/liblzo2.a` to the package definition.
What is the proper way to do this?

> 
>> +    (description "OpenTTD is a game in which you transport goods and
>> +passengers by land, water and air.  It is a free implementation of
>> +Transport Tycoon Deluxe but with many enhancements including
>> +multiplayer mode, internationalization support, conditional orders and
>> +the ability to clone, autoreplace and autoupdate vehicles.")
> 
> All software in Guix is free software, so I don't think it's necessary
> to call this a "free implementation". How about "re-implementation"?

OK.

>> +    ;; The software contains an in-game downloader from which the user
>> +    ;; may find non-functional data licensed under different terms.
> 
> I don't know the significance of this. Hopefully somebody else will
> comment on this subject.
> 
> Upon starting the program, I was prompted to download something related
> to graphics. I agreed, and the game seemed to download OpenGFX [0] and
> launch correctly, although it also warned me about needed to download
> some sound files.

Yes, it's not ideal that you are immediately prompted to download and
install something like this.  As you said, the package that gets
installed when you agree is OpenGFX (8 MiB).  It has the same license as
the game itself, i.e. GPLv2, just like the other available graphics sets
"NightGFX" (3.4 MiB) and "zBase" (273 MiB).

The music files that you can download are:

* Modern Motion (music): CC-BY-NC-ND 3.0
* OpenMSX: GPLv2
* Scott Joplin Anthology: public domain
* Traditional Winter Holiday Music: public domain

For sound effects only one package is currently available:

* OpenSFX: CC Sampling Plus 1.0


I can understand that packages that restrict commercial redistribution
may not be included in Guix, but the FSDG doesn't discuss the particular
case of packages that *recommend* non-free, non-functional data where
only non-commercial redistribution is permitted.

How does other free distros deal with this?  The Arch project
distributes openttd, openttd-opengfx and openttd-opensfx as separate
packages (where the package manager recommends the latter two upon
installation of openttd).  Parabola does the same, but removes
openttd-opensfx from their repository.  You can still download the sound
effects afterwards however.

Do you think we should follow Parabola in this case or take a different
approach?

> 
>> +    (license license:gpl2)))
> 
> Section 10.0 of 'readme.txt' describes the licensing of 3rd party
> components. If any of those are included, be sure to add them to a list
> here.

You are right! Thanks.

> 
> [0]
> http://dev.openttdcoop.org/projects/opengfx
> 

Best regards,

Albin

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

* Re: [PATCH] gnu: Add openttd
  2016-04-12 14:55   ` Albin
@ 2016-04-12 17:26     ` Alex Kost
  2016-04-12 18:24       ` Leo Famulari
  2016-04-12 18:23     ` [PATCH] gnu: Add openttd Leo Famulari
  1 sibling, 1 reply; 14+ messages in thread
From: Alex Kost @ 2016-04-12 17:26 UTC (permalink / raw)
  To: Albin; +Cc: guix-devel

Albin (2016-04-12 17:55 +0300) wrote:

> Thank you Leo for taking the time to inspect and install the package.
>
> Den 2016-04-12 kl. 03:09, skrev Leo Famulari:
>> On Tue, Apr 12, 2016 at 12:41:58AM +0200, Albin wrote:
>>> +                 ;; GNU's not Unix so let's modify the exit dialog.
>>> +                 (substitute* (find-files "src/lang/" "\\.txt")
>>> +                   ((":Unix") ":GNU"))))))
>> 
>> I don't think this is necessary.
>
> Maybe not.  I just wanted to exercise my freedom a little.  The above
> snippet lets you see this dialog box:
>
> "Are you sure you want to exit OpenTTD and return to GNU" ...instead of
> "...Unix", which I thought would make the Guix users happy.
>
> It works for 54 language versions, but not Arabic, Esperanto, Hebrew and
> Urdu where "Unix" is called something else.
>
> I'm not going to insist on keeping it, but remember that the "Words to
> avoid" article (https://www.gnu.org/philosophy/words-to-avoid.html)
> states: "To call the whole system 'Linux' is both unfair and confusing."
> Isn't it likewise wrong to call "GNU" "Unix"?

I don't have a preference if it will be "GNU" or "Unix" but this is a
cool hack (I admire how much time you devoted to your first package!)

[...]
>> I see this option in `./configure --help`:
>> 
>> --with-liblzo2[=liblzo2.a]     enables liblzo2 support
>
> Nice!
>
>> Does it work to provide the path to that option? Our lzo package does
>> build a static library, if that is what OpenTTD requires.
>
> Yes, I could make it work by first installing 'lzo' and then add
> `--with-liblzo2=/gnu/store/[...]/liblzo2.a` to the package definition.
> What is the proper way to do this?

Here it is (don't forget to uncomment "lzo" input):

           (lambda* (#:key inputs outputs #:allow-other-keys)
             (let ((out (assoc-ref outputs "out"))
                   (lzo (assoc-ref inputs "lzo")))
               (zero?
                (system* "./configure"
                         (string-append "--prefix=" out)
                         (string-append "--with-liblzo2="
                                        lzo "/lib/liblzo2.a")
                         ;; Put the binary in `bin' instead of `games'.
                         "--binary-dir=bin"))))

>>> +    ;; The software contains an in-game downloader from which the user
>>> +    ;; may find non-functional data licensed under different terms.
>> 
>> I don't know the significance of this. Hopefully somebody else will
>> comment on this subject.
>> 
>> Upon starting the program, I was prompted to download something related
>> to graphics. I agreed, and the game seemed to download OpenGFX [0] and
>> launch correctly, although it also warned me about needed to download
>> some sound files.
>
> Yes, it's not ideal that you are immediately prompted to download and
> install something like this.  As you said, the package that gets
> installed when you agree is OpenGFX (8 MiB).  It has the same license as
> the game itself, i.e. GPLv2, just like the other available graphics sets
> "NightGFX" (3.4 MiB) and "zBase" (273 MiB).
>
> The music files that you can download are:
>
> * Modern Motion (music): CC-BY-NC-ND 3.0
> * OpenMSX: GPLv2
> * Scott Joplin Anthology: public domain
> * Traditional Winter Holiday Music: public domain
>
> For sound effects only one package is currently available:
>
> * OpenSFX: CC Sampling Plus 1.0
>
>
> I can understand that packages that restrict commercial redistribution
> may not be included in Guix, but the FSDG doesn't discuss the particular
> case of packages that *recommend* non-free, non-functional data where
> only non-commercial redistribution is permitted.
>
> How does other free distros deal with this?  The Arch project
> distributes openttd, openttd-opengfx and openttd-opensfx as separate
> packages (where the package manager recommends the latter two upon
> installation of openttd).  Parabola does the same, but removes
> openttd-opensfx from their repository.  You can still download the sound
> effects afterwards however.
>
> Do you think we should follow Parabola in this case or take a different
> approach?

We have 'freedink' package that is combined of 'freedink-engine' and
'freedink-data'.  I think it would be good to have something similar for
'openttd'.

-- 
Alex

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

* Re: [PATCH] gnu: Add openttd
  2016-04-12 14:55   ` Albin
  2016-04-12 17:26     ` Alex Kost
@ 2016-04-12 18:23     ` Leo Famulari
  1 sibling, 0 replies; 14+ messages in thread
From: Leo Famulari @ 2016-04-12 18:23 UTC (permalink / raw)
  To: Albin; +Cc: guix-devel

On Tue, Apr 12, 2016 at 04:55:20PM +0200, Albin wrote:
> Thank you Leo for taking the time to inspect and install the package.

Thanks for taking the time to work on it :)

> Den 2016-04-12 kl. 03:09, skrev Leo Famulari:
> > On Tue, Apr 12, 2016 at 12:41:58AM +0200, Albin wrote:
> >> +                 ;; GNU's not Unix so let's modify the exit dialog.
> >> +                 (substitute* (find-files "src/lang/" "\\.txt")
> >> +                   ((":Unix") ":GNU"))))))
> > 
> > I don't think this is necessary.
> 
> Maybe not.  I just wanted to exercise my freedom a little.  The above
> snippet lets you see this dialog box:
> 
> "Are you sure you want to exit OpenTTD and return to GNU" ...instead of
> "...Unix", which I thought would make the Guix users happy.

It did make me smile :) I appreciate the motivation behind this change
very much.

> It works for 54 language versions, but not Arabic, Esperanto, Hebrew and
> Urdu where "Unix" is called something else.
> 
> I'm not going to insist on keeping it, but remember that the "Words to
> avoid" article (https://www.gnu.org/philosophy/words-to-avoid.html)
> states: "To call the whole system 'Linux' is both unfair and confusing."
> Isn't it likewise wrong to call "GNU" "Unix"?

I'm open to a wider discussion, but I don't think we should patch
upstream code unless it's to fix bugs.

Plus, I personally think it should say "return to Debian", since that's
what my workstation is running ;)

> > I see this option in `./configure --help`:
> > 
> > --with-liblzo2[=liblzo2.a]     enables liblzo2 support
> 
> Nice!
> 
> > Does it work to provide the path to that option? Our lzo package does
> > build a static library, if that is what OpenTTD requires.
> 
> Yes, I could make it work by first installing 'lzo' and then add
> `--with-liblzo2=/gnu/store/[...]/liblzo2.a` to the package definition.
> What is the proper way to do this?

There's a clear example in the package definition of 'apl'. Basically,
make 'lzo' an input, and then build a string like this...:

(string-append "--with-liblzo2=
               (assoc-ref %build-inputs "lzo") "/lib/liblzo2.a")

... and pass that as an argument to ./configure. You typically get a
useful error message from ./configure if there's a mistake.

> >> +    ;; The software contains an in-game downloader from which the user
> >> +    ;; may find non-functional data licensed under different terms.
> > 
> > I don't know the significance of this. Hopefully somebody else will
> > comment on this subject.
> > 
> > Upon starting the program, I was prompted to download something related
> > to graphics. I agreed, and the game seemed to download OpenGFX [0] and
> > launch correctly, although it also warned me about needed to download
> > some sound files.
> 
> Yes, it's not ideal that you are immediately prompted to download and
> install something like this.  As you said, the package that gets
> installed when you agree is OpenGFX (8 MiB).  It has the same license as
> the game itself, i.e. GPLv2, just like the other available graphics sets
> "NightGFX" (3.4 MiB) and "zBase" (273 MiB).
> 
> The music files that you can download are:
> 
> * Modern Motion (music): CC-BY-NC-ND 3.0
> * OpenMSX: GPLv2
> * Scott Joplin Anthology: public domain
> * Traditional Winter Holiday Music: public domain
> 
> For sound effects only one package is currently available:
> 
> * OpenSFX: CC Sampling Plus 1.0
> 
> 
> I can understand that packages that restrict commercial redistribution
> may not be included in Guix, but the FSDG doesn't discuss the particular
> case of packages that *recommend* non-free, non-functional data where
> only non-commercial redistribution is permitted.
> 
> How does other free distros deal with this?  The Arch project
> distributes openttd, openttd-opengfx and openttd-opensfx as separate
> packages (where the package manager recommends the latter two upon
> installation of openttd).  Parabola does the same, but removes
> openttd-opensfx from their repository.  You can still download the sound
> effects afterwards however.
> 
> Do you think we should follow Parabola in this case or take a different
> approach?

I don't know the details of how we are supposed to handle these issues.
I'll let more knowledgeable people have this discussion.

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

* Re: [PATCH] gnu: Add openttd
  2016-04-12 17:26     ` Alex Kost
@ 2016-04-12 18:24       ` Leo Famulari
  2016-04-13  2:09         ` [PATCH] gnu: Add openttd-engine Albin
  0 siblings, 1 reply; 14+ messages in thread
From: Leo Famulari @ 2016-04-12 18:24 UTC (permalink / raw)
  To: Alex Kost; +Cc: guix-devel

On Tue, Apr 12, 2016 at 08:26:25PM +0300, Alex Kost wrote:
> Here it is (don't forget to uncomment "lzo" input):
> 
>            (lambda* (#:key inputs outputs #:allow-other-keys)
>              (let ((out (assoc-ref outputs "out"))
>                    (lzo (assoc-ref inputs "lzo")))
>                (zero?
>                 (system* "./configure"
>                          (string-append "--prefix=" out)
>                          (string-append "--with-liblzo2="
>                                         lzo "/lib/liblzo2.a")
>                          ;; Put the binary in `bin' instead of `games'.
>                          "--binary-dir=bin"))))

I replied before seeing this message from Alex. He has provided a more
complete answer to this question, so please ignore mine :)

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

* [PATCH] gnu: Add openttd-engine
  2016-04-12 18:24       ` Leo Famulari
@ 2016-04-13  2:09         ` Albin
  2016-04-13  2:14           ` Albin
  2016-04-14  9:04           ` Alex Kost
  0 siblings, 2 replies; 14+ messages in thread
From: Albin @ 2016-04-13  2:09 UTC (permalink / raw)
  To: Leo Famulari, Alex Kost; +Cc: guix-devel


[-- Attachment #1.1.1: Type: text/plain, Size: 309 bytes --]

Here is a new patch for OpenTTD.

I have

* changed the name to openttd-engine (so that we can later add game data
as companion packages),
* removed the "Unix"->"GNU" hack,
* enabled 'lzo',
* added more licenses,
* rephrased a few comments,
* modified the commit message.

Best regards,

Albin

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.1.2: 0001-gnu-Add-openttd-engine.patch --]
[-- Type: text/x-patch; name="0001-gnu-Add-openttd-engine.patch", Size: 4130 bytes --]

From 15ca9395ef42c89a0d4d3a3f9f9212e1cb0f1db6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Albin=20S=C3=B6derqvist?= <albin@fripost.org>
Date: Wed, 13 Apr 2016 03:50:36 +0200
Subject: [PATCH] gnu: Add openttd-engine.

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

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 653e0c7..4338653 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -17,6 +17,7 @@
 ;;; Copyright © 2016 Rodger Fox <thylakoid@openmailbox.org>
 ;;; Copyright © 2016 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
 ;;; Copyright © 2016 Nils Gillmann <niasterisk@grrlz.net>
+;;; Copyright © 2016 Albin Söderqvist <albin@fripost.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -61,6 +62,7 @@
   #:use-module (gnu packages libunwind)
   #:use-module (gnu packages haskell)
   #:use-module (gnu packages mp3)
+  #:use-module (gnu packages icu4c)
   #:use-module (gnu packages image)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages python)
@@ -1859,6 +1861,67 @@ and a game metadata scraper.")
     (home-page "http://www.emulationstation.org")
     (license license:expat)))
 
+(define-public openttd-engine
+  (package
+    (name "openttd-engine")
+    (version "1.6.0")
+    (source
+     (origin (method url-fetch)
+             (uri (string-append "http://binaries.openttd.org/releases/"
+                                 version "/openttd-" version "-source.tar.xz"))
+             (sha256
+              (base32
+               "1cjf9gz7d0sn7893wv9d00q724sxv3d81bgb0c5f5ppz2ssyc4jc"))
+             (modules '((guix build utils)))
+             (snippet
+              '(begin
+                 ;; The DOS port contains proprietary software.
+                 (delete-file-recursively "os/dos")))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f ;; no "check" target.
+       #:phases
+       (modify-phases %standard-phases
+         ;; The build process fails if the configure script is passed the
+         ;; option "--enable-fast-install".
+         (replace 'configure
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out"))
+                   (lzo (assoc-ref inputs "lzo")))
+               (zero?
+                (system* "./configure"
+                         (string-append "--prefix=" out)
+                         ;; Provide the "lzo" path.
+                         (string-append "--with-liblzo2="
+                                        lzo "/lib/liblzo2.a")
+                         ;; Put the symlink to the binary in
+                         ;; ".guix-profile/bin/".
+                         "--binary-dir=bin"))))))))
+    (native-inputs `(("pkg-config" ,pkg-config)))
+    (inputs
+     `(("allegro" ,allegro-4)
+       ("fontconfig" ,fontconfig)
+       ("freetype" ,freetype)
+       ("icu4c" ,icu4c)
+       ("libpng" ,libpng)
+       ("lzo" ,lzo)
+       ("sdl" ,sdl)
+       ("xz" ,xz)
+       ("zlib" ,zlib)))
+    (synopsis "Transportation economics simulator")
+    (description "OpenTTD is a game in which you transport goods and
+passengers by land, water and air.  It is a re-implementation of Transport
+Tycoon Deluxe with many enhancements including multiplayer mode,
+internationalization support, conditional orders and the ability to clone,
+autoreplace and autoupdate vehicles.")
+    (home-page "http://openttd.org/")
+    ;; This package is GPLv2, except for a few files located in
+    ;; "src/3rdparty/" which are under the 3-clause BSD, LGPLv2.1+ and Zlib
+    ;; licenses.  In addition, this software contains an in-game downloader
+    ;; from which the user may find non-functional data licensed under
+    ;; different terms.
+    (license (list license:bsd-3 license:gpl2 license:lgpl2.1+ license:zlib))))
+
 (define-public pinball
   (package
     (name "pinball")
-- 
2.6.3


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [PATCH] gnu: Add openttd-engine
  2016-04-13  2:09         ` [PATCH] gnu: Add openttd-engine Albin
@ 2016-04-13  2:14           ` Albin
  2016-04-14  8:27             ` Alex Kost
  2016-04-14  9:04           ` Alex Kost
  1 sibling, 1 reply; 14+ messages in thread
From: Albin @ 2016-04-13  2:14 UTC (permalink / raw)
  To: guix-devel


[-- Attachment #1.1: Type: text/plain, Size: 473 bytes --]

I've also changed the download URL to the official one and the package
builds fine.

Den 2016-04-13 kl. 04:09, skrev Albin:
> Here is a new patch for OpenTTD.
> 
> I have
> 
> * changed the name to openttd-engine (so that we can later add game data
> as companion packages),
> * removed the "Unix"->"GNU" hack,
> * enabled 'lzo',
> * added more licenses,
> * rephrased a few comments,
> * modified the commit message.
> 
> Best regards,
> 
> Albin
> 


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [PATCH] gnu: Add openttd-engine
  2016-04-13  2:14           ` Albin
@ 2016-04-14  8:27             ` Alex Kost
  0 siblings, 0 replies; 14+ messages in thread
From: Alex Kost @ 2016-04-14  8:27 UTC (permalink / raw)
  To: Albin; +Cc: guix-devel

Albin (2016-04-13 05:14 +0300) wrote:

> I've also changed the download URL to the official one and the package
> builds fine.

I think this happened because you already had the source in the store,
so it wasn't redownloaded from the official url (which would fail).

FYI that downloading bug was fixed (thanks for reporting!):
http://git.savannah.gnu.org/cgit/guix.git/commit/?id=82fd23b81f6ab71ef4bc5f95f273bd77dbe6baf5

-- 
Alex

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

* Re: [PATCH] gnu: Add openttd-engine
  2016-04-13  2:09         ` [PATCH] gnu: Add openttd-engine Albin
  2016-04-13  2:14           ` Albin
@ 2016-04-14  9:04           ` Alex Kost
  2016-04-14  9:51             ` Albin
  1 sibling, 1 reply; 14+ messages in thread
From: Alex Kost @ 2016-04-14  9:04 UTC (permalink / raw)
  To: Albin; +Cc: guix-devel

Albin (2016-04-13 05:09 +0300) wrote:

> Here is a new patch for OpenTTD.
>
> I have
>
> * changed the name to openttd-engine (so that we can later add game data
> as companion packages),

I'm going to make this 'openttd-engine' variable private and to add the
following lines after it (I'm not sure if I should do it in a separate
commit):

--8<---------------cut here---------------start------------->8---
;; TODO Add 'openttd-opengfx' and 'openttd-opensfx' packages and make
;; 'openttd' a wrapper around them.  The engine is playable by itself,
;; but it asks a user to download graphics if it's not found.

(define-public openttd
  (package
    (inherit openttd-engine)
    (name "openttd")))
--8<---------------cut here---------------end--------------->8---

So you are welcome to add these graphics/sound packages if you wish :-)

> * removed the "Unix"->"GNU" hack,
> * enabled 'lzo',
> * added more licenses,
> * rephrased a few comments,
> * modified the commit message.

OK, thanks for your great work on this package!

I'm going to commit it in a day or two if there will be no other
comments.

No need to resend the patch, I will adjust it as I mentioned and also
for the following nitpicks:

[...]
> +(define-public openttd-engine
> +  (package
> +    (name "openttd-engine")
> +    (version "1.6.0")
> +    (source
> +     (origin (method url-fetch)
> +             (uri (string-append "http://binaries.openttd.org/releases/"
> +                                 version "/openttd-" version "-source.tar.xz"))
> +             (sha256
> +              (base32
> +               "1cjf9gz7d0sn7893wv9d00q724sxv3d81bgb0c5f5ppz2ssyc4jc"))
> +             (modules '((guix build utils)))
> +             (snippet
> +              '(begin
> +                 ;; The DOS port contains proprietary software.
> +                 (delete-file-recursively "os/dos")))))

No need to use 'begin' here.

> +    (build-system gnu-build-system)
> +    (arguments
> +     `(#:tests? #f ;; no "check" target.

It is a convention to use ";" for marginal comments and ";;" for
comments that are placed on separate lines.

> +       #:phases
> +       (modify-phases %standard-phases
> +         ;; The build process fails if the configure script is passed the
> +         ;; option "--enable-fast-install".
> +         (replace 'configure
> +           (lambda* (#:key inputs outputs #:allow-other-keys)
> +             (let ((out (assoc-ref outputs "out"))
> +                   (lzo (assoc-ref inputs "lzo")))
> +               (zero?
> +                (system* "./configure"
> +                         (string-append "--prefix=" out)
> +                         ;; Provide the "lzo" path.
> +                         (string-append "--with-liblzo2="
> +                                        lzo "/lib/liblzo2.a")
> +                         ;; Put the symlink to the binary in
> +                         ;; ".guix-profile/bin/".

I prefer your previous commentary:

;; Put the binary in 'bin' instead of 'games'.

> +                         "--binary-dir=bin"))))))))
> +    (native-inputs `(("pkg-config" ,pkg-config)))
> +    (inputs
> +     `(("allegro" ,allegro-4)
> +       ("fontconfig" ,fontconfig)
> +       ("freetype" ,freetype)
> +       ("icu4c" ,icu4c)
> +       ("libpng" ,libpng)
> +       ("lzo" ,lzo)
> +       ("sdl" ,sdl)
> +       ("xz" ,xz)
> +       ("zlib" ,zlib)))
> +    (synopsis "Transportation economics simulator")
> +    (description "OpenTTD is a game in which you transport goods and
> +passengers by land, water and air.  It is a re-implementation of Transport
> +Tycoon Deluxe with many enhancements including multiplayer mode,
> +internationalization support, conditional orders and the ability to clone,
> +autoreplace and autoupdate vehicles.")
> +    (home-page "http://openttd.org/")
> +    ;; This package is GPLv2, except for a few files located in
> +    ;; "src/3rdparty/" which are under the 3-clause BSD, LGPLv2.1+ and Zlib
> +    ;; licenses.  In addition, this software contains an in-game downloader
> +    ;; from which the user may find non-functional data licensed under
> +    ;; different terms.
> +    (license (list license:bsd-3 license:gpl2 license:lgpl2.1+ license:zlib))))
> +
>  (define-public pinball
>    (package
>      (name "pinball")

-- 
Alex

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

* Re: [PATCH] gnu: Add openttd-engine
  2016-04-14  9:04           ` Alex Kost
@ 2016-04-14  9:51             ` Albin
  2016-04-15  8:36               ` Alex Kost
  0 siblings, 1 reply; 14+ messages in thread
From: Albin @ 2016-04-14  9:51 UTC (permalink / raw)
  To: Alex Kost; +Cc: guix-devel


[-- Attachment #1.1: Type: text/plain, Size: 5066 bytes --]

Thanks!  Just one little thing: in the TODO, please change
"openttd-opensfx" to "openttd-openmsx".  This will give the user free
GPLv2 licensed music (along with the graphics) and should make a good
out-of-the-box experience even without the non-free (NC) opensfx sound
effects that I guess we shouldn't distribute directly ourselves.

I will work on the additional packages but I can't say when they will be
finished.

Albin

Den 2016-04-14 kl. 11:04, skrev Alex Kost:
> Albin (2016-04-13 05:09 +0300) wrote:
> 
>> Here is a new patch for OpenTTD.
>>
>> I have
>>
>> * changed the name to openttd-engine (so that we can later add game data
>> as companion packages),
> 
> I'm going to make this 'openttd-engine' variable private and to add the
> following lines after it (I'm not sure if I should do it in a separate
> commit):
> 
> --8<---------------cut here---------------start------------->8---
> ;; TODO Add 'openttd-opengfx' and 'openttd-opensfx' packages and make
> ;; 'openttd' a wrapper around them.  The engine is playable by itself,
> ;; but it asks a user to download graphics if it's not found.
> 
> (define-public openttd
>   (package
>     (inherit openttd-engine)
>     (name "openttd")))
> --8<---------------cut here---------------end--------------->8---
> 
> So you are welcome to add these graphics/sound packages if you wish :-)
> 
>> * removed the "Unix"->"GNU" hack,
>> * enabled 'lzo',
>> * added more licenses,
>> * rephrased a few comments,
>> * modified the commit message.
> 
> OK, thanks for your great work on this package!
> 
> I'm going to commit it in a day or two if there will be no other
> comments.
> 
> No need to resend the patch, I will adjust it as I mentioned and also
> for the following nitpicks:
> 
> [...]
>> +(define-public openttd-engine
>> +  (package
>> +    (name "openttd-engine")
>> +    (version "1.6.0")
>> +    (source
>> +     (origin (method url-fetch)
>> +             (uri (string-append "http://binaries.openttd.org/releases/"
>> +                                 version "/openttd-" version "-source.tar.xz"))
>> +             (sha256
>> +              (base32
>> +               "1cjf9gz7d0sn7893wv9d00q724sxv3d81bgb0c5f5ppz2ssyc4jc"))
>> +             (modules '((guix build utils)))
>> +             (snippet
>> +              '(begin
>> +                 ;; The DOS port contains proprietary software.
>> +                 (delete-file-recursively "os/dos")))))
> 
> No need to use 'begin' here.
> 
>> +    (build-system gnu-build-system)
>> +    (arguments
>> +     `(#:tests? #f ;; no "check" target.
> 
> It is a convention to use ";" for marginal comments and ";;" for
> comments that are placed on separate lines.
> 
>> +       #:phases
>> +       (modify-phases %standard-phases
>> +         ;; The build process fails if the configure script is passed the
>> +         ;; option "--enable-fast-install".
>> +         (replace 'configure
>> +           (lambda* (#:key inputs outputs #:allow-other-keys)
>> +             (let ((out (assoc-ref outputs "out"))
>> +                   (lzo (assoc-ref inputs "lzo")))
>> +               (zero?
>> +                (system* "./configure"
>> +                         (string-append "--prefix=" out)
>> +                         ;; Provide the "lzo" path.
>> +                         (string-append "--with-liblzo2="
>> +                                        lzo "/lib/liblzo2.a")
>> +                         ;; Put the symlink to the binary in
>> +                         ;; ".guix-profile/bin/".
> 
> I prefer your previous commentary:
> 
> ;; Put the binary in 'bin' instead of 'games'.
> 
>> +                         "--binary-dir=bin"))))))))
>> +    (native-inputs `(("pkg-config" ,pkg-config)))
>> +    (inputs
>> +     `(("allegro" ,allegro-4)
>> +       ("fontconfig" ,fontconfig)
>> +       ("freetype" ,freetype)
>> +       ("icu4c" ,icu4c)
>> +       ("libpng" ,libpng)
>> +       ("lzo" ,lzo)
>> +       ("sdl" ,sdl)
>> +       ("xz" ,xz)
>> +       ("zlib" ,zlib)))
>> +    (synopsis "Transportation economics simulator")
>> +    (description "OpenTTD is a game in which you transport goods and
>> +passengers by land, water and air.  It is a re-implementation of Transport
>> +Tycoon Deluxe with many enhancements including multiplayer mode,
>> +internationalization support, conditional orders and the ability to clone,
>> +autoreplace and autoupdate vehicles.")
>> +    (home-page "http://openttd.org/")
>> +    ;; This package is GPLv2, except for a few files located in
>> +    ;; "src/3rdparty/" which are under the 3-clause BSD, LGPLv2.1+ and Zlib
>> +    ;; licenses.  In addition, this software contains an in-game downloader
>> +    ;; from which the user may find non-functional data licensed under
>> +    ;; different terms.
>> +    (license (list license:bsd-3 license:gpl2 license:lgpl2.1+ license:zlib))))
>> +
>>  (define-public pinball
>>    (package
>>      (name "pinball")
> 


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [PATCH] gnu: Add openttd-engine
  2016-04-14  9:51             ` Albin
@ 2016-04-15  8:36               ` Alex Kost
  0 siblings, 0 replies; 14+ messages in thread
From: Alex Kost @ 2016-04-15  8:36 UTC (permalink / raw)
  To: Albin; +Cc: guix-devel

Albin (2016-04-14 12:51 +0300) wrote:

> Thanks!  Just one little thing: in the TODO, please change
> "openttd-opensfx" to "openttd-openmsx".  This will give the user free
> GPLv2 licensed music (along with the graphics) and should make a good
> out-of-the-box experience even without the non-free (NC) opensfx sound
> effects that I guess we shouldn't distribute directly ourselves.

Sure, thanks for pointing!

> I will work on the additional packages but I can't say when they will be
> finished.

Hey no problem, you are not forced to make them at all!  Thanks again
for your great work, I've committed it:
http://git.savannah.gnu.org/cgit/guix.git/commit/?id=e9687748e1

-- 
Alex

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

end of thread, other threads:[~2016-04-15  8:36 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-11 22:41 [PATCH] gnu: Add openttd Albin
2016-04-12  1:09 ` Leo Famulari
2016-04-12  8:30   ` Alex Kost
2016-04-12 13:09     ` Albin
2016-04-12 14:55   ` Albin
2016-04-12 17:26     ` Alex Kost
2016-04-12 18:24       ` Leo Famulari
2016-04-13  2:09         ` [PATCH] gnu: Add openttd-engine Albin
2016-04-13  2:14           ` Albin
2016-04-14  8:27             ` Alex Kost
2016-04-14  9:04           ` Alex Kost
2016-04-14  9:51             ` Albin
2016-04-15  8:36               ` Alex Kost
2016-04-12 18:23     ` [PATCH] gnu: Add openttd Leo Famulari

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