pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

megacmd: build with libinotify



Module Name:	pkgsrc-wip
Committed By:	kikadf <kikadf.01%gmail.com@localhost>
Pushed By:	kikadf
Date:		Thu Feb 13 12:01:44 2025 +0100
Changeset:	a32de61177842ae1350ca5a64343475f3c149b80

Modified Files:
	megacmd/Makefile
	megacmd/distinfo
	megacmd/patches/patch-sdk_cmake_modules_sdklib__libraries.cmake
	megacmd/patches/patch-sdk_include_mega_posix_megafs.h
	megacmd/patches/patch-sdk_src_posix_fs.cpp
Removed Files:
	megacmd/patches/patch-sdk_cmake_config.h.in
	megacmd/patches/patch-sdk_include_megaapi__impl.h

Log Message:
megacmd: build with libinotify

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=a32de61177842ae1350ca5a64343475f3c149b80

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 megacmd/Makefile                                   |  1 +
 megacmd/distinfo                                   |  8 +--
 megacmd/patches/patch-sdk_cmake_config.h.in        | 16 -----
 ...patch-sdk_cmake_modules_sdklib__libraries.cmake |  7 ++-
 .../patches/patch-sdk_include_mega_posix_megafs.h  | 31 ++--------
 megacmd/patches/patch-sdk_include_megaapi__impl.h  | 18 ------
 megacmd/patches/patch-sdk_src_posix_fs.cpp         | 71 +++++++++++++---------
 7 files changed, 58 insertions(+), 94 deletions(-)

diffs:
diff --git a/megacmd/Makefile b/megacmd/Makefile
index 3b8fc4f6c2..f7308db726 100644
--- a/megacmd/Makefile
+++ b/megacmd/Makefile
@@ -42,6 +42,7 @@ 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/distinfo b/megacmd/distinfo
index 4d43e79fcd..1580a68ff5 100644
--- a/megacmd/distinfo
+++ b/megacmd/distinfo
@@ -8,12 +8,10 @@ SHA512 (meganz-sdk-v8.3.1.tar.gz) = d80c7aa7a27f9f56405cd0bb5943135d6fb3590196c1
 Size (meganz-sdk-v8.3.1.tar.gz) = 4061833 bytes
 SHA1 (patch-CMakeLists.txt) = f8936fbcd4200139fec6ada0bad5644ddb54145b
 SHA1 (patch-build_cmake_modules_megacmd__libraries.cmake) = afabd22177c0437fbe1d13fdf6601832bc60cd96
-SHA1 (patch-sdk_cmake_config.h.in) = dfa1062558bb18aed61386d776316b8fb0784c48
-SHA1 (patch-sdk_cmake_modules_sdklib__libraries.cmake) = 3ee9061b49f244c9f3d9d60d9f2a6dfd672db501
+SHA1 (patch-sdk_cmake_modules_sdklib__libraries.cmake) = 1472d2e08d49e4cee6ada129ac079d6d3a01c353
 SHA1 (patch-sdk_cmake_modules_sdklib__target.cmake) = 33f5b16dc561e37f076c60fa537a4c5b8d8c992e
-SHA1 (patch-sdk_include_mega_posix_megafs.h) = 8cfcec74e870f911bbeb14bc59e853dd182d22ea
-SHA1 (patch-sdk_include_megaapi__impl.h) = ca1aea337841ba6d5cba29379a9523fc0b050c4e
-SHA1 (patch-sdk_src_posix_fs.cpp) = 61dc1ef8bc3b3f4eeec5a1fb0d92fd3bcaee9282
+SHA1 (patch-sdk_include_mega_posix_megafs.h) = e91665f72e67564fe512f7bf0ecf521bf7b3c06a
+SHA1 (patch-sdk_src_posix_fs.cpp) = d1e404625d58522dfebcaeab2877d2a2e930039b
 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
deleted file mode 100644
index 770bf49b22..0000000000
--- a/megacmd/patches/patch-sdk_cmake_config.h.in
+++ /dev/null
@@ -1,16 +0,0 @@
-$NetBSD$
-
-* Not define USE_INOTIFY on BSDs
-
---- sdk/cmake/config.h.in.orig	2025-02-06 17:13:17.062965383 +0100
-+++ sdk/cmake/config.h.in
-@@ -229,7 +229,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 75b56e22c9..87724c11af 100644
--- a/megacmd/patches/patch-sdk_cmake_modules_sdklib__libraries.cmake
+++ b/megacmd/patches/patch-sdk_cmake_modules_sdklib__libraries.cmake
@@ -4,7 +4,7 @@ $NetBSD$
 
 --- sdk/cmake/modules/sdklib_libraries.cmake.orig	2025-01-24 13:56:57.000000000 +0100
 +++ sdk/cmake/modules/sdklib_libraries.cmake
