Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Keystone
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Third Party Mirrors
Keystone
Commits
f19be804
Commit
f19be804
authored
8 years ago
by
Nguyen Anh Quynh
Browse files
Options
Downloads
Patches
Plain Diff
python: PyPi setup
parent
ae94ae9e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
bindings/python/README.pypi-src
+40
-0
40 additions, 0 deletions
bindings/python/README.pypi-src
bindings/python/setup.cfg
+2
-0
2 additions, 0 deletions
bindings/python/setup.cfg
bindings/python/setup.py
+24
-12
24 additions, 12 deletions
bindings/python/setup.py
with
67 additions
and
12 deletions
.gitignore
+
1
−
0
View file @
f19be804
...
@@ -20,3 +20,4 @@ build*/
...
@@ -20,3 +20,4 @@ build*/
samples/sample
samples/sample
_sample*.txt
_sample*.txt
tmp
tmp
MANIFEST
This diff is collapsed.
Click to expand it.
bindings/python/README.pypi-src
0 → 100644
+
40
−
0
View file @
f19be804
NOTE: This PyPi package "keystone-engine" includes source code of the core of Keystone.
So installing this would also compile the core with C compiler (either "gcc" or
"msvc" on Windows).
On Windows, CMake & MSVC needs compiler environmental setup, you would need to either
run "pip install keystone-engine" or "python setup.py install" from "Developer Command
Prompt".
For Windows, if you do not want to compile the core, try the "keystone-engine-windows"
package instead, which already includes the prebuilt "keystone.dll" inside.
https://pypi.python.org/pypi/keystone-engine-windows
--------------------------------------------------------------------------------
Keystone is a lightweight multi-platform, multi-architecture assembler framework.
It offers some unparalleled features:
- Multi-architecture, with support for Arm, Arm64 (AArch64/Armv8), Hexagon, Mips, PowerPC, Sparc, SystemZ & X86 (include 16/32/64bit).
- Clean/simple/lightweight/intuitive architecture-neutral API.
- Implemented in C/C++ languages, with bindings for Python, NodeJS, Ruby, Go, Rust, Haskell & OCaml available.
- Native support for Windows & \*nix (with Mac OSX, Linux, *BSD & Solaris confirmed).
- Thread-safe by design.
- Open source - with a dual license.
Further information is available at http://www.keystone-engine.org
[License]
Keystone is available under a dual license:
- Version 2 of the GNU General Public License (GPLv2). (I.e. Without the "any later version" clause.).
License information can be found in the COPYING and the EXCEPTIONS-CLIENT.
This combination allows almost all of open source projects to use Keystone without conflicts.
- For commercial usage in production environments, contact the authors of Keystone to buy a royalty-free license.
See LICENSE-COM.TXT for more information.
This diff is collapsed.
Click to expand it.
bindings/python/setup.cfg
0 → 100644
+
2
−
0
View file @
f19be804
[metadata]
description-file
=
README.pypi-src
This diff is collapsed.
Click to expand it.
bindings/python/setup.py
+
24
−
12
View file @
f19be804
...
@@ -19,12 +19,12 @@ from distutils.sysconfig import get_python_lib
...
@@ -19,12 +19,12 @@ from distutils.sysconfig import get_python_lib
PATH_LIB64
=
"
prebuilt/win64/keystone.dll
"
PATH_LIB64
=
"
prebuilt/win64/keystone.dll
"
PATH_LIB32
=
"
prebuilt/win32/keystone.dll
"
PATH_LIB32
=
"
prebuilt/win32/keystone.dll
"
# package name can be 'keystone' or 'keystone-windows'
# package name can be 'keystone
-engine
' or 'keystone-
engine-
windows'
PKG_NAME
=
'
keystone
'
PKG_NAME
=
'
keystone
-engine
'
if
os
.
path
.
exists
(
PATH_LIB64
)
and
os
.
path
.
exists
(
PATH_LIB32
):
if
os
.
path
.
exists
(
PATH_LIB64
)
and
os
.
path
.
exists
(
PATH_LIB32
):
PKG_NAME
=
'
keystone-windows
'
PKG_NAME
=
'
keystone-
engine-
windows
'
VERSION
=
'
0.9
'
VERSION
=
'
0.9
.1-2
'
SYSTEM
=
sys
.
platform
SYSTEM
=
sys
.
platform
# virtualenv breaks import, but get_python_lib() will work.
# virtualenv breaks import, but get_python_lib() will work.
...
@@ -55,7 +55,7 @@ def copy_sources():
...
@@ -55,7 +55,7 @@ def copy_sources():
except
(
IOError
,
OSError
):
except
(
IOError
,
OSError
):
pass
pass
dir_util
.
copy_tree
(
"
../../
arch
"
,
"
src/
arch
/
"
)
dir_util
.
copy_tree
(
"
../../
llvm
"
,
"
src/
llvm
/
"
)
dir_util
.
copy_tree
(
"
../../include
"
,
"
src/include/
"
)
dir_util
.
copy_tree
(
"
../../include
"
,
"
src/include/
"
)
src
.
extend
(
glob
.
glob
(
"
../../*.h
"
))
src
.
extend
(
glob
.
glob
(
"
../../*.h
"
))
...
@@ -63,12 +63,20 @@ def copy_sources():
...
@@ -63,12 +63,20 @@ def copy_sources():
src
.
extend
(
glob
.
glob
(
"
../../*.inc
"
))
src
.
extend
(
glob
.
glob
(
"
../../*.inc
"
))
src
.
extend
(
glob
.
glob
(
"
../../*.def
"
))
src
.
extend
(
glob
.
glob
(
"
../../*.def
"
))
src
.
extend
(
glob
.
glob
(
"
../../Makefile
"
))
src
.
extend
(
glob
.
glob
(
"
../../CMakeLists.txt
"
))
src
.
extend
(
glob
.
glob
(
"
../../CMakeUninstall.in
"
))
src
.
extend
(
glob
.
glob
(
"
../../*.txt
"
))
src
.
extend
(
glob
.
glob
(
"
../../*.txt
"
))
src
.
extend
(
glob
.
glob
(
"
../../*.TXT
"
))
src
.
extend
(
glob
.
glob
(
"
../../*.TXT
"
))
src
.
extend
(
glob
.
glob
(
"
../../COPYING
"
))
src
.
extend
(
glob
.
glob
(
"
../../LICENSE*
"
))
src
.
extend
(
glob
.
glob
(
"
../../LICENSE*
"
))
src
.
extend
(
glob
.
glob
(
"
../../EXCEPTIONS-CLIENT
"
))
src
.
extend
(
glob
.
glob
(
"
../../README.md
"
))
src
.
extend
(
glob
.
glob
(
"
../../README.md
"
))
src
.
extend
(
glob
.
glob
(
"
../../RELEASE_NOTES
"
))
src
.
extend
(
glob
.
glob
(
"
../../RELEASE_NOTES
"
))
src
.
extend
(
glob
.
glob
(
"
../../ChangeLog
"
))
src
.
extend
(
glob
.
glob
(
"
../../SPONSORS.TXT
"
))
src
.
extend
(
glob
.
glob
(
"
../../*.cmake
"
))
src
.
extend
(
glob
.
glob
(
"
../../*.sh
"
))
src
.
extend
(
glob
.
glob
(
"
../../*.bat
"
))
for
filename
in
src
:
for
filename
in
src
:
outpath
=
os
.
path
.
join
(
"
./src/
"
,
os
.
path
.
basename
(
filename
))
outpath
=
os
.
path
.
join
(
"
./src/
"
,
os
.
path
.
basename
(
filename
))
...
@@ -125,7 +133,10 @@ class custom_build_clib(build_clib):
...
@@ -125,7 +133,10 @@ class custom_build_clib(build_clib):
for
(
lib_name
,
build_info
)
in
libraries
:
for
(
lib_name
,
build_info
)
in
libraries
:
log
.
info
(
"
building
'
%s
'
library
"
,
lib_name
)
log
.
info
(
"
building
'
%s
'
library
"
,
lib_name
)
# cd src/build
os
.
chdir
(
"
src
"
)
os
.
chdir
(
"
src
"
)
os
.
mkdir
(
"
build
"
)
os
.
chdir
(
"
build
"
)
# platform description refers at https://docs.python.org/2/library/sys.html#sys.platform
# platform description refers at https://docs.python.org/2/library/sys.html#sys.platform
if
SYSTEM
==
"
cygwin
"
:
if
SYSTEM
==
"
cygwin
"
:
...
@@ -134,16 +145,17 @@ class custom_build_clib(build_clib):
...
@@ -134,16 +145,17 @@ class custom_build_clib(build_clib):
os
.
system
(
"
KEYSTONE_BUILD_CORE_ONLY=yes ./make.sh cygwin-mingw64
"
)
os
.
system
(
"
KEYSTONE_BUILD_CORE_ONLY=yes ./make.sh cygwin-mingw64
"
)
else
:
else
:
os
.
system
(
"
KEYSTONE_BUILD_CORE_ONLY=yes ./make.sh cygwin-mingw32
"
)
os
.
system
(
"
KEYSTONE_BUILD_CORE_ONLY=yes ./make.sh cygwin-mingw32
"
)
SETUP_DATA_FILES
.
append
(
"
src/keystone.dll
"
)
SETUP_DATA_FILES
.
append
(
"
src/
build/
keystone.dll
"
)
else
:
# Unix
else
:
# Unix
os
.
chmod
(
"
mak
e.sh
"
,
stat
.
S_IREAD
|
stat
.
S_IEXEC
)
os
.
chmod
(
"
../make-shar
e.sh
"
,
stat
.
S_IREAD
|
stat
.
S_IEXEC
)
os
.
system
(
"
KEYSTONE_BUILD_CORE_ONLY=yes ./make.sh
"
)
os
.
system
(
"
../make-share.sh lib_only
"
)
if
SYSTEM
==
"
darwin
"
:
if
SYSTEM
==
"
darwin
"
:
SETUP_DATA_FILES
.
append
(
"
src/libkeystone.dylib
"
)
SETUP_DATA_FILES
.
append
(
"
src/
build/llvm/lib/
libkeystone.dylib
"
)
else
:
# Non-OSX
else
:
# Non-OSX
SETUP_DATA_FILES
.
append
(
"
src/libkeystone.so
"
)
SETUP_DATA_FILES
.
append
(
"
src/
build/llvm/lib/
libkeystone.so
"
)
os
.
chdir
(
"
..
"
)
# back to root dir
os
.
chdir
(
"
../..
"
)
except
:
except
:
pass
pass
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment