Github messages for voidlinux
 help / color / mirror / Atom feed
From: sirikid <sirikid@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] WIP: New package: libtd-1.6.6
Date: Thu, 23 Jul 2020 03:52:36 +0200	[thread overview]
Message-ID: <20200723015236.NdyLcQnccdosXBJaV5EBr-NP3HRbzow6s9BMFYTREQY@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-23645@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 388 bytes --]

There is an updated pull request by sirikid against master on the void-packages repository

https://github.com/sirikid/void-packages package/libtd
https://github.com/void-linux/void-packages/pull/23645

WIP: New package: libtd-1.6.6
Pretty ugly patch, but their cross compilation is super cursed.

A patch file from https://github.com/void-linux/void-packages/pull/23645.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-package/libtd-23645.patch --]
[-- Type: text/x-diff, Size: 10195 bytes --]

From 73d6552306a9841e8fe6bd62841360b90497ffc8 Mon Sep 17 00:00:00 2001
From: Ivan Sokolov <ivan-p-sokolov@ya.ru>
Date: Thu, 16 Jul 2020 14:03:58 +0300
Subject: [PATCH 1/3] New package: libtd-1.6.6

---
 common/shlibs                               |   1 +
 srcpkgs/libtd-devel                         |   1 +
 srcpkgs/libtd/patches/cross-compiling.patch | 122 ++++++++++++++++++++
 srcpkgs/libtd/template                      |  30 +++++
 4 files changed, 154 insertions(+)
 create mode 120000 srcpkgs/libtd-devel
 create mode 100644 srcpkgs/libtd/patches/cross-compiling.patch
 create mode 100644 srcpkgs/libtd/template

diff --git a/common/shlibs b/common/shlibs
index fdbd5558b7c..74dbc50c9a0 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3974,3 +3974,4 @@ libtexluajit.so.2 texlive-LuaTeX-20200406_1
 libtexlua53.so.5 texlive-LuaTeX-20200406_1
 libptexenc.so.1 texlive-20200406_1
 libdolphinvcs.so.5 dolphin-20.04.3_1
