nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 installShellFiles,
5 tcl,
6 libiconv,
7 fetchurl,
8 buildPackages,
9 zlib,
10 openssl,
11 readline,
12 withInternalSqlite ? true,
13 sqlite,
14 ed,
15 which,
16 tclPackages,
17 withJson ? true,
18}:
19
20stdenv.mkDerivation (finalAttrs: {
21 pname = "fossil";
22 version = "2.26";
23
24 src = fetchurl {
25 url = "https://www.fossil-scm.org/home/tarball/version-${finalAttrs.version}/fossil-${finalAttrs.version}.tar.gz";
26 hash = "sha256-uzT3iOGB1MRQXWmtQNZWazOYiGH4kdtt/KJ6uVQrcqo=";
27 };
28
29 # required for build time tool `./tools/translate.c`
30 depsBuildBuild = [ buildPackages.stdenv.cc ];
31
32 nativeBuildInputs = [
33 installShellFiles
34 tcl
35 ];
36
37 buildInputs = [
38 zlib
39 openssl
40 readline
41 which
42 ed
43 ]
44 ++ lib.optional stdenv.hostPlatform.isDarwin libiconv
45 ++ lib.optional (!withInternalSqlite) sqlite;
46
47 enableParallelBuilding = true;
48
49 doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
50
51 configureFlags =
52 lib.optional (!withInternalSqlite) "--disable-internal-sqlite" ++ lib.optional withJson "--json";
53
54 preBuild = ''
55 export USER=nonexistent-but-specified-user
56 '';
57
58 installPhase = ''
59 mkdir -p $out/bin
60 INSTALLDIR=$out/bin make install
61
62 installManPage fossil.1
63 installShellCompletion --name fossil.bash tools/fossil-autocomplete.bash
64 '';
65
66 meta = with lib; {
67 description = "Simple, high-reliability, distributed software configuration management";
68 longDescription = ''
69 Fossil is a software configuration management system. Fossil is
70 software that is designed to control and track the development of a
71 software project and to record the history of the project. There are
72 many such systems in use today. Fossil strives to distinguish itself
73 from the others by being extremely simple to setup and operate.
74 '';
75 homepage = "https://www.fossil-scm.org/";
76 license = licenses.bsd2;
77 maintainers = with maintainers; [ maggesi ];
78 platforms = platforms.all;
79 mainProgram = "fossil";
80 };
81})