From 0c7cef591b9ea2d7b5227ab5548c8c56bff79915 Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Thu, 2 Jan 2020 12:16:45 +0100 Subject: nongnu: nvidia-cg-toolkit: Fix i686 build. * nongnu/packages/game-development.scm (nvidia-cg-toolkit): Extract the different archive sources. Set the supported-systems to i686-linux and x86_64-linux. --- nongnu/packages/game-development.scm | 141 +++++++++++++++++++++-------------- 1 file changed, 84 insertions(+), 57 deletions(-) diff --git a/nongnu/packages/game-development.scm b/nongnu/packages/game-development.scm index 8cc2287..5888d13 100644 --- a/nongnu/packages/game-development.scm +++ b/nongnu/packages/game-development.scm @@ -27,63 +27,89 @@ #:use-module (gnu packages gl) #:use-module (gnu packages xorg)) +(define nvidia-cg-toolkit-version "3.1") +(define nvidia-cg-toolkit-date "April2012") + +(define nvidia-cg-toolkit-i686-archive + (origin + (method url-fetch) + (uri + (string-append "http://developer.download.nvidia.com/cg/Cg_" + nvidia-cg-toolkit-version + "/Cg-" nvidia-cg-toolkit-version "_" nvidia-cg-toolkit-date "_" + "x86" ".tgz")) + (sha256 + (base32 "0yc8n6vpqyb6qhcv5kwvr3h21ya271fi930fvd98hlkg8cg5kwyf")))) + +(define nvidia-cg-toolkit-x86_64-archive + (origin + (method url-fetch) + (uri + (string-append "http://developer.download.nvidia.com/cg/Cg_" + nvidia-cg-toolkit-version + "/Cg-" nvidia-cg-toolkit-version "_" nvidia-cg-toolkit-date "_" + "x86_64" ".tgz")) + (sha256 + (base32 "0y4qms4lm9xiix93g45337rx5nrp0y3gb0x0avyv7l9qrkk03zz8")))) + +(define (lib) + (match (or (%current-target-system) + (%current-system)) + ("x86_64-linux" "lib64") + ("i686-linux" "lib"))) + (define-public nvidia-cg-toolkit - (let ((arch (match (or (%current-target-system) - (%current-system)) - ("x86_64-linux" "x86_64") - ("i686-linux" "x86") - (_ ""))) - (lib (match (or (%current-target-system) - (%current-system)) - ("x86_64-linux" "lib64") - ("i686-linux" "lib") - (_ ""))) - (date "April2012")) - (package - (name "nvidia-cg-toolkit") - (version "3.1") - (source (origin - (method url-fetch) - (uri - (string-append "http://developer.download.nvidia.com/cg/Cg_" - version "/Cg-" version "_" date "_" arch ".tgz")) - (sha256 - (base32 - "0y4qms4lm9xiix93g45337rx5nrp0y3gb0x0avyv7l9qrkk03zz8")))) - (build-system binary-build-system) - (arguments - `(#:strip-binaries? #f ; Fails with "allocated section `.dynstr' not in segment". - #:patchelf-plan - `(("bin/cgc" - ("glibc" "out")) - ("bin/cginfo" - ("gcc:lib" "glibc")) - ("bin/cgfxcat" - ("out" "glibc" "glu" "mesa" "libice" "libsm" - "libxmu" "libxt" "libxi" "libxext" "libx11")) - ("lib64/libCg.so" - ("glibc")) - ("lib64/libCgGL.so" - ("out" "glibc"))) - #:install-plan - `(("bin" (".") "bin/") - (,,lib (".") "lib/") - ("include" (".") "include/") - ("local" (".") "share/")))) - (inputs - `(("gcc:lib" ,gcc "lib") - ("glibc" ,glibc) - ("glu" ,glu) - ("libice" ,libice) - ("libsm" ,libsm) - ("libxmu" ,libxmu) - ("libxt" ,libxt) - ("libxi" ,libxi) - ("libxext" ,libxext) - ("libx11" ,libx11))) - (home-page "https://developer.nvidia.com/cg-toolkit") - (synopsis "High-level shading language") - (description "NVIDIA introduced programmable shading with Cg, which + (package + (name "nvidia-cg-toolkit") + (version nvidia-cg-toolkit-version) + (source #f) + (build-system binary-build-system) + (arguments + `(#:strip-binaries? #f ; Fails with "allocated section `.dynstr' not in segment". + #:patchelf-plan + `(("bin/cgc" + ("glibc" "out")) + ("bin/cginfo" + ("gcc:lib" "glibc")) + ("bin/cgfxcat" + ("out" "glibc" "glu" "mesa" "libice" "libsm" + "libxmu" "libxt" "libxi" "libxext" "libx11")) + (,,(string-append (lib) "/libCg.so") + ("glibc")) + (,,(string-append (lib) "/libCgGL.so") + ("out" "glibc"))) + #:install-plan + `(("bin" (".") "bin/") + (,,(lib) (".") "lib/") + ("include" (".") "include/") + ("local" (".") "share/")) + #:phases + (modify-phases %standard-phases + (replace 'unpack + (lambda* (#:key inputs #:allow-other-keys) + (let ((archive (assoc-ref inputs "nvidia-cg-toolkit-archive"))) + (invoke "tar" "xf" archive) + (chdir "usr") + #t)))))) + (native-inputs + `(("nvidia-cg-toolkit-archive" + ,(match (or (%current-target-system) (%current-system)) + ("x86_64-linux" nvidia-cg-toolkit-x86_64-archive) + (_ nvidia-cg-toolkit-i686-archive))))) + (inputs + `(("gcc:lib" ,gcc "lib") + ("glibc" ,glibc) + ("glu" ,glu) + ("libice" ,libice) + ("libsm" ,libsm) + ("libxmu" ,libxmu) + ("libxt" ,libxt) + ("libxi" ,libxi) + ("libxext" ,libxext) + ("libx11" ,libx11))) + (home-page "https://developer.nvidia.com/cg-toolkit") + (synopsis "High-level shading language") + (description "NVIDIA introduced programmable shading with Cg, which supported dozens of different OpenGL and DirectX profile targets. It allowed developers to incorporate interactive effects within 3D applications and share them among other Cg applications, across graphics APIs, and most operating @@ -93,4 +119,5 @@ The Cg Toolkit is a legacy NVIDIA toolkit no longer under active development or support. It is not recommended using it in new development projects because future hardware features may not be supported. Going forward, new development should opt for GLSL rather than Cg.") - (license (license:nonfree "file://share/Cg/docs/license.txt"))))) + (supported-systems '("i686-linux" "x86_64-linux")) + (license (license:nonfree "file://share/Cg/docs/license.txt")))) -- cgit v1.2.3