mirror of
https://github.com/isledecomp/isle-portable.git
synced 2024-11-26 01:17:55 -05:00
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:
parent
ad9cc339e9
commit
ec854c9308
8 changed files with 19 additions and 7 deletions
13
tools/isledecomp/isledecomp/lib/__init__.py
Normal file
13
tools/isledecomp/isledecomp/lib/__init__.py
Normal 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)
|
|
@ -1,6 +1,6 @@
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
from .utils import get_file_in_script_dir
|
from isledecomp.lib import lib_path_join
|
||||||
|
|
||||||
|
|
||||||
class RecompiledInfo:
|
class RecompiledInfo:
|
||||||
|
@ -18,7 +18,7 @@ class SymInfo:
|
||||||
|
|
||||||
def __init__(self, pdb, sym_recompfile, sym_logger, sym_wine_path_converter=None):
|
def __init__(self, pdb, sym_recompfile, sym_logger, sym_wine_path_converter=None):
|
||||||
self.logger = sym_logger
|
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:
|
if sym_wine_path_converter:
|
||||||
# Run cvdump through wine and convert path to Windows-friendly wine path
|
# Run cvdump through wine and convert path to Windows-friendly wine path
|
||||||
|
|
|
@ -6,4 +6,6 @@
|
||||||
description="Python tools for the isledecomp project",
|
description="Python tools for the isledecomp project",
|
||||||
packages=find_packages(),
|
packages=find_packages(),
|
||||||
tests_require=["pytest"],
|
tests_require=["pytest"],
|
||||||
|
include_package_data=True,
|
||||||
|
package_data={"isledecomp.lib": ["*.exe", "*.dll"]},
|
||||||
)
|
)
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
import difflib
|
import difflib
|
||||||
import subprocess
|
import subprocess
|
||||||
import os
|
import os
|
||||||
import sys
|
|
||||||
|
|
||||||
|
from isledecomp.lib import lib_path_join
|
||||||
from isledecomp.utils import print_diff
|
from isledecomp.utils import print_diff
|
||||||
|
|
||||||
|
|
||||||
|
@ -32,11 +32,8 @@ def main():
|
||||||
if not os.path.isfile(args.recompiled):
|
if not os.path.isfile(args.recompiled):
|
||||||
parser.error(f"Recompiled binary {args.recompiled} does not exist")
|
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):
|
def get_exports(file):
|
||||||
call = [get_file_in_script_dir("DUMPBIN.EXE"), "/EXPORTS"]
|
call = [lib_path_join("DUMPBIN.EXE"), "/EXPORTS"]
|
||||||
|
|
||||||
if os.name != "nt":
|
if os.name != "nt":
|
||||||
call.insert(0, "wine")
|
call.insert(0, "wine")
|
||||||
|
|
Loading…
Reference in a new issue