Message ID | 20160719205719.20769-1-rekado@elephly.net |
---|---|
State | New |
Headers |
Received: (qmail 738 invoked by uid 89); 19 Jul 2016 21:03:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.99.1 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy=5.2.0, Game, 7, 6, sk:downloa X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: lists.gnu.org Received: from lists.gnu.org (HELO lists.gnu.org) (208.118.235.17) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Tue, 19 Jul 2016 21:03:49 +0000 Received: from localhost ([::1]:58889 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <guix-devel-bounces+patchwork=sourceware.org@gnu.org>) id 1bPcB8-0001vm-Tk for patchwork@sourceware.org; Tue, 19 Jul 2016 17:03:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45919) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <rekado@elephly.net>) id 1bPc55-0002DA-P8 for guix-devel@gnu.org; Tue, 19 Jul 2016 16:57:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <rekado@elephly.net>) id 1bPc51-00015K-KH for guix-devel@gnu.org; Tue, 19 Jul 2016 16:57:31 -0400 Received: from sender163-mail.zoho.com ([74.201.84.163]:24111) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <rekado@elephly.net>) id 1bPc51-00014c-Ad for guix-devel@gnu.org; Tue, 19 Jul 2016 16:57:27 -0400 Received: from localhost (xd9bfe4c0.dyn.telefonica.de [217.191.228.192]) by mx.zohomail.com with SMTPS id 1468961843865255.86464131557784; Tue, 19 Jul 2016 13:57:23 -0700 (PDT) From: Ricardo Wurmus <rekado@elephly.net> To: guix-devel@gnu.org Subject: [PATCH 1/2] gnu: Add allegro. Date: Tue, 19 Jul 2016 22:57:18 +0200 Message-Id: <20160719205719.20769-1-rekado@elephly.net> X-Mailer: git-send-email 2.8.4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ZohoMail: Z_26063301 SPT_1 Z_26062608 SPT_0 X-Zoho-Virus-Status: 2 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 74.201.84.163 X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." <guix-devel.gnu.org> List-Unsubscribe: <https://lists.gnu.org/mailman/options/guix-devel>, <mailto:guix-devel-request@gnu.org?subject=unsubscribe> List-Archive: <http://lists.gnu.org/archive/html/guix-devel/> List-Post: <mailto:guix-devel@gnu.org> List-Help: <mailto:guix-devel-request@gnu.org?subject=help> List-Subscribe: <https://lists.gnu.org/mailman/listinfo/guix-devel>, <mailto:guix-devel-request@gnu.org?subject=subscribe> Errors-To: guix-devel-bounces+patchwork=sourceware.org@gnu.org Sender: "Guix-devel" <guix-devel-bounces+patchwork=sourceware.org@gnu.org> |
Commit Message
Ricardo Wurmus
July 19, 2016, 8:57 p.m. UTC
* gnu/packages/game-development.scm (allegro): New variable. --- gnu/packages/game-development.scm | 41 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+)
Comments
On Tue, Jul 19, 2016 at 4:57 PM, Ricardo Wurmus <rekado@elephly.net> wrote: > * gnu/packages/game-development.scm (allegro): New variable. > --- > gnu/packages/game-development.scm | 41 +++++++++++++++++++++++++++++++++++++++ > 1 file changed, 41 insertions(+) > > diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm > index b11285a..03623aa 100644 > --- a/gnu/packages/game-development.scm > +++ b/gnu/packages/game-development.scm > @@ -7,6 +7,7 @@ > ;;; Copyright © 2015, 2016 David Thompson <davet@gnu.org> > ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il> > ;;; Copyright © 2016 Kei Kebreau <kei@openmailbox.org> > +;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net> > ;;; > ;;; This file is part of GNU Guix. > ;;; > @@ -342,6 +343,46 @@ etc.") > (home-page "http://liballeg.org") > (license license:giftware))) > > +(define-public allegro Shouldn't this be allegro-5 since there is already an allegro-4? Other than that it looks good to me. - Dave
Thompson, David <dthompson2@worcester.edu> writes: > On Tue, Jul 19, 2016 at 4:57 PM, Ricardo Wurmus <rekado@elephly.net> wrote: >> * gnu/packages/game-development.scm (allegro): New variable. >> --- >> gnu/packages/game-development.scm | 41 +++++++++++++++++++++++++++++++++++++++ >> 1 file changed, 41 insertions(+) >> >> diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm >> index b11285a..03623aa 100644 >> --- a/gnu/packages/game-development.scm >> +++ b/gnu/packages/game-development.scm >> @@ -7,6 +7,7 @@ >> ;;; Copyright © 2015, 2016 David Thompson <davet@gnu.org> >> ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il> >> ;;; Copyright © 2016 Kei Kebreau <kei@openmailbox.org> >> +;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net> >> ;;; >> ;;; This file is part of GNU Guix. >> ;;; >> @@ -342,6 +343,46 @@ etc.") >> (home-page "http://liballeg.org") >> (license license:giftware))) >> >> +(define-public allegro > > Shouldn't this be allegro-5 since there is already an allegro-4? I want the “allegro” variable to simply hold the latest version of allegro. If ever there’s a need to clarify (e.g. because we need to keep around the last of the 5.x series when 6.x comes out) we can change the name then. As far as I can see that’s been our approach for some other packages, too, most prominently “python”. ~~ Ricardo
> > Shouldn't this be allegro-5 since there is already an allegro-4? > > I want the “allegro” variable to simply hold the latest version of > allegro. If ever there’s a need to clarify (e.g. because we need to > keep around the last of the 5.x series when 6.x comes out) we can change > the name then. As far as I can see that’s been our approach for some > other packages, too, most prominently “python”. In my humble opinion it would best if there was an "allego-5.0" and an "allegro" variable, with the "allegro" variable not being referenced by any other package (they would reference "allegro-5.0" instead - or whatever major API version they need, for example "allegro-5.2"). This way we wouldn't have to update half of all package specs after they break just because a new incompatible version came out. I think the way it was done for Python3 in Guix is wrong. On the other hand, the way it was done for Python2 in Guix was exactly right. What happens when a new (incompatible) Python4 comes out? Patch all the Python modules package specs there are? The only reason we can get away with it for Python is because they only do breaking change in the language every five years. This is something Debian got right - have the (API) version as suffix as part of the name. The "allegro" metapackage is purely a user convenience (of questionable benefit). If something becomes incompatible, its name should change.
On Wed, Jul 27, 2016 at 05:54:31PM +0200, Danny Milosavljevic wrote: > In my humble opinion it would best if there was an "allego-5.0" and an "allegro" variable, with the "allegro" variable not being referenced by any other package (they would reference "allegro-5.0" instead - or whatever major API version they need, for example "allegro-5.2"). > If something becomes incompatible, its name should change. It is our common practice to not re-encode the version into the name: Usually the unnumbered name simply stands for the latest version, Only when we need to keep several versions around do we add a versioned name for the earlier one. In this way, updating dependencies becomes easier: Most of the time, a later version of a dependency will work. To follow your suggestion, we would ultimately add the soname of libraries to package names, and then whenever some package is updated, all packages depending on it would need to have their inputs rewritten. This would not be very practical. Andreas
Hi Andreas, On Wed, 27 Jul 2016 18:19:18 +0200 Andreas Enge <andreas@enge.fr> wrote: >It is our common practice to not re-encode the version into the name: Usually the unnumbered name simply stands for the latest version That's unfortunate. I can live with it - but there is a reason the API major versions are usually encoded there. Otherwise it's not possible to ever make a clean API break and be safe with it. Just to make sure: I'm not saying the API major number should absolutely be part of the name, I'm saying there should be version bounds for all the inputs of packages. > In this way, updating dependencies becomes easier: Most of the time, a later version of a dependency will work. Then there would have been no reason to update the API major number in the first place. Of course I can think of scenarios where it would work regardless - for example if the package used only a subset of the entire functionality, it could be that this subset is still compatible. Python 3 is an example - few Python 2 programs will work on Python 3 without changes - so it makes no sense to "autoupdate" a Python 2 package to a Python 3 interpreter in isolation. Of course, if you are lucky, you can find some subset where it happens to work by accident. When Python 4 is released, a similar argument can be made. >To follow your suggestion, we would ultimately add the soname of libraries to package names, Only the part that is the API (in)compatibility version number - but yes. > and then whenever some package is updated, all packages depending on it would need to have > their inputs rewritten. Hopefully after checking whether the new API actually still does the right thing for it... Thanks, good to know the common practice.
Hello,
just replying to part of your message, since I think there might be a
misunderstanding:
On Wed, Jul 27, 2016 at 11:06:15PM +0200, Danny Milosavljevic wrote:
> Just to make sure: I'm not saying the API major number should absolutely be part of the name, I'm saying there should be version bounds for all the inputs of packages.
The inputs of our packages are absolutely precise: They are given as scheme
variables (which are, in a sense, a moving target, since their content
changes over time; but they are completely fixed at any given point in time).
So we have no way of saying, like in many other distributions, that the input
is any "python >= 2 and < 3"; in fact, we are always saying "use exactly
this Python, with this source, build system, inputs, etc.".
If a package x has as input "python", this is the scheme variable of this name,
which, in my current git tree, refers to a package containing Python 3.4.3,
and nothing else. Another package y may have as input "python-2", which is a
scheme variable containing currently Python 2.7.10. In core-updates, we
updated python-2 to contain Python 2.7.11. So the input to package y,
compiled in core-updates, is still called "python-2", but has actually
changed. The variable names are just conventions; and it is almost a pure
coincidence that they usually are the same as the "name" field of the
package record :-)
But maybe I simply misunderstood your comment. Anyway, upgrading has been
working generally well so far. Also, it is not always easy to determine
whether APIs are compatible or not, since they are not necessarily tied
to major versions of the software. For instance, I think that anything
(or almost) written for gmp-4 still compiles with gmp-5 or 6. But this
requires some familiarity with the code, which I have in this case since
I am following the gmp development. Apart from that, we have thousands of
packages now, some of which are probably not familiar to anybody. I know
that I packaged software of which I did not even understand the description,
just because it was a prerequisite for something I am interested in...
Andreas
Andreas Enge <andreas@enge.fr> writes: > The inputs of our packages are absolutely precise: They are given as scheme > variables (which are, in a sense, a moving target, since their content > changes over time; but they are completely fixed at any given point in time). > So we have no way of saying, like in many other distributions, that the input > is any "python >= 2 and < 3"; in fact, we are always saying "use exactly > this Python, with this source, build system, inputs, etc.". For this reason, the exact structure of the name doesn't seem too important. My understanding is that Nix and Guix both avoid "nominal" dependency specifications specifically it's unreliable. The first few pages of Eelco Dolstra's Nix thesis [1] discuss the pitfalls of "nominal" dependency specification: "Related to the inability to validate dependency specifications is the fact that dependencies tend to be inexact. Above, xhello required that a component named hello is present — but it makes no requirements on the actual properties or interfaces of that component. That is, the dependency specification is nominal (determined by name only), not by contract (requiring that the dependency has certain properties). So any component named hello satisfies the dependency. Actually, we can require specific versions of the dependency: Requires: hello >= 1.0 which excludes version 1.0. However, such version specifications involve a high degree of wishful thinking, since we can never in general rely on the fact that any version in an open range works. For instance, there is no way to know whether future release 1.3.1 of hello will be backwards compatible. Even “exact” dependencies such as Require: hello = 1.0 are unsafe, because this is still a nominal dependency: we can conceive of any number of component instances with name hello and version number 1.0 that behave completely differently. In fact, this is a real problem: Linux distributions from different vendors can easily have components with equal names (e.g., glibc-2.3.5) that actually have vendor-specific patches applied, have been built with specific options, compilers, or ABI options, and so on." [1] https://nixos.org/%7Eeelco/pubs/phd-thesis.pdf
diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm index b11285a..03623aa 100644 --- a/gnu/packages/game-development.scm +++ b/gnu/packages/game-development.scm @@ -7,6 +7,7 @@ ;;; Copyright © 2015, 2016 David Thompson <davet@gnu.org> ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il> ;;; Copyright © 2016 Kei Kebreau <kei@openmailbox.org> +;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net> ;;; ;;; This file is part of GNU Guix. ;;; @@ -342,6 +343,46 @@ etc.") (home-page "http://liballeg.org") (license license:giftware))) +(define-public allegro + (package + (name "allegro") + (version "5.2.0") + (source (origin + (method url-fetch) + (uri (string-append "http://download.gna.org/allegro/allegro/" + version "/allegro-" version ".tar.gz")) + (sha256 + (base32 + "1mwzgzc4nb5k5zkbq7yrc6hg63yxq3wk69lmjag1h19x8b6njnmg")))) + (build-system cmake-build-system) + (arguments `(#:tests? #f)) ; there are no tests + (inputs + ;; FIXME: Add the following optional inputs: xinput2, opensl, dumb + `(("flac" ,flac) + ("freetype" ,freetype) + ("glu" ,glu) + ("gtk" ,gtk+-2) + ("libjpeg" ,libjpeg) + ("libpng" ,libpng) + ("libtheora" ,libtheora) + ("libvorbis" ,libvorbis) + ("libxcursor" ,libxcursor) + ("libxinerama" ,libxinerama) + ("libxrandr" ,libxrandr) + ("mesa" ,mesa) + ("openal" ,openal) + ("physfs" ,physfs) + ("zlib" ,zlib))) + (native-inputs + `(("pkg-config" ,pkg-config))) + (synopsis "Game programming library") + (description "Allegro is a library mainly aimed at video game and +multimedia programming. It handles common, low-level tasks such as creating +windows, accepting user input, loading data, drawing images, playing sounds, +etc.") + (home-page "http://liballeg.org") + (license license:bsd-3))) + (define-public aseprite (package (name "aseprite")