diff --git a/pkgs/tools/misc/ffsend/Cargo.lock.patch b/pkgs/tools/misc/ffsend/Cargo.lock.patch new file mode 100644 index 000000000000..4d95a43cfb06 --- /dev/null +++ b/pkgs/tools/misc/ffsend/Cargo.lock.patch @@ -0,0 +1,13 @@ +diff --git a/Cargo.lock b/Cargo.lock +index 2344bfd..08413d8 100644 +--- a/Cargo.lock ++++ b/Cargo.lock +@@ -614,7 +614,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" + + [[package]] + name = "ffsend" +-version = "0.2.45" ++version = "0.2.46" + dependencies = [ + "chbs 0.0.8 (registry+https://github.com/rust-lang/crates.io-index)", + "chrono 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/pkgs/tools/misc/ffsend/default.nix b/pkgs/tools/misc/ffsend/default.nix index 9eaba1e8d3f6..2eca6de7b61e 100644 --- a/pkgs/tools/misc/ffsend/default.nix +++ b/pkgs/tools/misc/ffsend/default.nix @@ -1,34 +1,41 @@ { stdenv, fetchFromGitLab, rustPlatform, cmake, pkgconfig, openssl , darwin -, x11Support ? stdenv.isLinux +, x11Support ? stdenv.isLinux || stdenv.hostPlatform.isBSD , xclip ? null, xsel ? null , preferXsel ? false # if true and xsel is non-null, use it instead of xclip }: -assert (x11Support && stdenv.isLinux) -> xclip != null || xsel != null; +let + usesX11 = stdenv.isLinux || stdenv.hostPlatform.isBSD; +in + +assert (x11Support && usesX11) -> xclip != null || xsel != null; with rustPlatform; buildRustPackage rec { pname = "ffsend"; - version = "0.2.45"; + version = "0.2.46"; src = fetchFromGitLab { owner = "timvisee"; repo = "ffsend"; rev = "v${version}"; - sha256 = "1rhbpkalbbklbg0bq3xzbqw918ymqjnwhib3agzqd7477hrh1bkr"; + sha256 = "048kmhy8l2dy7v1b3vzlhcw5qhnz82y1wki6wpd2nz8siyd7dnpi"; }; - cargoSha256 = "1218v6rm1j545764g8rkpanwafjzk1c7f5x22v9ivzm0b6lmnm56"; + cargoSha256 = "09i44vpxbww972zyv393xxwk7wz26cnqzq4gi1mg4703h02jkpjk"; nativeBuildInputs = [ cmake pkgconfig ]; buildInputs = [ openssl ] ++ stdenv.lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ CoreFoundation CoreServices Security AppKit ]) ; - preBuild = stdenv.lib.optionalString (x11Support && stdenv.isLinux) ( + # Patch for v0.2.45 only + patches = [ ./Cargo.lock.patch ]; + + preBuild = stdenv.lib.optionalString (x11Support && usesX11) ( if preferXsel && xsel != null then '' export XSEL_PATH="${xsel}/bin/xsel" '' else '' @@ -54,6 +61,6 @@ buildRustPackage rec { homepage = https://gitlab.com/timvisee/ffsend; license = licenses.gpl3; maintainers = [ maintainers.lilyball ]; - platforms = platforms.darwin ++ platforms.linux; + platforms = platforms.unix; }; }