polarity: latest-unstable-2025-01-08 -> latest-unstable-2025-01-23 (#376222)
[NixPkgs.git] / pkgs / by-name / co / cook-cli / package.nix
blob5990e30bfe5a5cb7082efef43d4ae313ab907d4a
2   lib,
3   stdenv,
4   fetchFromGitHub,
5   buildNpmPackage,
6   rustPlatform,
7   pkg-config,
8   openssl,
9   darwin,
11 rustPlatform.buildRustPackage rec {
12   pname = "cook-cli";
13   version = "0.7.1";
15   src = fetchFromGitHub {
16     owner = "cooklang";
17     repo = "cookcli";
18     rev = "v${version}";
19     hash = "sha256-3gLVsk6GCxOG24Md7E9fk28Vnc4kVDdwyZUD/GtSwFE=";
20   };
22   cargoHash = "sha256-6lnURuE1cgNAniHl5ozXo1W3cLYYje7er+ZhvZDKdVg=";
24   nativeBuildInputs = [
25     pkg-config
26     openssl
27   ];
29   buildInputs = [
30     openssl
31   ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.apple_sdk.frameworks.SystemConfiguration ];
33   postPatch = ''
34     rm -rf "ui/public"
35     ln -s ${passthru.ui} "ui/public"
36   '';
38   OPENSSL_NO_VENDOR = 1;
40   passthru.ui = buildNpmPackage {
41     name = "ui";
42     src = "${src}/ui";
43     npmDepsHash = "sha256-uMyOAYLVHhY4ytvEFvVzdoQ7ExzQ4sH+ZtDrEacu5bk=";
44     makeCacheWritable = true;
45     npmFlags = [ "--legacy-peer-deps" ];
46     installPhase = ''
47       runHook preInstall
48       mv public/ $out
49       runHook postInstall
50     '';
51   };
53   meta = with lib; {
54     changelog = "https://github.com/cooklang/cookcli/releases/tag/v${version}";
55     description = "Suite of tools to create shopping lists and maintain recipes";
56     homepage = "https://cooklang.org/";
57     license = [ licenses.mit ];
58     mainProgram = "cook";
59     maintainers = [ maintainers.emilioziniades ];
60     platforms = platforms.linux ++ platforms.darwin;
61   };