21.05.2025 08:28, Klemens Nanni пишет:
> net/tdesktop needs net/tdlib with -TD_E2E_ONLY=ON, which is really a second
> port as it exposes private API;  it is a different library in the same repo.
> 
> FLAVORS / MULTI_PACKAGE is not an option due to conflicts and overall 
> complexity.
> 
> Splitting net/tdlib/tdlib and net/tdlib/tde2e with common Makefile.inc makes
> stuff easy, doesn't change anything for existing tdlib consumers 
> (net/py-telegram).
> 
> The diff adjusts the only consumer, attached is net/tdlib/ without CVS bits.

Here's the split as diff, in case that's easier to review.
Needs 'mkdir -p /usr/ports/net/tdlib/td{lib,e2e}/pkg/' before applying.

Also, distinfo now remains where it was, just like patches.

> 
> With that nothing changes in tdlib and tdesktop against tde2e just works.
> 
> Feedback? OK?
> 
> Index: net/py-telegram/Makefile
> ===================================================================
> RCS file: /cvs/ports/net/py-telegram/Makefile,v
> diff -u -p -r1.11 Makefile
> --- net/py-telegram/Makefile  29 Apr 2025 10:39:07 -0000      1.11
> +++ net/py-telegram/Makefile  21 May 2025 05:25:33 -0000
> @@ -4,7 +4,6 @@ MODPY_DISTV = 0.19.0
>  
>  DISTNAME =   python_telegram-${MODPY_DISTV}
>  PKGNAME =    py-telegram-${MODPY_DISTV}
> -REVISION =   0
>  
>  CATEGORIES = net
>  
> @@ -18,7 +17,7 @@ MODULES =   lang/python
>  MODPY_PI =   Yes
>  MODPY_PYBUILD =      setuptools_scm
>  
> -RUN_DEPENDS =        net/tdlib \
> +RUN_DEPENDS =        net/tdlib/tdlib>=1.8.49p0 \
>               textproc/py-telegram-text
>  
>  # remove bundled binaries


Index: Makefile
===================================================================
RCS file: /cvs/ports/net/tdlib/Makefile,v
diff -u -p -r1.10 Makefile
--- Makefile    20 May 2025 01:03:23 -0000      1.10
+++ Makefile    22 May 2025 01:52:07 -0000
@@ -1,42 +1,5 @@
-# See https://github.com/tdlib/td/issues/364
-NOT_FOR_ARCHS =        ${BE_ARCHS}
+SUBDIR =
+SUBDIR += tdlib
+SUBDIR += tde2e
 
