-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
133 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
packages/proton-mail-export/0001-cmake-disable-vcpkg.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
From 724d6bb0b58be2c8aaffd4f6250f6c071f0aa9cb Mon Sep 17 00:00:00 2001 | ||
From: Leon Schumacher <[email protected]> | ||
Date: Sun, 29 Dec 2024 18:18:36 +0100 | ||
Subject: [PATCH 1/2] cmake: disable vcpkg | ||
|
||
--- | ||
CMakeLists.txt | 1 - | ||
1 file changed, 1 deletion(-) | ||
|
||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index 90b2343..2221314 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -1,5 +1,4 @@ | ||
include(cmake/mingw.cmake) | ||
-include(cmake/vcpkg_setup.cmake) | ||
cmake_minimum_required(VERSION 3.23) | ||
project(ExportTool CXX C) | ||
|
||
-- | ||
2.47.0 | ||
|
44 changes: 44 additions & 0 deletions
44
packages/proton-mail-export/0002-dont-write-logs-in-exe-directory.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
From 95ee52657a7b0861d6ce830a57089625f5ee33f1 Mon Sep 17 00:00:00 2001 | ||
From: Leon Schumacher <[email protected]> | ||
Date: Sun, 29 Dec 2024 19:28:56 +0100 | ||
Subject: [PATCH 2/2] dont write logs in exe directory | ||
|
||
--- | ||
cli/bin/main.cpp | 16 ++-------------- | ||
1 file changed, 2 insertions(+), 14 deletions(-) | ||
|
||
diff --git a/cli/bin/main.cpp b/cli/bin/main.cpp | ||
index 4bd6124..17d74f2 100644 | ||
--- a/cli/bin/main.cpp | ||
+++ b/cli/bin/main.cpp | ||
@@ -261,19 +261,7 @@ public: | ||
}; | ||
|
||
std::filesystem::path getOutputPath() { | ||
-#if !defined(__APPLE__) | ||
- std::filesystem::path execPath; | ||
- try { | ||
- execPath = etcpp::getExecutableDir(); | ||
- } catch (const std::exception& e) { | ||
- std::cerr << "Failed to get executable directory: " << e.what() << std::endl; | ||
- std::cerr << "Will user working directory instead" << std::endl; | ||
- } | ||
- | ||
- return execPath; | ||
-#else | ||
- return getMacOSDownloadsDir() / "proton-mail-export-cli"; | ||
-#endif | ||
+ return std::filesystem::current_path(); | ||
} | ||
|
||
|
||
@@ -745,4 +733,4 @@ int main(int argc, const char** argv) { | ||
return EXIT_FAILURE; | ||
} | ||
return EXIT_SUCCESS; | ||
-} | ||
\ No newline at end of file | ||
+} | ||
-- | ||
2.47.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
pkgs: | ||
let | ||
pname = "proton-mail-export"; | ||
version = "1.0.4"; | ||
|
||
src = pkgs.fetchFromGitHub { | ||
owner = "ProtonMail"; | ||
repo = pname; | ||
rev = "v${version}"; | ||
hash = "sha256-AbIS7iB5y1+vOfvAgw8mRNRTvuzdE2ML6Izod+BMCUE="; | ||
}; | ||
|
||
inherit (pkgs.buildGoModule { | ||
inherit pname version; | ||
src = "${src}/go-lib"; | ||
vendorHash = "sha256-0JsJO5E9Y7DpuZfWHFpqZKO8PPsCokl+YS5zs+zLt30="; | ||
}) goModules; | ||
in | ||
pkgs.stdenv.mkDerivation { | ||
inherit pname version src; | ||
|
||
patches = [ | ||
./0001-cmake-disable-vcpkg.patch | ||
./0002-dont-write-logs-in-exe-directory.patch | ||
]; | ||
|
||
nativeBuildInputs = with pkgs; [ | ||
clang-tools # clang-tidy | ||
cmake | ||
go | ||
ninja | ||
]; | ||
|
||
buildInputs = with pkgs; [ | ||
catch2_3 | ||
cxxopts | ||
fmt | ||
]; | ||
|
||
preConfigure = '' | ||
export GOCACHE=$TMPDIR/go-cache | ||
export GOPATH="$TMPDIR/go" | ||
export GOPROXY=off | ||
export GOSUMDB=off | ||
cp -r --reflink=auto "${goModules}" go-lib/vendor | ||
''; | ||
|
||
postInstall = '' | ||
cd $out | ||
# meta only includes version.json, which we don't need | ||
rm -rf $out/meta | ||
# for some reason, the library is installed into bin | ||
mkdir lib | ||
mv {bin,lib}/${pname}.so | ||
''; | ||
|
||
meta = { | ||
description = "Proton Mail Export allows you to export your emails as eml files"; | ||
homepage = "https://github.com/ProtonMail/proton-mail-export"; | ||
mainProgram = "${pname}-cli"; | ||
}; | ||
} |