Actual recipe (#5023)

This commit is contained in:
extrowerk
2020-09-06 09:19:27 +02:00
committed by GitHub
parent e262b6c790
commit 4a780e2691
3 changed files with 254 additions and 213 deletions

View File

@@ -1,210 +0,0 @@
From d7f9dfcba425734b64e31fa5595edfbe5c496768 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Fri, 5 Sep 2014 14:57:25 +0000
Subject: haiku patch
diff --git a/libtransmission/platform-quota.c b/libtransmission/platform-quota.c
index e7d1f6d..ee11876 100644
--- a/libtransmission/platform-quota.c
+++ b/libtransmission/platform-quota.c
@@ -13,7 +13,7 @@
#include <event2/util.h> /* evutil_ascii_strcasecmp () */
-#ifndef _WIN32
+#if !defined(WIN32) && !defined(__HAIKU__)
#include <unistd.h> /* getuid() */
#include <sys/types.h> /* types needed by quota.h */
#if defined(__FreeBSD__) || defined(__OpenBSD__)
@@ -72,7 +72,7 @@
****
***/
-#ifndef _WIN32
+#if !defined(WIN32) && !defined(__HAIKU__)
static const char *
getdev (const char * path)
{
@@ -347,7 +347,7 @@ tr_getQuotaFreeSpace (const struct tr_device_info * info)
{
int64_t ret = -1;
-#ifndef _WIN32
+#if !defined(WIN32) && !defined(__HAIKU__)
if (info->fstype && !evutil_ascii_strcasecmp(info->fstype, "xfs"))
{
@@ -410,7 +410,7 @@ tr_device_info_create (const char * path)
info = tr_new0 (struct tr_device_info, 1);
info->path = tr_strdup (path);
-#ifndef _WIN32
+#if !defined(WIN32) && !defined(__HAIKU__)
info->device = tr_strdup (getblkdev (path));
info->fstype = tr_strdup (getfstype (path));
#endif
diff --git a/third-party/miniupnp/miniupnpc.c b/third-party/miniupnp/miniupnpc.c
index 82e7535..425d7fc 100644
--- a/third-party/miniupnp/miniupnpc.c
+++ b/third-party/miniupnp/miniupnpc.c
@@ -17,7 +17,7 @@
#endif
#endif
-#if !defined(__DragonFly__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && !defined(__APPLE__) && !defined(_WIN32) && !defined(__CYGWIN__) && !defined(__sun)
+#if !defined(__DragonFly__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && !defined(__APPLE__) && !defined(_WIN32) && !defined(__CYGWIN__) && !defined(__sun) && !defined(__HAIKU__)
#define HAS_IP_MREQN
#endif
diff --git a/third-party/miniupnp/portlistingparse.c b/third-party/miniupnp/portlistingparse.c
index 19e3054..2b1bce8 100644
--- a/third-party/miniupnp/portlistingparse.c
+++ b/third-party/miniupnp/portlistingparse.c
@@ -28,7 +28,7 @@ static const struct {
/* Helper function */
static UNSIGNED_INTEGER
-atoui(const char * p, int l)
+my_atoui(const char * p, int l)
{
UNSIGNED_INTEGER r = 0;
while(l > 0 && *p)
@@ -94,7 +94,7 @@ data(void * d, const char * data, int l)
pm->remoteHost[l] = '\0';
break;
case NewExternalPort:
- pm->externalPort = (unsigned short)atoui(data, l);
+ pm->externalPort = (unsigned short)my_atoui(data, l);
break;
case NewProtocol:
if(l > 3)
@@ -103,21 +103,21 @@ data(void * d, const char * data, int l)
pm->protocol[l] = '\0';
break;
case NewInternalPort:
- pm->internalPort = (unsigned short)atoui(data, l);
+ pm->internalPort = (unsigned short)my_atoui(data, l);
break;
case NewInternalClient:
memcpy(pm->internalClient, data, l);
pm->internalClient[l] = '\0';
break;
case NewEnabled:
- pm->enabled = (unsigned char)atoui(data, l);
+ pm->enabled = (unsigned char)my_atoui(data, l);
break;
case NewDescription:
memcpy(pm->description, data, l);
pm->description[l] = '\0';
break;
case NewLeaseTime:
- pm->leaseTime = atoui(data, l);
+ pm->leaseTime = my_atoui(data, l);
break;
default:
break;
--
2.26.0
From b3ab37a63b744fe01b3b54a7ef62dc418fbf4f82 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= <zmizsei@extrowerk.com>
Date: Sat, 4 Nov 2017 14:24:02 +0100
Subject: Haiku supporting patches
diff --git a/CMakeLists.txt b/CMakeLists.txt
index da28e31..ee6f98b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -522,6 +522,13 @@ if(HAVE_LIBM)
set(LIBM_LIBRARY m)
endif()
+if (HAIKU)
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DB_USE_POSITIVE_POSIX_ERRORS")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DB_USE_POSITIVE_POSIX_ERRORS")
+ set(NETWORKING_LIBRARY network)
+ set(HAIKU_SUPPORT_LIBRARY posix_error_mapper)
+endif()
+
if(ENABLE_TESTS)
enable_testing()
include(CTest)
diff --git a/libtransmission/CMakeLists.txt b/libtransmission/CMakeLists.txt
index b5230b9..0dbfbf6 100644
--- a/libtransmission/CMakeLists.txt
+++ b/libtransmission/CMakeLists.txt
@@ -248,6 +248,8 @@ target_link_libraries(${TR_NAME}
${B64_LIBRARIES}
${LIBINTL_LIBRARY}
${LIBM_LIBRARY}
+ ${NETWORKING_LIBRARY}
+ ${HAIKU_SUPPORT_LIBRARY}
)
if(ICONV_FOUND)
--
2.26.0
From 16b0d9c87710d01a7d7304a200a34d60bd643e48 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Wed, 10 Jun 2020 20:35:03 +1000
Subject: Use haiku int types for UTP library
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ee6f98b..cbe06e6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -339,7 +339,8 @@ if(ENABLE_UTP)
COMMAND "${CMAKE_COMMAND}" -E copy "${THIRD_PARTY_DIR}/utp_config.h" "<SOURCE_DIR>/utp_config.h"
COMMAND "${CMAKE_COMMAND}" -E chdir "<SOURCE_DIR>" patch -p1 --binary -i "${THIRD_PARTY_DIR}/utp-01-ticket-5002.patch"
COMMAND "${CMAKE_COMMAND}" -E chdir "<SOURCE_DIR>" patch -p1 --binary -i "${THIRD_PARTY_DIR}/utp-02-win32.patch"
- COMMAND "${CMAKE_COMMAND}" -E chdir "<SOURCE_DIR>" patch -p1 --binary -i "${THIRD_PARTY_DIR}/utp-03-msvc14.patch")
+ COMMAND "${CMAKE_COMMAND}" -E chdir "<SOURCE_DIR>" patch -p1 --binary -i "${THIRD_PARTY_DIR}/utp-03-msvc14.patch"
+ COMMAND "${CMAKE_COMMAND}" -E chdir "<SOURCE_DIR>" patch -p1 --binary -i "${THIRD_PARTY_DIR}/utp-04-haikutypes.patch")
endif()
tr_add_external_auto_library(B64 b64
diff --git a/third-party/utp-04-haikutypes.patch b/third-party/utp-04-haikutypes.patch
new file mode 100644
index 0000000..8350d02
--- /dev/null
+++ b/third-party/utp-04-haikutypes.patch
@@ -0,0 +1,30 @@
+diff --git a/utypes.h b/utypes.h
+--- a/utypes.h
++++ b/utypes.h
+@@ -3,6 +3,9 @@
+
+ // standard types
+ typedef unsigned char byte;
++#ifdef __HAIKU__
++#include <SupportDefs.h>
++#else
+ typedef unsigned char uint8;
+ typedef signed char int8;
+ typedef unsigned short uint16;
+@@ -18,6 +21,7 @@
+ typedef unsigned long long uint64;
+ typedef long long int64;
+ #endif
++#endif
+
+ /* compile-time assert */
+ #ifndef CASSERT
+@@ -35,7 +39,7 @@
+ typedef const char * cstr;
+ typedef char * str;
+
+-#ifndef __cplusplus
++#if !defined(__cplusplus) && !defined(__HAIKU__)
+ typedef uint8 bool;
+ #endif
+
--
2.26.0

View File

@@ -0,0 +1,242 @@
From cdf1c4e7997a54d7a6c8256bfbac7ff83f6d78a2 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Fri, 5 Sep 2014 14:57:25 +0000
Subject: haiku patch 1
diff --git a/libtransmission/platform-quota.c b/libtransmission/platform-quota.c
index 9f33b62..81c114b 100644
--- a/libtransmission/platform-quota.c
+++ b/libtransmission/platform-quota.c
@@ -12,7 +12,7 @@
#include <event2/util.h> /* evutil_ascii_strcasecmp() */
-#ifndef _WIN32
+#if !defined(WIN32) && !defined(__HAIKU__)
#include <unistd.h> /* getuid() */
#include <sys/types.h> /* types needed by quota.h */
#if defined(__FreeBSD__) || defined(__OpenBSD__)
@@ -73,7 +73,7 @@
****
***/
-#ifndef _WIN32
+#if !defined(WIN32) && !defined(__HAIKU__)
static char const* getdev(char const* path)
{
@@ -434,7 +434,7 @@ static int64_t tr_getQuotaFreeSpace(struct tr_device_info const* info)
{
int64_t ret = -1;
-#ifndef _WIN32
+#if !defined(WIN32) && !defined(__HAIKU__)
if (info->fstype != NULL && evutil_ascii_strcasecmp(info->fstype, "xfs") == 0)
{
@@ -500,7 +500,7 @@ struct tr_device_info* tr_device_info_create(char const* path)
info = tr_new0(struct tr_device_info, 1);
info->path = tr_strdup(path);
-#ifndef _WIN32
+#if !defined(WIN32) && !defined(__HAIKU__)
info->device = tr_strdup(getblkdev(path));
info->fstype = tr_strdup(getfstype(path));
#endif
--
2.27.0
From e714b45b9df1e3e4a9da5208232bc9df17a85eca Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Fri, 5 Sep 2014 14:57:25 +0000
Subject: No HAS_IP_MREQN for Haiku
diff --git a/third-party/miniupnpc/minissdpc.c b/third-party/miniupnpc/minissdpc.c
index 8eee2e9..c171bb6 100644
--- a/third-party/miniupnpc/minissdpc.c
+++ b/third-party/miniupnpc/minissdpc.c
@@ -67,7 +67,7 @@ struct sockaddr_un {
#define PRINT_SOCKET_ERROR(x) perror(x)
#endif
-#if !defined(__DragonFly__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && !defined(__APPLE__) && !defined(_WIN32) && !defined(__CYGWIN__) && !defined(__sun) && !defined(__GNU__) && !defined(__FreeBSD_kernel__)
+#if !defined(__DragonFly__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && !defined(__APPLE__) && !defined(_WIN32) && !defined(__CYGWIN__) && !defined(__sun) && !defined(__GNU__) && !defined(__FreeBSD_kernel__) && !defined(__HAIKU__)
#define HAS_IP_MREQN
#endif
--
2.27.0
From 98c7a6e59c102b20290a129a0f1c6c493578690d Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Fri, 5 Sep 2014 14:57:25 +0000
Subject: fix for atoui
diff --git a/third-party/miniupnpc/portlistingparse.c b/third-party/miniupnpc/portlistingparse.c
index 55859f2..c05f4a1 100644
--- a/third-party/miniupnpc/portlistingparse.c
+++ b/third-party/miniupnpc/portlistingparse.c
@@ -31,7 +31,7 @@ static const struct {
/* Helper function */
static UNSIGNED_INTEGER
-atoui(const char * p, int l)
+my_atoui(const char * p, int l)
{
UNSIGNED_INTEGER r = 0;
while(l > 0 && *p)
@@ -107,7 +107,7 @@ data(void * d, const char * data, int l)
pm->remoteHost[l] = '\0';
break;
case NewExternalPort:
- pm->externalPort = (unsigned short)atoui(data, l);
+ pm->externalPort = (unsigned short)my_atoui(data, l);
break;
case NewProtocol:
if(l > 3)
@@ -116,21 +116,21 @@ data(void * d, const char * data, int l)
pm->protocol[l] = '\0';
break;
case NewInternalPort:
- pm->internalPort = (unsigned short)atoui(data, l);
+ pm->internalPort = (unsigned short)my_atoui(data, l);
break;
case NewInternalClient:
memcpy(pm->internalClient, data, l);
pm->internalClient[l] = '\0';
break;
case NewEnabled:
- pm->enabled = (unsigned char)atoui(data, l);
+ pm->enabled = (unsigned char)my_atoui(data, l);
break;
case NewDescription:
memcpy(pm->description, data, l);
pm->description[l] = '\0';
break;
case NewLeaseTime:
- pm->leaseTime = atoui(data, l);
+ pm->leaseTime = my_atoui(data, l);
break;
default:
break;
--
2.27.0
From b28b5e7369dce6250038968cccecd14d957c77ca Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= <zmizsei@extrowerk.com>
Date: Sat, 4 Nov 2017 14:24:02 +0100
Subject: Haiku supporting patches
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 62bf87b..21ec195 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -508,6 +508,13 @@ if(HAVE_LIBM)
set(LIBM_LIBRARY m)
endif()
+if (HAIKU)
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DB_USE_POSITIVE_POSIX_ERRORS")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DB_USE_POSITIVE_POSIX_ERRORS")
+ set(NETWORKING_LIBRARY network)
+ set(HAIKU_SUPPORT_LIBRARY posix_error_mapper)
+endif()
+
set(TR_NETWORK_LIBRARIES)
if(WIN32)
list(APPEND TR_NETWORK_LIBRARIES iphlpapi ws2_32)
diff --git a/libtransmission/CMakeLists.txt b/libtransmission/CMakeLists.txt
index 672cd0e..9b7b8c7 100644
--- a/libtransmission/CMakeLists.txt
+++ b/libtransmission/CMakeLists.txt
@@ -274,6 +274,8 @@ target_link_libraries(${TR_NAME}
${LIBINTL_LIBRARY}
${LIBM_LIBRARY}
${TR_NETWORK_LIBRARIES}
+ ${NETWORKING_LIBRARY}
+ ${HAIKU_SUPPORT_LIBRARY}
)
if(ICONV_FOUND)
--
2.27.0
From dfe6d1a5315a54c1fc3b064b670842a13e19c956 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Wed, 10 Jun 2020 20:35:03 +1000
Subject: Use haiku int types for UTP library
diff --git a/third-party/libutp/utypes.h b/third-party/libutp/utypes.h
index 79bafcd..676a088 100644
--- a/third-party/libutp/utypes.h
+++ b/third-party/libutp/utypes.h
@@ -2,7 +2,10 @@
#define __UTYPES_H__
// standard types
-typedef unsigned char byte;
+typedef unsigned char byte;
+#ifdef __HAIKU__
+#include <SupportDefs.h>
+#else
typedef unsigned char uint8;
typedef signed char int8;
typedef unsigned short uint16;
@@ -17,6 +20,7 @@ typedef signed __int64 int64;
#else
typedef unsigned long long uint64;
typedef long long int64;
+#endif
#endif
/* compile-time assert */
@@ -35,7 +39,7 @@ CASSERT(8 == sizeof(int64), sizeof_int64_is_8)
typedef const char * cstr;
typedef char * str;
-#ifndef __cplusplus
+#if !defined(__cplusplus) && !defined(__HAIKU__)
typedef uint8 bool;
#endif
--
2.27.0
From da0110403f7bcf0b5338fedf5eaf7e2d83ac7483 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= <zmizsei@extrowerk.com>
Date: Mon, 29 Jun 2020 07:46:02 +0200
Subject: Test for libnetwork
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 21ec195..bb2fd1f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -519,12 +519,12 @@ set(TR_NETWORK_LIBRARIES)
if(WIN32)
list(APPEND TR_NETWORK_LIBRARIES iphlpapi ws2_32)
else()
- tr_select_library("c;socket;net" socket "" LIB)
+ tr_select_library("c;socket;net;network" socket "" LIB)
if(NOT LIB MATCHES "^(|c)$")
list(APPEND TR_NETWORK_LIBRARIES ${LIB})
endif()
- tr_select_library("c;nsl;bind" gethostbyname "" LIB)
+ tr_select_library("c;nsl;bind;network" gethostbyname "" LIB)
if(NOT LIB MATCHES "^(|c)$")
list(APPEND TR_NETWORK_LIBRARIES ${LIB})
endif()
--
2.27.0

View File

@@ -4,7 +4,7 @@ encryption, a web interface, peer exchange, magnet links, DHT, µTP, UPnP and \
NAT-PMP port forwarding, webseed support, watch directories, tracker editing, \
global and per-torrent speed limits, and more."
HOMEPAGE="https://www.transmissionbt.com/"
COPYRIGHT="2005-2016 Transmission authors and contributors
COPYRIGHT="2005-2020 Transmission authors and contributors
2015-2018 Sandro Tos
2001-2004 Unicode, Inc
2006-2010 JSON.org
@@ -21,7 +21,7 @@ LICENSE="Transmission
GNU GPL v2"
REVISION="7"
SOURCE_URI="https://github.com/transmission/transmission-releases/raw/master/transmission-$portVersion.tar.xz"
CHECKSUM_SHA256="35442cc849f91f8df982c3d0d479d650c6ca19310a994eccdaa79a4af3916b7d"
CHECKSUM_SHA256="9144652fe742f7f7dd6657716e378da60b751aaeda8bef8344b3eefc4db255f2"
PATCHES="transmission-$portVersion.patchset"
ADDITIONAL_FILES="
transmission.rdef.in
@@ -54,6 +54,7 @@ REQUIRES="
haiku$secondaryArchSuffix
lib:libcrypto$secondaryArchSuffix
lib:libcurl$secondaryArchSuffix
lib:libdht$secondaryArchSuffix
lib:libevent_2.1$secondaryArchSuffix
lib:libiconv$secondaryArchSuffix
lib:libintl$secondaryArchSuffix
@@ -71,6 +72,7 @@ REQUIRES="
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libcurl$secondaryArchSuffix
devel:libdht$secondaryArchSuffix
devel:libevent_2.1$secondaryArchSuffix
devel:libgettextlib$secondaryArchSuffix >= 0.14.1
devel:libiconv$secondaryArchSuffix
@@ -112,8 +114,15 @@ BUILD()
cd build
cmake \
$cmakeDirArgs \
-DUSE_QT5=ON \
-DENABLE_QT=ON \
-DENABLE_DAEMON=ON \
-DENABLE_CLI=ON \
-DUSE_SYSTEM_DHT=ON \
-DUSE_SYSTEM_EVENT2=ON \
-DUSE_SYSTEM_MINIUPNPC=ON \
-DUSE_SYSTEM_NATPMP=ON \
-DWITH_CRYPTO=openssl \
-DENABLE_TESTS=OFF \
..
make $jobArgs
}