On Tue, January 17, 2023 21:47, Kirill Bychkov wrote: > On Tue, January 17, 2023 13:26, Stuart Henderson wrote: >> On 2023/01/17 08:48, Antoine Jacoutot wrote: >>> CMake Error at /usr/local/share/cmake/Modules/ExternalProject.cmake:2790 >>> (message): >>> error: could not find git for clone of libregraphapisrc-populate >> >> Or alternatively if you do have git installed, but use PORTS_PRIVSEP >> and the default "block .. user _pbuild" PF rules: >> [...] >> > Hi, > Sorry for the breakage. I'm working on fix by using multiple > distfiles and post-extract hooks. >
The patch below is a bit ugly because of meaningless distname,
but it fixes build without git installed and without fetching extra
distfile using cmake internals.
I'm aware of the next ways to make it nicer:
- host distfile myself with the correct name
- create a new port for this extra dependency
Maybe some magic dance with DISTNAME I can't imagine? (like done with GH_*
ports)
Index: Makefile
===================================================================
RCS file: /cvs/ports/net/owncloudclient/Makefile,v
retrieving revision 1.66
diff -u -p -u -p -r1.66 Makefile
--- Makefile 15 Jan 2023 10:39:35 -0000 1.66
+++ Makefile 17 Jan 2023 20:45:13 -0000
@@ -1,8 +1,11 @@
COMMENT = owncloud sync client
V = 3.0.0.9215
+GRAPHAPI_V = 0.13.2
DISTNAME = ownCloud-${V}
PKGNAME = owncloudclient-${V}
+DISTFILES += ownCloud-${V}.tar.xz \
+ v${GRAPHAPI_V}.tar.gz:0
SHARED_LIBS += owncloudsync 8.0
SHARED_LIBS += owncloud_csync 2.0
@@ -23,7 +26,7 @@ WANTLIB += ${COMPILER_LIBCXX} lib/inotif
MASTER_SITES
=
https://download.owncloud.com/desktop/ownCloud/stable/latest/source/ \
https://download.owncloud.com/desktop/ownCloud/stable/${V}/source/
-EXTRACT_SUFX = .tar.xz
+MASTER_SITES0 =
https://github.com/owncloud/libre-graph-api-cpp-qt-client/archive/refs/tags/
MODULES = devel/cmake x11/qt5
@@ -50,6 +53,9 @@ MODCMAKE_LDFLAGS = -L${LOCALBASE}/lib
NO_TEST = Yes
+post-extract:
+ cp -r ${WRKDIR}/libre-graph-api-cpp-qt-client-${GRAPHAPI_V} \
+ ${WRKDIST}/src/libsync/libregraphapisrc-src
post-install:
${INSTALL_DATA_DIR} ${PREFIX}/share/examples/ownCloud/
mv ${WRKINST}/etc/ownCloud ${PREFIX}/share/examples/
Index: distinfo
===================================================================
RCS file: /cvs/ports/net/owncloudclient/distinfo,v
retrieving revision 1.41
diff -u -p -u -p -r1.41 distinfo
--- distinfo 15 Jan 2023 10:39:35 -0000 1.41
+++ distinfo 17 Jan 2023 20:45:13 -0000
@@ -1,2 +1,4 @@
SHA256 (ownCloud-3.0.0.9215.tar.xz) =
cORFiyMEEX1jKQJIW4eqFAkwIFoXcP18PZTn6Zi1y+U=
+SHA256 (v0.13.2.tar.gz) = ON0gpGaNz9honvyqppmj3C1jiHh99MciB5kgEwGXIAU=
SIZE (ownCloud-3.0.0.9215.tar.xz) = 5676836
+SIZE (v0.13.2.tar.gz) = 79738
Index: patches/patch-src_libsync_CMakeLists_txt
===================================================================
RCS file: patches/patch-src_libsync_CMakeLists_txt
diff -N patches/patch-src_libsync_CMakeLists_txt
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_libsync_CMakeLists_txt 17 Jan 2023 20:45:13 -0000
@@ -0,0 +1,17 @@
+Index: src/libsync/CMakeLists.txt
+--- src/libsync/CMakeLists.txt.orig
++++ src/libsync/CMakeLists.txt
+@@ -3,12 +3,7 @@ set(LibreGraphAPIVersion v0.13.2)
+ find_package(LibreGraphAPI QUIET)
+ if (NOT TARGET OpenAPI::LibreGraphAPI)
+ message(WARNING "Failed to find system OpenAPI::LibreGraphAPI: fetching
${LibreGraphAPIVersion}")
+- include(FetchContent)
+- FetchContent_Populate(LibreGraphAPISrc
+- QUIET
+- GIT_REPOSITORY
https://github.com/owncloud/libre-graph-api-cpp-qt-client.git
+- GIT_TAG ${LibreGraphAPIVersion})
+- add_subdirectory(${libregraphapisrc_SOURCE_DIR}/client
${libregraphapisrc_BINARY_DIR}/client EXCLUDE_FROM_ALL)
++ add_subdirectory(libregraphapisrc-src/client libregraphapisrc-src/client
EXCLUDE_FROM_ALL)
+ endif()
+
+ set(libsync_SRCS
oc.diff
Description: Binary data
