anvil-editor: init at 0.4
[NixPkgs.git] / pkgs / applications / version-management / fossil / default.nix
blob77658b58f2603c958553a70c68bc26d3637bf45f
1 { lib, stdenv
2 , installShellFiles
3 , tcl
4 , libiconv
5 , fetchurl
6 , fetchpatch
7 , buildPackages
8 , zlib
9 , openssl
10 , readline
11 , withInternalSqlite ? true
12 , sqlite
13 , ed
14 , which
15 , tclPackages
16 , withJson ? true
19 stdenv.mkDerivation (finalAttrs: {
20   pname = "fossil";
21   version = "2.24";
23   src = fetchurl {
24     url = "https://www.fossil-scm.org/home/tarball/version-${finalAttrs.version}/fossil-${finalAttrs.version}.tar.gz";
25     hash = "sha256-lc08F2g1vrm4lwdvpYFx/jCwspH2OHu1R0nvvfqWL0w=";
26   };
28   # required for build time tool `./tools/translate.c`
29   depsBuildBuild = [ buildPackages.stdenv.cc ];
31   nativeBuildInputs = [ installShellFiles tcl tclPackages.tcllib ];
33   buildInputs = [ zlib openssl readline which ed ]
34     ++ lib.optional stdenv.hostPlatform.isDarwin libiconv
35     ++ lib.optional (!withInternalSqlite) sqlite;
37   enableParallelBuilding = true;
39   doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
41   configureFlags =
42     lib.optional (!withInternalSqlite) "--disable-internal-sqlite"
43     ++ lib.optional withJson "--json";
45   patches = [
46     (fetchpatch {
47        url = "https://fossil-scm.org/home/vpatch?from=8be0372c10510437&to=5ad708085a90365f";
48        extraPrefix = "";
49        hash = "sha256-KxF40wiEY3R1RFM0/YOmdNiedQHzs+vyMXslnqLtqQ4=";
50        name = "fossil-disable-tests.patch";
51     })
52     (fetchpatch {
53        url = "https://fossil-scm.org/home/vpatch?from=fb4e90b662803e47&to=17c01c549e73c6b8";
54        extraPrefix = "";
55        hash = "sha256-b0JSDWEBTlLWFr5rO+g0biPzUfVsdeAw71DR7/WQKzU=";
56        name = "fossil-fix-json-test.patch";
57     })
58     (fetchpatch {
59        url = "https://fossil-scm.org/home/vpatch?from=5ad708085a90365f&to=fb4e90b662803e47";
60        extraPrefix = "";
61        hash = "sha256-bbWUrlhPxC/DQQDeC3gG0jGfxQ6F7YkxINqg3baf+j0=";
62        name = "fossil-comment-utf-tests.patch";
63     })
64   ];
66   preBuild = ''
67     export USER=nonexistent-but-specified-user
68   '';
70   installPhase = ''
71     mkdir -p $out/bin
72     INSTALLDIR=$out/bin make install
74     installManPage fossil.1
75     installShellCompletion --name fossil.bash tools/fossil-autocomplete.bash
76   '';
78   meta = with lib; {
79     description = "Simple, high-reliability, distributed software configuration management";
80     longDescription = ''
81       Fossil is a software configuration management system.  Fossil is
82       software that is designed to control and track the development of a
83       software project and to record the history of the project. There are
84       many such systems in use today. Fossil strives to distinguish itself
85       from the others by being extremely simple to setup and operate.
86     '';
87     homepage = "https://www.fossil-scm.org/";
88     license = licenses.bsd2;
89     maintainers = with maintainers; [ maggesi ];
90     platforms = platforms.all;
91     mainProgram = "fossil";
92   };