net-im/telegram

Matthias Apitz guru at unixarea.de
Sun Dec 4 19:40:14 UTC 2016


The current port net-im/telegram is version 1.3.x and a bit outdated. I
compiled from git the actual upstream version 1.4.1 and I have here
some diffs to get it compiled and run on FreeBSD current amd64.

HIH someone


	matthias


*** tg/tgl/tl-parser/portable_endian.h.orig	2016-12-02 21:16:58.559277000 +0100
--- tg/tgl/tl-parser/portable_endian.h	2016-12-02 21:17:15.223912000 +0100
***************
*** 53,58 ****
--- 53,59 ----
  
  #	include <sys/endian.h>
  
+ /*
  #	define be16toh(x) betoh16(x)
  #	define le16toh(x) letoh16(x)
  
***************
*** 61,66 ****
--- 62,68 ----
  
  #	define be64toh(x) betoh64(x)
  #	define le64toh(x) letoh64(x)
+ */
  
  #elif defined(__WINDOWS__)
  
*** tg/tgl/mtproto-utils.c.orig	2016-11-30 10:05:22.000000000 +0100
--- tg/tgl/mtproto-utils.c	2016-11-30 10:58:57.000000000 +0100
***************
*** 98,104 ****
    if (sizeof (unsigned long) == 8) {
      return TGLC_bn_get_word (b);
    } else if (sizeof (unsigned long long) == 8) {
!     assert (0); // As long as nobody ever uses this code, assume it is broken.
      unsigned long long tmp;
      /* Here be dragons, but it should be okay due to be64toh */
      TGLC_bn_bn2bin (b, (unsigned char *) &tmp);
--- 98,104 ----
    if (sizeof (unsigned long) == 8) {
      return TGLC_bn_get_word (b);
    } else if (sizeof (unsigned long long) == 8) {
!     // assert (0); // As long as nobody ever uses this code, assume it is broken.
      unsigned long long tmp;
      /* Here be dragons, but it should be okay due to be64toh */
      TGLC_bn_bn2bin (b, (unsigned char *) &tmp);
***************
*** 112,118 ****
    if (sizeof (unsigned long) == 8 || val < (1ll << 32)) {
      TGLC_bn_set_word (b, val);
    } else if (sizeof (unsigned long long) == 8) {
!     assert (0); // As long as nobody ever uses this code, assume it is broken.
      htobe64(val);
      /* Here be dragons, but it should be okay due to htobe64 */
      TGLC_bn_bin2bn ((unsigned char *) &val, 8, b);
--- 112,118 ----
    if (sizeof (unsigned long) == 8 || val < (1ll << 32)) {
      TGLC_bn_set_word (b, val);
    } else if (sizeof (unsigned long long) == 8) {
!     // assert (0); // As long as nobody ever uses this code, assume it is broken.
      htobe64(val);
      /* Here be dragons, but it should be okay due to htobe64 */
      TGLC_bn_bin2bn ((unsigned char *) &val, 8, b);
*** tg/Makefile.in.orig	2016-11-30 10:05:04.000000000 +0100
--- tg/Makefile.in	2016-12-03 09:27:23.065984000 +0100
***************
*** 6,12 ****
  DEFS=@DEFS@
  COMPILE_FLAGS=${CFLAGS} ${CPFLAGS} ${CPPFLAGS} ${DEFS} -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC
  EXTRA_LIBS=@LIBS@ @EXTRA_LIBS@ @OPENSSL_LIBS@
! LOCAL_LDFLAGS=-rdynamic -ggdb -levent ${EXTRA_LIBS} -ldl -lpthread -lutil
  LINK_FLAGS=${LDFLAGS} ${LOCAL_LDFLAGS}
  
  DEP=dep
--- 6,12 ----
  DEFS=@DEFS@
  COMPILE_FLAGS=${CFLAGS} ${CPFLAGS} ${CPPFLAGS} ${DEFS} -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC
  EXTRA_LIBS=@LIBS@ @EXTRA_LIBS@ @OPENSSL_LIBS@
! LOCAL_LDFLAGS=-rdynamic -ggdb -levent ${EXTRA_LIBS} -lpthread -lutil
  LINK_FLAGS=${LDFLAGS} ${LOCAL_LDFLAGS}
  
  DEP=dep


-- 
Matthias Apitz, ✉ guru at unixarea.de, ⌂ http://www.unixarea.de/  ☎ +49-176-38902045


More information about the freebsd-ports mailing list