2023-04-12 12:48:02 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, libffi
|
|
|
|
, pkg-config
|
|
|
|
, wayland-protocols
|
|
|
|
, wayland
|
|
|
|
, xorg
|
|
|
|
, darwin
|
2023-07-15 17:15:38 +00:00
|
|
|
, nix-update-script
|
2023-08-04 22:07:22 +00:00
|
|
|
, alsa-lib
|
2023-04-12 12:48:02 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "clipboard-jh";
|
2023-08-04 22:07:22 +00:00
|
|
|
version = "0.8.1";
|
2023-04-12 12:48:02 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Slackadays";
|
|
|
|
repo = "clipboard";
|
|
|
|
rev = version;
|
2023-08-04 22:07:22 +00:00
|
|
|
hash = "sha256-UlN2BjtzS54oImAGM2Kl+j/LwfAyDXtbEMhsijBh/yg=";
|
2023-04-12 12:48:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
sed -i "/CMAKE_OSX_ARCHITECTURES/d" CMakeLists.txt
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
pkg-config
|
|
|
|
];
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
buildInputs = lib.optionals stdenv.isLinux [
|
2023-04-12 12:48:02 +00:00
|
|
|
libffi
|
|
|
|
wayland-protocols
|
|
|
|
wayland
|
|
|
|
xorg.libX11
|
2023-08-04 22:07:22 +00:00
|
|
|
alsa-lib
|
2023-04-12 12:48:02 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
darwin.apple_sdk.frameworks.AppKit
|
|
|
|
];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DCMAKE_BUILD_TYPE='MinSizeRel'"
|
|
|
|
"-Wno-dev"
|
|
|
|
"-DINSTALL_PREFIX=${placeholder "out"}"
|
|
|
|
];
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
postFixup = lib.optionalString stdenv.isLinux ''
|
|
|
|
patchelf $out/bin/cb --add-rpath $out/lib
|
|
|
|
'';
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
passthru.updateScript = nix-update-script { };
|
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Cut, copy, and paste anything, anywhere, all from the terminal";
|
|
|
|
homepage = "https://github.com/Slackadays/clipboard";
|
|
|
|
license = licenses.gpl3Only;
|
|
|
|
maintainers = with maintainers; [ dit7ya ];
|
2023-05-24 13:37:59 +00:00
|
|
|
platforms = platforms.all;
|
|
|
|
mainProgram = "cb";
|
2023-04-12 12:48:02 +00:00
|
|
|
};
|
|
|
|
}
|