Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 0 additions & 119 deletions srcpkgs/MEGAcmd/patches/autotools.patch

This file was deleted.

100 changes: 100 additions & 0 deletions srcpkgs/MEGAcmd/patches/cmd_cmake.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 05dd8528..236859a8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,7 +1,6 @@
# CMakeLists.txt file to build the MEGAcmd
cmake_minimum_required(VERSION 3.16)

-find_package(Git REQUIRED)
execute_process(
COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/sdk
@@ -25,6 +24,7 @@ set(QT_CREATOR_SKIP_VCPKG_SETUP TRUE CACHE BOOL "")
## Modules location
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/build/cmake/modules) # Modules from MEGAcmd
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/sdk/cmake/modules) # Modules from MEGAsdk
+list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/sdk/cmake/modules/packages)

set(VCPKG_ROOT "${CMAKE_CURRENT_LIST_DIR}/../vcpkg" CACHE PATH "If set, it will build and use the VCPKG packages defined in the manifest file")

@@ -39,7 +39,7 @@ execute_process(
)
endif()

-if((NOT WIN32 OR BASH_VERSION_RESULT EQUAL 0) AND NOT EXISTS ${VCPKG_ROOT})
+if(VCPKG_ROOT AND (NOT WIN32 OR BASH_VERSION_RESULT EQUAL 0) AND NOT EXISTS ${VCPKG_ROOT})
message(STATUS "vcpkg will be cloned into ${VCPKG_ROOT}")
execute_process(
#TODO: have the same for windows ... or at least check if bash is available
@@ -346,6 +346,7 @@ if (ENABLE_MEGACMD_TESTS)
)
target_include_directories(mega-cmd-tests-integration PUBLIC ${ProjectDir}/src ${ProjectDir}/tests/common)
target_link_libraries(mega-cmd-tests-integration PUBLIC LMegacmdServer LMegacmdClient LMegacmdTestsCommon)
+ target_link_libraries(mega-cmd-tests-integration PUBLIC gmock gtest)
if(APPLE)
target_link_libraries(mega-cmd-tests-integration PRIVATE "-framework Security" )
endif()
@@ -363,6 +364,7 @@ if (ENABLE_MEGACMD_TESTS)
"${ProjectDir}/tests/unit/UtilsTests.cpp"
"${ProjectDir}/tests/unit/main.cpp"
)
+ target_link_libraries(mega-cmd-tests-unit PUBLIC gmock gtest)

if(APPLE)
target_link_libraries(mega-cmd-tests-unit PRIVATE "-framework Security" )
@@ -474,17 +476,19 @@ elseif(NOT WIN32)
DESTINATION "etc/sysctl.d"
)

