2021-10-03 17:49:08 +00:00
|
|
|
{ lib
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
2022-12-10 22:18:20 +00:00
|
|
|
, fetchpatch
|
2021-10-03 17:49:08 +00:00
|
|
|
, robloxSupport ? true
|
|
|
|
, pkg-config
|
|
|
|
, openssl
|
|
|
|
, stdenv
|
2022-12-10 22:18:20 +00:00
|
|
|
, darwin
|
2021-10-03 17:49:08 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "selene";
|
2022-12-10 22:18:20 +00:00
|
|
|
version = "0.23.1";
|
2021-10-03 17:49:08 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "kampfkarren";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2022-12-10 22:18:20 +00:00
|
|
|
sha256 = "sha256-gD49OzhpO059wawA+PJc8SIYQ23965LF21zqIfj62Y4=";
|
2021-10-03 17:49:08 +00:00
|
|
|
};
|
|
|
|
|
2022-12-10 22:18:20 +00:00
|
|
|
cargoSha256 = "sha256-oekqM/Jvh0z6O6iJhSi7Ph5gsF5Fssr5ItKpmyozhPk=";
|
2021-10-03 17:49:08 +00:00
|
|
|
|
2022-12-10 22:18:20 +00:00
|
|
|
patches = [
|
|
|
|
# fix broken test
|
|
|
|
# https://github.com/kampfkarren/selene/pull/471
|
|
|
|
(fetchpatch {
|
|
|
|
name = "fix-test-roblox-incorrect-roact-usage.patch";
|
|
|
|
url = "https://github.com/kampfkarren/selene/commit/f4abf9f3fb639b372fe4ac47449f8a1e455c28a5.patch";
|
|
|
|
sha256 = "sha256-nk7HGygXXu91cqiRZBA/sLBlaJLkNg90C2NX8Kr1WGA=";
|
|
|
|
})
|
|
|
|
];
|
2021-10-03 17:49:08 +00:00
|
|
|
|
2022-12-10 22:18:20 +00:00
|
|
|
nativeBuildInputs = lib.optionals robloxSupport [
|
|
|
|
pkg-config
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = lib.optionals robloxSupport [
|
|
|
|
openssl
|
|
|
|
] ++ lib.optional (robloxSupport && stdenv.isDarwin) [
|
|
|
|
darwin.apple_sdk.frameworks.Security
|
|
|
|
];
|
2021-10-03 17:49:08 +00:00
|
|
|
|
2021-11-16 13:32:07 +00:00
|
|
|
buildNoDefaultFeatures = !robloxSupport;
|
2021-10-03 17:49:08 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A blazing-fast modern Lua linter written in Rust";
|
|
|
|
homepage = "https://github.com/kampfkarren/selene";
|
|
|
|
changelog = "https://github.com/kampfkarren/selene/blob/${version}/CHANGELOG.md";
|
|
|
|
license = licenses.mpl20;
|
|
|
|
maintainers = with maintainers; [ figsoda ];
|
|
|
|
};
|
|
|
|
}
|