From 9c7bf9da28da344ed2ce1073d7f19449a64499b5 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Mon, 30 Jun 2014 14:42:40 +0200 Subject: Fix patch names... * Fix patch names: + 212_nxcomp_build-on-Android.patch -> 212_nxcomp_build-on-Android.full+lite.patch + 302_nx-X11_xkbbasedir-detection.patch -> 302_nx-X11_xkbbasedir-detection.full.patch --- debian/changelog | 6 +- .../212_nxcomp_build-on-Android.full+lite.patch | 253 +++++++++++++++++++++ debian/patches/212_nxcomp_build-on-Android.patch | 253 --------------------- .../302_nx-X11_xkbbasedir-detection.full.patch | 84 +++++++ .../patches/302_nx-X11_xkbbasedir-detection.patch | 84 ------- debian/patches/series | 4 +- 6 files changed, 344 insertions(+), 340 deletions(-) create mode 100644 debian/patches/212_nxcomp_build-on-Android.full+lite.patch delete mode 100644 debian/patches/212_nxcomp_build-on-Android.patch create mode 100644 debian/patches/302_nx-X11_xkbbasedir-detection.full.patch delete mode 100644 debian/patches/302_nx-X11_xkbbasedir-detection.patch diff --git a/debian/changelog b/debian/changelog index 8d8bf1710..57498f1d1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,10 @@ nx-libs (2:3.5.0.26-0x2go1) UNRELEASED; urgency=medium - * Continue development... + * Fix patch names: + + 212_nxcomp_build-on-Android.patch -> + 212_nxcomp_build-on-Android.full+lite.patch + + 302_nx-X11_xkbbasedir-detection.patch -> + 302_nx-X11_xkbbasedir-detection.full.patch -- Mike Gabriel Mon, 30 Jun 2014 14:24:42 +0200 diff --git a/debian/patches/212_nxcomp_build-on-Android.full+lite.patch b/debian/patches/212_nxcomp_build-on-Android.full+lite.patch new file mode 100644 index 000000000..528d33b74 --- /dev/null +++ b/debian/patches/212_nxcomp_build-on-Android.full+lite.patch @@ -0,0 +1,253 @@ +Author: Nito Martinez +Description: Fix FTBFS of nxproxy/nxcomp on Android + +--- a/nxcomp/Jpeg.cpp ++++ b/nxcomp/Jpeg.cpp +@@ -17,6 +17,9 @@ + + #include + ++#ifdef ANDROID ++#include ++#endif + #include + #include + #include +--- a/nxcomp/Loop.cpp ++++ b/nxcomp/Loop.cpp +@@ -4187,7 +4187,7 @@ + + #endif + +- char *separator = rindex(display, ':'); ++ char *separator = strrchr(display, ':'); + + if ((separator == NULL) || !isdigit(*(separator + 1))) + { +@@ -8240,7 +8240,7 @@ + char *name; + char *value; + +- value = rindex(nextOpts, ':'); ++ value = strrchr(nextOpts, ':'); + + if (value != NULL) + { +@@ -11010,7 +11010,7 @@ + packMethod == PACK_LOSSLESS || + packMethod == PACK_ADAPTIVE) + { +- const char *dash = rindex(opt, '-'); ++ const char *dash = strrchr(opt, '-'); + + if (dash != NULL && strlen(dash) == 2 && + *(dash + 1) >= '0' && *(dash + 1) <= '9') +@@ -12275,6 +12275,10 @@ + control -> ShmemServer = 0; + } + ++ // For android, no shared memory available ++ control -> ShmemServer = 0; ++ control -> ShmemClientSize = 0; ++ + return 1; + } + +@@ -13525,7 +13529,7 @@ + + int newPort = port; + +- const char *separator = rindex(opt, ':'); ++ const char *separator = strrchr(opt, ':'); + + if (separator != NULL) + { +--- a/nxcomp/Pgn.cpp ++++ b/nxcomp/Pgn.cpp +@@ -23,6 +23,9 @@ + + #include + ++#ifdef ANDROID ++#include ++#endif + #include + #include + #include +--- a/nxcomp/Proxy.cpp ++++ b/nxcomp/Proxy.cpp +@@ -20,6 +20,11 @@ + #include + #include + #include ++#ifdef ANDROID ++#include ++#include ++#include ++#endif + + #include "Misc.h" + +@@ -31,9 +36,11 @@ + #include + #endif + ++#ifndef ANDROID + #include + #include + #include ++#endif + + #if defined(__EMX__ ) || defined(__CYGWIN32__) + +--- a/nxcomp/ServerChannel.cpp ++++ b/nxcomp/ServerChannel.cpp +@@ -18,7 +18,9 @@ + #include + #include + #include ++#ifndef ANDROID + #include ++#endif + + #include + #include +@@ -1079,7 +1081,6 @@ + + priority_++; + } +- + // + // Account this data to the original opcode. + // +@@ -1500,7 +1501,6 @@ + continue; + } + } +- + // + // Check if user pressed the CTRL+ALT+SHIFT+ESC key + // sequence because was unable to kill the session +@@ -5475,7 +5475,7 @@ + *logofs << "handleColormap: Dumping colormap entries:\n" + << logofs_flush; + +- const unsigned char *p = unpackState_[resource] -> colormap -> data; ++ const unsigned char *p = (const unsigned char *) unpackState_[resource] -> colormap -> data; + + for (unsigned int i = 0; i < unpackState_[resource] -> + colormap -> entries; i++) +@@ -7100,7 +7100,12 @@ + { + encodeBuffer.encodeValue(stage, 2); + ++#ifndef ANDROID + shmemState_ -> present = *(buffer + 8); ++#else ++ shmemState_ -> present = 0; ++ cerr << "Info: handleShmemReply: In android no shared memory. Setting present to 0 hardcoded\n"; ++#endif + shmemState_ -> opcode = *(buffer + 9); + shmemState_ -> event = *(buffer + 10); + shmemState_ -> error = *(buffer + 11); +@@ -7128,7 +7133,12 @@ + cerr << "Info" << ": Using shared memory parameters 1/" + << (shmemState_ -> size / 1024) << "K.\n"; + ++#ifndef ANDROID + shmemState_ -> enabled = 1; ++#else ++ cerr << "Info: handleShmemReply: In android no shared memory. Setting enabled to -1. This should not be displayed\n"; ++ shmemState_ -> enabled = -1; ++#endif + + encodeBuffer.encodeBoolValue(1); + } +@@ -7241,7 +7251,7 @@ + // memory support is disabled by the + // user. + // +- ++#ifndef ANDROID + if (control -> ShmemServer == 1 && + control -> ShmemServerSize > 0 && + enableServer == 1) +@@ -7252,8 +7262,12 @@ + { + memcpy(buffer + 8, "NO-MIT-", 7); + } ++#else ++ cerr << "Info: handleShmemRequest: In android no shared memory. Returning NO-MIT- answer\n"; + +- sequenceQueue_.push(clientSequence_, opcode, ++ memcpy(buffer + 8, "NO-MIT-", 7); ++#endif ++ sequenceQueue_.push(clientSequence_, opcode, + opcodeStore_ -> getShmemParameters, stage); + + // +@@ -7289,9 +7303,13 @@ + + shmemState_ -> size = control -> ShmemServerSize; + ++#ifndef ANDROID + shmemState_ -> id = shmget(IPC_PRIVATE, shmemState_ -> size, + IPC_CREAT | permissions); +- ++#else ++ cerr << "Info: handleShmemReqyest: In android no shared memory (shmget). This message should not be displayed present should never be 1 in android\n"; ++ shmemState_ -> id = -1; ++#endif + if (shmemState_ -> id >= 0) + { + #if defined(TEST) || defined(INFO) +@@ -7302,8 +7320,12 @@ + #endif + + ++#ifndef ANDROID + shmemState_ -> address = shmat(shmemState_ -> id, 0, 0); +- ++#else ++ cerr << "Info: handleShmemReqyest: In android no shared memory (shmat). This message should not be displayed. present should never be 1 in android\n"; ++ shmemState_ -> address = NULL; ++#endif + if (shmemState_ -> address != NULL) + { + #ifdef TEST +@@ -7437,6 +7459,10 @@ + + return 0; + } ++#ifdef ANDROID ++ cerr << "Info: handleShmem: In android no shared memory. enabled should never be 1. This should not be displayed\n"; ++ return 0; ++#endif + + // + // Ignore null requests and requests that will not result +@@ -8054,14 +8080,22 @@ + { + if (shmemState_ != NULL) + { +- if (shmemState_ -> address != NULL) ++ if (shmemState_ -> address != NULL) + { +- shmdt((char *) shmemState_ -> address); ++#ifndef ANDROID ++ shmdt((char *) shmemState_ -> address); ++#else ++ cerr << "Info: handleShmemStateRemove: In android no shared memory. This should not be displayed. address should always be NULL\n"; ++#endif + } + + if (shmemState_ -> id > 0) + { ++#ifndef ANDROID + shmctl(shmemState_ -> id, IPC_RMID, 0); ++#else ++ cerr << "Info: handleShmemStateRemove: In android no shared memory. This should not be displayed. id should always be 0\n"; ++#endif + } + + delete shmemState_; diff --git a/debian/patches/212_nxcomp_build-on-Android.patch b/debian/patches/212_nxcomp_build-on-Android.patch deleted file mode 100644 index 528d33b74..000000000 --- a/debian/patches/212_nxcomp_build-on-Android.patch +++ /dev/null @@ -1,253 +0,0 @@ -Author: Nito Martinez -Description: Fix FTBFS of nxproxy/nxcomp on Android - ---- a/nxcomp/Jpeg.cpp -+++ b/nxcomp/Jpeg.cpp -@@ -17,6 +17,9 @@ - - #include - -+#ifdef ANDROID -+#include -+#endif - #include - #include - #include ---- a/nxcomp/Loop.cpp -+++ b/nxcomp/Loop.cpp -@@ -4187,7 +4187,7 @@ - - #endif - -- char *separator = rindex(display, ':'); -+ char *separator = strrchr(display, ':'); - - if ((separator == NULL) || !isdigit(*(separator + 1))) - { -@@ -8240,7 +8240,7 @@ - char *name; - char *value; - -- value = rindex(nextOpts, ':'); -+ value = strrchr(nextOpts, ':'); - - if (value != NULL) - { -@@ -11010,7 +11010,7 @@ - packMethod == PACK_LOSSLESS || - packMethod == PACK_ADAPTIVE) - { -- const char *dash = rindex(opt, '-'); -+ const char *dash = strrchr(opt, '-'); - - if (dash != NULL && strlen(dash) == 2 && - *(dash + 1) >= '0' && *(dash + 1) <= '9') -@@ -12275,6 +12275,10 @@ - control -> ShmemServer = 0; - } - -+ // For android, no shared memory available -+ control -> ShmemServer = 0; -+ control -> ShmemClientSize = 0; -+ - return 1; - } - -@@ -13525,7 +13529,7 @@ - - int newPort = port; - -- const char *separator = rindex(opt, ':'); -+ const char *separator = strrchr(opt, ':'); - - if (separator != NULL) - { ---- a/nxcomp/Pgn.cpp -+++ b/nxcomp/Pgn.cpp -@@ -23,6 +23,9 @@ - - #include - -+#ifdef ANDROID -+#include -+#endif - #include - #include - #include ---- a/nxcomp/Proxy.cpp -+++ b/nxcomp/Proxy.cpp -@@ -20,6 +20,11 @@ - #include - #include - #include -+#ifdef ANDROID -+#include -+#include -+#include -+#endif - - #include "Misc.h" - -@@ -31,9 +36,11 @@ - #include - #endif - -+#ifndef ANDROID - #include - #include - #include -+#endif - - #if defined(__EMX__ ) || defined(__CYGWIN32__) - ---- a/nxcomp/ServerChannel.cpp -+++ b/nxcomp/ServerChannel.cpp -@@ -18,7 +18,9 @@ - #include - #include - #include -+#ifndef ANDROID - #include -+#endif - - #include - #include -@@ -1079,7 +1081,6 @@ - - priority_++; - } -- - // - // Account this data to the original opcode. - // -@@ -1500,7 +1501,6 @@ - continue; - } - } -- - // - // Check if user pressed the CTRL+ALT+SHIFT+ESC key - // sequence because was unable to kill the session -@@ -5475,7 +5475,7 @@ - *logofs << "handleColormap: Dumping colormap entries:\n" - << logofs_flush; - -- const unsigned char *p = unpackState_[resource] -> colormap -> data; -+ const unsigned char *p = (const unsigned char *) unpackState_[resource] -> colormap -> data; - - for (unsigned int i = 0; i < unpackState_[resource] -> - colormap -> entries; i++) -@@ -7100,7 +7100,12 @@ - { - encodeBuffer.encodeValue(stage, 2); - -+#ifndef ANDROID - shmemState_ -> present = *(buffer + 8); -+#else -+ shmemState_ -> present = 0; -+ cerr << "Info: handleShmemReply: In android no shared memory. Setting present to 0 hardcoded\n"; -+#endif - shmemState_ -> opcode = *(buffer + 9); - shmemState_ -> event = *(buffer + 10); - shmemState_ -> error = *(buffer + 11); -@@ -7128,7 +7133,12 @@ - cerr << "Info" << ": Using shared memory parameters 1/" - << (shmemState_ -> size / 1024) << "K.\n"; - -+#ifndef ANDROID - shmemState_ -> enabled = 1; -+#else -+ cerr << "Info: handleShmemReply: In android no shared memory. Setting enabled to -1. This should not be displayed\n"; -+ shmemState_ -> enabled = -1; -+#endif - - encodeBuffer.encodeBoolValue(1); - } -@@ -7241,7 +7251,7 @@ - // memory support is disabled by the - // user. - // -- -+#ifndef ANDROID - if (control -> ShmemServer == 1 && - control -> ShmemServerSize > 0 && - enableServer == 1) -@@ -7252,8 +7262,12 @@ - { - memcpy(buffer + 8, "NO-MIT-", 7); - } -+#else -+ cerr << "Info: handleShmemRequest: In android no shared memory. Returning NO-MIT- answer\n"; - -- sequenceQueue_.push(clientSequence_, opcode, -+ memcpy(buffer + 8, "NO-MIT-", 7); -+#endif -+ sequenceQueue_.push(clientSequence_, opcode, - opcodeStore_ -> getShmemParameters, stage); - - // -@@ -7289,9 +7303,13 @@ - - shmemState_ -> size = control -> ShmemServerSize; - -+#ifndef ANDROID - shmemState_ -> id = shmget(IPC_PRIVATE, shmemState_ -> size, - IPC_CREAT | permissions); -- -+#else -+ cerr << "Info: handleShmemReqyest: In android no shared memory (shmget). This message should not be displayed present should never be 1 in android\n"; -+ shmemState_ -> id = -1; -+#endif - if (shmemState_ -> id >= 0) - { - #if defined(TEST) || defined(INFO) -@@ -7302,8 +7320,12 @@ - #endif - - -+#ifndef ANDROID - shmemState_ -> address = shmat(shmemState_ -> id, 0, 0); -- -+#else -+ cerr << "Info: handleShmemReqyest: In android no shared memory (shmat). This message should not be displayed. present should never be 1 in android\n"; -+ shmemState_ -> address = NULL; -+#endif - if (shmemState_ -> address != NULL) - { - #ifdef TEST -@@ -7437,6 +7459,10 @@ - - return 0; - } -+#ifdef ANDROID -+ cerr << "Info: handleShmem: In android no shared memory. enabled should never be 1. This should not be displayed\n"; -+ return 0; -+#endif - - // - // Ignore null requests and requests that will not result -@@ -8054,14 +8080,22 @@ - { - if (shmemState_ != NULL) - { -- if (shmemState_ -> address != NULL) -+ if (shmemState_ -> address != NULL) - { -- shmdt((char *) shmemState_ -> address); -+#ifndef ANDROID -+ shmdt((char *) shmemState_ -> address); -+#else -+ cerr << "Info: handleShmemStateRemove: In android no shared memory. This should not be displayed. address should always be NULL\n"; -+#endif - } - - if (shmemState_ -> id > 0) - { -+#ifndef ANDROID - shmctl(shmemState_ -> id, IPC_RMID, 0); -+#else -+ cerr << "Info: handleShmemStateRemove: In android no shared memory. This should not be displayed. id should always be 0\n"; -+#endif - } - - delete shmemState_; diff --git a/debian/patches/302_nx-X11_xkbbasedir-detection.full.patch b/debian/patches/302_nx-X11_xkbbasedir-detection.full.patch new file mode 100644 index 000000000..dac3d8a08 --- /dev/null +++ b/debian/patches/302_nx-X11_xkbbasedir-detection.full.patch @@ -0,0 +1,84 @@ +Description: Test for xkb/rules/base instead of xkb/keymap.dir for setting XkbBaseDir +Author: Mike Gabriel +Abstract: + In recent (as of 2014/06) X.org release, the keymap.dir file + has become obsolete. Let's test for the xkb/rules/base file + instead. +--- a/nx-X11/programs/Xserver/xkb/ddxLoad.c ++++ b/nx-X11/programs/Xserver/xkb/ddxLoad.c +@@ -180,7 +180,7 @@ + + #define NX_XKB_BASE_DIRECTORY "/usr/lib/X11/xkb" + #define NX_XKB_ALTERNATE_BASE_DIRECTORY "/usr/share/X11/xkb" +-#define NX_KEYMAP_DIR_FILE "keymap.dir" ++#define NX_XKB_RULES_BASE_FILE "rules/base" + #define NX_ALT_XKBCOMP_PATH "/usr/bin" + + static char _NXXkbBasePath[PATH_MAX]; +@@ -189,43 +189,43 @@ + static int NXVerifyXkbBaseDirectory(const char *dirPath) + { + int size; +- char *keymapDirFilePath; +- struct stat keymapDirFileStat; ++ char *rulesBaseFilePath; ++ struct stat rulesBaseFileStat; + + /* +- * If keymap.dir file +- * is not present into +- * Xkb Base Directory, ++ * If rules/base file ++ * is not present inside ++ * the Xkb Base Directory, + * we suppose that the + * path is not valid. + */ + + size = strlen(dirPath) + strlen("/") + +- strlen(NX_KEYMAP_DIR_FILE) + 1; ++ strlen(NX_XKB_RULES_BASE_FILE) + 1; + +- if ((keymapDirFilePath = malloc((size + 1) * sizeof(char))) == NULL) ++ if ((rulesBaseFilePath = malloc((size + 1) * sizeof(char))) == NULL) + { + FatalError("NXVerifyXkbBaseDirectory: malloc failed.\n"); + } + +- strcpy(keymapDirFilePath, dirPath); +- strcat(keymapDirFilePath, "/"); +- strcat(keymapDirFilePath, NX_KEYMAP_DIR_FILE); ++ strcpy(rulesBaseFilePath, dirPath); ++ strcat(rulesBaseFilePath, "/"); ++ strcat(rulesBaseFilePath, NX_XKB_RULES_BASE_FILE); + + #ifdef TEST + fprintf(stderr, "NXVerifyXkbBaseDirectory: Looking for [%s] file.\n", +- keymapDirFilePath); ++ rulesBaseFilePath); + #endif + +- if (stat(keymapDirFilePath, &keymapDirFileStat) != 0) ++ if (stat(rulesBaseFilePath, &rulesBaseFileStat) != 0) + { + + #ifdef TEST + fprintf(stderr, "NXVerifyXkbBaseDirectory: Can't find the keymap.dir file [%s].\n", +- keymapDirFilePath); ++ rulesBaseFilePath); + #endif + +- free(keymapDirFilePath); ++ free(rulesBaseFilePath); + + return 0; + } +@@ -235,7 +235,7 @@ + dirPath); + #endif + +- free(keymapDirFilePath); ++ free(rulesBaseFilePath); + + return 1; + } diff --git a/debian/patches/302_nx-X11_xkbbasedir-detection.patch b/debian/patches/302_nx-X11_xkbbasedir-detection.patch deleted file mode 100644 index dac3d8a08..000000000 --- a/debian/patches/302_nx-X11_xkbbasedir-detection.patch +++ /dev/null @@ -1,84 +0,0 @@ -Description: Test for xkb/rules/base instead of xkb/keymap.dir for setting XkbBaseDir -Author: Mike Gabriel -Abstract: - In recent (as of 2014/06) X.org release, the keymap.dir file - has become obsolete. Let's test for the xkb/rules/base file - instead. ---- a/nx-X11/programs/Xserver/xkb/ddxLoad.c -+++ b/nx-X11/programs/Xserver/xkb/ddxLoad.c -@@ -180,7 +180,7 @@ - - #define NX_XKB_BASE_DIRECTORY "/usr/lib/X11/xkb" - #define NX_XKB_ALTERNATE_BASE_DIRECTORY "/usr/share/X11/xkb" --#define NX_KEYMAP_DIR_FILE "keymap.dir" -+#define NX_XKB_RULES_BASE_FILE "rules/base" - #define NX_ALT_XKBCOMP_PATH "/usr/bin" - - static char _NXXkbBasePath[PATH_MAX]; -@@ -189,43 +189,43 @@ - static int NXVerifyXkbBaseDirectory(const char *dirPath) - { - int size; -- char *keymapDirFilePath; -- struct stat keymapDirFileStat; -+ char *rulesBaseFilePath; -+ struct stat rulesBaseFileStat; - - /* -- * If keymap.dir file -- * is not present into -- * Xkb Base Directory, -+ * If rules/base file -+ * is not present inside -+ * the Xkb Base Directory, - * we suppose that the - * path is not valid. - */ - - size = strlen(dirPath) + strlen("/") + -- strlen(NX_KEYMAP_DIR_FILE) + 1; -+ strlen(NX_XKB_RULES_BASE_FILE) + 1; - -- if ((keymapDirFilePath = malloc((size + 1) * sizeof(char))) == NULL) -+ if ((rulesBaseFilePath = malloc((size + 1) * sizeof(char))) == NULL) - { - FatalError("NXVerifyXkbBaseDirectory: malloc failed.\n"); - } - -- strcpy(keymapDirFilePath, dirPath); -- strcat(keymapDirFilePath, "/"); -- strcat(keymapDirFilePath, NX_KEYMAP_DIR_FILE); -+ strcpy(rulesBaseFilePath, dirPath); -+ strcat(rulesBaseFilePath, "/"); -+ strcat(rulesBaseFilePath, NX_XKB_RULES_BASE_FILE); - - #ifdef TEST - fprintf(stderr, "NXVerifyXkbBaseDirectory: Looking for [%s] file.\n", -- keymapDirFilePath); -+ rulesBaseFilePath); - #endif - -- if (stat(keymapDirFilePath, &keymapDirFileStat) != 0) -+ if (stat(rulesBaseFilePath, &rulesBaseFileStat) != 0) - { - - #ifdef TEST - fprintf(stderr, "NXVerifyXkbBaseDirectory: Can't find the keymap.dir file [%s].\n", -- keymapDirFilePath); -+ rulesBaseFilePath); - #endif - -- free(keymapDirFilePath); -+ free(rulesBaseFilePath); - - return 0; - } -@@ -235,7 +235,7 @@ - dirPath); - #endif - -- free(keymapDirFilePath); -+ free(rulesBaseFilePath); - - return 1; - } diff --git a/debian/patches/series b/debian/patches/series index 5c3f659c8..a7634ba05 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -52,11 +52,11 @@ 209_x2goagent_add-man-page.full.patch 210_nxagent+nxcomp_save_session_state.full+lite.patch 211_nxcomp_set_default_options.full+lite.patch -212_nxcomp_build-on-Android.patch +212_nxcomp_build-on-Android.full+lite.patch 220_nxproxy_bind-loopback-only.full+lite.patch 300_nxagent_set-wm-class.full.patch 301_nx-X11_use-shared-libs.full.patch -302_nx-X11_xkbbasedir-detection.patch +302_nx-X11_xkbbasedir-detection.full.patch 320_nxagent_configurable-keystrokes.full.patch 600_nx-X11+nxcompext+nxcompshad_unique-libnames.full.patch 601_nx-X11_build-option-changes-to-not-use-bundled-libraries.full.patch -- cgit v1.2.3