From patchwork Wed Oct 7 18:20:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Malte Frank Gerdes X-Patchwork-Id: 24500 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id D5BB127BBE9; Wed, 7 Oct 2020 19:22:09 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,T_DKIM_INVALID,URIBL_BLOCKED,URIBL_SBL,URIBL_SBL_A autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id DA29C27BBE8 for ; Wed, 7 Oct 2020 19:22:08 +0100 (BST) Received: from localhost ([::1]:48428 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kQE4l-0008Ix-TT for patchwork@mira.cbaines.net; Wed, 07 Oct 2020 14:22:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41698) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kQE4g-0008Il-K3 for guix-patches@gnu.org; Wed, 07 Oct 2020 14:22:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:46499) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kQE4g-0007Pa-Ai for guix-patches@gnu.org; Wed, 07 Oct 2020 14:22:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kQE4g-0006bG-6v for guix-patches@gnu.org; Wed, 07 Oct 2020 14:22:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#43654] [PATCH] Add perl-opengl References: <86pn67xcmn.fsf@gmail.com> In-Reply-To: <86pn67xcmn.fsf@gmail.com> Resent-From: Malte Frank Gerdes Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 07 Oct 2020 18:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43654 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 43654@debbugs.gnu.org Received: via spool by 43654-submit@debbugs.gnu.org id=B43654.160209487225314 (code B ref 43654); Wed, 07 Oct 2020 18:22:02 +0000 Received: (at 43654) by debbugs.gnu.org; 7 Oct 2020 18:21:12 +0000 Received: from localhost ([127.0.0.1]:58045 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kQE3i-0006a5-Q5 for submit@debbugs.gnu.org; Wed, 07 Oct 2020 14:21:11 -0400 Received: from mail-ej1-f67.google.com ([209.85.218.67]:45663) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kQE3e-0006ZE-OZ for 43654@debbugs.gnu.org; Wed, 07 Oct 2020 14:21:02 -0400 Received: by mail-ej1-f67.google.com with SMTP id dt13so4329314ejb.12 for <43654@debbugs.gnu.org>; Wed, 07 Oct 2020 11:20:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:user-agent:mime-version :content-transfer-encoding; bh=C8+MMHauUZgAOZ1/LOYgZED4TUWt1nK//pkkVfdteng=; b=RJcjF/ti9lhoMWo/55o80Jo+Dhk7Dko0//X9qlNizjARjVVXsVnMw8nSM7XcJ77PN0 OzDB2dmGdBsZ4Wvh5cITNhHIMVSF+Sr05V53ae/VRRXId6F4rErTiti/0CDHfzttXrhT JAjQ7qimNS4bg1JwvEgyHK88n5hmbpwQubgx7cH9X2noCXx7h0I5B7YQ5dYuF8rQl5Py dE5J4lLMCRkslI0uuzyYpILQzL65HHPcIAlQ36v2ahwuHkBMgoUEtkVlwtmYVyndjoJw IGx4STh2rNs0TNNWnesnhwmEYLJ46TULZ1VQ+sbq9JdtO/0CFQeXmALm9JKzAtCL27x8 BfIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:user-agent :mime-version:content-transfer-encoding; bh=C8+MMHauUZgAOZ1/LOYgZED4TUWt1nK//pkkVfdteng=; b=VhjI5YjEi3qmyB4Y6THDGNDPBVv99mIB9SEbhzigiqBZmrV6Ty7D8wzT5Fm4crLY+j TDRbymCS8wkVXqEdqpzCU/JR5sdDpKwzw2SsptgAhMqgG8HvIIjKxgg+5SlMKWdF+Lt2 TVMoRuD/TSn0MdBpaw5HbgZF9fjN1YK4kObGCLBvblojflAM1qcvh1gVMRt9mw05eR3T RyDSf89EWo53VHCmrYOC1pVgfdEkAhKzMKeYqb5uwgYownehkxj0x5wpCfy/Y8HaVs45 1RVUDhCMiim/iQWc7RI4a59s93yDEYIgLyzTQYIKDe1+XEIKcxixXydqf+YFC2L9/OD6 HcMA== X-Gm-Message-State: AOAM533BiP7t0E9yM+FxbIvNhrsJCYm8MxDsGjhdJk3g/xi9qiWgniAN J4CtoOM/yfnp6e9G0JmoaDxFEVzWT2c= X-Google-Smtp-Source: ABdhPJyjyTPFBjNjNXDk2T5UWfbqQ04fyOlH20FQJsdMJ7DU5b1y4pcfxMtP6t5BkQT5oU3zdPp+yg== X-Received: by 2002:a17:906:4ec7:: with SMTP id i7mr4088416ejv.439.1602094852310; Wed, 07 Oct 2020 11:20:52 -0700 (PDT) Received: from Morphium (ip-84-118-73-55.unity-media.net. [84.118.73.55]) by smtp.gmail.com with ESMTPSA id qw1sm1576580ejb.44.2020.10.07.11.20.51 for <43654@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Oct 2020 11:20:51 -0700 (PDT) From: Malte Frank Gerdes Date: Wed, 07 Oct 2020 20:20:51 +0200 Message-ID: <86pn5t6gos.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Forgot to Cc the list... Andreas Enge writes: > On Fri, Oct 02, 2020 at 09:33:04PM +0200, Malte Frank Gerdes wrote: >> I just tried to build with those variables set to arbitrary values: >> >> --8<---------------cut here---------------start------------->8--- >> GLUT=99999 >> VERSION=3.0 Mesa 99.99.99 >> VENDOR=NoVendor >> RENDERER=MesaRenderer >> --8<---------------cut here---------------end--------------->8--- > > Actually I just went further: > FREEGLUT= > GLUT= > VERSION= > VENDOR= > RENDERER= > EXTENSIONS= Nice! (I didn't even think of leaving them empty ...) > The package compiles, but running test.pl (which showed just a blank square > before) now fails with this message: > Goto undefined subroutine &AutoLoader::AUTOLOAD at > /home/andreas/.guix-profile/lib/perl5/site_perl/5.30.2/x86_64-linux-thread-multi/OpenGL.pm > line 6178. > > However, I tried several of the examples, and they work. > > So one option would be to disable the test ("#:tests? #f") and create the > essentially empty glversion.txt file above inside a phase. There would not > even be a need to store it as a an auxiliary file; see the use of > "call-with-output-file" in guix/tests.scm, for instance. > > What do you think? > > Andreas > IMHO disabling the tests is the best solution then - it didn't /really/ test the libraries functionality it seems, because the examples do much more different things. > Something like this: > (add-before 'configure 'glversion > ;; Building utils/glversion.txt fails, and is probably > ;; dependent on the graphics card in the build system. > ;; Replace it by a content-free file; while this breaks > ;; the test, the examples in the examples/ subdirectory > ;; can be run. > (lambda _ > (substitute* "Makefile.PL" > (("unlink") "# unlink") ; prevent utils/glversion.txt > ; from being deleted once... > (("\\.\"\\$make_ver clean\"") "")) ; ...and twice... > (substitute* "utils/Makefile" > (("all: glversion.txt") "all: ")) ; ...and thrice. > (call-with-output-file "utils/glversion.txt" > (lambda (port) > (display (string-append "FREEGLUT=\nGLUT=\nVERSION=\n" > "VENDOR=\nRENDERER=\n" > "EXTENSIONS=\n") > port))) > #t)) > > I tried to add the following instead of patching Makefile.PL: > (add-before 'configure 'fix-interface > ;; Libraries are not found in default locations, so force > ;; an interface. > (lambda _ > (substitute* "Makefile.PL" > (("die \"FreeGLUT or GLUT libraries") > "$interface_lib = 'FREEGLUT'; #")) > #t)) > > But it fails during compilation with error messages such as this one: > /gnu/store/1qmd9achfkm1njzxf8hi86q53pmy9sxk-mesa-20.0.7/include/GL/glxext.h:530:169: error: unknown type name ‘GLintptr’; did you mean ‘GLint’? > From some search engine results, I surmise that I am missing the > $DEFS .= " -DGL_GLEXT_LEGACY"; > from line 525 of Makefile.PL. > > So maybe we will have to replace the "-L/what/ever" as you do it in your > cdr/match phase; but instead of adding a patch that drops the "-L" in > favour of some "@@libpaths@@" text, only to replace the new text again > in a phase, I would use just a phase. For instance, instead of replacing > "^@@libdirs@@", just replace "-L/usr/local/freeglut/lib". Makes sense that it's pointless to replace the text twice. > On Tue, Oct 06, 2020 at 12:35:43AM +0200, Andreas Enge wrote: > > But it is already tomorrow, time to stop. > > Did I mention that Guix is addictive? I feel you 😂. It just makes fun to do things in Guix. > If you feel like it, you could replace "cdr" by "match", and maybe test > if all of the inputs are actually needed. After all it seems glu and mesa are not necessary as inputs because freeglut propagates them anyway. Is it ok to rely on propagated inputs? They still need to be added to the library search dir though. Attached is a updated version of your patch :) Malte > From 1fdc8885e04bdad9fee886c58dea9c8c712b5848 Mon Sep 17 00:00:00 2001 From: Andreas Enge Date: Tue, 6 Oct 2020 00:43:45 +0200 Subject: [PATCH] gnu: Add perl-opengl. * gnu/packages/perl.scm (perl-opengl): New variable. Co-authored-by: Malte Frank Gerdes --- gnu/packages/perl.scm | 64 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 62 insertions(+), 2 deletions(-) diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm index 1c3d999d79..9916c579e4 100644 --- a/gnu/packages/perl.scm +++ b/gnu/packages/perl.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès -;;; Copyright © 2013, 2019 Andreas Enge +;;; Copyright © 2013, 2019, 2020 Andreas Enge ;;; Copyright © 2015, 2016, 2017, 2019 Ricardo Wurmus ;;; Copyright © 2015, 2016, 2017, 2019, 2020 Eric Bavier ;;; Copyright © 2015 Eric Dvorsak @@ -27,6 +27,7 @@ ;;; Copyright © 2020 Vincent Legoll ;;; Copyright © 2020 Paul Garlick ;;; Copyright © 2020 Nicolas Goaziou +;;; Copyright © 2020 Malte Frank Gerdes ;;; ;;; This file is part of GNU Guix. ;;; @@ -74,7 +75,8 @@ #:use-module (gnu packages sdl) #:use-module (gnu packages textutils) #:use-module (gnu packages video) - #:use-module (gnu packages web)) + #:use-module (gnu packages web) + #:use-module (gnu packages xorg)) ;;; ;;; Please: Try to add new module packages in alphabetic order. @@ -7870,6 +7872,64 @@ technology to store hierarchical information such as links to other documents within a single file.") (license (package-license perl)))) +(define-public perl-opengl + (package + (name "perl-opengl") + (version "0.70") + (source + (origin + (method url-fetch) + (uri (string-append + "mirror://cpan/authors/id/C/CH/CHM/OpenGL-" + version + ".tar.gz")) + (sha256 + (base32 + "1q3lz168q081iwl9jg21fbzhp9la79gav9mv6nmh2jab83s2l3mj")))) + (build-system perl-build-system) + (inputs `(("freeglut" ,freeglut) + ("libxi" ,libxi) + ("libxmu" ,libxmu))) + (arguments + '(#:tests? #f ; test.pl fails with our empty glversion.txt, while + ; the package still seems to work on the examples + #:phases + (modify-phases %standard-phases + (add-before 'configure 'glversion + ;; Building utils/glversion.txt fails, and is probably + ;; dependent on the graphics card in the build system. + ;; Replace it by a content-free file; while this breaks + ;; the tests, the examples in the examples/ subdirectory + ;; can be run. + (lambda _ + (substitute* "Makefile.PL" + (("unlink") "# unlink") ; prevent utils/glversion.txt + ; from being deleted once... + (("\\.\"\\$make_ver clean\"") "")) ; ...and twice... + (substitute* "utils/Makefile" + (("all: glversion.txt") "all: ")) ; ...and thrice. + (call-with-output-file "utils/glversion.txt" + (lambda (port) + (display (string-append "FREEGLUT=\nGLUT=\nVERSION=\n" + "VENDOR=\nRENDERER=\n" + "EXTENSIONS=\n") + port))) + #t)) + (add-before 'configure 'fix-library-flags + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "Makefile.PL" + (("-L/usr/local/freeglut/lib") + (string-append "-L" (assoc-ref inputs "freeglut") "/lib\n" + "-L" (assoc-ref inputs "glu") "/lib\n" + "-L" (assoc-ref inputs "mesa") "/lib\n"))) + #t))))) + (home-page "https://metacpan.org/release/OpenGL") + (synopsis + "Perl bindings to the OpenGL API, GLU, and GLUT/FreeGLUT") + (description "The package provides Perl bindings to OpenGL, GLU +and FreeGLUT.") + (license (package-license perl)))) + (define-public perl-package-anon (package (name "perl-package-anon")