biglybt: 3.5.0.0 -> 3.6.0.0
[NixPkgs.git] / pkgs / applications / misc / jekyll / default.nix
blob2b9f1497b765d5cab1957744c631af1f23a583ee
1 { lib, bundlerApp, ruby
2 , writeShellScriptBin, makeWrapper
3 , withOptionalDependencies ? false
4 }:
6 let
7   rubyWrapper = writeShellScriptBin "ruby" ''
8     if [[ "$#" -eq 2 ]]; then
9       if [[ "''${1##*/}" == "bundle" && "$2" == "install" ]]; then
10         # See https://github.com/NixOS/nixpkgs/issues/58126 for more details.
11         echo 'Skipping "bundle install" as it fails due to the Nix wrapper.'
12         echo 'Please enter the new directory and run the following commands to serve the page:'
13         echo 'nix-shell -p bundler --run "bundle install --gemfile=Gemfile --path vendor/cache"'
14         echo 'nix-shell -p bundler --run "bundle exec jekyll serve"'
15         exit 0
16         # The following nearly works:
17         unset BUNDLE_FROZEN
18         exec ${ruby}/bin/ruby "$@" --gemfile=Gemfile --path=vendor/cache
19       fi
20     fi
21     # Else: Don't modify the arguments:
22     exec ${ruby}/bin/ruby "$@"
23   '';
24 in bundlerApp {
25   pname = "jekyll";
26   exes = [ "jekyll" ];
28   inherit ruby;
29   gemdir = if withOptionalDependencies
30     then ./full
31     else ./basic;
33   nativeBuildInputs = [ makeWrapper ];
35   postBuild = ''
36     wrapProgram $out/bin/jekyll --prefix PATH : ${rubyWrapper}/bin
37   '';
39   passthru.updateScript = ./update.sh;
41   meta = with lib; {
42     description = "A blog-aware, static site generator, written in Ruby";
43     longDescription = ''
44       Jekyll is a simple, blog-aware, static site generator, written in Ruby.
45       Think of it like a file-based CMS, without all the complexity. Jekyll
46       takes your content, renders Markdown and Liquid templates, and spits out a
47       complete, static website ready to be served by Apache, Nginx or another
48       web server. Jekyll is the engine behind GitHub Pages, which you can use to
49       host sites right from your GitHub repositories.
50     '';
51     homepage    = "https://jekyllrb.com/";
52     #changelog   = "https://raw.githubusercontent.com/jekyll/jekyll/v${version}/History.markdown";
53     license     = licenses.mit;
54     maintainers = with maintainers; [ ];
55     platforms   = platforms.unix;
56     mainProgram = "jekyll";
57   };