Commit graph

129 commits

Author SHA1 Message Date
John Ott
9f727d495f Remove outdated ctypes requirement
The library ctypes has shipped with the python standard library since
Python 2.5, however this was still added via the `requires` keyword in
setuptools.setup. This results in a spurious requirement being created
in the .whl METADATA file, causing warnings when packaged via tools like
pex:

```
$ python3 -m pex capstone -o capstone.pex
/Users/ott/.venv/lib/python3.9/site-packages/pex/dist_metadata.py:397: PEXWarning: Ignoring 1 `Requires` field in /Users/ott/.pex/installed_wheels/2a4c7a0d4c87aceed3134ae20997a764af1811fee8e151cf5da90e0462822893/capstone-4.0.2-py3-none-macosx_12_arm64.whl metadata:
1.) Requires: ctypes

You may have issues using the 'capstone' distribution as a result.
More information on this workaround can be found here:
  https://github.com/pantsbuild/pex/issues/1201#issuecomment-791715585
```

Since this requirement is outdated, it can just be removed.
2022-08-24 11:29:48 -07:00
kabeor
2b05b8ef94 replace missing option CMAKE_BUILD_SHARED for python setup.py 2022-02-28 00:01:09 +08:00
Duncan Ogilvie
f4d86a3034 Modernize CMake and switch to CMake 3.15 2022-02-25 20:39:30 +01:00
Nguyen Anh Quynh
4e13196da8 python: classifier Python3 for setup.py 2020-01-26 13:26:58 +08:00
Benno Fünfstück
08ca4fa4bb bindings/python: fix install error due to old libname (#1338) 2019-01-11 00:10:25 +08:00
Hugo
633050764d Add python_requires and update Trove classifiers (#1251) 2018-10-02 17:45:45 +08:00
Nguyen Anh Quynh
76c1c3c4e9 merge next to master 2018-07-20 12:36:50 +08:00
Audrey Dutcher
f32a63b03b Add option for inhibiting the core build while installing the python components. Add option for loading the core from a custom path. (#1089) 2018-02-20 21:12:46 +08:00
Audrey Dutcher
10c4aa807d Add option for inhibiting the core build while installing the python components. Add option for loading the core from a custom path. (#1089) 2018-02-20 21:11:19 +08:00
Nguyen Anh Quynh
e9394bba5c python: cleanup 2018-01-15 13:42:00 +08:00
tdube
e1aaa50a5b python: fix merge confliction of #1073 2018-01-15 13:34:13 +08:00
tdube
1a1077db01 Update setup.py (#1073)
Check to make sure static library file exists before trying to copy it. Current build options include option to not build a static lib.
2018-01-15 13:30:51 +08:00
Andrew Dutcher
425bf530f2 Add ability to copy prebuilt libraries from prebuilt directory during python build 2017-03-04 17:09:07 -08:00
Andrew Dutcher
6e95167865 Add ability to copy prebuilt libraries from prebuilt directory during python build 2017-03-05 06:08:36 +08:00
Nguyen Anh Quynh
617c64fbb5 Python: Automatically conform to PEP440 for version numbers. ported from Unicorn Python binding 2017-02-01 13:23:15 +08:00
Nguyen Anh Quynh
3925b332ce Python: Automatically conform to PEP440 for version numbers. ported from Unicorn Python binding 2017-02-01 13:11:21 +08:00
Nguyen Anh Quynh
f1aa0a3d04 python: version 4.0.0 2016-11-04 23:55:20 +08:00
Andrew Dutcher
2f1c3ce8a6 On this branch, dylib and so files are versioned 2016-10-31 10:54:58 -07:00
Andrew Dutcher
b2504b963e Python setup: Clean up some merge failures, adapt for changes on next branch 2016-10-26 23:15:42 -07:00
Andrew Dutcher
06b26efbf4 Python: remove special case for cygwin build 2016-10-25 21:49:58 -07:00
Andrew Dutcher
816f131d27 Python: Make cython work with extreme prejudice 2016-10-25 21:49:58 -07:00
Andrew Dutcher
1008716ee5 Python: Clean up the capstone-windows stuff with extreme prejudice 2016-10-25 21:48:41 -07:00
Andrew Dutcher
3b5b5ff58c Python: make setup work as expected 2016-10-25 21:48:18 -07:00
Nguyen Anh Quynh
3bd582ef64 python: bump version to 3.0.5 2016-10-26 10:52:53 +08:00
Andrew Dutcher
0532314562 Python: remove special case for cygwin build 2016-10-21 03:30:53 -07:00
Andrew Dutcher
ac5121c7e0 Python: Make cython work with extreme prejudice 2016-10-21 03:30:50 -07:00
Andrew Dutcher
ad36604b55 Python: Clean up the capstone-windows stuff with extreme prejudice 2016-10-21 03:30:44 -07:00
Andrew Dutcher
fdcd607c99 Python: make setup work as expected 2016-10-14 05:06:30 -07:00
Benno Fünfstück
b446327f3b python-bindings: fix setup.py for wheel installation
When the python bindings are installed using the new wheels
infrastructure, data_files are relative to the site-packages directory
even if using absolute paths.

The following example demonstrates the bug fixed by this commit: (ran on archlinux)

```bash
$ pip install wheel       # if this package is installed, wheel installation is made the default
Collecting wheel
  Downloading wheel-0.29.0-py2.py3-none-any.whl (66kB)
    100% |################################| 71kB 124kB/s
Installing collected packages: wheel
Successfully installed wheel-0.29.0

$ pip install capstone    # this will use the wheel installation method now
Collecting capstone
  Using cached capstone-3.0.4.tar.gz
Building wheels for collected packages: capstone
  Running setup.py bdist_wheel for capstone ... done
  Stored in directory: /root/.cache/pip/wheels/7c/d1/d0/db6e2c5ef1063aabb9de2dd8b92b4c27ee6f9fd213240099b8
Successfully built capstone
Installing collected packages: capstone
Successfully installed capstone-3.0.4

$ find /usr/lib/ -name "libcapstone.so"
/usr/lib/python3.5/site-packages/usr/lib/python3.5/site-packages/capstone/libcapstone.so
```

So the path `SITE_PACKAGES` in the `data_files` specification of the
setup.py file was interpreted relative to the python site-packages
directory. The fix for this is simple: use `/capstone` instead of an
absolute path for `SITE_PACKAGES`.
2016-10-03 10:50:08 +08:00
Benno Fünfstück
df96d9ee6d python-bindings: fix setup.py for wheel installation
When the python bindings are installed using the new wheels
infrastructure, data_files are relative to the site-packages directory
even if using absolute paths.

The following example demonstrates the bug fixed by this commit: (ran on archlinux)

```bash
$ pip install wheel       # if this package is installed, wheel installation is made the default
Collecting wheel
  Downloading wheel-0.29.0-py2.py3-none-any.whl (66kB)
    100% |################################| 71kB 124kB/s
Installing collected packages: wheel
Successfully installed wheel-0.29.0

$ pip install capstone    # this will use the wheel installation method now
Collecting capstone
  Using cached capstone-3.0.4.tar.gz
Building wheels for collected packages: capstone
  Running setup.py bdist_wheel for capstone ... done
  Stored in directory: /root/.cache/pip/wheels/7c/d1/d0/db6e2c5ef1063aabb9de2dd8b92b4c27ee6f9fd213240099b8
Successfully built capstone
Installing collected packages: capstone
Successfully installed capstone-3.0.4

$ find /usr/lib/ -name "libcapstone.so"
/usr/lib/python3.5/site-packages/usr/lib/python3.5/site-packages/capstone/libcapstone.so
```

So the path `SITE_PACKAGES` in the `data_files` specification of the
setup.py file was interpreted relative to the python site-packages
directory. The fix for this is simple: use `/capstone` instead of an
absolute path for `SITE_PACKAGES`.
2016-10-02 15:25:13 +02:00
Michael Cohen
40a42b4939 Fix setup.py to use setuptools and put the libcapstone.so in the right place. 2016-02-15 02:34:32 +01:00
Michael Cohen
29ee560688 Support all OSs. 2016-02-11 23:43:22 +01:00
Michael Cohen
ff5b295b88 Fix setup.py. 2016-02-11 15:24:17 +01:00
Nguyen Anh Quynh
cc7434c57e python: do not copy msvc/headers directory in setup.py 2015-07-15 17:38:12 +08:00
Nguyen Anh Quynh
932381aacc python: do not copy msvc/headers directory in setup.py 2015-07-15 15:44:42 +08:00
Nguyen Anh Quynh
1a7a13e4da Merge branch 'master' into v3 2015-06-22 16:50:35 +08:00
Alex Chernetz
5799c485a6 [Python binding] Fix setup.py to allow installing in a virtualenv
In a virtualenv:
- site.getusersitepackages() won't import
- get_python_lib() will return the directory inside the virtualenv
- the "--user" option can therefore be safely ignored.
2015-06-19 23:22:36 -07:00
Alex Chernetz
38094b1098 [Python binding] Fix setup.py to allow installing in a virtualenv
In a virtualenv:
- site.getusersitepackages() won't import
- get_python_lib() will return the directory inside the virtualenv
- the "--user" option can therefore be safely ignored.
2015-06-19 23:18:52 -07:00
Nguyen Anh Quynh
ebc370ff40 bump version to 3.0.4 2015-06-08 22:29:55 +08:00
neuromancer
a210229a0f Allow local installations of the python bindings
These changes will allow a pypi user to locally install capstone using the --user flag. If it possible, please update the correspondent package (https://pypi.python.org/pypi/capstone/3.0.3)
2015-06-04 21:46:09 +08:00
neuromancer
911d0506cd Allow local installations of the python bindings
These changes will allow a pypi user to locally install capstone using the --user flag. If it possible, please update the correspondent package (https://pypi.python.org/pypi/capstone/3.0.3)
2015-06-02 14:31:36 +02:00
Nguyen Anh Quynh
b89c95fc99 python: bump package version to 3.0.3 (setup.py) 2015-05-08 17:06:59 +08:00
Nguyen Anh Quynh
c343a917fb python: revert to use distutils rather than setuptools 2015-04-07 16:03:01 +08:00
Richo Healey
3c862d5c11 python: Use setuptools if avilable 2015-03-22 23:05:58 -07:00
Nguyen Anh Quynh
88a95535d0 python: simplify setup.py 2015-03-19 16:57:47 +08:00
Nguyen Anh Quynh
3036ada407 python: simplify setup.py 2015-03-19 16:57:39 +08:00
Nguyen Tan Cong
e830b75d94 python: properly build the core in Cygwin environment for setup.py 2015-03-19 16:09:38 +08:00
Nguyen Tan Cong
569f7a5b08 python: properly build the core in Cygwin environment for setup.py 2015-03-19 16:05:32 +08:00
Mario Vilas
0950943392 Fixed #289 2015-03-18 07:43:53 +07:00
Mario Vilas
34831d0bd6 Fixed #289 2015-03-17 15:02:29 +01:00