1{
2 lib,
3 fetchFromGitHub,
4 rustPlatform,
5 openssl,
6 pkg-config,
7 git,
8 versionCheckHook,
9}:
10
11rustPlatform.buildRustPackage (finalAttrs: {
12 pname = "c2patool";
13 version = "0.19.1";
14
15 src = fetchFromGitHub {
16 owner = "contentauth";
17 repo = "c2pa-rs";
18 tag = "c2patool-v${finalAttrs.version}";
19 hash = "sha256-48qQwk0TwOmnzcG/cJCYkyPch+obj9pP/z8I1UFVCBE=";
20 };
21
22 cargoHash = "sha256-EA34It7DGGO8fTJuCCUkr4q/C6IgQ6d2dt4ZUfIv0OA=";
23
24 # use the non-vendored openssl
25 env.OPENSSL_NO_VENDOR = 1;
26
27 nativeBuildInputs = [
28 git
29 pkg-config
30 ];
31
32 buildInputs = [ openssl ];
33
34 # could not compile `c2pa` (lib test) due to 102 previous errors
35 doCheck = false;
36
37 checkFlags = [
38 # These tests rely on additional executables to be compiled to "target/debug/".
39 "--skip=test_fails_for_external_signer_failure"
40 "--skip=test_fails_for_external_signer_success_without_stdout"
41 "--skip=test_succeed_using_example_signer"
42
43 # These tests require network access to "http://timestamp.digicert.com", which is disabled in a sandboxed build.
44 "--skip=test_manifest_config"
45 "--skip=test_fails_for_not_found_external_signer"
46 "--skip=tool_embed_jpeg_report"
47 "--skip=tool_embed_jpeg_with_ingredients_report"
48 "--skip=tool_similar_extensions_match"
49 "--skip=tool_test_manifest_ingredient_json"
50 ];
51
52 doInstallCheck = true;
53
54 nativeInstallCheckInputs = [ versionCheckHook ];
55
56 meta = {
57 description = "Command line tool for working with C2PA manifests and media assets";
58 homepage = "https://github.com/contentauth/c2pa-rs/tree/main/cli";
59 license = with lib.licenses; [
60 asl20 # or
61 mit
62 ];
63 maintainers = with lib.maintainers; [ ok-nick ];
64 mainProgram = "c2patool";
65 };
66})