- #Install vcpkg dynamic libraries in locations defined by GNUInstallDirs.
- if(CMAKE_BUILD_TYPE STREQUAL "Debug")
- SET(vcpkg_lib_folder "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib/")
- else()
- SET(vcpkg_lib_folder "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/")
- endif()
- install(DIRECTORY "${vcpkg_lib_folder}"
+ if(VCPKG_ROOT)
+ #Install vcpkg dynamic libraries in locations defined by GNUInstallDirs.
+ if(CMAKE_BUILD_TYPE STREQUAL "Debug")
+ SET(vcpkg_lib_folder "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib/")
+ else()
+ SET(vcpkg_lib_folder "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/")
+ endif()
+ install(DIRECTORY "${vcpkg_lib_folder}"
DESTINATION ${CMAKE_INSTALL_LIBDIR}
FILES_MATCHING
PATTERN "lib*.so*"
PATTERN "*dylib*" #macOS
PATTERN "manual-link" EXCLUDE
PATTERN "pkgconfig" EXCLUDE)
+ endif()
endif() #not WIN32
diff --git a/build/cmake/modules/megacmd_configuration.cmake b/build/cmake/modules/megacmd_configuration.cmake
index 74e25cf0..6162d8fa 100644
--- a/build/cmake/modules/megacmd_configuration.cmake
+++ b/build/cmake/modules/megacmd_configuration.cmake
@@ -24,5 +24,5 @@ else()
check_include_file(inttypes.h HAVE_INTTYPES_H)
check_include_file(dirent.h HAVE_DIRENT_H)
check_include_file(glob.h HAVE_GLOB_H)
- check_function_exists(aio_write, HAVE_AIO_RT)
+ check_function_exists(aio_write HAVE_AIO_RT)
endif()
diff --git a/build/cmake/modules/megacmd_libraries.cmake b/build/cmake/modules/megacmd_libraries.cmake
index aa3c2d73..ca561922 100644
--- a/build/cmake/modules/megacmd_libraries.cmake
+++ b/build/cmake/modules/megacmd_libraries.cmake
@@ -17,9 +17,11 @@ macro(load_megacmdserver_libraries)

if(USE_PCRE) #TODO: UNTESTED!
pkg_check_modules(pcre REQUIRED IMPORTED_TARGET libpcre)
- target_link_libraries(LMegacmdServer PRIVATE PkgConfig::pcre)
+ target_link_libraries(LMegacmdServer PRIVATE pcrecpp)
set(USE_PCRE 1)
endif()
+
+ target_link_libraries(LMegacmdServer PRIVATE z)
endif()

endmacro()
10 changes: 0 additions & 10 deletions srcpkgs/MEGAcmd/patches/megaexec.patch

This file was deleted.

12 changes: 12 additions & 0 deletions srcpkgs/MEGAcmd/patches/musl.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/src/updater/MegaUpdater.cpp b/src/updater/MegaUpdater.cpp
index 8c443f1b..99e325ff 100644
--- a/src/updater/MegaUpdater.cpp
+++ b/src/updater/MegaUpdater.cpp
@@ -11,6 +11,7 @@
#include <sys/file.h> //flock
#include <errno.h>
#include <unistd.h>
+#include <fcntl.h>
#endif

#include <iostream>
26 changes: 26 additions & 0 deletions srcpkgs/MEGAcmd/patches/sdk_cmake.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
diff --git a/cmake/modules/configuration.cmake b/cmake/modules/configuration.cmake
index ad102d9cc..8707f5c6c 100644
--- a/cmake/modules/configuration.cmake
+++ b/cmake/modules/configuration.cmake
@@ -38,7 +38,7 @@ else()
include(CheckSymbolExists)
check_symbol_exists(glob glob.h HAVE_GLOB_H)

- check_function_exists(aio_write, HAVE_AIO_RT)
+ check_function_exists(aio_write HAVE_AIO_RT)

# Check if our toolchain supports TI emulation mode.
try_compile(SUPPORTS_TI_EMULATION_MODE
diff --git a/cmake/modules/sdklib_libraries.cmake b/cmake/modules/sdklib_libraries.cmake
index e51fb8ede..ecc170198 100644
--- a/cmake/modules/sdklib_libraries.cmake
+++ b/cmake/modules/sdklib_libraries.cmake
@@ -109,7 +109,7 @@ macro(load_sdklib_libraries)

find_package(PkgConfig REQUIRED) # For libraries loaded using pkg-config

- pkg_check_modules(cryptopp REQUIRED IMPORTED_TARGET libcrypto++)
+ pkg_check_modules(cryptopp REQUIRED IMPORTED_TARGET libcryptopp)
target_link_libraries(SDKlib PUBLIC PkgConfig::cryptopp) # TODO: Private for SDK core

pkg_check_modules(sodium REQUIRED IMPORTED_TARGET libsodium)
1 change: 1 addition & 0 deletions srcpkgs/MEGAcmd/patches/sdk_cmake.patch.args
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-Np1 -d sdk
48 changes: 34 additions & 14 deletions srcpkgs/MEGAcmd/template
Original file line number Diff line number Diff line change
@@ -1,27 +1,47 @@
# Template file for 'MEGAcmd'
pkgname=MEGAcmd
version=1.4.0
revision=2
build_style=gnu-configure
hostmakedepends="autoconf-archive autogen gettext automake libtool pkg-config"
makedepends="MEGAsdk-devel readline-devel pcre-devel"
version=2.6.0
revision=1
_sdk_commit="8775533fe50255723c45ab8abf4e14285a592d51"
build_style=cmake
configure_args="-DCMAKE_INSTALL_PREFIX=/ -DVCPKG_ROOT='' -DFULL_REQS=OFF
-DUSE_FFMPEG=ON -DENABLE_MEDIA_FILE_METADATA=ON -DENABLE_MEGACMD_TESTS=ON"
hostmakedepends="pkg-config"
makedepends="libsodium-devel openssl-devel sqlite-devel libcurl-devel icu-devel
freeimage-devel libuv-devel readline-devel pcre-devel crypto++-devel
libmediainfo-devel ffmpeg-devel zlib-devel fuse3-devel gtest-devel"
short_desc="Command Line Interactive and Scriptable Application to access MEGA"
maintainer="Orphaned <orphan@voidlinux.org>"
maintainer="otolias <p17anto2@gmail.com>"
license="BSD-2-Clause, GPL-3.0-or-later"
homepage="https://github.com/meganz/MEGAcmd"
distfiles="https://github.com/meganz/MEGAcmd/archive/${version}_Linux.tar.gz"
checksum=2a3626a9f1d22303fe2123f984a8ecf3779d6d59ac6c67c1bf43c2423dcb832d
distfiles="https://github.com/meganz/MEGAcmd/archive/${version}_Linux.tar.gz
https://github.com/meganz/sdk/archive/${_sdk_commit}.tar.gz"
checksum="705777008ff0242b539a689aaab22eed27857eec50b2c5596d751db17bf374be
ae942f99b9ac55d0fcd108559fded7e3dba15075e358815065b3bd2d41ec3357"
replaces="megacmd>=0"
CXXFLAGS=-std=c++17

if [ "$CROSS_BUILD" ]; then
configure_args="--with-libtool-sysroot=${XBPS_CROSS_BASE}"
fi
CXXFLAGS="-fpermissive"

pre_configure() {
./autogen.sh
skip_extraction="${_sdk_commit}.tar.gz"

post_extract() {
vsrcextract -C sdk/ "${_sdk_commit}.tar.gz"
}

do_check() {
./build/mega-cmd-tests-unit
}

post_install() {
# Remove test binaries
rm ${DESTDIR}/usr/bin/mega-cmd-tests-integration
rm ${DESTDIR}/usr/bin/mega-cmd-tests-unit

vmkdir usr/lib/sysctl.d
mv ${DESTDIR}/etc/sysctl.d/99-megacmd-inotify-limit.conf ${DESTDIR}/usr/lib/sysctl.d/

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really like seeing packages drop in sysctls with high priority to change global limits. Waiting for feedback from other contributors.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file sets fs.inotify.max_user_watches to a high number and it is used by the sync functionality. I tested setting it low locally and it outputs the error "Unable to add filesystem watch" which, if you search online (with MEGAcmd), there are multiple issues related to this. Additionally, we can add a README.voidlinux that states how to increase it.


vcompletion ${DESTDIR}/etc/bash_completion.d/megacmd_completion.sh bash mega-cmd
rm -r ${DESTDIR}/etc/bash_completion.d

vlicense LICENSE
}
2 changes: 2 additions & 0 deletions srcpkgs/MEGAcmd/update
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
site=https://github.com/meganz/MEGAcmd/tags
pattern='\K[[\d.]+(?=_Linux)'
Loading