base16-schemes: unstable-2024-06-21 -> unstable-2024-11-12
[NixPkgs.git] / pkgs / by-name / sw / swim / package.nix
blob3fd19809f90734a335502c4e5f876b5c6b19a3cb
2   lib,
3   rustPlatform,
4   fetchFromGitLab,
5   pkg-config,
6   openssl,
7   spade,
8   stdenv,
9   darwin,
10   git,
13 rustPlatform.buildRustPackage rec {
14   pname = "swim";
15   version = "0.10.0";
17   src = fetchFromGitLab {
18     owner = "spade-lang";
19     repo = "swim";
20     rev = "v${version}";
21     hash = "sha256-Yuq1eYjxNnmrydzPyx+UWJJlZnC9sIEP3ZEleKmkzIM=";
22   };
24   cargoHash = "sha256-3WcMXvxlY0I7HnR+GTxHPAN+1HQsQLymjGFMM6q18xQ=";
26   preConfigure = ''
27     # de-vendor spade git submodule
28     test "$version" = "${spade.version}" || {
29       >&2 echo ERROR: version mismatch between spade and swim!
30       false
31     }
32     ln -s ${spade.src} runt/spade
33   '';
35   nativeBuildInputs = [ pkg-config ];
37   buildInputs =
38     [
39       openssl
40     ]
41     ++ lib.optionals stdenv.isDarwin [
42       darwin.apple_sdk.frameworks.Security
43       darwin.apple_sdk.frameworks.SystemConfiguration
44     ];
46   nativeCheckInputs = [ git ];
48   checkFlags = [
49     # tries to clone https://gitlab.com/spade-lang/swim-templates
50     "--skip=init::tests::git_init_then_swim_init_works"
51     "--skip=init::tests::init_board_correctly_sets_project_name"
52     "--skip=init::tests::init_board_creates_required_files"
53     "--skip=plugin::test::deny_changes_to_plugins::edits_are_denied"
54     "--skip=plugin::test::deny_changes_to_plugins::restores_work"
55   ];
57   passthru = {
58     inherit (spade) updateScript;
59   };
61   meta = {
62     description = "Build tool for spade";
63     homepage = "https://gitlab.com/spade-lang/swim";
64     changelog = "https://gitlab.com/spade-lang/swim/-/blob/${src.rev}/CHANGELOG.md";
65     license = lib.licenses.eupl12;
66     maintainers = with lib.maintainers; [ pbsds ];
67     mainProgram = "swim";
68   };