[python-escript] 01/01: Protect against g++-6 [close #831149]

Joel Fenwick jfenwick-guest at moszumanska.debian.org
Tue Jul 19 23:28:28 UTC 2016


This is an automated email from the git hooks/post-receive script.

jfenwick-guest pushed a commit to branch debian
in repository python-escript.

commit 96dc8750c411cd66c2394aafbdbaa326af117f98
Author: Joel Fenwick <joelfenwick at uq.edu.au>
Date:   Wed Jul 20 09:26:30 2016 +1000

    Protect against g++-6 [close #831149]
    
    While the development version of escript is c++>=11 compliant,
    this release is not.
---
 debian/patches/11_use_c++03    | 11 ++++++
 debian/patches/13_cpp_overlord | 84 ++++++++++++++++++++++++++++++++++++++++++
 debian/patches/series          |  2 +
 3 files changed, 97 insertions(+)

diff --git a/debian/patches/11_use_c++03 b/debian/patches/11_use_c++03
new file mode 100644
index 0000000..86b37df
--- /dev/null
+++ b/debian/patches/11_use_c++03
@@ -0,0 +1,11 @@
+--- a/scons/templates/sid_options.py
++++ b/scons/templates/sid_options.py
+@@ -56,7 +56,7 @@ escript_opts_version = 202
+ # Flags to use with the C++ compiler. Do not set unless you know
+ # what you are doing - use cxx_extra to specify additional flags!
+ # DEFAULT: compiler-dependent
+-#cc_flags = ''
++cc_flags = '-std=c++03'
+ 
+ # Additional compiler (optimization) flags for non-debug builds
+ # DEFAULT: compiler-dependent
diff --git a/debian/patches/13_cpp_overlord b/debian/patches/13_cpp_overlord
new file mode 100644
index 0000000..ebb1a87
--- /dev/null
+++ b/debian/patches/13_cpp_overlord
@@ -0,0 +1,84 @@
+--- a/tools/overlord/SConscript
++++ b/tools/overlord/SConscript
+@@ -19,7 +19,7 @@ Import('*')
+ local_env = env.Clone()
+ 
+ if not local_env['IS_WINDOWS']:
+-    prog = local_env.Program('escript-overlord', ['overlord.c'])
++    prog = local_env.Program('escript-overlord', ['overlord.cpp'])
+     env.Alias('build_overlord', prog)
+     install_overlord = local_env.Install(local_env['bininstall'], prog)
+     env.Alias('install_overlord', install_overlord) #oh no! our freedoms!
+--- /dev/null
++++ b/tools/overlord/overlord.cpp
+@@ -0,0 +1,70 @@
++/*****************************************************************************
++*
++* Copyright (c) 2003-2016 by The University of Queensland
++* http://www.uq.edu.au
++*
++* Primary Business: Queensland, Australia
++* Licensed under the Apache License, version 2.0
++* http://www.apache.org/licenses/LICENSE-2.0
++*
++* Development until 2012 by Earth Systems Science Computational Center (ESSCC)
++* Development 2012-2013 by School of Earth Sciences
++* Development from 2014 by Centre for Geoscience Computing (GeoComp)
++*
++*****************************************************************************/
++
++#include <stdlib.h>
++#include <unistd.h>
++#include <stdio.h>
++#include <string.h>
++#include <errno.h>
++#include <sys/socket.h>
++#include <netinet/in.h>
++#include <arpa/inet.h>
++
++int main(int argc, char **argv) {
++    int key = 0, port = 0, sfd = 0;
++    FILE *escript = NULL;
++    struct sockaddr_in sa;
++
++    if (argc < 4) {
++        fprintf(stderr, "Missing minimum arguments: %s port key cmd [args]\n",
++                argv[0]);
++        return 1;
++    }
++    key = atoi(argv[2]);
++    port = atoi(argv[1]);
++    
++    
++    sa.sin_family = AF_INET;
++    sa.sin_port = htons(port);
++    sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
++    memset(sa.sin_zero, '\0', sizeof(sa.sin_zero));
++    
++    sfd = socket(PF_INET, SOCK_STREAM, 0);
++    if (sfd < 0) {
++        perror("overlord socket creation failed");
++        return 1;
++    }
++
++    if (connect(sfd, (struct sockaddr*)&sa, sizeof(sa)) < 0) {
++        perror("overlord connect() call failed");
++        return 1;
++    }
++    
++    escript = fdopen(sfd, "w");
++    if (escript == NULL) {
++        perror("overlord failed to open file descriptor for writes");
++        return 1;
++    }
++    if (fwrite(&key, sizeof(int), 1, escript) != 1) {
++        fprintf(stderr, "overlord failed to initialise communication with escript\n");
++        return 1;
++    }
++        
++    fflush(escript);
++    execvp(argv[3], argv+3);
++    perror("overlord exec failed");
++    return 1;
++}
++
diff --git a/debian/patches/series b/debian/patches/series
index 67d7345..35f21f1 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,3 @@
 10_use_python35.patch
+11_use_c++03
+13_cpp_overlord

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/python-escript.git



More information about the debian-science-commits mailing list