sigrok-cross-mingw: Fix firmware/decoder dir locations.
authorUwe Hermann <uwe@hermann-uwe.de>
Wed, 1 Jan 2014 21:04:05 +0000 (22:04 +0100)
committerUwe Hermann <uwe@hermann-uwe.de>
Wed, 1 Jan 2014 21:06:13 +0000 (22:06 +0100)
cross-compile/mingw/libsigrok_firmwaredir.patch [new file with mode: 0644]
cross-compile/mingw/pulseview_decodersdir.patch [new file with mode: 0644]
cross-compile/mingw/sigrok-cross-mingw
cross-compile/mingw/sigrok_cli_decodersdir.patch [new file with mode: 0644]

diff --git a/cross-compile/mingw/libsigrok_firmwaredir.patch b/cross-compile/mingw/libsigrok_firmwaredir.patch
new file mode 100644 (file)
index 0000000..d9d351a
--- /dev/null
@@ -0,0 +1,13 @@
+diff --git a/configure.ac b/configure.ac
+index cbe91cf..447c7e2 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -543,7 +543,7 @@ AC_TYPE_SIZE_T
+ # Checks for library functions.
+ AC_CHECK_FUNCS([gettimeofday memset strchr strcspn strdup strerror strncasecmp strstr strtol strtoul strtoull])
+-AC_SUBST(FIRMWARE_DIR, "$datadir/sigrok-firmware")
++AC_SUBST(FIRMWARE_DIR, "firmware")
+ AC_SUBST(MAKEFLAGS, '--no-print-directory')
+ AC_SUBST(AM_LIBTOOLFLAGS, '--silent')
diff --git a/cross-compile/mingw/pulseview_decodersdir.patch b/cross-compile/mingw/pulseview_decodersdir.patch
new file mode 100644 (file)
index 0000000..5532362
--- /dev/null
@@ -0,0 +1,13 @@
+diff --git a/main.cpp b/main.cpp
+index 3fa93c4..db589f3 100644
+--- a/main.cpp
++++ b/main.cpp
+@@ -120,7 +120,7 @@ int main(int argc, char *argv[])
+ #ifdef ENABLE_DECODE
+               // Initialise libsigrokdecode
+-              if (srd_init(NULL) != SRD_OK) {
++              if (srd_init("decoders") != SRD_OK) {
+                       qDebug() << "ERROR: libsigrokdecode init failed.";
+                       break;
+               }
index b38a111f3413e078c5a0d87e97f0de61e7c45178..066a78c75cbe745c498c3654b2bd661743fc67f1 100755 (executable)
@@ -91,6 +91,7 @@ cd ..
 # libsigrok
 git clone git://sigrok.org/libsigrok
 cd libsigrok
+patch -p1 < ../../libsigrok_firmwaredir.patch
 ./autogen.sh
 PKG_CONFIG_PATH_i686_pc_mingw32=$P ./configure $C $L && make install
 cd ..
@@ -105,6 +106,7 @@ cd ..
 # sigrok-cli
 git clone git://sigrok.org/sigrok-cli
 cd sigrok-cli
+patch -p1 < ../../sigrok_cli_decodersdir.patch
 ./autogen.sh
 PKG_CONFIG_PATH_i686_pc_mingw32=$P:$P2 ./configure $C && make install
 makensis -DHOME=$HOME contrib/sigrok-cli_cross.nsi
@@ -114,6 +116,7 @@ cd ..
 git clone git://sigrok.org/pulseview
 cd pulseview
 patch -p1 < ../../pulseview_linkfix.patch
+patch -p1 < ../../pulseview_decodersdir.patch
 PKG_CONFIG_PATH_i686_pc_mingw32=$P:$P2 cmake $CM -DCMAKE_INSTALL_PREFIX:PATH=$PREFIX -DDISABLE_WERROR=y . && make install VERBOSE=1
 makensis -DHOME=$HOME contrib/pulseview_cross.nsi
 cd ..
diff --git a/cross-compile/mingw/sigrok_cli_decodersdir.patch b/cross-compile/mingw/sigrok_cli_decodersdir.patch
new file mode 100644 (file)
index 0000000..2cf140b
--- /dev/null
@@ -0,0 +1,26 @@
+diff --git a/main.c b/main.c
+index 9ab3f77..9d34034 100644
+--- a/main.c
++++ b/main.c
+@@ -216,7 +216,7 @@ int main(int argc, char **argv)
+               goto done;
+       if (opt_pds) {
+-              if (srd_init(NULL) != SRD_OK)
++              if (srd_init("decoders") != SRD_OK)
+                       goto done;
+               if (srd_session_new(&srd_sess) != SRD_OK) {
+                       g_critical("Failed to create new decode session.");
+diff --git a/show.c b/show.c
+index db643d1..55c1bf6 100644
+--- a/show.c
++++ b/show.c
+@@ -65,7 +65,7 @@ void show_version(void)
+       printf("\n");
+ #ifdef HAVE_SRD
+-      if (srd_init(NULL) == SRD_OK) {
++      if (srd_init("decoders") == SRD_OK) {
+               printf("Supported protocol decoders:\n");
+               srd_decoder_load_all();
+               for (l = srd_decoder_list(); l; l = l->next) {