-@@ -95,7 +95,7 @@ macro(load_sdklib_libraries)
+@@ -95,9 +95,12 @@ macro(load_sdklib_libraries)
  
          find_package(PkgConfig REQUIRED) # For libraries loaded using pkg-config
  
@@ -12,4 +12,9 @@ $NetBSD$
 +        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_posix_megafs.h b/megacmd/patches/patch-sdk_include_mega_posix_megafs.h
index 582389cd98..49edec5b37 100644
--- a/megacmd/patches/patch-sdk_include_mega_posix_megafs.h
+++ b/megacmd/patches/patch-sdk_include_mega_posix_megafs.h
@@ -1,35 +1,14 @@
 $NetBSD$
 
-* BSDFileSystemAccess for BSDs
-
---- sdk/include/mega/posix/megafs.h.orig	2025-01-24 13:56:57.000000000 +0100
+--- sdk/include/mega/posix/megafs.h.orig	2025-02-13 10:44:28.677854322 +0100
 +++ sdk/include/mega/posix/megafs.h
-@@ -192,8 +192,7 @@ private:
+@@ -192,7 +192,8 @@ private:
  
  };
  
 -#ifdef __linux__
--
-+#if defined(__linux__)
- #define FSACCESS_CLASS LinuxFileSystemAccess
- 
- class LinuxFileSystemAccess
-@@ -260,6 +259,18 @@ private:
++#if defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) || \
++    defined(__NetBSD__) || defined(__DragonFly__)
  
- #endif // ENABLE_SYNC
- 
-+#elif  defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__)
-+#define FSACCESS_CLASS BSDFileSystemAccess
-+
-+class BSDFileSystemAccess
-+  : public PosixFileSystemAccess
-+{
-+public:
-+    ~BSDFileSystemAccess();
-+    void addevents(Waiter* waiter, int flags) override;
-+    int checkevents(Waiter* waiter) override;
-+};
-+
- #endif // __linux__
+ #define FSACCESS_CLASS LinuxFileSystemAccess
  
- } // namespace
diff --git a/megacmd/patches/patch-sdk_include_megaapi__impl.h b/megacmd/patches/patch-sdk_include_megaapi__impl.h
deleted file mode 100644
index 28956872d5..0000000000
--- a/megacmd/patches/patch-sdk_include_megaapi__impl.h
+++ /dev/null
@@ -1,18 +0,0 @@
-$NetBSD$
-
-* Use BSDFileSystemAccess on BSDs
-
---- sdk/include/megaapi_impl.h.orig	2025-02-06 18:38:02.113595808 +0100
-+++ sdk/include/megaapi_impl.h
-@@ -90,8 +90,10 @@ class MegaSemaphore : public CppSemaphor
-     class MegaWaiter : public PosixWaiter {};
-     #ifdef __APPLE__
-     class MegaFileSystemAccess : public MacFileSystemAccess {};
--    #else
-+    #elif defined(__linux__)
-     class MegaFileSystemAccess : public LinuxFileSystemAccess {};
-+    #else
-+    class MegaFileSystemAccess : public BSDFileSystemAccess {};
-     #endif
- #endif
- 
diff --git a/megacmd/patches/patch-sdk_src_posix_fs.cpp b/megacmd/patches/patch-sdk_src_posix_fs.cpp
index a0b14dc30e..2c216e0132 100644
--- a/megacmd/patches/patch-sdk_src_posix_fs.cpp
+++ b/megacmd/patches/patch-sdk_src_posix_fs.cpp
@@ -26,32 +26,37 @@ $NetBSD: patch-sdk_src_posix_fs.cpp,v 1.2 2024/06/18 18:23:15 bsiegert Exp $
  #include <sys/types.h>
  #include <sys/utsname.h>
  #ifdef TARGET_OS_MAC
-@@ -876,6 +880,24 @@ bool PosixFileSystemAccess::cwd_static(L
-     return true;
+@@ -818,7 +822,8 @@ PosixFileSystemAccess::PosixFileSystemAc
+     defaultfolderpermissions = 0700;
  }
  
