summaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/fo/fossil/package.nix
blob: 497264e94d931a88345ba488eff1ab49749e87cb (plain)
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
{
  lib,
  stdenv,
  installShellFiles,
  tcl,
  libiconv,
  fetchurl,
  buildPackages,
  zlib,
  openssl,
  readline,
  withInternalSqlite ? true,
  sqlite,
  ed,
  which,
  withJson ? true,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "fossil";
  version = "2.28";

  src = fetchurl {
    url = "https://www.fossil-scm.org/home/tarball/version-${finalAttrs.version}/fossil-${finalAttrs.version}.tar.gz";
    hash = "sha256-y5joXR+QZAyYniRSHpD+vJjtjuPyZj2Lg6RFsVvMg9M=";
  };

  # required for build time tool `./tools/translate.c`
  depsBuildBuild = [ buildPackages.stdenv.cc ];

  nativeBuildInputs = [
    installShellFiles
    tcl
  ];

  buildInputs = [
    zlib
    openssl
    readline
    which
    ed
  ]
  ++ lib.optional stdenv.hostPlatform.isDarwin libiconv
  ++ lib.optional (!withInternalSqlite) sqlite;

  enableParallelBuilding = true;

  doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;

  configureFlags =
    lib.optional (!withInternalSqlite) "--disable-internal-sqlite" ++ lib.optional withJson "--json";

  preBuild = ''
    export USER=nonexistent-but-specified-user
  '';

  installFlags = [ "INSTALLDIR=$(out)/bin" ];

  postInstall = ''
    installManPage fossil.1
    installShellCompletion --cmd fossil tools/fossil-autocomplete.{bash,zsh}
  '';

  meta = {
    description = "Simple, high-reliability, distributed software configuration management";
    longDescription = ''
      Fossil is a software configuration management system.  Fossil is
      software that is designed to control and track the development of a
      software project and to record the history of the project. There are
      many such systems in use today. Fossil strives to distinguish itself
      from the others by being extremely simple to setup and operate.
    '';
    homepage = "https://www.fossil-scm.org/";
    license = lib.licenses.bsd2;
    platforms = lib.platforms.all;
    mainProgram = "fossil";
  };
})