···
19
+
stdenv.mkDerivation (finalAttrs: {
20
+
pname = "protonmail-export";
23
+
src = fetchFromGitHub {
24
+
owner = "ProtonMail";
25
+
repo = "proton-mail-export";
26
+
tag = "v${finalAttrs.version}";
27
+
fetchSubmodules = true;
28
+
hash = "sha256-rpfTI3vcZlEK1TrxRMMHFKutwC/YqAZrZCFiUsfMafc=";
33
+
pname = "protonmail-export-go-modules";
34
+
inherit (finalAttrs) src version;
35
+
sourceRoot = "${finalAttrs.src.name}/go-lib";
36
+
vendorHash = "sha256-rKi3PNsYsZA+MLcLTVrVI3T2SUBZCiq9Zxtf+1SGArk=";
38
+
nativeBuildInputs = [ unzip ];
44
+
echo "" > vcpkg/scripts/buildsystems/vcpkg.cmake
46
+
substituteInPlace CMakeLists.txt \
47
+
--replace-fail 'include(clang_tidy)' ''' \
48
+
--replace-fail 'include(clang_format)' '''
50
+
substituteInPlace lib/CMakeLists.txt \
51
+
--replace-fail 'add_subdirectory(tests)' '''
53
+
substituteInPlace cli/bin/main.cpp --replace-fail \
54
+
'execPath = etcpp::getExecutableDir();' 'execPath = std::filesystem::u8path(std::getenv("HOME")) / ".config" / "protonmail-export";'
58
+
export GOCACHE=$TMPDIR/go-cache
59
+
export GOPATH=$TMPDIR/go
60
+
export GOPROXY=file://$goModules
63
+
nativeBuildInputs = [
79
+
so = "proton-mail-export${stdenv.hostPlatform.extensions.library}";
82
+
install -Dm644 $out/bin/${so} -t $out/lib
83
+
rm -f $out/bin/${so}
85
+
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
86
+
install_name_tool -change @loader_path/${so} \
88
+
$out/bin/proton-mail-export-cli
91
+
nativeInstallCheckInputs = [
94
+
versionCheckProgram = "${placeholder "out"}/bin/proton-mail-export-cli";
95
+
versionCheckProgramArg = "--version";
96
+
doInstallCheck = true;
99
+
description = "Export your Proton Mail emails as eml files";
100
+
homepage = "https://github.com/ProtonMail/proton-mail-export";
101
+
license = lib.licenses.gpl3Plus;
102
+
platforms = lib.platforms.unix;
103
+
maintainers = [ lib.maintainers.ryand56 ];
104
+
mainProgram = "proton-mail-export-cli";