-
-
Notifications
You must be signed in to change notification settings - Fork 13.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
signalbackup-tools: init at 20220107 #150763
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
...ations/networking/instant-messengers/signalbackup-tools/apple-sdk-missing-utimensat.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,34 @@ | ||
diff --git a/signalbackup/setfiletimestamp.cc b/signalbackup/setfiletimestamp.cc | ||
index f53a168..d2d1c5e 100644 | ||
--- a/signalbackup/setfiletimestamp.cc | ||
+++ b/signalbackup/setfiletimestamp.cc | ||
@@ -21,24 +21,23 @@ | ||
|
||
#if !defined(_WIN32) && !defined(__MINGW64__) | ||
|
||
-#include <fcntl.h> | ||
-#include <sys/stat.h> | ||
+#include <sys/time.h> | ||
|
||
bool SignalBackup::setFileTimeStamp(std::string const &file, long long int time_usec) const | ||
{ | ||
- struct timespec ntimes[] = | ||
+ struct timeval ntimes[] = | ||
{ | ||
{ // ntimes[0] = | ||
time_usec / 1000, // tv_sec, seconds | ||
- (time_usec % 1000) * 1000 // tv_usec, nanoseconds | ||
+ static_cast<int>(time_usec) // tv_usec, nanoseconds | ||
}, | ||
{ // ntimes[1] = | ||
time_usec / 1000, // tv_sec, seconds | ||
- (time_usec % 1000) * 1000 // tv_usec, nanoseconds | ||
+ static_cast<int>(time_usec) // tv_usec, nanoseconds | ||
} | ||
}; | ||
|
||
- return (utimensat(AT_FDCWD, file.c_str(), ntimes, 0) == 0); | ||
+ return (utimes(file.c_str(), ntimes) == 0); | ||
} | ||
|
||
#else // this is poorly tested, I don't have windows |
45 changes: 45 additions & 0 deletions
45
pkgs/applications/networking/instant-messengers/signalbackup-tools/default.nix
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,45 @@ | ||
{ lib, stdenv, fetchFromGitHub, openssl, sqlite }: | ||
|
||
stdenv.mkDerivation rec { | ||
pname = "signalbackup-tools"; | ||
version = "20220107"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "bepaald"; | ||
repo = pname; | ||
rev = version; | ||
sha256 = "sha256-sB8/xQgSORtwupcwSejKUhHoz04exdYS0ymefw9wXDQ="; | ||
}; | ||
|
||
# Remove when Apple SDK is >= 10.13 | ||
patches = lib.optional (stdenv.system == "x86_64-darwin") ./apple-sdk-missing-utimensat.patch; | ||
|
||
buildInputs = [ openssl sqlite ]; | ||
buildFlags = [ | ||
"-Wall" | ||
"-Wextra" | ||
"-Wshadow" | ||
"-Wold-style-cast" | ||
"-Woverloaded-virtual" | ||
"-pedantic" | ||
"-std=c++2a" | ||
"-O3" | ||
"-march=native" | ||
]; | ||
buildPhase = '' | ||
$CXX $buildFlags */*.cc *.cc -lcrypto -lsqlite3 -o signalbackup-tools | ||
''; | ||
|
||
installPhase = '' | ||
mkdir -p $out/bin | ||
cp signalbackup-tools $out/bin/ | ||
''; | ||
|
||
meta = with lib; { | ||
description = "Tool to work with Signal Backup files"; | ||
homepage = "https://github.com/bepaald/signalbackup-tools"; | ||
license = licenses.gpl3Only; | ||
maintainers = [ maintainers.malo ]; | ||
platforms = platforms.all; | ||
}; | ||
} |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it do harm to apply it also on aarch64-darwin? If not we can remove the conditional.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the package does build on
aarch64-darwin
with the patch applied. However I think it's probably best to only apply the patch when it's needed so that, if the patch has some unintended consequence, it doesn't affect platforms that don't require the patch in the first place.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but then it will most likely be forgotten when the package is updated from someone not being on x86_64-darwin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll do my best to keep and eye on it, and remove the patch once #101229 lands.