From mboxrd@z Thu Jan 1 00:00:00 1970 From: taylanbayirli@gmail.com (Taylan Ulrich =?utf-8?Q?Bay=C4=B1rl=C4=B1?= =?utf-8?Q?=2FKammer?=) Subject: Re: [PATCH] gnu: Add s2tc. Date: Tue, 17 Mar 2015 11:58:47 +0100 Message-ID: <87twxj6gbc.fsf@taylan.uni.cx> References: <87y4n36wd9.fsf@taylan.uni.cx> <87pp8e6i4y.fsf@taylan.uni.cx> <87ioe47wju.fsf@taylan.uni.cx> <878uez3dhe.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37618) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXpD4-0004nm-9y for guix-devel@gnu.org; Tue, 17 Mar 2015 06:58:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YXpD2-00082o-SA for guix-devel@gnu.org; Tue, 17 Mar 2015 06:58:54 -0400 In-Reply-To: <878uez3dhe.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Sat, 14 Mar 2015 14:39:09 +0100") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable ludo@gnu.org (Ludovic Court=C3=A8s) writes: >> + (description >> + "S2TC is a patent-free S3TC compatible implementation and provides >> +texture compression to Mesa.") > > Could you expound a bit, giving a bit more context? > > Thanks! > > Ludo=E2=80=99. Updated patches below; is this description OK? --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-gnu-Add-s2tc.patch Content-Description: patch1 >From 7b35851a3da24d376c59b192555d885c9baf79dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?= Date: Wed, 11 Mar 2015 21:49:24 +0100 Subject: [PATCH 1/5] gnu: Add s2tc. * gnu/packages/gl.scm (s2tc): New variable. (mesa-headers): New variable. --- gnu/packages/gl.scm | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/gnu/packages/gl.scm b/gnu/packages/gl.scm index 7d549d3..26c514e 100644 --- a/gnu/packages/gl.scm +++ b/gnu/packages/gl.scm @@ -26,6 +26,7 @@ #:use-module (guix download) #:use-module (guix build-system gnu) #:use-module (guix packages) + #:use-module (gnu packages autotools) #:use-module (gnu packages bison) #:use-module (gnu packages flex) #:use-module (gnu packages pkg-config) @@ -123,6 +124,37 @@ rendering modes are: Bitmaps, Anti-aliased pixmaps, Texture maps, Outlines, Polygon meshes, and Extruded polygon meshes") (license l:x11))) +(define-public s2tc + (package + (name "s2tc") + (version "1.0") + (source + (origin + (method url-fetch) + (uri (string-append + "https://github.com/divVerent/s2tc/archive/v" version ".tar.gz")) + (sha256 + (base32 "0ibfdib277fhbqvxzan0bmglwnsl1y1rw2g8skvz82l1sfmmn752")))) + (build-system gnu-build-system) + (native-inputs + `(("autoconf" ,autoconf) + ("automake" ,automake) + ("libtool" ,libtool))) + (inputs + `(("mesa-headers" ,mesa-headers))) + (arguments + '(#:phases + (modify-phases %standard-phases + (add-after unpack autogen + (lambda _ + (zero? (system* "sh" "autogen.sh"))))))) + (home-page "https://github.com/divVerent/s2tc") + (synopsis "S3 Texture Compression implementation") + (description + "S2TC is a patent-free implementation of S3 Texture Compression (S3TC, +also known as DXTn or DXTC) for Mesa.") + (license l:expat))) + (define-public mesa (package (name "mesa") @@ -196,6 +228,25 @@ allows Mesa to be used in many different environments ranging from software emulation to complete hardware acceleration for modern GPUs.") (license l:x11))) +(define-public mesa-headers + (package + (inherit mesa) + (name "mesa-headers") + (propagated-inputs '()) + (inputs '()) + (native-inputs '()) + (arguments + '(#:phases + (modify-phases %standard-phases + (delete configure) + (delete build) + (delete check) + (replace install + (lambda* (#:key outputs #:allow-other-keys) + (copy-recursively "include" (string-append + (assoc-ref outputs "out") + "/include"))))))))) + (define-public glew (package (name "glew") -- 2.2.1 --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0002-gnu-mesa-Add-input-s2tc.patch Content-Description: patch2 >From ba19b56ba979e5a85a26aa98c0eef8e12846edd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?= Date: Sat, 14 Mar 2015 15:05:15 +0100 Subject: [PATCH 2/5] gnu: mesa: Add input s2tc. * gnu/packages/gl.scm (mesa): Add input s2tc, patch sources to make the reference to libtxc_dxtn.so absolute since it's passed to dlopen(3). --- gnu/packages/gl.scm | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/gnu/packages/gl.scm b/gnu/packages/gl.scm index 26c514e..d2096b6 100644 --- a/gnu/packages/gl.scm +++ b/gnu/packages/gl.scm @@ -185,7 +185,8 @@ also known as DXTn or DXTC) for Mesa.") ("libxml2" ,libxml2) ;; TODO: Add 'libva' ;; TODO: Add 'libxml2-python' for OpenGL ES 1.1 and 2.0 support - ("makedepend" ,makedepend))) + ("makedepend" ,makedepend) + ("s2tc" ,s2tc))) (native-inputs `(("pkg-config" ,pkg-config) ("gettext" ,gnu-gettext) @@ -219,7 +220,18 @@ also known as DXTn or DXTC) for Mesa.") (lambda _ (substitute* "src/glsl/tests/lower_jumps/create_test_cases.py" (("/usr/bin/env bash") (which "bash")))) - %standard-phases)))) + (alist-cons-before + 'build 'fix-dxtn-libname + (lambda* (#:key inputs #:allow-other-keys) + (let ((s2tc (assoc-ref inputs "s2tc"))) + ;; Remain agnostic to .so.X.Y.Z versions while doing + ;; the substitutions so we're future-safe. + (substitute* + '("src/gallium/auxiliary/util/u_format_s3tc.c" + "src/mesa/main/texcompress_s3tc.c") + (("\"libtxc_dxtn\\.so") + (string-append "\"" s2tc "/lib/libtxc_dxtn.so"))))) + %standard-phases))))) (home-page "http://mesa3d.org/") (synopsis "OpenGL implementation") (description "Mesa is a free implementation of the OpenGL specification - -- 2.2.1 --=-=-=--