nixpkgs/pkgs/tools/misc/silicon/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

65 lines
1.5 KiB
Nix
Raw Normal View History

2020-01-30 00:28:24 +00:00
{ lib
, stdenv
, rustPlatform
, fetchFromGitHub
2023-05-09 20:04:53 +00:00
, fetchpatch
2021-01-17 03:51:22 +00:00
, pkg-config
2020-01-30 00:28:24 +00:00
, cmake
, expat
, freetype
, libxcb
, python3
2021-05-18 11:47:50 +00:00
, libiconv
2020-01-30 00:28:24 +00:00
, AppKit
, CoreText
, Security
2021-05-18 21:53:34 +00:00
, fira-code
2022-10-14 11:37:23 +00:00
, fontconfig
, harfbuzz
2020-01-30 00:28:24 +00:00
}:
rustPlatform.buildRustPackage rec {
pname = "silicon";
2022-10-14 11:37:23 +00:00
version = "0.5.1";
2020-01-30 00:28:24 +00:00
src = fetchFromGitHub {
owner = "Aloxaf";
repo = "silicon";
rev = "v${version}";
2022-10-14 11:37:23 +00:00
sha256 = "sha256-RuzaRJr1n21MbHSeHBt8CjEm5AwbDbvX9Nw5PeBTl+w=";
2020-01-30 00:28:24 +00:00
};
2023-05-09 20:04:53 +00:00
patches = [
# fix build on aarch64-linux, see https://github.com/Aloxaf/silicon/pull/210
(fetchpatch {
url = "https://github.com/Aloxaf/silicon/commit/f666c95d3dab85a81d60067e2f25d29ee8ab59e7.patch";
hash = "sha256-L6tF9ndC38yVn5ZNof1TMxSImmaqZ6bJ/NYhb0Ebji4=";
})
];
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
"pathfinder_simd-0.5.1" = "sha256-jQCa8TpGHLWvDT9kXWmlw51QtpKImPlWi082Va721cE=";
};
};
2020-01-30 00:28:24 +00:00
2023-05-26 22:00:20 +00:00
buildInputs = [ expat freetype fira-code fontconfig harfbuzz ]
2020-01-30 00:28:24 +00:00
++ lib.optionals stdenv.isLinux [ libxcb ]
2021-05-18 11:47:50 +00:00
++ lib.optionals stdenv.isDarwin [ libiconv AppKit CoreText Security ];
2020-01-30 00:28:24 +00:00
2023-05-26 22:00:20 +00:00
nativeBuildInputs = [ cmake pkg-config rustPlatform.bindgenHook ]
2020-01-30 00:28:24 +00:00
++ lib.optionals stdenv.isLinux [ python3 ];
2022-10-14 11:37:23 +00:00
preCheck = ''
export HOME=$TMPDIR
'';
2020-01-30 00:28:24 +00:00
meta = with lib; {
description = "Create beautiful image of your source code";
2020-01-30 00:28:24 +00:00
homepage = "https://github.com/Aloxaf/silicon";
license = with licenses; [ mit /* or */ asl20 ];
2022-10-14 18:57:35 +00:00
maintainers = with maintainers; [ evanjs _0x4A6F ];
2020-01-30 00:28:24 +00:00
};
}