summary refs log tree commit diff
path: root/pkgs/servers/meguca/default.nix
blob: 4c5521e97bb5a4a34c24720cbdea79621ba203b2 (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
{ stdenv, buildGoPackage, fetchFromGitHub, pkgconfig, cmake, ffmpeg-full
, ghostscript, graphicsmagick, quicktemplate, go-bindata, easyjson
, nodePackages, emscripten, opencv, statik }:

buildGoPackage {
  pname = "meguca-unstable";
  version = "2019-03-12";
  goPackagePath = "github.com/bakape/meguca";
  goDeps = ./server_deps.nix;

  src = fetchFromGitHub {
    owner = "bakape";
    repo = "meguca";
    rev = "21b08de09b38918061c5cd0bbd0dc9bcc1280525";
    sha256 = "1nb3bf1bscbdma83sp9fbgvmxxlxh21j9h80wakfn85sndcrws5i";
    fetchSubmodules = true;
  };

  enableParallelBuilding = true;
  nativeBuildInputs = [ pkgconfig cmake go-bindata ];

  buildInputs = [
    ffmpeg-full graphicsmagick ghostscript quicktemplate
    easyjson emscripten opencv statik
  ];

  buildPhase = ''
    export HOME=`pwd`
    cd go/src/github.com/bakape/meguca
    ln -sf ${nodePackages.meguca}/lib/node_modules/meguca/node_modules
    sed -i "/npm install --progress false --depth 0/d" Makefile
    make -j $NIX_BUILD_CORES generate all
  '' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
    make -j $NIX_BUILD_CORES wasm
  '';

  installPhase = ''
    mkdir -p $out/bin $out/share/meguca
    cp meguca $out/bin
    cp -r www $out/share/meguca
  '';

  meta = with stdenv.lib; {
    homepage = "https://github.com/bakape/meguca";
    description = "High performance anonymous realtime imageboard";
    license = licenses.agpl3Plus;
    maintainers = with maintainers; [ chiiruno ];
    platforms = platforms.all;
    broken = true; # Broken on Hydra since 2019-04-18:
    # https://hydra.nixos.org/build/98885902
  };
}