From 4a64fae41fd8ca77e5b7a5e9a88ebba813cb58e5 Mon Sep 17 00:00:00 2001
From: Cody Piersall <cody.piersall@gmail.com>
Date: Mon, 31 Dec 2018 15:32:35 -0600
Subject: [PATCH] Update to new nng source tree layout.

nng moved headers from src/ to include/nng.
---
 build_pynng.py  | 26 +++++++++++++-------------
 generate_api.sh | 26 +++++++++++++-------------
 nng_api.h       |  2 +-
 setup.py        |  2 +-
 4 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/build_pynng.py b/build_pynng.py
index bf36645..1f7bf92 100644
--- a/build_pynng.py
+++ b/build_pynng.py
@@ -26,23 +26,23 @@
     r""" // passed to the real C compiler,
          // contains implementation of things declared in cdef()
          #define NNG_DECL
-         #include <nng.h>
-         #include <protocol/bus0/bus.h>
-         #include <protocol/pair0/pair.h>
-         #include <protocol/pair1/pair.h>
-         #include <protocol/pipeline0/pull.h>
-         #include <protocol/pipeline0/push.h>
-         #include <protocol/pubsub0/pub.h>
-         #include <protocol/pubsub0/sub.h>
-         #include <protocol/reqrep0/req.h>
-         #include <protocol/reqrep0/rep.h>
-         #include <protocol/survey0/respond.h>
-         #include <protocol/survey0/survey.h>
+         #include <nng/nng.h>
+         #include <nng/protocol/bus0/bus.h>
+         #include <nng/protocol/pair0/pair.h>
+         #include <nng/protocol/pair1/pair.h>
+         #include <nng/protocol/pipeline0/pull.h>
+         #include <nng/protocol/pipeline0/push.h>
+         #include <nng/protocol/pubsub0/pub.h>
+         #include <nng/protocol/pubsub0/sub.h>
+         #include <nng/protocol/reqrep0/req.h>
+         #include <nng/protocol/reqrep0/rep.h>
+         #include <nng/protocol/survey0/respond.h>
+         #include <nng/protocol/survey0/survey.h>
     """,
     libraries=libraries,
     # library_dirs=['nng/build/Debug',],
     # (more arguments like setup.py's Extension class:
-    include_dirs=['nng/src'],
+    include_dirs=['nng/include'],
     extra_objects=objects,
 )
 
diff --git a/generate_api.sh b/generate_api.sh
index eb6cce9..e16de39 100755
--- a/generate_api.sh
+++ b/generate_api.sh
@@ -16,17 +16,17 @@ function process_header() {
     sed 's/^NNG_DECL *//g'
 }
 
-process_header nng/src/nng.h >> nng_api.h
-process_header nng/src/protocol/bus0/bus.h >> nng_api.h
-process_header nng/src/protocol/pair0/pair.h >> nng_api.h
-process_header nng/src/protocol/pair1/pair.h >> nng_api.h
-process_header nng/src/protocol/pipeline0/push.h >> nng_api.h
-process_header nng/src/protocol/pipeline0/pull.h >> nng_api.h
-process_header nng/src/protocol/pubsub0/pub.h >> nng_api.h
-process_header nng/src/protocol/pubsub0/sub.h >> nng_api.h
-process_header nng/src/protocol/reqrep0/req.h >> nng_api.h
-process_header nng/src/protocol/reqrep0/rep.h >> nng_api.h
-process_header nng/src/protocol/survey0/survey.h >> nng_api.h
-process_header nng/src/protocol/survey0/respond.h >> nng_api.h
-grep '#define NNG_.*_VERSION' nng/src/nng.h >> nng_api.h
+process_header nng/include/nng/nng.h >> nng_api.h
+process_header nng/include/nng/protocol/bus0/bus.h >> nng_api.h
+process_header nng/include/nng/protocol/pair0/pair.h >> nng_api.h
+process_header nng/include/nng/protocol/pair1/pair.h >> nng_api.h
+process_header nng/include/nng/protocol/pipeline0/push.h >> nng_api.h
+process_header nng/include/nng/protocol/pipeline0/pull.h >> nng_api.h
+process_header nng/include/nng/protocol/pubsub0/pub.h >> nng_api.h
+process_header nng/include/nng/protocol/pubsub0/sub.h >> nng_api.h
+process_header nng/include/nng/protocol/reqrep0/req.h >> nng_api.h
+process_header nng/include/nng/protocol/reqrep0/rep.h >> nng_api.h
+process_header nng/include/nng/protocol/survey0/survey.h >> nng_api.h
+process_header nng/include/nng/protocol/survey0/respond.h >> nng_api.h
+grep '#define NNG_.*_VERSION' nng/include/nng/nng.h >> nng_api.h
 
diff --git a/nng_api.h b/nng_api.h
index fc17fc0..c42f8cd 100644
--- a/nng_api.h
+++ b/nng_api.h
@@ -362,5 +362,5 @@ int nng_surveyor0_open_raw(nng_socket *);
 int nng_respondent0_open(nng_socket *);
 int nng_respondent0_open_raw(nng_socket *);
 #define NNG_MAJOR_VERSION 1
-#define NNG_MINOR_VERSION 0
+#define NNG_MINOR_VERSION 1
 #define NNG_PATCH_VERSION 1
diff --git a/setup.py b/setup.py
index 11be774..d924d64 100644
--- a/setup.py
+++ b/setup.py
@@ -10,7 +10,7 @@
 THIS_DIR = os.path.dirname(__file__)
 
 
-NNG_REVISION = '6c334f3'
+NNG_REVISION = 'd3bd35ab49ad74528fd9e34cce9016d74dd91943'
 
 
 def build_nng_lib():