-COMMENT =      cross-platform library for building Telegram clients
-
-# upstream tags stable versions, but various clients using this library
-# track "unofficial minor versions" which are only present as commit hashes.
-GH_ACCOUNT =   tdlib
-GH_PROJECT =   td
-GH_COMMIT =    51743dfd01dff6179e2d8f7095729caa4e2222e9
-DISTNAME =     tdlib-1.8.49
-
-SHARED_LIBS += tdjson  0.1
-CATEGORIES =   net
-
-HOMEPAGE =     https://core.telegram.org/tdlib
-
-MAINTAINER =   Omar Polo <o...@omarpolo.com>
-
-# Boost SL 1.0
-PERMIT_PACKAGE = Yes
-
-MODULES =      devel/cmake
-
-BUILD_DEPENDS =        devel/gperf
-
-# C++17
-COMPILER =     base-clang ports-gcc
-
-WANTLIB +=     ${COMPILER_LIBCXX} crypto m ssl z
-
-# if moving from GH_COMMIT to GH_TAGNAME, include the actual commit hash here
-COMMIT =       ${GH_COMMIT}
-SUBST_VARS +=  COMMIT
-
-CONFIGURE_ARGS =       -DCMAKE_DISABLE_FIND_PROGRAM_ccache=ON \
-                       -DCMAKE_DISABLE_FIND_PROGRAM_php=ON
-
-post-patch:
-       ${SUBST_CMD} ${WRKSRC}/CMake/GetGitRevisionDescription.cmake
-
-.include <bsd.port.mk>
+.include <bsd.port.subdir.mk>
Index: Makefile.inc
===================================================================
RCS file: Makefile.inc
diff -N Makefile.inc
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ Makefile.inc        22 May 2025 01:52:07 -0000
@@ -0,0 +1,38 @@
+# See https://github.com/tdlib/td/issues/364
+NOT_FOR_ARCHS =        ${BE_ARCHS}
+
+COMMENT =      cross-platform library for building Telegram clients
+
+# upstream tags stable versions, but various clients using this library
+# track "unofficial minor versions" which are only present as commit hashes.
+GH_ACCOUNT =   tdlib
+GH_PROJECT =   td
+GH_COMMIT =    51743dfd01dff6179e2d8f7095729caa4e2222e9
+DISTNAME =     tdlib-1.8.49
+
+CATEGORIES =   net
+
+HOMEPAGE =     https://core.telegram.org/tdlib
+
+MAINTAINER =   Omar Polo <o...@omarpolo.com>, \
+               Klemens Nanni <k...@openbsd.org>
+
+# Boost SL 1.0
+PERMIT_PACKAGE ?=      Yes
+
+MODULES =      devel/cmake
+
+BUILD_DEPENDS =        devel/gperf
+
+# C++17
+COMPILER =     base-clang ports-gcc
+
+# if moving from GH_COMMIT to GH_TAGNAME, include the actual commit hash here
+COMMIT =       ${GH_COMMIT}
+SUBST_VARS +=  COMMIT
+
+CHECKSUM_FILE =        ${.CURDIR}/../distinfo
+PATCHDIR =     ${.CURDIR}/../patches
+
+post-patch:
+       ${SUBST_CMD} ${WRKSRC}/CMake/GetGitRevisionDescription.cmake
Index: tde2e/Makefile
===================================================================
RCS file: tde2e/Makefile
diff -N tde2e/Makefile
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ tde2e/Makefile      22 May 2025 01:52:07 -0000
@@ -0,0 +1,13 @@
+COMMENT =              private headers and library for net/tdesktop
+PKGNAME =              ${DISTNAME:S/lib/e2e/}
+
+# tde2e is separate static library, but upstream keeps all in one repository.
+CONFIGURE_ARGS =       -DTD_E2E_ONLY=ON
+
+# @comment common files and ship only extra ones to avoid conflict handling.
+RUN_DEPENDS =          net/tdlib/tdlib>=1.8.49p0
+
+# Nothing else should use this.
+PERMIT_PACKAGE =       No
+
+.include <bsd.port.mk>
Index: tde2e/pkg/DESCR
===================================================================
RCS file: tde2e/pkg/DESCR
diff -N tde2e/pkg/DESCR
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ tde2e/pkg/DESCR     22 May 2025 01:52:07 -0000
@@ -0,0 +1 @@
+TDE2E is a private API of TDLib for exlusive use during builds of net/tdesktop.
Index: tde2e/pkg/PLIST
===================================================================
RCS file: tde2e/pkg/PLIST
diff -N tde2e/pkg/PLIST
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ tde2e/pkg/PLIST     22 May 2025 01:52:07 -0000
@@ -0,0 +1,13 @@
+include/td/e2e/
+include/td/e2e/e2e_api.h
+include/td/e2e/e2e_errors.h
+lib/cmake/tde2e/
+lib/cmake/tde2e/tde2eConfig.cmake
+lib/cmake/tde2e/tde2eConfigVersion.cmake
+lib/cmake/tde2e/tde2eStaticTargets${MODCMAKE_BUILD_SUFFIX}
+lib/cmake/tde2e/tde2eStaticTargets.cmake
+@comment shipped in tdlib
+@comment @static-lib lib/libtde2e.a
+@comment @static-lib lib/libtdutils.a
+@comment lib/pkgconfig/tde2e.pc
+@comment lib/pkgconfig/tdutils.pc
Index: tdlib/Makefile
===================================================================
RCS file: tdlib/Makefile
diff -N tdlib/Makefile
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ tdlib/Makefile      22 May 2025 01:52:07 -0000
@@ -0,0 +1,11 @@
+COMMENT =              cross-platform library for building Telegram clients
+REVISION =             0
+
+SHARED_LIBS =          tdjson  0.1
+
+WANTLIB =              ${COMPILER_LIBCXX} crypto m ssl z
+
+CONFIGURE_ARGS =       -DCMAKE_DISABLE_FIND_PROGRAM_ccache=ON \
+                       -DCMAKE_DISABLE_FIND_PROGRAM_php=ON
+
+.include <bsd.port.mk>
Index: tdlib/pkg/DESCR
===================================================================
RCS file: tdlib/pkg/DESCR
diff -N tdlib/pkg/DESCR
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ tdlib/pkg/DESCR     22 May 2025 01:52:07 -0000
@@ -0,0 +1,2 @@
+TDLib (Telegram Database library) is a cross-platform library for
+building Telegram clients.
Index: tdlib/pkg/PLIST
===================================================================
RCS file: tdlib/pkg/PLIST
diff -N tdlib/pkg/PLIST
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ tdlib/pkg/PLIST     22 May 2025 01:52:07 -0000
@@ -0,0 +1,47 @@
+@conflict tdlib-<1.8.49p0
+@pkgpath net/tdlib
+include/td/
+include/td/telegram/
+include/td/telegram/Client.h
+include/td/telegram/Log.h
+include/td/telegram/td_api.h
+include/td/telegram/td_api.hpp
+include/td/telegram/td_json_client.h
+include/td/telegram/td_log.h
+include/td/telegram/tdjson_export.h
+include/td/tl/
+include/td/tl/TlObject.h
+lib/cmake/
+lib/cmake/Td/
+lib/cmake/Td/TdConfig.cmake
+lib/cmake/Td/TdConfigVersion.cmake
+lib/cmake/Td/TdStaticTargets${MODCMAKE_BUILD_SUFFIX}
+lib/cmake/Td/TdStaticTargets.cmake
+lib/cmake/Td/TdTargets${MODCMAKE_BUILD_SUFFIX}
+lib/cmake/Td/TdTargets.cmake
+@static-lib lib/libtdactor.a
+@static-lib lib/libtdapi.a
+@static-lib lib/libtdclient.a
+@static-lib lib/libtdcore.a
+@static-lib lib/libtddb.a
+@static-lib lib/libtde2e.a
+@lib lib/libtdjson.so.${LIBtdjson_VERSION}
+@static-lib lib/libtdjson_private.a
+@static-lib lib/libtdjson_static.a
+@static-lib lib/libtdmtproto.a
+@static-lib lib/libtdnet.a
+@static-lib lib/libtdsqlite.a
+@static-lib lib/libtdutils.a
+lib/pkgconfig/tdactor.pc
+lib/pkgconfig/tdapi.pc
+lib/pkgconfig/tdclient.pc
+lib/pkgconfig/tdcore.pc
+lib/pkgconfig/tddb.pc
+lib/pkgconfig/tde2e.pc
+lib/pkgconfig/tdjson.pc
+lib/pkgconfig/tdjson_private.pc
+lib/pkgconfig/tdjson_static.pc
+lib/pkgconfig/tdmtproto.pc
+lib/pkgconfig/tdnet.pc
+lib/pkgconfig/tdsqlite.pc
+lib/pkgconfig/tdutils.pc


Reply via email to