compil with windows purely

48 views
Skip to first unread message

francois PEGORY

unread,
Feb 21, 2017, 5:13:40 PM2/21/17
to Beancount
dear all,
i succeed to install beancout (and fava) directly in windows.

so to do this, first you need install Visual C++  ate least vc14 http://landinghub.visualstudio.com/visual-cpp-build-tools  select windows 10 sdk
then
pip install --upgrade setuptools

then pip install beancount will work if we make few change.
i have a problem with unistd.h
so if i put in lexer.h it compile without any problem
and add "

the only problem i don't solve is i can't install it with
python setup.py develop i receive "wrong hash of the last lexer"
it only work if do
pip install .


please see the diff below

> hg diff
diff -r be516153d11d setup.py
--- a/setup.py Mon Feb 20 13:32:51 2017 -0500
+++ b/setup.py Tue Feb 21 23:07:51 2017 +0100
@@ -122,7 +122,7 @@
('upload-to-sheets', 'beancount.tools.sheets_upload'),
]

-if not has_setuptools and platform.system() == 'Windows':
+if platform.system() == 'Windows':
setup_extra_kwargs.update(entry_points={
'console_scripts': [
'{} = {}:main'.format(binary, module)
@@ -135,6 +135,9 @@
for binary, _ in binaries])


+
+
+
# Create a setup.
# Please read: http://furius.ca/beancount/doc/install about version numbers.
setup(
@@ -205,3 +208,4 @@
# Add optional arguments that only work with some variants of setup().
**setup_extra_kwargs
)
+
diff -r be516153d11d src/python/beancount/parser/lexer.c
--- a/src/python/beancount/parser/lexer.c Mon Feb 20 13:32:51 2017 -0500
+++ b/src/python/beancount/parser/lexer.c Tue Feb 21 23:07:51 2017 +0100
@@ -988,6 +988,8 @@
#define INVALID 1
#define STRLIT 2

+#define YY_NO_UNISTD_H 0
+
#ifndef YY_NO_UNISTD_H
/* Special case for "unistd.h", since it is non-ANSI. We include it way
* down here because we want the user's section 1 to have been scanned first.
diff -r be516153d11d src/python/beancount/parser/lexer.h
--- a/src/python/beancount/parser/lexer.h Mon Feb 20 13:32:51 2017 -0500
+++ b/src/python/beancount/parser/lexer.h Tue Feb 21 23:07:51 2017 +0100
@@ -312,6 +312,10 @@

#endif

+#ifdef _WIN64
+#define YY_NO_UNISTD_H 0
+#endif
+
#ifndef YY_NO_UNISTD_H
/* Special case for "unistd.h", since it is non-ANSI. We include it way
* down here because we want the user's section 1 to have been scanned first.
diff -r be516153d11d src/python/beancount/parser/parser.c
--- a/src/python/beancount/parser/parser.c Mon Feb 20 13:32:51 2017 -0500
+++ b/src/python/beancount/parser/parser.c Tue Feb 21 23:07:51 2017 +0100
@@ -270,7 +270,7 @@
/* Provide the source hash to the parser module for verification that the
* extension module is up-to-date. */
/* uint64_t int_source_hash = #PARSER_SOURCE_HASH; */
- PyObject* source_hash = PyUnicode_FromString(PARSER_SOURCE_HASH);
+ PyObject* source_hash = PyUnicode_FromString("#PARSER_SOURCE_HASH");
PyObject_SetAttrString(module, "SOURCE_HASH", source_hash);

/* Import the module that defines the missing object constant. */
Reply all
Reply to author
Forward
0 new messages