+libtdjson.so.1.6.6 libtd-1.6.6_1
diff --git a/srcpkgs/libtd-devel b/srcpkgs/libtd-devel
new file mode 120000
index 00000000000..ee1a79b2bad
--- /dev/null
+++ b/srcpkgs/libtd-devel
@@ -0,0 +1 @@
+libtd
\ No newline at end of file
diff --git a/srcpkgs/libtd/patches/cross-compiling.patch b/srcpkgs/libtd/patches/cross-compiling.patch
new file mode 100644
index 00000000000..b1273726cd2
--- /dev/null
+++ b/srcpkgs/libtd/patches/cross-compiling.patch
@@ -0,0 +1,122 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 46524dba..5b7265c4 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -261,7 +261,7 @@ add_subdirectory(tdutils)
+ 
+ add_subdirectory(td/generate)
+ 
+-if (NOT CMAKE_CROSSCOMPILING)
++if (YES)
+   add_custom_target(prepare_cross_compiling DEPENDS tl_generate_common tdmime_auto tl_generate_json)
+   if (TD_ENABLE_DOTNET)
+     add_custom_target(remove_cpp_documentation
+@@ -785,7 +785,7 @@ target_include_directories(tdcore PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURC
+ target_include_directories(tdcore SYSTEM PRIVATE ${OPENSSL_INCLUDE_DIR})
+ target_link_libraries(tdcore PUBLIC tdapi tdactor tdutils tdnet tddb PRIVATE ${OPENSSL_CRYPTO_LIBRARY} ${CMAKE_DL_LIBS} ${ZLIB_LIBRARIES})
+ 
+-if (NOT CMAKE_CROSSCOMPILING)
++if (YES)
+   add_dependencies(tdcore tl_generate_common)
+   if (TD_ENABLE_JNI)
+     add_dependencies(tdcore td_generate_java_api)
+@@ -813,7 +813,7 @@ if (TD_ENABLE_DOTNET)
+   target_include_directories(tddotnet PUBLIC
+     $<BUILD_INTERFACE:${TL_TD_AUTO_INCLUDE_DIR}>
+   )
+-  if (NOT CMAKE_CROSSCOMPILING)
++  if (YES)
+     add_dependencies(tddotnet generate_dotnet_api)
+   endif()
+ 
+@@ -833,7 +833,7 @@ target_include_directories(tdc PUBLIC
+   $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
+   $<BUILD_INTERFACE:${TL_TD_AUTO_INCLUDE_DIR}>)
+ target_link_libraries(tdc PRIVATE tdclient tdutils)
+-if (NOT CMAKE_CROSSCOMPILING)
++if (YES)
+   add_dependencies(tdc tl_generate_c)
+ endif()
+ 
+@@ -842,7 +842,7 @@ target_include_directories(tdjson_private PUBLIC
+   $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
+   $<BUILD_INTERFACE:${TL_TD_AUTO_INCLUDE_DIR}>)
+ target_link_libraries(tdjson_private PUBLIC tdclient tdutils)
+-if (NOT CMAKE_CROSSCOMPILING)
++if (YES)
+   add_dependencies(tdjson_private tl_generate_common tl_generate_json)
+   if (TD_ENABLE_DOTNET)
+     add_dependencies(tdjson_private remove_cpp_documentation)
+@@ -899,7 +899,7 @@ if (EMSCRIPTEN)
+ endif()
+ 
+ #EXECUTABLES
+-if (NOT CMAKE_CROSSCOMPILING)
++if (YES)
+   add_executable(tg_cli td/telegram/cli.cpp ${TL_TD_JSON_SOURCE})
+ 
+   if (NOT READLINE_FOUND)
+diff --git a/td/generate/CMakeLists.txt b/td/generate/CMakeLists.txt
+index adbaa266..49947baa 100644
+--- a/td/generate/CMakeLists.txt
++++ b/td/generate/CMakeLists.txt
+@@ -93,7 +93,7 @@ set(TL_GENERATE_JSON_SOURCE
+   tl_json_converter.h
+ )
+ 
+-if (NOT CMAKE_CROSSCOMPILING)
++if (YES)
+   find_program(PHP_EXECUTABLE php)
+ 
+   if ((CMAKE_SYSTEM_NAME MATCHES "FreeBSD") AND (CMAKE_SYSTEM_VERSION MATCHES "HBSD"))
+diff --git a/tddb/CMakeLists.txt b/tddb/CMakeLists.txt
+index 9a80b6cf..8cc9b0f5 100644
+--- a/tddb/CMakeLists.txt
++++ b/tddb/CMakeLists.txt
+@@ -48,7 +48,7 @@ add_library(tddb STATIC ${TDDB_SOURCE})
+ target_include_directories(tddb PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
+ target_link_libraries(tddb PUBLIC tdactor tdutils PRIVATE tdsqlite)
+ 
+-if (NOT CMAKE_CROSSCOMPILING)
++if (YES)
+   add_executable(binlog_dump td/db/binlog/binlog_dump.cpp)
+   target_link_libraries(binlog_dump PRIVATE tddb)
+ endif()
+diff --git a/tdutils/CMakeLists.txt b/tdutils/CMakeLists.txt
+index d57d93c8..89c1a21c 100644
+--- a/tdutils/CMakeLists.txt
++++ b/tdutils/CMakeLists.txt
+@@ -291,7 +291,7 @@ if (WIN32)
+   # target_link_libraries(tdutils PRIVATE ${WS2_32_LIBRARY} ${MSWSOCK_LIBRARY})
+   target_link_libraries(tdutils PRIVATE ws2_32 Mswsock Normaliz)
+ endif()
+-if (NOT CMAKE_CROSSCOMPILING)
++if (YES)
+   add_dependencies(tdutils tdmime_auto)
+ endif()
+ 
+@@ -329,6 +329,11 @@ if (CMAKE_HOST_SYSTEM_NAME MATCHES "NetBSD")
+   target_link_libraries(tdutils PUBLIC /usr/pkg/gcc5/i486--netbsdelf/lib/libatomic.so)
+ endif()
+ 
++# armv6l missing atomic operations without libatomic
++if (CMAKE_SYSTEM_PROCESSOR MATCHES "arm")
++  target_link_libraries(tdutils PUBLIC atomic)
++endif()
++
+ install(TARGETS tdutils EXPORT TdTargets
+   LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
+   ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
+diff --git a/tdutils/generate/CMakeLists.txt b/tdutils/generate/CMakeLists.txt
+index 9eca574a..72e51c9a 100644
+--- a/tdutils/generate/CMakeLists.txt
++++ b/tdutils/generate/CMakeLists.txt
+@@ -16,7 +16,7 @@ set(TDMIME_AUTO
+ 
+ add_custom_target(tdmime_auto DEPENDS ${TDMIME_SOURCE})
+ 
+-if (NOT CMAKE_CROSSCOMPILING)
++if (YES)
+   find_program(GPERF_EXECUTABLE gperf)
+   if (NOT GPERF_EXECUTABLE)
+     message(FATAL_ERROR "Could NOT find gperf. Add path to gperf executable to PATH environment variable or specify it manually using GPERF_EXECUTABLE option, i. e. 'cmake -DGPERF_EXECUTABLE:FILEPATH=\"<path to gperf executable>\"'.")
diff --git a/srcpkgs/libtd/template b/srcpkgs/libtd/template
new file mode 100644
index 00000000000..021ae4e8475
--- /dev/null
+++ b/srcpkgs/libtd/template
@@ -0,0 +1,30 @@
+# Template file for 'libtd'
+pkgname=libtd
+version=1.6.6
+revision=1
+_commit=c78fbe4bc5e31395e08f916816704e8051f27296
+wrksrc="td-${_commit}"
+build_style=cmake
+build_helper=qemu
+hostmakedepends="gperf"
+makedepends="libressl-devel zlib-devel"
+short_desc="Cross-platform library for building Telegram clients"
+maintainer="Ivan Sokolov <ivan-p-sokolov@ya.ru>"
+license="BSL-1.0"
+homepage="https://core.telegram.org/tdlib"
+distfiles="https://github.com/tdlib/td/archive/${_commit}.tar.gz"
+checksum=adb84e39d95c3cde8a70d47410acd91af3953fc6ebbca152a1afbef9c7135e1e
+patch_args="-Np1"
+
+case "$XBPS_TARGET_MACHINE" in
+	(arm*) makedepends+=" libatomic-devel" ;;
+esac
+
+libtd-devel_package() {
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove "usr/lib/*.a"
+		vmove usr/include
+		vmove usr/lib/cmake
+	}
+}

From dd5d8ee9b323424affba7b8369917015683476c2 Mon Sep 17 00:00:00 2001
From: Ivan Sokolov <ivan-p-sokolov@ya.ru>
Date: Thu, 23 Jul 2020 01:17:26 +0300
Subject: [PATCH 2/3] WIP: libtd: link libatomic using configure_args

---
 srcpkgs/libtd/patches/cross-compiling.patch | 14 +-------------
 srcpkgs/libtd/template                      |  7 ++++---
 2 files changed, 5 insertions(+), 16 deletions(-)
 mode change 100644 => 100755 srcpkgs/libtd/template

diff --git a/srcpkgs/libtd/patches/cross-compiling.patch b/srcpkgs/libtd/patches/cross-compiling.patch
index b1273726cd2..c2b2333fb85 100644
--- a/srcpkgs/libtd/patches/cross-compiling.patch
+++ b/srcpkgs/libtd/patches/cross-compiling.patch
@@ -83,7 +83,7 @@ index 9a80b6cf..8cc9b0f5 100644
    target_link_libraries(binlog_dump PRIVATE tddb)
  endif()
 diff --git a/tdutils/CMakeLists.txt b/tdutils/CMakeLists.txt
-index d57d93c8..89c1a21c 100644
+index d57d93c8..8150188c 100644
 --- a/tdutils/CMakeLists.txt
 +++ b/tdutils/CMakeLists.txt
 @@ -291,7 +291,7 @@ if (WIN32)
@@ -95,18 +95,6 @@ index d57d93c8..89c1a21c 100644
    add_dependencies(tdutils tdmime_auto)
  endif()
  
-@@ -329,6 +329,11 @@ if (CMAKE_HOST_SYSTEM_NAME MATCHES "NetBSD")
-   target_link_libraries(tdutils PUBLIC /usr/pkg/gcc5/i486--netbsdelf/lib/libatomic.so)
- endif()
- 
-+# armv6l missing atomic operations without libatomic
-+if (CMAKE_SYSTEM_PROCESSOR MATCHES "arm")
-+  target_link_libraries(tdutils PUBLIC atomic)
-+endif()
-+
- install(TARGETS tdutils EXPORT TdTargets
-   LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
-   ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
 diff --git a/tdutils/generate/CMakeLists.txt b/tdutils/generate/CMakeLists.txt
 index 9eca574a..72e51c9a 100644
 --- a/tdutils/generate/CMakeLists.txt
diff --git a/srcpkgs/libtd/template b/srcpkgs/libtd/template
old mode 100644
new mode 100755
index 021ae4e8475..e21f11ff933
--- a/srcpkgs/libtd/template
+++ b/srcpkgs/libtd/template
@@ -16,9 +16,10 @@ distfiles="https://github.com/tdlib/td/archive/${_commit}.tar.gz"
 checksum=adb84e39d95c3cde8a70d47410acd91af3953fc6ebbca152a1afbef9c7135e1e
 patch_args="-Np1"
 
-case "$XBPS_TARGET_MACHINE" in
-	(arm*) makedepends+=" libatomic-devel" ;;
-esac
+if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+	configure_args+=" -DCMAKE_CXX_STADARD_LIBRARIES=-latomic"
+	makedepends+=" libatomic-devel"
+fi
 
 libtd-devel_package() {
 	short_desc+=" - development files"

From 1b9c335a5d6d5f7d0a543252425651d9b6d4c38d Mon Sep 17 00:00:00 2001
From: Ivan Sokolov <ivan-p-sokolov@ya.ru>
Date: Thu, 23 Jul 2020 04:27:02 +0300
Subject: [PATCH 3/3] WIP: libtd: fix typo

---
 srcpkgs/libtd/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/libtd/template b/srcpkgs/libtd/template
index e21f11ff933..7d26c590943 100755
--- a/srcpkgs/libtd/template
+++ b/srcpkgs/libtd/template
@@ -17,7 +17,7 @@ checksum=adb84e39d95c3cde8a70d47410acd91af3953fc6ebbca152a1afbef9c7135e1e
 patch_args="-Np1"
 
 if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
-	configure_args+=" -DCMAKE_CXX_STADARD_LIBRARIES=-latomic"
+	configure_args+=" -DCMAKE_CXX_STANDARD_LIBRARIES=-latomic"
 	makedepends+=" libatomic-devel"
 fi
 

  parent reply	other threads:[~2020-07-23  1:52 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-19  5:32 [PR PATCH] New package: libtd-1.6.0 sirikid
2020-07-19  7:42 ` [PR PATCH] [Updated] " sirikid
2020-07-19  8:29 ` sirikid
2020-07-19 10:30 ` New package: libtd-1.6.6 sirikid
2020-07-22 13:37 ` [PR REVIEW] " sgn
2020-07-22 14:21 ` sirikid
2020-07-22 20:41 ` Chocimier
2020-07-22 22:18 ` [PR PATCH] [Updated] " sirikid
2020-07-23  1:27 ` [PR PATCH] [Updated] WIP: " sirikid
2020-07-23  1:29 ` [PR REVIEW] " sgn
2020-07-23  1:52 ` sirikid [this message]
2020-07-23  6:03 ` [PR REVIEW] " sirikid
2020-07-24 16:32 ` [PR PATCH] [Updated] " sirikid
2020-07-24 16:33 ` sirikid
2020-07-25  4:46 ` [PR REVIEW] " sgn
2020-07-25 22:14 ` sirikid
2020-07-25 22:16 ` sirikid
2020-07-26 16:13 ` sirikid
2020-07-27 12:37 ` [PR PATCH] [Updated] " sirikid
2020-07-27 12:41 ` sirikid
2020-07-27 13:26 ` [PR REVIEW] " ericonr
2020-07-27 13:26 ` ericonr
2020-07-27 13:26 ` ericonr
2020-07-27 15:09 ` [PR PATCH] [Updated] " sirikid
2020-07-27 15:09 ` sirikid
2020-07-30  3:44 ` [PR PATCH] [Updated] WIP: " sirikid
2020-07-31  9:02 ` [PR REVIEW] " sirikid
2020-08-04  3:30 ` sirikid
2020-08-14  2:11 ` [PR PATCH] [Updated] " sirikid
2020-08-14  3:01 ` [PR PATCH] [Updated] New package: libtd-1.6.7 sirikid
2020-08-14  3:53 ` sirikid
2020-08-17 10:49 ` Chocimier
2020-08-17 12:19 ` [PR PATCH] [Updated] " sirikid
2020-08-18 13:48 ` [PR PATCH] [Merged]: New package: libtd-1.6.0 Chocimier
2020-08-18 17:39 ` sirikid

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200723015236.NdyLcQnccdosXBJaV5EBr-NP3HRbzow6s9BMFYTREQY@z \
    --to=sirikid@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).