nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 stdenv,
3 lib,
4 fetchurl,
5 makeWrapper,
6 ghostscript_headless, # for ps2pdf binary
7}:
8
9stdenv.mkDerivation rec {
10 pname = "ccal";
11 version = "2.5.3";
12 src = fetchurl {
13 url = "https://ccal.chinesebay.com/ccal-${version}.tar.gz";
14 sha256 = "sha256-PUy9yfkFzgKrSEBB+79/C3oxmuajUMbBbWNuGlpQ35Y=";
15 };
16
17 nativeBuildInputs = [ makeWrapper ];
18
19 makeFlags = [
20 "CXX:=$(CXX)"
21 "BINDIR=$(out)/bin"
22 "MANDIR=$(out)/share/man"
23 ];
24 installTargets = [
25 "install"
26 "install-man"
27 ];
28
29 # ccalpdf depends on a `ps2pdf` binary in PATH
30 postFixup = ''
31 wrapProgram $out/bin/ccalpdf \
32 --prefix PATH : ${lib.makeBinPath [ ghostscript_headless ]}:$out/bin
33 '';
34
35 meta = {
36 homepage = "https://ccal.chinesebay.com/ccal.htm";
37 description = "Command line Chinese calendar viewer, similar to cal";
38 license = lib.licenses.gpl3;
39 maintainers = with lib.maintainers; [ sharzy ];
40 platforms = lib.platforms.all;
41 };
42}