sapling/setup.py
Jun Wu 5cd2c64da0 setup: build linelog
Summary:
This diff builds linelog. It brings Cython as a build dependency as linelog
CPython wrapper is written in Cython. Alternatively we can check in the
generated, non-human-readable `.c` code if we get feedback that the Cython
dependency is making things hard.

Note that `setuptools` (Python 2.6 version) has issues with Cython therefore
removed.

Test Plan: `make local`, then check `linelog.so` is built and `import linelog` works.

Reviewers: #mercurial, rmcelroy, ttung

Reviewed By: rmcelroy

Subscribers: mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3669753

Signature: t1:3669753:1470403459:5bf81861b31deed5076c2322c4015d5dd4b4673e
2016-08-10 22:26:05 +01:00

71 lines
2.2 KiB
Python

from Cython.Build import cythonize
from distutils.core import setup, Extension
from glob import glob
hgext3rd = [
p[:-3].replace('/', '.')
for p in glob('hgext3rd/*.py')
if p != 'hgext3rd/__init__.py'
]
setup(
name='fbhgext',
version='0.1.2',
author='Durham Goode',
maintainer='Durham Goode',
maintainer_email='durham@fb.com',
url='',
description='Facebook specific mercurial extensions',
long_description="",
keywords='fb hg mercurial',
license='',
packages=[
'fastmanifest',
'phabricator',
'sqldirstate',
],
py_modules=[
'statprof'
] + hgext3rd,
ext_modules = [
Extension('cfastmanifest',
sources=['cfastmanifest.c',
'cfastmanifest/bsearch.c',
'cfastmanifest/buffer.c',
'cfastmanifest/checksum.c',
'cfastmanifest/node.c',
'cfastmanifest/tree.c',
'cfastmanifest/tree_arena.c',
'cfastmanifest/tree_convert.c',
'cfastmanifest/tree_copy.c',
'cfastmanifest/tree_diff.c',
'cfastmanifest/tree_disk.c',
'cfastmanifest/tree_iterator.c',
'cfastmanifest/tree_path.c',
],
include_dirs=['cfastmanifest',
'/usr/local/include',
'/opt/local/include',
],
library_dirs=[
'/usr/local/lib',
'/opt/local/lib',
],
libraries=['crypto',
],
extra_compile_args=[
"-std=c99",
"-Wall",
"-Werror", "-Werror=strict-prototypes"],
),
] + cythonize([
Extension('linelog',
sources=['linelog/pyext/linelog.pyx'],
extra_compile_args=[
'-std=c99',
'-Wall', '-Wextra', '-Wconversion', '-pedantic',
],
),
]),
)