mirror of
https://github.com/LIV2/amitools.git
synced 2025-12-06 06:32:47 +00:00
allow to run amitools again in place
This commit is contained in:
parent
4213054643
commit
df28dee721
17
README.md
17
README.md
@ -23,9 +23,7 @@ will be very helpful.
|
||||
- [Cython][1] >= 0.21
|
||||
- All other packages are installed automatically, if missing:
|
||||
- [pytest][2]
|
||||
- [lhafile - FS Edition][3]
|
||||
- setuptools_scm
|
||||
- pytest-runner
|
||||
- [lhafile - FS Edition][3] (Optional: required to use lha file scanner)
|
||||
- First make sure to have the Python package installer ```pip```:
|
||||
- On Mac OS X using [MacPorts][4] (Tool is called ```pip-2.7``` here):
|
||||
```
|
||||
@ -58,12 +56,7 @@ pacman -S mingw-w64-x86_64-python2-pip mingw-w64-x86_64-gcc git make
|
||||
|
||||
## Installation
|
||||
|
||||
- The musashi CPU emulator required for vamos needs some code generated first:
|
||||
```
|
||||
make do_gen
|
||||
```
|
||||
- This will create some files in directory ```gen```
|
||||
- Now you can use Python's ```setuptools``` to install everything:
|
||||
- You have multiple variants to install the tools with Python's `setuptools`:
|
||||
- **Global Install** is available for all users of your system and needs root privileges
|
||||
```
|
||||
sudo python setup.py install
|
||||
@ -76,6 +69,12 @@ python setup.py install --user
|
||||
you to change/develop the code and test it immediately. (I prefer user install here)
|
||||
```
|
||||
python setup.py develop --user
|
||||
```
|
||||
- **Run In Place** allows you to run the binaries directly from the `bin` directory
|
||||
without any installation. You need `setup.py` only to build the native library
|
||||
of vamos:
|
||||
```
|
||||
python setup.py build
|
||||
```
|
||||
|
||||
## Contents
|
||||
|
||||
45
bin/amitools
Executable file
45
bin/amitools
Executable file
@ -0,0 +1,45 @@
|
||||
#!/usr/bin/env python2.7
|
||||
#
|
||||
# a small wrapper to run amitools' scripts from here without installation
|
||||
#
|
||||
# it assumes that this script resides in a directory of the amitools base dir
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
import os
|
||||
import sys
|
||||
import importlib
|
||||
|
||||
# get current directory
|
||||
cur_dir = os.path.dirname(__file__)
|
||||
# amitools folder is in parent dir
|
||||
base_dir = os.path.abspath(os.path.join(cur_dir, os.pardir))
|
||||
# check for amitools dir
|
||||
at_dir = os.path.join(base_dir, "amitools")
|
||||
if not os.path.isdir(at_dir):
|
||||
print("amitools: can't find 'amitools' dir in base dir!!", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
# add base dir to python path
|
||||
sys.path.insert(1, base_dir)
|
||||
|
||||
# tool
|
||||
tool = os.path.basename(__file__)
|
||||
# tool module name
|
||||
tool_module = "amitools.tools." + tool
|
||||
main = None
|
||||
# import tool module
|
||||
try:
|
||||
mod = importlib.import_module(tool_module)
|
||||
mod_dict = mod.__dict__
|
||||
# check for main function
|
||||
if 'main' not in mod_dict:
|
||||
print("amitools: no 'main' function in tool module found!", file=sys.stderr)
|
||||
sys.exit(3)
|
||||
main = mod_dict['main']
|
||||
except ImportError as e:
|
||||
print("amitools: error importing tool '%s': %s" % (tool_module, e), file=sys.stderr)
|
||||
sys.exit(2)
|
||||
|
||||
# call tool
|
||||
main()
|
||||
1
bin/fdtool
Symbolic link
1
bin/fdtool
Symbolic link
@ -0,0 +1 @@
|
||||
amitools
|
||||
1
bin/geotool
Symbolic link
1
bin/geotool
Symbolic link
@ -0,0 +1 @@
|
||||
amitools
|
||||
1
bin/hunktool
Symbolic link
1
bin/hunktool
Symbolic link
@ -0,0 +1 @@
|
||||
amitools
|
||||
1
bin/rdbtool
Symbolic link
1
bin/rdbtool
Symbolic link
@ -0,0 +1 @@
|
||||
amitools
|
||||
1
bin/romtool
Symbolic link
1
bin/romtool
Symbolic link
@ -0,0 +1 @@
|
||||
amitools
|
||||
1
bin/typetool
Symbolic link
1
bin/typetool
Symbolic link
@ -0,0 +1 @@
|
||||
amitools
|
||||
1
bin/vamospath
Symbolic link
1
bin/vamospath
Symbolic link
@ -0,0 +1 @@
|
||||
amitools
|
||||
1
bin/xdfscan
Symbolic link
1
bin/xdfscan
Symbolic link
@ -0,0 +1 @@
|
||||
amitools
|
||||
1
bin/xdftool
Symbolic link
1
bin/xdftool
Symbolic link
@ -0,0 +1 @@
|
||||
amitools
|
||||
Loading…
x
Reference in New Issue
Block a user