aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches/metabat-fix-compilation.patch
blob: 7086a96e86088fc1fb903975117e78fc9bcabfb4 (about) (plain)
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
This patch changes metabat so that (1) it is not build statically, (2) it uses
shared libraries rather than static libraries where possible.

diff --git a/SConstruct b/SConstruct
index 69cdc0a..ac99bcb 100644
--- a/SConstruct
+++ b/SConstruct
@@ -26,8 +26,6 @@ debug = ARGUMENTS.get('DEBUG', None)
 build_flags = ['-Wall', '-g', '-std=c++11', '-fopenmp']
 link_flags = ['-lstdc++', '-lm', '-fopenmp']
 
-if platform.platform(True, True).find('Darwin') == -1:
-    link_flags.extend(['-static', '-static-libgcc', '-static-libstdc++'])
 
 if debug is None:
     build_flags.extend(['-O3', '-DNDEBUG', '-Wno-unknown-pragmas', '-Wno-deprecated-declarations', '-Wno-overflow', '-Wno-unused-variable'])
@@ -110,17 +108,17 @@ def findStaticOrShared( lib, testPaths, static_source_list, link_flag_list, stat
     for path in testPaths:
         if not os.path.isdir(path):
             continue
+        for testfile in ('%s/lib%s.so' % (path, lib), '%s/lib%s.dylib' % (path, lib)):
+            if os.path.isfile(testfile):
+                print "Found shared library %s as %s" % (lib, testfile)
+                link_flag_list.extend( ["-L%s" % (path), "-l%s" % (lib) ] )
+                return
         for suffix in staticSuffixes:
             testfile = '%s/lib%s%s' % (path, lib, suffix)
             if os.path.isfile(testfile):
                 static_source_list.append(testfile)
                 print "Found static library %s as %s" % (lib, testfile)
                 return
-        for testfile in ('%s/lib%s.so' % (path, lib), '%s/lib%s.dylib' % (path, lib)):
-            if os.path.isfile(testfile):
-                print "Found shared library %s as %s" % (lib, testfile)
-                link_flag_list.extend( ["-L%s" % (path), "-l%s" % (lib) ] )
-                return
     print "Could not find library for %s!!! Looked in %s" % (lib, testPaths)
     return
 
ttings->order_support[NEG_MEMBLT_V2_INDEX] = true; - settings->order_support[NEG_MEM3BLT_V2_INDEX] = false; - settings->order_support[NEG_SAVEBITMAP_INDEX] = false; - settings->order_support[NEG_GLYPH_INDEX_INDEX] = true; - settings->order_support[NEG_FAST_INDEX_INDEX] = true; - settings->order_support[NEG_FAST_GLYPH_INDEX] = false; - settings->order_support[NEG_POLYGON_SC_INDEX] = false; - settings->order_support[NEG_POLYGON_CB_INDEX] = false; - settings->order_support[NEG_ELLIPSE_SC_INDEX] = false; - settings->order_support[NEG_ELLIPSE_CB_INDEX] = false; -#endif return TRUE; } @@ -587,15 +553,7 @@ frdp_post_connect (freerdp *instance) rdpGdi *gdi; int stride; - gdi_init (instance, -#if defined(FREERDP_VERSION_MAJOR) && defined(FREERDP_VERSION_MINOR) && \ - !(FREERDP_VERSION_MAJOR > 1 || (FREERDP_VERSION_MAJOR == 1 && \ - FREERDP_VERSION_MINOR >= 2)) - CLRBUF_24BPP, -#else - CLRBUF_32BPP, -#endif - NULL); + gdi_init (instance, PIXEL_FORMAT_BGRA32); gdi = instance->context->gdi; instance->update->BeginPaint = frdp_begin_paint; @@ -705,21 +663,15 @@ frdp_key_pressed (GtkWidget *widget, VinagreRdpTab *rdp_tab = (VinagreRdpTab *) user_data; VinagreRdpTabPrivate *priv = rdp_tab->priv; frdpEventKey *frdp_event; -#if HAVE_FREERDP_1_1 UINT16 scancode; -#endif frdp_event = g_new0 (frdpEventKey, 1); frdp_event->type = FRDP_EVENT_TYPE_KEY; frdp_event->flags = event->type == GDK_KEY_PRESS ? KBD_FLAGS_DOWN : KBD_FLAGS_RELEASE; -#if HAVE_FREERDP_1_1 scancode = freerdp_keyboard_get_rdp_scancode_from_x11_keycode (event->hardware_keycode); frdp_event->code = RDP_SCANCODE_CODE(scancode); frdp_event->extended = RDP_SCANCODE_EXTENDED(scancode); -#else - frdp_event->code = freerdp_kbd_get_scancode_by_keycode (event->hardware_keycode, &frdp_event->extended); -#endif if (frdp_event->extended) frdp_event->flags |= KBD_FLAGS_EXTENDED; @@ -934,11 +886,13 @@ frdp_authenticate (freerdp *instance, return TRUE; } -static BOOL +static DWORD frdp_certificate_verify (freerdp *instance, - char *subject, - char *issuer, - char *fingerprint) + const char *common_name, + const char *subject, + const char *issuer, + const char *fingerprint, + BOOL host_mismatch) { VinagreTab *tab = VINAGRE_TAB (((frdpContext *) instance->context)->rdp_tab); GtkBuilder *builder; @@ -968,17 +922,18 @@ frdp_certificate_verify (freerdp *instance, gtk_widget_hide (dialog); - return response == GTK_RESPONSE_YES; + return (response == GTK_RESPONSE_YES) ? 1 : 0; } - -#if HAVE_FREERDP_1_1 -static BOOL +static DWORD frdp_changed_certificate_verify (freerdp *instance, - char *subject, - char *issuer, - char *new_fingerprint, - char *old_fingerprint) + const char *common_name, + const char *subject, + const char *issuer, + const char *new_fingerprint, + const char *old_subject, + const char *old_issuer, + const char *old_fingerprint) { VinagreTab *tab = VINAGRE_TAB (((frdpContext *) instance->context)->rdp_tab); GtkBuilder *builder; @@ -1023,9 +978,8 @@ frdp_changed_certificate_verify (freerdp *instance, gtk_widget_hide (dialog); - return response == GTK_RESPONSE_YES; + return (response == GTK_RESPONSE_YES) ? 1 : 0; } -#endif static void init_freerdp (VinagreRdpTab *rdp_tab) @@ -1053,15 +1007,9 @@ init_freerdp (VinagreRdpTab *rdp_tab) priv->freerdp_session->PostConnect = frdp_post_connect; priv->freerdp_session->Authenticate = frdp_authenticate; priv->freerdp_session->VerifyCertificate = frdp_certificate_verify; -#if HAVE_FREERDP_1_1 priv->freerdp_session->VerifyChangedCertificate = frdp_changed_certificate_verify; -#endif -#if HAVE_FREERDP_1_1 priv->freerdp_session->ContextSize = sizeof (frdpContext); -#else - priv->freerdp_session->context_size = sizeof (frdpContext); -#endif freerdp_context_new (priv->freerdp_session); ((frdpContext *) priv->freerdp_session->context)->rdp_tab = rdp_tab; @@ -1070,53 +1018,24 @@ init_freerdp (VinagreRdpTab *rdp_tab) settings = priv->freerdp_session->settings; /* Security settings */ -#if HAVE_FREERDP_1_1 settings->RdpSecurity = TRUE; settings->TlsSecurity = TRUE; settings->NlaSecurity = TRUE; settings->EncryptionMethods = ENCRYPTION_METHOD_40BIT | ENCRYPTION_METHOD_128BIT | ENCRYPTION_METHOD_FIPS; settings->EncryptionLevel = ENCRYPTION_LEVEL_CLIENT_COMPATIBLE; -#else - settings->rdp_security = true; - settings->tls_security = true; - settings->nla_security = true; - settings->encryption = true; - settings->encryption_method = ENCRYPTION_METHOD_40BIT | ENCRYPTION_METHOD_128BIT | ENCRYPTION_METHOD_FIPS; - settings->encryption_level = ENCRYPTION_LEVEL_CLIENT_COMPATIBLE; -#endif -#include <freerdp/version.h> -#if (FREERDP_VERSION_MAJOR == 1 && FREERDP_VERSION_MINOR >= 2 && FREERDP_VERSION_REVISION >= 1) || (FREERDP_VERSION_MAJOR == 2) settings->UseRdpSecurityLayer = FALSE; -#else - settings->DisableEncryption = FALSE; -#endif /* Set display size */ -#if HAVE_FREERDP_1_1 settings->DesktopWidth = width; settings->DesktopHeight = height; -#else - settings->width = width; - settings->height = height; -#endif /* Set hostname */ -#if HAVE_FREERDP_1_1 settings->WindowTitle = g_strdup (hostname); settings->ServerHostname = g_strdup (hostname); settings->ServerPort = port; -#else - settings->window_title = g_strdup (hostname); - settings->hostname = g_strdup (hostname); - settings->port = port; -#endif /* Set keyboard layout */ -#if HAVE_FREERDP_1_1 freerdp_keyboard_init (KBD_US); -#else - freerdp_kbd_init (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), KBD_US); -#endif /* Allow font smoothing by default */ settings->AllowFontSmoothing = TRUE; -- 2.18.1