unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: taylanbayirli@gmail.com (Taylan Ulrich Bayırlı/Kammer)
To: guix-devel@gnu.org
Subject: Re: [PATCH] gnu: Add s2tc.
Date: Fri, 13 Mar 2015 16:21:25 +0100	[thread overview]
Message-ID: <87ioe47wju.fsf@taylan.uni.cx> (raw)
In-Reply-To: <87pp8e6i4y.fsf@taylan.uni.cx> ("Taylan Ulrich \=\?utf-8\?Q\?\=5C\=22Bay\=C4\=B1rl\=C4\=B1\=2FKammer\=5C\=22\=22's\?\= message of "Thu, 12 Mar 2015 22:05:49 +0100")

[-- Attachment #1: Type: text/plain, Size: 95 bytes --]

Here's the updated patch, which adds a mesa-headers package, and fixes
the dlopening of s2tc.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-diff, Size: 4575 bytes --]

From 01539ae1ff353ac7feccdfdd05992ad295dcdd00 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?=
 <taylanbayirli@gmail.com>
Date: Wed, 11 Mar 2015 21:49:24 +0100
Subject: [PATCH 1/3] gnu: Add s2tc.

* gnu/packages/gl.scm (s2tc): New variable.
(mesa): Add input s2tc, patch references to "libtxc_dxtn.so".
(mesa-headers): New variable.
---
 gnu/packages/gl.scm | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 65 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/gl.scm b/gnu/packages/gl.scm
index 7d549d3..e237cb1 100644
--- a/gnu/packages/gl.scm
+++ b/gnu/packages/gl.scm
@@ -21,11 +21,13 @@
 
 (define-module (gnu packages gl)
   #:use-module (ice-9 match)
+  #:use-module (guix build utils)
   #:use-module ((guix licenses) #:prefix l:)
   #:use-module (guix packages)
   #: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 +125,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 Text Compression implementation")
+    (description
+     "S2TC is a patent-free S3TC compatible implementation and provides
+texture compression to Mesa.")
+    (license l:expat)))
+
 (define-public mesa
   (package
     (name "mesa")
@@ -153,7 +186,8 @@ Polygon meshes, and Extruded polygon meshes")
         ("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)
@@ -187,7 +221,17 @@ Polygon meshes, and Extruded polygon meshes")
                   (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")))
+                       (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 -
@@ -196,6 +240,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


  reply	other threads:[~2015-03-13 15:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-11 21:46 [PATCH] gnu: Add s2tc Taylan Ulrich Bayırlı/Kammer
2015-03-12 21:05 ` Taylan Ulrich Bayırlı/Kammer
2015-03-13 15:21   ` Taylan Ulrich Bayırlı/Kammer [this message]
2015-03-14 13:39     ` Ludovic Courtès
2015-03-17 10:58       ` Taylan Ulrich Bayırlı/Kammer
2015-03-18  8:44         ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ioe47wju.fsf@taylan.uni.cx \
    --to=taylanbayirli@gmail.com \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).