btrbk: add mainProgram (#356350)
[NixPkgs.git] / pkgs / by-name / de / decker / package.nix
blobe9a667bd7958cff779321f8c14dd80371306c4b6
1 { lib
2 , stdenv
3 , fetchFromGitHub
4 , SDL2
5 , SDL2_image
6 , unixtools
7 , multimarkdown
8 }:
10 stdenv.mkDerivation rec {
11   pname = "decker";
12   version = "1.50";
14   src = fetchFromGitHub {
15     owner = "JohnEarnest";
16     repo = "Decker";
17     rev = "v${version}";
18     hash = "sha256-2va11qci/BEN6clw3aDjZA2EVaW1WF93bU44wPYyKrA=";
19   };
21   buildInputs = [
22     SDL2
23     SDL2_image
24     multimarkdown
25     unixtools.xxd
26   ];
28   doCheck = true;
30   postPatch = ''
31     patchShebangs ./scripts
32   '';
34   buildPhase = ''
35     runHook preBuild
36     make lilt
37     make decker
38     make docs
39     runHook postBuild
40   '';
42   installPhase = ''
43     runHook preInstall
45     install -Dm0755 ./c/build/lilt -t $out/bin
46     install -Dm0755 ./c/build/decker -t $out/bin
47     install -Dm0644 ./syntax/vim/ftdetect/lil.vim -t $out/share/vim-plugins/decker/ftdetect
48     install -Dm0644 ./syntax/vim/syntax/lil.vim -t $out/share/vim-plugins/decker/syntax
50     # Fixing the permissions of the installed files on the documentation.
51     chmod a-x ./docs/images/* \
52               ./docs/*.md \
53               ./examples/decks/*.deck \
54               ./examples/lilt/*.lil
56     # This example has a shebang so we'll leave it as an executable.
57     chmod a+x ./examples/lilt/podcasts.lil
59     mkdir -p $out/share/doc/decker
60     cp -r ./docs/*.html ./docs/images ./examples $out/share/doc/decker
62     runHook postInstall
63   '';
65   checkPhase = ''
66     runHook preCheck
67     make test
68     runHook postCheck
69   '';
71   meta = with lib; {
72     homepage = "https://beyondloom.com/decker";
73     description = "Multimedia platform for creating and sharing interactive documents";
74     license = licenses.mit;
75     mainProgram = "decker";
76     platforms = platforms.all;
77     maintainers = with maintainers; [ foo-dogsquared ];
78   };