nixpkgs/pkgs/by-name/cl/clipboard-jh/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

74 lines
1.4 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
cmake,
libffi,
pkg-config,
wayland-protocols,
wayland-scanner,
wayland,
xorg,
darwin,
nix-update-script,
alsa-lib,
openssl,
}:
stdenv.mkDerivation rec {
pname = "clipboard-jh";
version = "0.9.1";
src = fetchFromGitHub {
owner = "Slackadays";
repo = "clipboard";
rev = version;
hash = "sha256-1vGM9OUE7b4XVTm4Gf20CO80hjYAooeVt0REkY3xu3U=";
};
postPatch = ''
sed -i "/CMAKE_OSX_ARCHITECTURES/d" CMakeLists.txt
'';
nativeBuildInputs = [
cmake
pkg-config
wayland-scanner
];
buildInputs =
[ openssl ]
++ lib.optionals stdenv.hostPlatform.isLinux [
libffi
wayland-protocols
wayland
xorg.libX11
alsa-lib
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
darwin.apple_sdk.frameworks.AppKit
];
cmakeBuildType = "MinSizeRel";
cmakeFlags = [
"-Wno-dev"
"-DINSTALL_PREFIX=${placeholder "out"}"
];
postFixup = lib.optionalString stdenv.hostPlatform.isLinux ''
patchelf $out/bin/cb --add-rpath $out/lib
'';
passthru.updateScript = nix-update-script { };
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 ];
platforms = platforms.all;
mainProgram = "cb";
};
}