File: libpq-query

package info (click to toggle)
pglast 5.0~dev0%2B1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 4,872 kB
  • sloc: python: 12,256; sql: 2,151; makefile: 134
file content (39 lines) | stat: -rw-r--r-- 1,361 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
--- a/pglast/parser.pyx
+++ b/pglast/parser.pyx
@@ -117,7 +117,7 @@ cdef extern from "pg_query.h" nogil:
     void pg_query_free_scan_result(PgQueryScanResult result)
 
 
-cdef extern from "src/pg_query_internal.h" nogil:
+cdef extern from "pg_query/pg_query_internal.h" nogil:
     ctypedef struct PgQueryInternalParsetreeAndError:
         structs.List* tree
         char* stderr_buffer
@@ -144,7 +144,7 @@ cdef extern from "protobuf-c/protobuf-c.
                                                              int value)
 
 
-cdef extern from "protobuf/pg_query.pb-c.h" nogil:
+cdef extern from "pg_query/pg_query.pb-c.h" nogil:
     ctypedef enum PgQuery__Token:
         pass
 
--- a/setup.py
+++ b/setup.py
@@ -31,6 +31,7 @@ with (here / 'version.txt').open(encodin
 
 LIBPG_QUERY_DIR = str(Path('libpg_query'))
 INCLUDE_DIR = str(Path('libpg_query') / 'src' / 'postgres' / 'include')
+INCLUDE_DIR = subprocess.check_output(["/usr/lib/postgresql/15/bin/pg_config", "--includedir-server"]).decode().rstrip()
 VENDOR_DIR = str(Path('libpg_query') / 'vendor')
 
 
@@ -74,7 +75,7 @@ setup(
 
     packages=find_packages('.'),
 
-    cmdclass={'build_ext': BuildLibPgQueryFirst},
+    #cmdclass={'build_ext': BuildLibPgQueryFirst},
     ext_modules=cythonize([
         Extension('pglast.parser', [extension_source],
                   libraries=['pg_query'],