Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
sakia
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
clients
python
sakia
Commits
06640dca
Commit
06640dca
authored
11 years ago
by
Donald Stufft
Browse files
Options
Downloads
Patches
Plain Diff
Bundle a tarballed of libsodium
parent
06f70dbf
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libsodium-0.4.3.tar.gz
+0
-0
0 additions, 0 deletions
libsodium-0.4.3.tar.gz
setup.py
+30
-5
30 additions, 5 deletions
setup.py
with
30 additions
and
5 deletions
libsodium-0.4.3.tar.gz
0 → 100644
+
0
−
0
View file @
06640dca
File added
This diff is collapsed.
Click to expand it.
setup.py
+
30
−
5
View file @
06640dca
...
@@ -2,7 +2,10 @@
...
@@ -2,7 +2,10 @@
import
sys
import
sys
import
os.path
import
os.path
import
shlex
import
shlex
import
shutil
import
subprocess
import
subprocess
import
tarfile
import
tempfile
from
distutils.command.build_clib
import
build_clib
as
_build_clib
from
distutils.command.build_clib
import
build_clib
as
_build_clib
...
@@ -12,6 +15,9 @@ from setuptools.command.test import test as TestCommand
...
@@ -12,6 +15,9 @@ from setuptools.command.test import test as TestCommand
import
nacl
import
nacl
SODIUM_VERSION
=
"
0.4.3
"
def
here
(
*
paths
):
def
here
(
*
paths
):
return
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
*
paths
))
return
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
*
paths
))
...
@@ -24,21 +30,40 @@ except ImportError:
...
@@ -24,21 +30,40 @@ except ImportError:
else
:
else
:
# building bdist - cffi is here!
# building bdist - cffi is here!
ext_modules
=
[
nacl
.
nacl
.
ffi
.
verifier
.
get_extension
()]
ext_modules
=
[
nacl
.
nacl
.
ffi
.
verifier
.
get_extension
()]
ext_modules
[
0
].
include_dirs
.
append
(
here
(
"
lib
sodium/src/libsodium/include
"
))
ext_modules
[
0
].
include_dirs
.
append
(
here
(
"
build/
sodium/src/libsodium/include
"
))
class
build_clib
(
_build_clib
):
class
build_clib
(
_build_clib
):
def
run
(
self
):
def
run
(
self
):
# Unpack the Libsodium Tarball
sourcefile
=
tarfile
.
open
(
here
(
"
libsodium-%s.tar.gz
"
%
SODIUM_VERSION
),
)
tmpdir
=
tempfile
.
mkdtemp
()
try
:
sourcefile
.
extractall
(
tmpdir
)
# Copy our installed directory into the build location
shutil
.
rmtree
(
here
(
"
build/sodium
"
))
shutil
.
copytree
(
os
.
path
.
join
(
tmpdir
,
"
libsodium-%s
"
%
SODIUM_VERSION
),
here
(
"
build/sodium
"
)
)
finally
:
shutil
.
rmtree
(
tmpdir
,
ignore_errors
=
True
)
sourcefile
.
close
()
# Run ./configure
# Run ./configure
subprocess
.
check_call
(
subprocess
.
check_call
(
"
./configure --disable-debug --disable-dependency-tracking
"
,
"
./configure --disable-debug --disable-dependency-tracking
"
,
cwd
=
here
(
"
lib
sodium
"
),
cwd
=
here
(
"
build/
sodium
"
),
shell
=
True
,
shell
=
True
,
)
)
# Parse the Makefile to determine what macros to define
# Parse the Makefile to determine what macros to define
with
open
(
here
(
"
lib
sodium/Makefile
"
))
as
makefile
:
with
open
(
here
(
"
build/
sodium/Makefile
"
))
as
makefile
:
for
line
in
makefile
:
for
line
in
makefile
:
if
line
.
startswith
(
"
DEFS
"
):
if
line
.
startswith
(
"
DEFS
"
):
defines
=
[
defines
=
[
...
@@ -89,7 +114,7 @@ class build_clib(_build_clib):
...
@@ -89,7 +114,7 @@ class build_clib(_build_clib):
# Expand out all of the sources to their full path
# Expand out all of the sources to their full path
sources
=
[
sources
=
[
here
(
"
lib
sodium/src/libsodium
"
,
s
)
for
s
in
sources
here
(
"
build/
sodium/src/libsodium
"
,
s
)
for
s
in
sources
]
]
build_info
[
"
sources
"
]
=
sources
build_info
[
"
sources
"
]
=
sources
...
@@ -153,7 +178,7 @@ setup(
...
@@ -153,7 +178,7 @@ setup(
libraries
=
[
libraries
=
[
(
"
sodium
"
,
{
(
"
sodium
"
,
{
"
include_dirs
"
:
[
"
include_dirs
"
:
[
here
(
"
lib
sodium/src/libsodium/include/sodium
"
),
here
(
"
build/
sodium/src/libsodium/include/sodium
"
),
],
],
"
sources
"
:
[
"
sources
"
:
[
"
crypto_auth/crypto_auth.c
"
,
"
crypto_auth/crypto_auth.c
"
,
...
...
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