[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

apitrace: Changes to 'debian'



 debian/README.source                                 |   11 -
 debian/control                                       |    3 
 debian/copyright                                     |    4 
 debian/patches/02_use_system_libpng_snappy_zlib.diff |  144 +++++++++++++++++++
 debian/patches/series                                |    1 
 debian/rules                                         |    7 
 6 files changed, 163 insertions(+), 7 deletions(-)

New commits:
commit 478ad4c16e807b3893c6ba4670468d5c7b8c08d8
Author: Christopher James Halse Rogers <chris@cooperteam.net>
Date:   Tue Aug 21 11:46:51 2012 +1000

    Update README.source, discussing system-libs patch

diff --git a/debian/README.source b/debian/README.source
index f40f1f5..4ff2593 100644
--- a/debian/README.source
+++ b/debian/README.source
@@ -2,13 +2,16 @@ apitrace for Debian
 -------------------
 
 Upstream ships with embedded copies of zlib, libpng, libsnappy, and libqjson.
-The buildsystem is patched to use the system copies of these libraries, but the
-tarball is not stripped.  Upstream also ships with headers for MSVC, which are
-unused.
+The buildsystem is patched to use the system copies of these libraries for the
+UI tools, but the tracing wrappers use a statically linked copy of the bundled
+libsnappy to minimise the possibility of symbol conflicts when tracing
+third-party applications.
+
+Upstream also ships with headers for MSVC, which are unused.
 
 The thirdparty/ directory also contains GL extension headers in glext/, these
 are used in preference to the system-wide headers to ensure that the tracer
 can proxy all the calls it knows about, not just those that the system's Mesa
 library knows about.
 
- -- Christopher James Halse Rogers <raof@ubuntu.com>, Wed,  5 Oct 2011 17:57:43 +1100
+ -- Christopher James Halse Rogers <raof@ubuntu.com>, Tue, 21 Aug 2012 11:46:26 +1000

commit 621ac35704a3b0e81952df9858ed3ec9a5194b82
Author: Christopher James Halse Rogers <chris@cooperteam.net>
Date:   Tue Aug 21 11:11:20 2012 +1000

    Enable parallel builds

diff --git a/debian/rules b/debian/rules
index 6a152ec..c0362f5 100755
--- a/debian/rules
+++ b/debian/rules
@@ -29,4 +29,4 @@ override_dh_clean:
 	dh_clean
 
 %:
-	dh $@
+	dh $@ --parallel

commit 574d7dd0f65d9d630bc24a14f5bd90dfd4e2752a
Author: Christopher James Halse Rogers <chris@cooperteam.net>
Date:   Tue Aug 21 11:09:59 2012 +1000

    Fix build-twice-in-a-row by deleting generated .pyc files on clean

diff --git a/debian/rules b/debian/rules
index e8b7d93..6a152ec 100755
--- a/debian/rules
+++ b/debian/rules
@@ -23,5 +23,10 @@ override_dh_install:
 	-rm debian/tmp/usr/share/doc/apitrace/LICENSE
 	dh_install --fail-missing
 
+override_dh_clean:
+        # The buildsystem doesn't clean the generate python bytecode
+	find . -name *.pyc -delete
+	dh_clean
+
 %:
 	dh $@

commit 957719fe66ea96802ebebfa3139b0b0a5e526854
Author: Christopher James Halse Rogers <chris@cooperteam.net>
Date:   Tue Aug 21 11:08:38 2012 +1000

    Fix DEP-5 format issue in debian/copyright

diff --git a/debian/copyright b/debian/copyright
index 263c841..6095569 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -3,8 +3,8 @@ Upstream-Name: apitrace
 Source: https://github.com/apitrace/apitrace
 
 Files: *
-Copyright: 2011 Jose Fonseca, Zack Rusin
-Copyright: 2008-2010 VMware, Inc.
+Copyright: © 2011 Jose Fonseca, Zack Rusin
+           © 2008-2010 VMware, Inc.
 License: Expat
 
 Files: debian/*

commit 67bbf6b13fcc1765c064c1c24a703c08bd048718
Author: Christopher James Halse Rogers <chris@cooperteam.net>
Date:   Tue Aug 21 11:03:08 2012 +1000

    Rework and reinstate use-system-libs patch.
    
    The wrappers now statically link libsnappy, to prevent symbol pollution, but
    the rest of the programs link to system libraries.

diff --git a/debian/control b/debian/control
index ea67a85..ab45237 100644
--- a/debian/control
+++ b/debian/control
@@ -12,8 +12,11 @@ Build-Depends:
  libqt4-dev,
  libqtwebkit-dev,
  libqjson-dev,
+ libsnappy-dev,
+ libpng12-dev,
  pkg-config,
  python,
+ zlib1g-dev,
 Standards-Version: 3.9.2
 Homepage: https://github.com/apitrace/apitrace
 Vcs-Git: git://git.debian.org/pkg-xorg/app/apitrace.git
diff --git a/debian/patches/02_use_system_libpng_snappy_zlib.diff b/debian/patches/02_use_system_libpng_snappy_zlib.diff
new file mode 100644
index 0000000..3171e8b
--- /dev/null
+++ b/debian/patches/02_use_system_libpng_snappy_zlib.diff
@@ -0,0 +1,144 @@
+Description: Link against system libraries for zlib, libsnappy, and libpng
+Author: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> 
+Forwarded: not-needed
+
+Index: apitrace/CMakeLists.txt
+===================================================================
+--- apitrace.orig/CMakeLists.txt	2012-08-21 11:28:58.205446085 +1000
++++ apitrace/CMakeLists.txt	2012-08-21 11:28:58.501446094 +1000
+@@ -159,23 +159,24 @@
+ # - on unices to prevent symbol collisions when tracing applications that link
+ # against other versions of these libraries
+ 
+-set (ZLIB_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/zlib)
+-set (ZLIB_LIBRARIES z_bundled)
+-add_subdirectory (thirdparty/zlib EXCLUDE_FROM_ALL)
+-
++find_package (ZLIB REQUIRED)
+ include_directories (${ZLIB_INCLUDE_DIRS})
+ 
+-set (SNAPPY_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/snappy)
+-set (SNAPPY_LIBRARIES snappy_bundled)
+-add_subdirectory (thirdparty/snappy EXCLUDE_FROM_ALL)
++#
++# libSnappy doesn't ship a pc file, because it is made of hate
++#
++#find_package (SNAPPY REQUIRED)
++set (SNAPPY_INCLUDE_DIRS "")
++set (SNAPPY_LIBRARIES -lsnappy)
+ 
+ include_directories (${SNAPPY_INCLUDE_DIRS})
+ 
+-set (PNG_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/libpng)
+-set (PNG_DEFINITIONS "")
+-set (PNG_LIBRARIES png_bundled)
++set (BUNDLED_SNAPPY_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/snappy)
++set (BUNDLED_SNAPPY_LIBRARIES snappy_bundled)
++add_subdirectory (thirdparty/snappy EXCLUDE_FROM_ALL)
++
+ 
+-add_subdirectory (thirdparty/libpng EXCLUDE_FROM_ALL)
++find_package (PNG REQUIRED)
+ include_directories (${PNG_INCLUDE_DIR})
+ add_definitions (${PNG_DEFINITIONS})
+ 
+Index: apitrace/common/trace_file_zlib.cpp
+===================================================================
+--- apitrace.orig/common/trace_file_zlib.cpp	2012-08-21 09:49:30.677240886 +1000
++++ apitrace/common/trace_file_zlib.cpp	2012-08-21 11:28:58.501446094 +1000
+@@ -31,7 +31,6 @@
+ #include <string.h>
+ 
+ #include <zlib.h>
+-#include <gzguts.h>
+ 
+ // for lseek
+ #ifdef _WIN32
+@@ -44,6 +43,7 @@
+ #include "os.hpp"
+ 
+ #include <iostream>
++#include <stdio.h>
+ 
+ 
+ using namespace trace;
+@@ -70,6 +70,7 @@
+ private:
+     gzFile m_gzFile;
+     double m_endOffset;
++    int raw_fd;
+ };
+ 
+ ZLibFile::ZLibFile(const std::string &filename,
+@@ -86,18 +87,23 @@
+ 
+ bool ZLibFile::rawOpen(const std::string &filename, File::Mode mode)
+ {
+-    m_gzFile = gzopen(filename.c_str(),
+-                      (mode == File::Write) ? "wb" : "rb");
++    FILE *file = fopen(filename.c_str(),
++                       (mode == File::Write) ? "wb" : "rb") ;
++    if (file == NULL)
++        return false;
++
++    raw_fd = fileno(file);
++    m_gzFile = gzdopen(raw_fd,
++                       (mode == File::Write) ? "wb" : "rb");
+ 
+     if (mode == File::Read && m_gzFile) {
+         //XXX: unfortunately zlib doesn't support
+         //     SEEK_END or we could've done:
+         //m_endOffset = gzseek(m_gzFile, 0, SEEK_END);
+         //gzrewind(m_gzFile);
+-        gz_state *state = (gz_state *)m_gzFile;
+-        off_t loc = lseek(state->fd, 0, SEEK_CUR);
+-        m_endOffset = lseek(state->fd, 0, SEEK_END);
+-        lseek(state->fd, loc, SEEK_SET);
++        off_t loc = lseek(raw_fd, 0, SEEK_CUR);
++        m_endOffset = lseek(raw_fd, 0, SEEK_END);
++        lseek(raw_fd, loc, SEEK_SET);
+     }
+ 
+     return m_gzFile != NULL;
+@@ -149,8 +155,7 @@
+ 
+ int ZLibFile::rawPercentRead()
+ {
+-    gz_state *state = (gz_state *)m_gzFile;
+-    return 100 * (lseek(state->fd, 0, SEEK_CUR) / m_endOffset);
++    return 100 * (lseek(raw_fd, 0, SEEK_CUR) / m_endOffset);
+ }
+ 
+ 
+Index: apitrace/wrappers/CMakeLists.txt
+===================================================================
+--- apitrace.orig/wrappers/CMakeLists.txt	2012-08-17 12:29:29.206106465 +1000
++++ apitrace/wrappers/CMakeLists.txt	2012-08-21 11:29:15.353446673 +1000
+@@ -7,6 +7,7 @@
+     ${CMAKE_SOURCE_DIR}/helpers
+     ${CMAKE_BINARY_DIR}/dispatch
+     ${CMAKE_SOURCE_DIR}/dispatch
++    ${BUNDLED_SNAPPY_INCLUDE_DIRS}
+ )
+ 
+ add_library (common_trace STATIC
+@@ -344,8 +345,7 @@
+         glproc_gl
+         common_trace
+         common
+-        ${ZLIB_LIBRARIES}
+-        ${SNAPPY_LIBRARIES}
++        ${BUNDLED_SNAPPY_LIBRARIES}
+         ${X11_X11_LIB}
+         ${CMAKE_THREAD_LIBS_INIT}
+         dl
+@@ -393,8 +393,7 @@
+         glproc_egl
+         common_trace
+         common
+-        ${ZLIB_LIBRARIES}
+-        ${SNAPPY_LIBRARIES}
++        ${BUNDLED_SNAPPY_LIBRARIES}
+         ${CMAKE_THREAD_LIBS_INIT}
+         dl
+     )
diff --git a/debian/patches/series b/debian/patches/series
index e7a73e5..14ea3b6 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 01_multiarchify.patch
+02_use_system_libpng_snappy_zlib.diff


Reply to: