about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/misc/HentaiAtHome/default.nix
blob: e34c2434a4f5394431d301256416d9100f658ef9 (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
{ buildPackages
, fetchzip
, javaOpts ? "-XX:+UseZGC"
, jdk
, jre_headless
, lib
, makeWrapper
, stdenvNoCC
,
}:
stdenvNoCC.mkDerivation rec {
  pname = "HentaiAtHome";
  version = "1.6.2";

  src = fetchzip {
    url = "https://repo.e-hentai.org/hath/HentaiAtHome_${version}_src.zip";
    hash = "sha256-ioL/GcnbYjt1IETH8521d1TcLGtENdFzceJui1ywXTY=";
    stripRoot = false;
  };

  nativeBuildInputs = [ jdk makeWrapper ];

  LANG = "en_US.UTF-8";
  LOCALE_ARCHIVE = lib.optionalString (stdenvNoCC.buildPlatform.libc == "glibc")
    "${buildPackages.glibcLocales}/lib/locale/locale-archive";

  buildPhase = ''
    make all
  '';

  installPhase = ''
    mkdir -p $out/share/java
    cp build/HentaiAtHome.jar $out/share/java

    mkdir -p $out/bin
    makeWrapper ${jre_headless}/bin/java $out/bin/HentaiAtHome \
      --add-flags "${javaOpts} -jar $out/share/java/HentaiAtHome.jar"
  '';

  doInstallCheck = true;
  installCheckPhase = ''
    pushd $(mktemp -d)
    $out/bin/HentaiAtHome
    popd
  '';

  strictDeps = true;

  meta = with lib; {
    homepage = "https://ehwiki.org/wiki/Hentai@Home";
    description =
      "Hentai@Home is an open-source P2P gallery distribution system which reduces the load on the E-Hentai Galleries";
    license = licenses.gpl3;
    maintainers = with maintainers; [ terrorjack ];
    mainProgram = "HentaiAtHome";
  };
}