File: build.py

package info (click to toggle)
python-xeddsa 1.1.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 204 kB
  • sloc: python: 421; makefile: 15; ansic: 15
file content (20 lines) | stat: -rw-r--r-- 481 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import os
import platform

import cffi

ffibuilder = cffi.FFI()

libxeddsa_header = os.path.join(os.path.dirname(os.path.abspath(__file__)), "xeddsa.h")

with open(libxeddsa_header, encoding="utf-8") as f:
    ffibuilder.cdef(f.read())

ffibuilder.set_source(
    "_libxeddsa",
    '#include "' + libxeddsa_header + '"',
    libraries=[ "libxeddsa", "libsodium" ] if platform.system() == "Windows" else [ "xeddsa", "sodium" ]
)

if __name__ == "__main__":
    ffibuilder.compile()