about summary refs log tree commit diff
path: root/pkgs/applications/editors/tijolo/default.nix
blob: ff198df57fe82d169acddf00ba81ba4dfeef52ab (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
{ stdenv
, lib
, fetchFromGitHub
, crystal
, vte-gtk4
, libgit2
, gtk4
, libadwaita
, editorconfig-core-c
, gtksourceview5
, wrapGAppsHook4
, gobject-introspection
, desktopToDarwinBundle
}:

crystal.buildCrystalPackage rec {
  pname = "tijolo";
  version = "0.8.1";

  src = fetchFromGitHub {
    owner = "hugopl";
    repo = "tijolo";
    rev = "v${version}";
    hash = "sha256-+sRcS5bVH6WLmSDLiPw608OB6OjBVwLqWxGT5Y6caBc=";
  };

  postPatch = ''
    substituteInPlace Makefile \
      --replace-fail "shards install" "true"
  '';

  shardsFile = ./shards.nix;
  copyShardDeps = true;

  preBuild = ''
    cd lib/gi-crystal && shards build -Dpreview_mt --release --no-debug
    cd ../.. && mkdir bin/ && cp lib/gi-crystal/bin/gi-crystal bin/
  '';

  nativeBuildInputs = [ wrapGAppsHook4 gobject-introspection ]
    ++ lib.optionals stdenv.isDarwin [ desktopToDarwinBundle ];
  buildInputs = [ gtk4 libadwaita vte-gtk4 libgit2 gtksourceview5 editorconfig-core-c ];

  buildTargets = [ "all" ];
  doCheck = false;

  installTargets = [ "install" "post-install" "install-fonts"];
  doInstallCheck = false;

  meta = with lib; {
    description = "Lightweight, keyboard-oriented IDE for the masses";
    homepage = "https://github.com/hugopl/tijolo";
    license = licenses.mit;
    mainProgram = "tijolo";
    maintainers = with maintainers; [ sund3RRR ];
  };
}