pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
megacmd: fix package
Module Name: pkgsrc-wip
Committed By: kikadf <kikadf.01%gmail.com@localhost>
Pushed By: kikadf
Date: Mon May 12 15:21:04 2025 +0200
Changeset: e6e1149f381de649003a1bdec25cbb2778c0de28
Modified Files:
megacmd/Makefile
megacmd/TODO
megacmd/distinfo
megacmd/patches/patch-sdk_cmake_modules_sdklib__libraries.cmake
megacmd/patches/patch-sdk_include_mega_filesystem.h
megacmd/patches/patch-sdk_include_mega_posix_megafs.h
megacmd/patches/patch-sdk_src_posix_fs.cpp
Added Files:
megacmd/patches/patch-sdk_cmake_config.h.in
megacmd/patches/patch-sdk_include_mega_sync.h
megacmd/patches/patch-sdk_include_megaapi__impl.h
Log Message:
megacmd: fix package
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=e6e1149f381de649003a1bdec25cbb2778c0de28
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
megacmd/Makefile | 3 +-
megacmd/TODO | 4 +-
megacmd/distinfo | 11 ++-
megacmd/patches/patch-sdk_cmake_config.h.in | 29 ++++++
...patch-sdk_cmake_modules_sdklib__libraries.cmake | 10 +--
.../patches/patch-sdk_include_mega_filesystem.h | 16 +++-
.../patches/patch-sdk_include_mega_posix_megafs.h | 38 ++++++--
megacmd/patches/patch-sdk_include_mega_sync.h | 22 +++++
megacmd/patches/patch-sdk_include_megaapi__impl.h | 15 ++++
megacmd/patches/patch-sdk_src_posix_fs.cpp | 100 ++++++++++++---------
10 files changed, 179 insertions(+), 69 deletions(-)
diffs:
diff --git a/megacmd/Makefile b/megacmd/Makefile
index 70d3e00a43..abfd55b152 100644
--- a/megacmd/Makefile
+++ b/megacmd/Makefile
@@ -23,7 +23,7 @@ FORCE_CXX_STD= c++17
USE_LIBTOOL= yes
USE_TOOLS+= pkg-config
REPLACE_SH= src/client/mega-*
-CXXFLAGS+= -DCRYPTOPP_DISABLE_ASM -ggdb
+CXXFLAGS+= -DCRYPTOPP_DISABLE_ASM
INSTALL_UNSTRIPPED= yes
CMAKE_CONFIGURE_ARGS+= -DCMAKE_BUILD_TYPE=Release
@@ -46,7 +46,6 @@ post-install:
.include "../../databases/sqlite3/buildlink3.mk"
.include "../../devel/cmake/build.mk"
.include "../../devel/pcre/buildlink3.mk"
-.include "../../devel/libinotify/buildlink3.mk"
.include "../../devel/libuv/buildlink3.mk"
.include "../../devel/readline/buildlink3.mk"
.include "../../net/libcares/buildlink3.mk"
diff --git a/megacmd/TODO b/megacmd/TODO
index b4fdfb1524..79625969c0 100644
--- a/megacmd/TODO
+++ b/megacmd/TODO
@@ -1,4 +1,4 @@
-Broken:
+Broken with libinotify-kqueue:
1) Not detect changes in subfolders with libinotify-kqueue.
2) With more sync job mega-cmd-server crashes:
Core was generated by `mega-cmd-server'.
@@ -28,3 +28,5 @@ Program terminated with signal SIGABRT, Aborted.
#15 0x0000000000200000 in ?? ()
#16 0x0000000000000000 in ?? ()
+Workaround:
+1) periodic scan instead of filesystem notification
diff --git a/megacmd/distinfo b/megacmd/distinfo
index 31e2474779..c69adc4a2d 100644
--- a/megacmd/distinfo
+++ b/megacmd/distinfo
@@ -8,12 +8,15 @@ SHA512 (meganz-sdk-v9.1.1.tar.gz) = bb39b0c5d35caeeed70f373fc9b94dd19b995931d4ba
Size (meganz-sdk-v9.1.1.tar.gz) = 4151889 bytes
SHA1 (patch-CMakeLists.txt) = f8936fbcd4200139fec6ada0bad5644ddb54145b
SHA1 (patch-build_cmake_modules_megacmd__libraries.cmake) = afabd22177c0437fbe1d13fdf6601832bc60cd96
-SHA1 (patch-sdk_cmake_modules_sdklib__libraries.cmake) = 67c919b57515659075ea43e26e349d9a94180a8c
+SHA1 (patch-sdk_cmake_config.h.in) = 4cc3eab8be8c11571f4aab834690749335c764ec
+SHA1 (patch-sdk_cmake_modules_sdklib__libraries.cmake) = 65125e82d0921571a9ba44cfbbb816776a8fc987
SHA1 (patch-sdk_cmake_modules_sdklib__target.cmake) = 33f5b16dc561e37f076c60fa537a4c5b8d8c992e
-SHA1 (patch-sdk_include_mega_filesystem.h) = 287ac85c9ac80a96b49269983ff67c5ee5cb4a11
-SHA1 (patch-sdk_include_mega_posix_megafs.h) = b266e3a568925df3227387e16e1cb9f6670d9b4a
+SHA1 (patch-sdk_include_mega_filesystem.h) = 827dd8098b72ddc397790c60b1a21163a5df45a5
+SHA1 (patch-sdk_include_mega_posix_megafs.h) = a87e49a8a9d387f5325bf41df3fbd27ecd453b02
+SHA1 (patch-sdk_include_mega_sync.h) = 7b73c2619a5fbf33a4df012164876cc4dccfdb84
+SHA1 (patch-sdk_include_megaapi__impl.h) = cd5cd30d989d11d58d0030ebb7a34b3b0963d6fb
SHA1 (patch-sdk_src_filesystem.cpp) = 3890ea10a66cd2a99925af57b0a3558c617cd6e3
-SHA1 (patch-sdk_src_posix_fs.cpp) = e537a61f9c97408d2192b7d602329d2b6ac8fb1d
+SHA1 (patch-sdk_src_posix_fs.cpp) = b8516bc9291c79e3f3903491cd19eac506413637
SHA1 (patch-src_megacmdcommonutils.cpp) = 6128e295e1a816ad4d7ea1ec59fa963391eb3bfb
SHA1 (patch-src_megacmdcommonutils.h) = 194d991a02e8e48c9c31c60384549c276e4ee735
SHA1 (patch-src_megacmdshell_megacmdshellcommunications.cpp) = ff794d128ffa6e0626296a504b22f391e0fc923b
diff --git a/megacmd/patches/patch-sdk_cmake_config.h.in b/megacmd/patches/patch-sdk_cmake_config.h.in
new file mode 100644
index 0000000000..8cbefacb4f
--- /dev/null
+++ b/megacmd/patches/patch-sdk_cmake_config.h.in
@@ -0,0 +1,29 @@
+$NetBSD$
+
+* Use periodic scan instead of filesystem notification on BSDs
+
+--- sdk/cmake/config.h.in.orig 2025-05-12 14:43:30.633759167 +0200
++++ sdk/cmake/config.h.in
+@@ -10,6 +10,12 @@
+ #cmakedefine ENABLE_SYNC 1
+ #endif
+
++/* Define to use periodic scan instead of filesystem notification */
++#if (defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__)) && \
++ defined(ENABLE_SYNC)
++#define USE_PERIODIC
++#endif
++
+ #ifndef ENABLE_LOG_PERFORMANCE
+ #cmakedefine ENABLE_LOG_PERFORMANCE 1
+ #endif
+@@ -226,7 +232,8 @@
+ #define USE_DB 0
+
+ /* Use inotify API */
+-#if !defined(__APPLE__) && !defined(_WIN32)
++#if !defined(__APPLE__) && !defined(_WIN32) && !defined(__FreeBSD__) && !defined(__OpenBSD__) && \
++ !defined(__NetBSD__) && !defined(__DragonFly__)
+ #define USE_INOTIFY 1
+ #endif
+
diff --git a/megacmd/patches/patch-sdk_cmake_modules_sdklib__libraries.cmake b/megacmd/patches/patch-sdk_cmake_modules_sdklib__libraries.cmake
index 32d5a695ec..92726f8945 100644
--- a/megacmd/patches/patch-sdk_cmake_modules_sdklib__libraries.cmake
+++ b/megacmd/patches/patch-sdk_cmake_modules_sdklib__libraries.cmake
@@ -1,11 +1,10 @@
$NetBSD: patch-sdk_cmake_modules_sdklib__libraries.cmake,v 1.1 2025/02/15 07:40:13 wiz Exp $
* Fix to find libcrypto++
-* Add libinotify check
---- sdk/cmake/modules/sdklib_libraries.cmake.orig 2025-01-24 13:56:57.000000000 +0100
+--- sdk/cmake/modules/sdklib_libraries.cmake.orig 2025-04-02 09:16:59.000000000 +0200
+++ sdk/cmake/modules/sdklib_libraries.cmake
-@@ -95,9 +95,12 @@ macro(load_sdklib_libraries)
+@@ -91,7 +91,7 @@ macro(load_sdklib_libraries)
find_package(PkgConfig REQUIRED) # For libraries loaded using pkg-config
@@ -13,9 +12,4 @@ $NetBSD: patch-sdk_cmake_modules_sdklib__libraries.cmake,v 1.1 2025/02/15 07:40:
+ pkg_check_modules(cryptopp REQUIRED IMPORTED_TARGET libcryptopp)
target_link_libraries(SDKlib PUBLIC PkgConfig::cryptopp) # TODO: Private for SDK core
-+ pkg_check_modules(inotify REQUIRED IMPORTED_TARGET libinotify)
-+ target_link_libraries(SDKlib PRIVATE PkgConfig::inotify)
-+
pkg_check_modules(sodium REQUIRED IMPORTED_TARGET libsodium)
- target_link_libraries(SDKlib PRIVATE PkgConfig::sodium)
-
diff --git a/megacmd/patches/patch-sdk_include_mega_filesystem.h b/megacmd/patches/patch-sdk_include_mega_filesystem.h
index b15285f235..61e8576d64 100644
--- a/megacmd/patches/patch-sdk_include_mega_filesystem.h
+++ b/megacmd/patches/patch-sdk_include_mega_filesystem.h
@@ -2,7 +2,7 @@ $NetBSD$
* Add BSD supported filesystems
---- sdk/include/mega/filesystem.h.orig 2025-04-17 16:17:57.087434545 +0200
+--- sdk/include/mega/filesystem.h.orig 2025-04-02 09:16:59.000000000 +0200
+++ sdk/include/mega/filesystem.h
@@ -51,6 +51,10 @@ enum FileSystemType
FS_SMB = 12,
@@ -15,3 +15,17 @@ $NetBSD$
};
typedef void (*asyncfscallback)(void *);
+@@ -233,11 +237,13 @@ class MEGA_API LocalPath
+ friend class ScopedSyncPathRestore;
+ friend class WinFileSystemAccess;
+ friend class PosixFileSystemAccess;
++ friend class FallbackFileSystemAccess;
+ friend struct WinDirAccess;
+ friend struct WinDirNotify;
+ friend class LinuxDirNotify;
+ friend class MacDirNotify;
+ friend class PosixDirNotify;
++ friend class FallbackDirNotify;
+ friend class WinFileAccess;
+ friend class PosixFileAccess;
+ friend void RemoveHiddenFileAttribute(LocalPath& path);
diff --git a/megacmd/patches/patch-sdk_include_mega_posix_megafs.h b/megacmd/patches/patch-sdk_include_mega_posix_megafs.h
index c60da85b3b..2108f409cc 100644
--- a/megacmd/patches/patch-sdk_include_mega_posix_megafs.h
+++ b/megacmd/patches/patch-sdk_include_mega_posix_megafs.h
@@ -1,16 +1,36 @@
$NetBSD: patch-sdk_include_mega_posix_megafs.h,v 1.2 2025/02/15 07:40:13 wiz Exp $
-* Use FSACCESS_CLASS of linux on BSDs
+* Add Fallback classes to avoid inotify
---- sdk/include/mega/posix/megafs.h.orig 2025-02-13 10:44:28.677854322 +0100
+--- sdk/include/mega/posix/megafs.h.orig 2025-04-02 09:16:59.000000000 +0200
+++ sdk/include/mega/posix/megafs.h
-@@ -192,7 +192,8 @@ private:
+@@ -260,6 +260,29 @@ private:
- };
+ #endif // ENABLE_SYNC
--#ifdef __linux__
-+#if defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) || \
-+ defined(__NetBSD__) || defined(__DragonFly__)
-
- #define FSACCESS_CLASS LinuxFileSystemAccess
++#elif defined(USE_PERIODIC)
++
++#define FSACCESS_CLASS FallbackFileSystemAccess
++
++class FallbackFileSystemAccess : public PosixFileSystemAccess
++{
++public:
++ DirNotify* newdirnotify(LocalNode& root,
++ const LocalPath& rootPath,
++ Waiter* waiter) override;
++
++ void addevents(Waiter*, int) override;
++
++ int checkevents(Waiter*) override;
++
++}; // class FallbackFileSystemAccess
++
++class FallbackDirNotify : public DirNotify
++{
++public:
++ FallbackDirNotify(const LocalPath& rootPath);
++};
++
+ #endif // __linux__
+ } // namespace
diff --git a/megacmd/patches/patch-sdk_include_mega_sync.h b/megacmd/patches/patch-sdk_include_mega_sync.h
new file mode 100644
index 0000000000..37e00f6e44
--- /dev/null
+++ b/megacmd/patches/patch-sdk_include_mega_sync.h
@@ -0,0 +1,22 @@
+$NetBSD$
+
+* Set ChangeDetectionMethod to USE_PERIODIC
+
+--- sdk/include/mega/sync.h.orig 2025-05-12 14:52:24.963962961 +0200
++++ sdk/include/mega/sync.h
+@@ -224,10 +224,14 @@ public:
+ const MegaClient& client) const;
+
+ // How should the engine detect filesystem changes?
++#ifdef USE_PERIODIC
++ ChangeDetectionMethod mChangeDetectionMethod = CDM_PERIODIC_SCANNING;
++#else
+ ChangeDetectionMethod mChangeDetectionMethod = CDM_NOTIFICATIONS;
++#endif
+
+ // Only meaningful when a sync is in CDM_PERIODIC_SCANNING mode.
+- unsigned mScanIntervalSec = 0;
++ unsigned mScanIntervalSec = 60;
+
+ // enum to string conversion
+ static const char* synctypename(const Type type);
diff --git a/megacmd/patches/patch-sdk_include_megaapi__impl.h b/megacmd/patches/patch-sdk_include_megaapi__impl.h
new file mode 100644
index 0000000000..c940764e72
--- /dev/null
+++ b/megacmd/patches/patch-sdk_include_megaapi__impl.h
@@ -0,0 +1,15 @@
+$NetBSD$
+
+* Use FallbackFileSystemAccess if USE_PERIODIC defined
+
+--- sdk/include/megaapi_impl.h.orig 2025-05-12 14:53:36.536485792 +0200
++++ sdk/include/megaapi_impl.h
+@@ -90,6 +90,8 @@ class MegaSemaphore : public CppSemaphor
+ class MegaWaiter : public PosixWaiter {};
+ #ifdef __APPLE__
+ class MegaFileSystemAccess : public MacFileSystemAccess {};
++ #elif defined(USE_PERIODIC)
++ class MegaFileSystemAccess : public FallbackFileSystemAccess {};
+ #else
+ class MegaFileSystemAccess : public LinuxFileSystemAccess {};
+ #endif
diff --git a/megacmd/patches/patch-sdk_src_posix_fs.cpp b/megacmd/patches/patch-sdk_src_posix_fs.cpp
index 8e2ba76c29..b5fc9cded4 100644
--- a/megacmd/patches/patch-sdk_src_posix_fs.cpp
+++ b/megacmd/patches/patch-sdk_src_posix_fs.cpp
@@ -3,7 +3,7 @@ $NetBSD: patch-sdk_src_posix_fs.cpp,v 1.3 2025/02/15 07:40:14 wiz Exp $
* Fix build on NetBSD, use statvfs
* Don't use mntent features on BSDs
* O_NOATIME not available on BSDs
-* BSDs use LinuxFileSystemAccess
+* Fallback funcs
--- sdk/src/posix/fs.cpp.orig 2025-04-02 09:16:59.000000000 +0200
+++ sdk/src/posix/fs.cpp
@@ -27,37 +27,43 @@ $NetBSD: patch-sdk_src_posix_fs.cpp,v 1.3 2025/02/15 07:40:14 wiz Exp $
#include <sys/types.h>
#include <sys/utsname.h>
#ifdef TARGET_OS_MAC
-@@ -821,7 +825,8 @@ PosixFileSystemAccess::PosixFileSystemAc
- defaultfolderpermissions = 0700;
+@@ -1018,6 +1022,18 @@ int LinuxFileSystemAccess::checkevents([
+ return result;
}
--#ifdef __linux__
-+#if defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) || \
-+ defined(__NetBSD__) || defined(__DragonFly__)
- #ifdef ENABLE_SYNC
-
- bool LinuxFileSystemAccess::initFilesystemNotificationSystem()
-@@ -881,7 +886,8 @@ bool PosixFileSystemAccess::cwd_static(L
-
- // wake up from filesystem updates
-
--#ifdef __linux__
-+#if defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) || \
-+ defined(__NetBSD__) || defined(__DragonFly__)
- void LinuxFileSystemAccess::addevents([[maybe_unused]] Waiter* waiter, int /*flags*/)
- {
- #ifdef ENABLE_SYNC
-@@ -1640,7 +1646,8 @@ void PosixFileSystemAccess::statsid(stri
++#elif defined(USE_PERIODIC)
++
++void FallbackFileSystemAccess::addevents([[maybe_unused]] Waiter* waiter, int /*flags*/)
++{
++ //Nothing
++}
++
++int FallbackFileSystemAccess::checkevents([[maybe_unused]] Waiter* waiter)
++{
++ return 0;
++}
++
+ #endif // __linux__
+
+
+@@ -1749,6 +1765,16 @@ void LinuxDirNotify::removeWatch(WatchMa
}
- #if defined(ENABLE_SYNC)
--#if defined(__linux__)
-+#if defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) || \
-+ defined(__NetBSD__) || defined(__DragonFly__)
-
- LinuxDirNotify::LinuxDirNotify(LinuxFileSystemAccess& owner,
- LocalNode& /*root*/,
-@@ -1805,8 +1812,8 @@ private:
+ #endif // USE_INOTIFY
++
++#elif defined(USE_PERIODIC)
++
++FallbackDirNotify::FallbackDirNotify(const LocalPath& rootPath):
++ DirNotify(rootPath)
++{
++ // Let the engine know everything's ok.
++ setFailed(0, "");
++}
++
+ #endif // __linux__
+
+ #endif //ENABLE_SYNC
+@@ -1805,8 +1831,8 @@ private:
// open with O_NOATIME if possible
int open(const char *path)
{
@@ -68,7 +74,7 @@ $NetBSD: patch-sdk_src_posix_fs.cpp,v 1.3 2025/02/15 07:40:14 wiz Exp $
int fd = ::open(path, O_RDONLY) ;
#else
// for sync in particular, try to open without setting access-time
-@@ -2065,6 +2072,7 @@ ScanResult PosixFileSystemAccess::direct
+@@ -2065,6 +2091,7 @@ ScanResult PosixFileSystemAccess::direct
}
#ifndef __APPLE__
@@ -76,7 +82,7 @@ $NetBSD: patch-sdk_src_posix_fs.cpp,v 1.3 2025/02/15 07:40:14 wiz Exp $
// Determine which device contains the specified path.
static std::string deviceOf(const std::string& database,
-@@ -2233,6 +2241,7 @@ static std::string deviceOf(const std::s
+@@ -2233,6 +2260,7 @@ static std::string deviceOf(const std::s
// No database has a mapping for this path.
return std::string();
}
@@ -84,7 +90,7 @@ $NetBSD: patch-sdk_src_posix_fs.cpp,v 1.3 2025/02/15 07:40:14 wiz Exp $
// Compute legacy filesystem fingerprint.
static std::uint64_t fingerprintOf(const std::string& path)
-@@ -2261,6 +2270,7 @@ static std::uint64_t fingerprintOf(const
+@@ -2261,6 +2289,7 @@ static std::uint64_t fingerprintOf(const
return ++value;
}
@@ -92,7 +98,7 @@ $NetBSD: patch-sdk_src_posix_fs.cpp,v 1.3 2025/02/15 07:40:14 wiz Exp $
// Determine the UUID of the specified device.
static std::string uuidOf(const std::string& device)
{
-@@ -2337,6 +2347,7 @@ static std::string uuidOf(const std::str
+@@ -2337,6 +2366,7 @@ static std::string uuidOf(const std::str
// Couldn't determine device's UUID.
return std::string();
}
@@ -100,7 +106,7 @@ $NetBSD: patch-sdk_src_posix_fs.cpp,v 1.3 2025/02/15 07:40:14 wiz Exp $
fsfp_t FileSystemAccess::fsFingerprint(const LocalPath& path) const
{
-@@ -2347,6 +2358,7 @@ fsfp_t FileSystemAccess::fsFingerprint(c
+@@ -2347,6 +2377,7 @@ fsfp_t FileSystemAccess::fsFingerprint(c
if (!fingerprint)
return fsfp_t();
@@ -108,7 +114,7 @@ $NetBSD: patch-sdk_src_posix_fs.cpp,v 1.3 2025/02/15 07:40:14 wiz Exp $
// What device contains the specified path?
auto device = deviceOf(path.localpath);
-@@ -2360,6 +2372,7 @@ fsfp_t FileSystemAccess::fsFingerprint(c
+@@ -2360,6 +2391,7 @@ fsfp_t FileSystemAccess::fsFingerprint(c
if (!uuid.empty())
return fsfp_t(fingerprint, std::move(uuid));
}
@@ -116,17 +122,23 @@ $NetBSD: patch-sdk_src_posix_fs.cpp,v 1.3 2025/02/15 07:40:14 wiz Exp $
// Couldn't determine filesystem UUID.
return fsfp_t(fingerprint, std::string());
-@@ -2443,7 +2456,8 @@ unique_ptr<DirAccess> PosixFileSystemAc
- #endif
+@@ -2452,6 +2484,15 @@ DirNotify* LinuxFileSystemAccess::newdir
+ return new LinuxDirNotify(*this, root, rootPath);
}
+ #endif
++
++#elif defined(USE_PERIODIC)
++DirNotify* FallbackFileSystemAccess::newdirnotify(LocalNode& root,
++ const LocalPath& rootPath,
++ Waiter*)
++{
++ return new FallbackDirNotify(rootPath);
++}
++
+ #endif
--#ifdef __linux__
-+#if defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) || \
-+ defined(__NetBSD__) || defined(__DragonFly__)
- #ifdef ENABLE_SYNC
- DirNotify* LinuxFileSystemAccess::newdirnotify(LocalNode& root,
- const LocalPath& rootPath,
-@@ -2526,18 +2540,26 @@ bool PosixFileSystemAccess::getlocalfsty
+ bool PosixFileSystemAccess::issyncsupported(const LocalPath& localpathArg, bool& isnetwork, SyncError& syncError, SyncWarning& syncWarning)
+@@ -2526,18 +2567,26 @@ bool PosixFileSystemAccess::getlocalfsty
}
#endif /* __linux__ || __ANDROID__ */
@@ -154,7 +166,7 @@ $NetBSD: patch-sdk_src_posix_fs.cpp,v 1.3 2025/02/15 07:40:14 wiz Exp $
}; /* filesystemTypes */
struct statfs statbuf;
-@@ -2555,7 +2577,7 @@ bool PosixFileSystemAccess::getlocalfsty
+@@ -2555,7 +2604,7 @@ bool PosixFileSystemAccess::getlocalfsty
type = FS_UNKNOWN;
return true;
}
Home |
Main Index |
Thread Index |
Old Index