nixpkgs/pkgs/applications/version-management/fossil/default.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
2021-01-11 10:38:22 +01:00

69 lines
1.7 KiB
Nix

{ lib, stdenv
, installShellFiles
, tcl
, libiconv
, fetchurl
, zlib
, openssl
, readline
, sqlite
, ed
, which
, tcllib
, withJson ? true
}:
stdenv.mkDerivation rec {
pname = "fossil";
version = "2.13";
src = fetchurl {
urls =
[
"https://www.fossil-scm.org/index.html/uv/fossil-src-${version}.tar.gz"
];
name = "${pname}-${version}.tar.gz";
sha256 = "1xbk7bb7340x2vvn22ykii54v721fwk8vgr3xvjkvv8ff7hd6cyr";
};
nativeBuildInputs = [ installShellFiles tcl ];
buildInputs = [ zlib openssl readline sqlite which ed ]
++ stdenv.lib.optional stdenv.isDarwin libiconv;
doCheck = stdenv.hostPlatform == stdenv.buildPlatform;
configureFlags = [ "--disable-internal-sqlite" ]
++ stdenv.lib.optional withJson "--json";
preCheck = ''
export TCLLIBPATH="${tcllib}/lib/tcllib${tcllib.version}"
'';
preBuild = ''
export USER=nonexistent-but-specified-user
'';
installPhase = ''
mkdir -p $out/bin
INSTALLDIR=$out/bin make install
installManPage fossil.1
installShellCompletion --name fossil.bash tools/fossil-autocomplete.bash
'';
meta = with lib; {
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 = "http://www.fossil-scm.org/";
license = licenses.bsd2;
maintainers = with maintainers; [ maggesi viric ];
};
}