Bug#830265: ring: Backport to Jessie?

Petter Reinholdtsen pere at hungry.com
Thu Jul 7 18:09:03 UTC 2016


Package: ring
Version: 20160630.3.52c5ef6~dfsg1-1
Severity: wishlist

Hi.  I wanted to give ring a try on my Jessie laptop, and for that I
needed to build the package from unstable.  But it fail to build.  Here
is a patch to get it compiling, but unfortunately it isn't enough.  The
code fail to link.  Any clues to spare on how to get it to build in
Jessie?

The first patch I had to do was to disable some video4linux types that
are unknown in Jessie:

diff -ur ring-20160630.3.52c5ef6~dfsg1/daemon/src/media/video/v4l2/video_device_impl.cpp ring-20160630.3.52c5ef6~dfsg1-pere/daemon/src/media/video/v4l2/video_device_impl.cpp
--- ring-20160630.3.52c5ef6~dfsg1/daemon/src/media/video/v4l2/video_device_impl.cpp	2016-07-01 07:02:27.000000000 +0200
+++ ring-20160630.3.52c5ef6~dfsg1-pere/daemon/src/media/video/v4l2/video_device_impl.cpp	2016-07-07 18:56:08.910677353 +0200
@@ -183,7 +183,9 @@
     V4L2_PIX_FMT_MPEG,
     V4L2_PIX_FMT_H264,
     V4L2_PIX_FMT_H264_NO_SC,
+#ifdef V4L2_PIX_FMT_H264_MVC
     V4L2_PIX_FMT_H264_MVC,
+#endif
     V4L2_PIX_FMT_H263,
     V4L2_PIX_FMT_MPEG1,
     V4L2_PIX_FMT_MPEG2,
@@ -191,7 +193,9 @@
     V4L2_PIX_FMT_XVID,
     V4L2_PIX_FMT_VC1_ANNEX_G,
     V4L2_PIX_FMT_VC1_ANNEX_L,
+#ifdef V4L2_PIX_FMT_VP8
     V4L2_PIX_FMT_VP8,
+#endif
 
 #if 0
     /* RGB formats */
@@ -488,7 +492,9 @@
             return "mpeg1video";
         case V4L2_PIX_FMT_H264:
         case V4L2_PIX_FMT_H264_NO_SC:
+#ifdef V4L2_PIX_FMT_H264_MVC
         case V4L2_PIX_FMT_H264_MVC:
+#endif
             return "h264";
         case V4L2_PIX_FMT_H263:
             return "h263";
@@ -499,8 +505,10 @@
         case V4L2_PIX_FMT_VC1_ANNEX_G:
         case V4L2_PIX_FMT_VC1_ANNEX_L:
             return "vc1";
+#ifdef V4L2_PIX_FMT_VP8
         case V4L2_PIX_FMT_VP8:
             return "vp8";
+#endif
         default: // Most pixel formats do not need any codec
             return "";
     }

Next is a more problematic change, which causes the link failure.  The
problem is that Json::ValueIterator can not be used as a pointer to its
value, so p->asString() do not exist.  I tried rewriting it as below,
and this compiles but complain about missing copy constructor.

diff -ur ring-20160630.3.52c5ef6~dfsg1/daemon/src/im/message_engine.cpp ring-20160630.3.52c5ef6~dfsg1-pere/daemon/src/im/message_engine.cpp
--- ring-20160630.3.52c5ef6~dfsg1/daemon/src/im/message_engine.cpp	2016-07-07 19:38:23.000000000 +0200
+++ ring-20160630.3.52c5ef6~dfsg1-pere/daemon/src/im/message_engine.cpp	2016-07-07 19:23:00.895869530 +0200
@@ -195,8 +195,10 @@
             msg.last_op = clock::now() + (wall_time - std::chrono::system_clock::now());
             msg.retried = jmsg.get("retried", 0).asUInt();
             const auto& pl = jmsg["payload"];
-            for (auto p = pl.begin(); p != pl.end(); ++p)
-                msg.payloads[p.key().asString()] = p->asString();
+            for (auto pit = pl.begin(); pit != pl.end(); ++pit) {
+	        const Json::Value& p = *pit;
+                msg.payloads[pit.key().asString()] = p.asString();
+	    }
            messages_.emplace(token, std::move(msg));
         }
 
diff -ur ring-20160630.3.52c5ef6~dfsg1/daemon/src/archiver.cpp ring-20160630.3.52c5ef6~dfsg1-pere/daemon/src/archiver.cpp
--- ring-20160630.3.52c5ef6~dfsg1/daemon/src/archiver.cpp	2016-07-07 19:38:23.000000000 +0200
+++ ring-20160630.3.52c5ef6~dfsg1-pere/daemon/src/archiver.cpp	2016-07-07 19:27:02.165960906 +0200
@@ -198,21 +198,22 @@
     auto detailsMap = DRing::getAccountTemplate(value[DRing::Account::ConfProperties::TYPE].asString());
 
     for( Json::ValueIterator itr = value.begin() ; itr != value.end() ; itr++ ) {
-        if (itr->asString().empty())
+        const Json::Value& v = *itr;
+        if (v.asString().empty())
             continue;
         if (itr.key().asString().compare(DRing::Account::ConfProperties::TLS::CA_LIST_FILE) == 0) {
-            std::string fileContent(itr->asString());
+            std::string fileContent(v.asString());
             fileutils::saveFile(idPath_ + DIR_SEPARATOR_STR "ca.key", {fileContent.begin(), fileContent.end()}, 0600);
 
         } else if (itr.key().asString().compare(DRing::Account::ConfProperties::TLS::PRIVATE_KEY_FILE) == 0) {
-            std::string fileContent(itr->asString());
+            std::string fileContent(v.asString());
             fileutils::saveFile(idPath_ + DIR_SEPARATOR_STR "dht.key", {fileContent.begin(), fileContent.end()}, 0600);
 
         } else if (itr.key().asString().compare(DRing::Account::ConfProperties::TLS::CERTIFICATE_FILE) == 0) {
-            std::string fileContent(itr->asString());
+            std::string fileContent(v.asString());
             fileutils::saveFile(idPath_ + DIR_SEPARATOR_STR "dht.crt", {fileContent.begin(), fileContent.end()}, 0600);
         } else
-            detailsMap[itr.key().asString()] = itr->asString();
+            detailsMap[itr.key().asString()] = v.asString();
     }
 
     return detailsMap;

Is there a better rewrite available that work with older versions of the
json library?

-- 
Happy hacking
Petter Reinholdtsen



More information about the Pkg-voip-maintainers mailing list