Move redist tools to central location (#334)

* Move redist tools to central location

* Include exe and dll in package setup
This commit is contained in:
MS 2023-12-16 05:59:17 -05:00 committed by GitHub
parent ad9cc339e9
commit ec854c9308
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 19 additions and 7 deletions

View File

@ -0,0 +1,13 @@
"""Provides a reference point for redistributed tools found in this directory.
This allows you to get the path for these tools from a script run anywhere."""
from os.path import join, dirname
def lib_path() -> str:
"""Returns the directory for this module."""
return dirname(__file__)
def lib_path_join(name: str) -> str:
"""Convenience wrapper for os.path.join."""
return join(lib_path(), name)

View File

@ -1,6 +1,6 @@
import os
import subprocess
from .utils import get_file_in_script_dir
from isledecomp.lib import lib_path_join
class RecompiledInfo:
@ -18,7 +18,7 @@ class SymInfo:
def __init__(self, pdb, sym_recompfile, sym_logger, sym_wine_path_converter=None):
self.logger = sym_logger
call = [get_file_in_script_dir("cvdump.exe"), "-l", "-s"]
call = [lib_path_join("cvdump.exe"), "-l", "-s"]
if sym_wine_path_converter:
# Run cvdump through wine and convert path to Windows-friendly wine path

View File

@ -6,4 +6,6 @@ setup(
description="Python tools for the isledecomp project",
packages=find_packages(),
tests_require=["pytest"],
include_package_data=True,
package_data={"isledecomp.lib": ["*.exe", "*.dll"]},
)

View File

@ -4,8 +4,8 @@ import argparse
import difflib
import subprocess
import os
import sys
from isledecomp.lib import lib_path_join
from isledecomp.utils import print_diff
@ -32,11 +32,8 @@ def main():
if not os.path.isfile(args.recompiled):
parser.error(f"Recompiled binary {args.recompiled} does not exist")
def get_file_in_script_dir(fn):
return os.path.join(os.path.dirname(os.path.abspath(sys.argv[0])), fn)
def get_exports(file):
call = [get_file_in_script_dir("DUMPBIN.EXE"), "/EXPORTS"]
call = [lib_path_join("DUMPBIN.EXE"), "/EXPORTS"]
if os.name != "nt":
call.insert(0, "wine")