nixpkgs/pkgs/by-name/gi/gi-crystal/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

49 lines
1.1 KiB
Nix

{ lib
, fetchFromGitHub
, crystal
, gobject-introspection
, gitUpdater
}:
crystal.buildCrystalPackage rec {
pname = "gi-crystal";
version = "0.22.2";
src = fetchFromGitHub {
owner = "hugopl";
repo = "gi-crystal";
rev = "v${version}";
hash = "sha256-JfBbKqobikpTGMryeO86zZ46EbOHybem+Cc5FZEL6i4=";
};
# Make sure gi-crystal picks up the name of the so or dylib and not the leading nix store path
# when the package name happens to start with “lib”.
patches = [ ./src.patch ./store-friendly-library-name.patch ];
nativeBuildInputs = [ gobject-introspection ];
buildTargets = [ "generator" ];
doCheck = false;
doInstallCheck = false;
installPhase = ''
runHook preInstall
mkdir $out
cp -r * $out
runHook postInstall
'';
passthru = {
updateScript = gitUpdater { rev-prefix = "v"; };
};
meta = with lib; {
description = "GI Crystal is a binding generator used to generate Crystal bindings for GObject based libraries using GObject Introspection";
homepage = "https://github.com/hugopl/gi-crystal";
mainProgram = "gi-crystal";
maintainers = with maintainers; [ sund3RRR ];
};
}