summaryrefslogtreecommitdiff
path: root/debian/patches/0001-Link-system-tsk-statically-talloc-dynamically-instea.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/0001-Link-system-tsk-statically-talloc-dynamically-instea.patch')
-rw-r--r--debian/patches/0001-Link-system-tsk-statically-talloc-dynamically-instea.patch97
1 files changed, 97 insertions, 0 deletions
diff --git a/debian/patches/0001-Link-system-tsk-statically-talloc-dynamically-instea.patch b/debian/patches/0001-Link-system-tsk-statically-talloc-dynamically-instea.patch
new file mode 100644
index 0000000..87f8a1b
--- /dev/null
+++ b/debian/patches/0001-Link-system-tsk-statically-talloc-dynamically-instea.patch
@@ -0,0 +1,97 @@
+From: Hilko Bengen <bengen@debian.org>
+Date: Sat, 19 Mar 2016 22:31:25 +0100
+Subject: Link system tsk (statically),
+ talloc (dynamically) instead of embedding
+
+Forwarded: not-needed
+---
+ setup.py | 47 ++++++++++++-----------------------------------
+ 1 file changed, 12 insertions(+), 35 deletions(-)
+
+diff --git a/setup.py b/setup.py
+index a5fbc0d..1a2da3d 100755
+--- a/setup.py
++++ b/setup.py
+@@ -245,9 +245,9 @@ class BuildExtCommand(build_ext):
+ def run(self):
+ compiler = new_compiler(compiler=self.compiler)
+ # pylint: disable=attribute-defined-outside-init
+- self.define = self.configure_source_tree(compiler)
++ self.define = [("HAVE_TSK_LIBTSK_H", "")]
+
+- libtsk_path = os.path.join("sleuthkit", "tsk")
++ libtsk_path = "/usr/include/tsk"
+
+ if not os.access("pytsk3.c", os.R_OK):
+ # Generate the Python binding code (pytsk3.c).
+@@ -269,7 +269,7 @@ class BuildExtCommand(build_ext):
+ class SDistCommand(sdist):
+ """Custom handler for generating source dist."""
+ def run(self):
+- libtsk_path = os.path.join("sleuthkit", "tsk")
++ libtsk_path = "/usr/include/tsk"
+
+ # sleuthkit submodule is not there, probably because this has been
+ # freshly checked out.
+@@ -356,35 +356,10 @@ class UpdateCommand(Command):
+ subprocess.check_call(["git", "apply", patch_file], cwd="sleuthkit")
+
+ def run(self):
+- subprocess.check_call(["git", "stash"], cwd="sleuthkit")
+-
+- subprocess.check_call(["git", "submodule", "init"])
+- subprocess.check_call(["git", "submodule", "update"])
+-
+- print("Updating sleuthkit")
+- subprocess.check_call(["git", "reset", "--hard"], cwd="sleuthkit")
+- subprocess.check_call(["git", "clean", "-x", "-f", "-d"], cwd="sleuthkit")
+- subprocess.check_call(["git", "checkout", "master"], cwd="sleuthkit")
+- subprocess.check_call(["git", "pull"], cwd="sleuthkit")
+- if self.use_head:
+- print("Pulling from HEAD")
+- else:
+- print("Pulling from tag: {0:s}".format(self._SLEUTHKIT_GIT_TAG))
+- subprocess.check_call(["git", "fetch", "--tags"], cwd="sleuthkit")
+- git_tag_path = "tags/sleuthkit-{0:s}".format(self._SLEUTHKIT_GIT_TAG)
+- subprocess.check_call(["git", "checkout", git_tag_path], cwd="sleuthkit")
+-
+- self.patch_sleuthkit()
+-
+- compiler_type = distutils.ccompiler.get_default_compiler()
+- if compiler_type != "msvc":
+- subprocess.check_call(["./bootstrap"], cwd="sleuthkit")
+-
+- # Now derive the version based on the date.
+ with open("version.txt", "w") as fd:
+ fd.write(self.version)
+
+- libtsk_path = os.path.join("sleuthkit", "tsk")
++ libtsk_path = "/usr/include/tsk"
+
+ # Generate the Python binding code (pytsk3.c).
+ libtsk_header_files = [
+@@ -418,16 +393,18 @@ class ProjectBuilder(object):
+ # The args for the extension builder.
+ self.extension_args = {
+ "define_macros": [],
+- "include_dirs": ["talloc", self._libtsk_path, "sleuthkit", "."],
++ "include_dirs": ["."],
+ "library_dirs": [],
+- "libraries": []}
++ "libraries": [ "talloc" ],
++ "extra_link_args": [
++ "-Wl,-Bstatic", "-ltsk", "-Wl,-Bdynamic",
++ "-lafflib", "-lewf", "-lstdc++", "-lz",
++ "-lvmdk", "-lvhdi",
++ ]}
+
+ # The sources to build.
+ self._source_files = [
+- "class.c", "error.c", "tsk3.c", "pytsk3.c", "talloc/talloc.c"]
+-
+- # Path to the top of the unpacked sleuthkit sources.
+- self._sleuthkit_path = "sleuthkit"
++ "class.c", "error.c", "tsk3.c", "pytsk3.c"]
+
+ def build(self):
+ """Build everything."""