-+#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__)
-+
-+BSDFileSystemAccess::~BSDFileSystemAccess()
-+{
-+   // do nothing, as no notifiers
-+}
-+
-+void BSDFileSystemAccess::addevents([[maybe_unused]] Waiter* waiter, int /*flags*/)
-+{
-+   // do nothing
-+}
-+
-+int BSDFileSystemAccess::checkevents(Waiter*)
-+{
-+    return 0;
-+}
-+
-+#endif
+-#ifdef __linux__
++#if defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) || \
++    defined(__NetBSD__) || defined(__DragonFly__)
+ #ifdef ENABLE_SYNC
+ 
+ bool LinuxFileSystemAccess::initFilesystemNotificationSystem()
+@@ -878,7 +883,8 @@ bool PosixFileSystemAccess::cwd_static(L
+ 
  // wake up from filesystem updates
  
- #ifdef __linux__
-@@ -1802,8 +1824,8 @@ private:
+-#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
+@@ -1637,7 +1643,8 @@ void PosixFileSystemAccess::statsid(stri
+ }
+ 
+ #if defined(ENABLE_SYNC)
+-#if defined(__linux__)
++#if defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) || \
++    defined(__NetBSD__) || defined(__DragonFly__)
+ 
+ LinuxDirNotify::LinuxDirNotify(LinuxFileSystemAccess& owner,
+                                LocalNode& /*root*/,
+@@ -1802,8 +1809,8 @@ private:
      // open with O_NOATIME if possible
      int open(const char *path)
      {
@@ -62,7 +67,7 @@ $NetBSD: patch-sdk_src_posix_fs.cpp,v 1.2 2024/06/18 18:23:15 bsiegert Exp $
          int fd = ::open(path, O_RDONLY) ;
  #else
          // for sync in particular, try to open without setting access-time
-@@ -2062,6 +2084,7 @@ ScanResult PosixFileSystemAccess::direct
+@@ -2062,6 +2069,7 @@ ScanResult PosixFileSystemAccess::direct
  }
  
  #ifndef __APPLE__
@@ -70,7 +75,7 @@ $NetBSD: patch-sdk_src_posix_fs.cpp,v 1.2 2024/06/18 18:23:15 bsiegert Exp $
  
  // Determine which device contains the specified path.
  static std::string deviceOf(const std::string& database,
-@@ -2230,6 +2253,7 @@ static std::string deviceOf(const std::s
+@@ -2230,6 +2238,7 @@ static std::string deviceOf(const std::s
      // No database has a mapping for this path.
      return std::string();
  }
@@ -78,7 +83,7 @@ $NetBSD: patch-sdk_src_posix_fs.cpp,v 1.2 2024/06/18 18:23:15 bsiegert Exp $
  
  // Compute legacy filesystem fingerprint.
  static std::uint64_t fingerprintOf(const std::string& path)
-@@ -2258,6 +2282,7 @@ static std::uint64_t fingerprintOf(const
+@@ -2258,6 +2267,7 @@ static std::uint64_t fingerprintOf(const
      return ++value;
  }
  
@@ -86,7 +91,7 @@ $NetBSD: patch-sdk_src_posix_fs.cpp,v 1.2 2024/06/18 18:23:15 bsiegert Exp $
  // Determine the UUID of the specified device.
  static std::string uuidOf(const std::string& device)
  {
-@@ -2334,6 +2359,7 @@ static std::string uuidOf(const std::str
+@@ -2334,6 +2344,7 @@ static std::string uuidOf(const std::str
      // Couldn't determine device's UUID.
      return std::string();
  }
@@ -94,7 +99,7 @@ $NetBSD: patch-sdk_src_posix_fs.cpp,v 1.2 2024/06/18 18:23:15 bsiegert Exp $
  
  fsfp_t FileSystemAccess::fsFingerprint(const LocalPath& path) const
  {
-@@ -2344,6 +2370,7 @@ fsfp_t FileSystemAccess::fsFingerprint(c
+@@ -2344,6 +2355,7 @@ fsfp_t FileSystemAccess::fsFingerprint(c
      if (!fingerprint)
          return fsfp_t();
  
@@ -102,7 +107,7 @@ $NetBSD: patch-sdk_src_posix_fs.cpp,v 1.2 2024/06/18 18:23:15 bsiegert Exp $
      // What device contains the specified path?
      auto device = deviceOf(path.localpath);
  
-@@ -2360,6 +2387,7 @@ fsfp_t FileSystemAccess::fsFingerprint(c
+@@ -2360,6 +2372,7 @@ fsfp_t FileSystemAccess::fsFingerprint(c
  
      LOG_warn << "Falling back to legacy filesystem fingerprint: "
               << path;
@@ -110,3 +115,13 @@ $NetBSD: patch-sdk_src_posix_fs.cpp,v 1.2 2024/06/18 18:23:15 bsiegert Exp $
  
      // Couldn't determine filesystem UUID.
      return fsfp_t(fingerprint, std::string());
+@@ -2419,7 +2432,8 @@ unique_ptr<DirAccess>  PosixFileSystemAc
+     return unique_ptr<DirAccess>(new PosixDirAccess());
+ }
+ 
+-#ifdef __linux__
++#if defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) || \
++    defined(__NetBSD__) || defined(__DragonFly__)
+ #ifdef ENABLE_SYNC
+ DirNotify* LinuxFileSystemAccess::newdirnotify(LocalNode& root,
+     const LocalPath& rootPath,


Home | Main Index | Thread Index | Old Index