nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 fetchFromGitHub,
4 rustPlatform,
5 fetchurl,
6}:
7
8rustPlatform.buildRustPackage (finalAttrs: {
9 pname = "flaca";
10 version = "3.5.3";
11
12 lockFile = fetchurl {
13 url = "https://github.com/Blobfolio/flaca/releases/download/v${finalAttrs.version}/Cargo.lock";
14 hash = "sha256-NNeq8qr+z0s98mgFYyUu9aNRqaAi2CZfQx0vQzSzOc8=";
15 };
16
17 src = fetchFromGitHub {
18 owner = "Blobfolio";
19 repo = "flaca";
20 tag = "v${finalAttrs.version}";
21 hash = "sha256-Fh+nWnAG87NL3scr/y2jCNqaeJtEwi4nCYTGwnmEsIQ=";
22 };
23
24 postUnpack = ''
25 ln -s ${finalAttrs.lockFile} ${finalAttrs.src.name}/Cargo.lock
26 '';
27
28 nativeBuildInputs = [ rustPlatform.bindgenHook ];
29
30 cargoHash = "sha256-yHkUsxJppHhIpgX7Vtrs8TCy43xaNpqoVkMZ0msr02k=";
31
32 meta = {
33 description = "CLI tool to losslessly compress JPEG and PNG images";
34 longDescription = "A CLI tool for x86-64 Linux machines that simplifies the task of maximally, losslessly compressing JPEG and PNG images for use in production web environments";
35 homepage = "https://github.com/Blobfolio/flaca";
36 changelog = "https://github.com/Blobfolio/flaca/releases/tag/v${finalAttrs.version}";
37 maintainers = with lib.maintainers; [ zzzsy ];
38 platforms = lib.platforms.linux;
39 license = lib.licenses.wtfpl;
40 mainProgram = "flaca";
41 };
42})