bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH]libtorrent: FTBFS on hurd-i386: error: 'IPV6_TCLASS' was not decl


From: haha wang
Subject: [PATCH]libtorrent: FTBFS on hurd-i386: error: 'IPV6_TCLASS' was not declared in this scope.
Date: Thu, 29 Apr 2021 20:48:55 +0900

Package: libtorrent
Severity: important
Version: 0.13.8-2
Tags: patch
User:hahwang@yandex.com
Usertags: hurd
X-Debbugs-CC: debian-hurd@lists.debian.org 
 
I decide to fix a broken package found at the recommended page https://people.debian.org/~sthibault/out_of_date2.txt named `libtorrent`.
 
      After I download the package source and try to build without any modifications under the debian hurd running in qemu (debian-hurd-20210219.img),  I got the following error.
 
      ```
   socket_fd.cc: In member function 'bool torrent::SocketFd::set_priority(torrent::SocketFd::priority_type)':
   socket_fd.cc:78:43: error: 'IPV6_TCLASS' was not declared in this scope; did you mean 'IPOPT_CLASS'?
    ```
 
   and it matches with what that page said.
 
  I also try to build that package under my debian desktop(Debian GNU/Linux bullseye/sid x86_64) and it got no errors. After a quick search, i have found linux defined the `IPV6_TCLASS` macro at `bits/in.h` as follows:
 
  ```
  #define IPV6_TCLASS 67
  ```
 
So that, I modify the `configure.ac` to add a conditional compilation when it detects the host operating system is hurd based, along with macro definition at the `Makefile.am` found at `src/net/`. The patch file is attached at the end of this email.
 
Hope for reviews!
 
Thank you!
 
---
hahawang
 
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,17 @@
AC_INIT(libtorrent, 0.13.8, sundell.software@gmail.com)
 
+AC_CANONICAL_HOST
+
+build_hurd=no
+
+case "${host_os}" in
+ gnu*)
+ build_hurd=yes
+ ;;
+esac
+
+AM_CONDITIONAL([BUILD_HURD], [test "$build_hurd" = "yes"])
+
LT_INIT([disable-static])
 
dnl Find a better way to do this
--- a/src/net/Makefile.am
+++ b/src/net/Makefile.am
@@ -26,3 +26,7 @@
throttle_node.h
 
AM_CPPFLAGS = -I$(srcdir) -I$(srcdir)/.. -I$(top_srcdir)
+
+if BUILD_HURD
+AM_CPPFLAGS += -DBUILD_HURD
+endif
--- a/src/net/socket_fd.cc
+++ b/src/net/socket_fd.cc
@@ -50,6 +50,10 @@
#include "torrent/exceptions.h"
#include "socket_fd.h"
 
+#ifdef BUILD_HURD
+#define IPV6_TCLASS 67
+#endif
+
namespace torrent {
 
inline void

reply via email to

[Prev in Thread] Current Thread [Next in Thread]