nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 boost,
6 zlib,
7 botan2,
8 libidn,
9 lua,
10 pcre,
11 sqlite,
12 perl,
13 pkg-config,
14 expect,
15 less,
16 bzip2,
17 gmp,
18 openssl,
19 autoreconfHook,
20 texinfo,
21 fetchpatch,
22}:
23
24let
25 version = "1.1-unstable-2021-05-01";
26 perlVersion = lib.getVersion perl;
27in
28
29assert perlVersion != "";
30
31stdenv.mkDerivation rec {
32 pname = "monotone";
33 inherit version;
34
35 # src = fetchurl {
36 # url = "http://monotone.ca/downloads/${version}/monotone-${version}.tar.bz2";
37 # sha256 = "124cwgi2q86hagslbk5idxbs9j896rfjzryhr6z63r6l485gcp7r";
38 # };
39
40 # My mirror of upstream Monotone repository
41 # Could fetchmtn, but circular dependency; snapshot requested
42 # https://lists.nongnu.org/archive/html/monotone-devel/2021-05/msg00000.html
43 src = fetchFromGitHub {
44 owner = "7c6f434c";
45 repo = "monotone-mirror";
46 rev = "b30b0e1c16def043d2dad57d1467d5bfdecdb070";
47 hash = "sha256:1hfy8vaap3184cd7h3qhz0da7c992idkc6q2nz9frhma45c5vgmd";
48 };
49
50 patches = [
51 ./monotone-1.1-Adapt-to-changes-in-pcre-8.42.patch
52 ./monotone-1.1-adapt-to-botan2.patch
53 (fetchpatch {
54 name = "rm-clang-float128-hack.patch";
55 url = "https://github.com/7c6f434c/monotone-mirror/commit/5f01a3a9326a8dbdae7fc911b208b7c319e5f456.patch";
56 revert = true;
57 sha256 = "0fzjdv49dx5lzvqhkvk50lkccagwx8h0bfha4a0k6l4qh36f9j7c";
58 })
59 ./monotone-1.1-gcc-14.patch
60 ];
61
62 postPatch = ''
63 sed -e 's@/usr/bin/less@${less}/bin/less@' -i src/unix/terminal.cc
64 ''
65 + lib.optionalString (lib.versionAtLeast boost.version "1.73") ''
66 find . -type f -exec sed -i \
67 -e 's/ E(/ internal_E(/g' \
68 -e 's/{E(/{internal_E(/g' \
69 {} +
70 '';
71
72 CXXFLAGS = " --std=c++11 ";
73
74 nativeBuildInputs = [
75 pkg-config
76 autoreconfHook
77 texinfo
78 ];
79 buildInputs = [
80 boost
81 zlib
82 botan2
83 libidn
84 lua
85 pcre
86 sqlite
87 expect
88 openssl
89 gmp
90 bzip2
91 perl
92 ];
93
94 postInstall = ''
95 mkdir -p $out/share/${pname}-${version}
96 cp -rv contrib/ $out/share/${pname}-${version}/contrib
97 mkdir -p $out/${perl.libPrefix}/${perlVersion}
98 cp -v contrib/Monotone.pm $out/${perl.libPrefix}/${perlVersion}
99
100 patchShebangs "$out/share/monotone"
101 patchShebangs "$out/share/${pname}-${version}"
102
103 find "$out"/share/{doc/monotone,${pname}-${version}}/contrib/ -type f | xargs sed -e 's@! */usr/bin/@!/usr/bin/env @; s@! */bin/bash@!/usr/bin/env bash@' -i
104 '';
105
106 #doCheck = true; # some tests fail (and they take VERY long)
107
108 meta = with lib; {
109 description = "Free distributed version control system";
110 maintainers = [ maintainers.raskin ];
111 platforms = platforms.unix;
112 license = licenses.gpl2Plus;
113 };
114}