@@ -1,10 +1,11 @@
1−{ lib, stdenv, fetchurl, boost, zlib, botan, libidn
2−, lua, pcre, sqlite, perl, pkg-config, expect
1+{ lib, stdenv, fetchurl, fetchFromGitHub, boost, zlib, botan2, libidn
2+, lua, pcre, sqlite, perl, pkg-config, expect, less
33, bzip2, gmp, openssl
4+, autoreconfHook, texinfo
45}:
56
67let
7− version = "1.1";
8+ version = "1.1-unstable-2021-05-01";
89 perlVersion = lib.getVersion perl;
910in
1011
@@ -14,22 +15,41 @@ stdenv.mkDerivation rec {
1415 pname = "monotone";
1516 inherit version;
1617
17− src = fetchurl {
18− url = "http://monotone.ca/downloads/${version}/monotone-${version}.tar.bz2";
19− sha256 = "124cwgi2q86hagslbk5idxbs9j896rfjzryhr6z63r6l485gcp7r";
18+ # src = fetchurl {
19+ # url = "http://monotone.ca/downloads/${version}/monotone-${version}.tar.bz2";
20+ # sha256 = "124cwgi2q86hagslbk5idxbs9j896rfjzryhr6z63r6l485gcp7r";
21+ # };
22+
23+ # My mirror of upstream Monotone repository
24+ # Could fetchmtn, but circular dependency; snapshot requested
25+ # https://lists.nongnu.org/archive/html/monotone-devel/2021-05/msg00000.html
26+ src = fetchFromGitHub {
27+ owner = "7c6f434c";
28+ repo = "monotone-mirror";
29+ rev = "b30b0e1c16def043d2dad57d1467d5bfdecdb070";
30+ hash = "sha256:1hfy8vaap3184cd7h3qhz0da7c992idkc6q2nz9frhma45c5vgmd";
2031 };
2132
2233 patches = [ ./monotone-1.1-Adapt-to-changes-in-pcre-8.42.patch ];
2334
24− nativeBuildInputs = [ pkg-config ];
25− buildInputs = [ boost zlib botan libidn lua pcre sqlite expect
26− openssl gmp bzip2 ];
35+ postPatch = ''
36+ sed -e 's@/usr/bin/less@${less}/bin/less@' -i src/unix/terminal.cc
37+ '';
38+
39+ nativeBuildInputs = [ pkg-config autoreconfHook texinfo ];
40+ buildInputs = [ boost zlib botan2 libidn lua pcre sqlite expect
41+ openssl gmp bzip2 perl ];
2742
2843 postInstall = ''
2944 mkdir -p $out/share/${pname}-${version}
3045 cp -rv contrib/ $out/share/${pname}-${version}/contrib
3146 mkdir -p $out/${perl.libPrefix}/${perlVersion}
3247 cp -v contrib/Monotone.pm $out/${perl.libPrefix}/${perlVersion}
48+
49+ patchShebangs "$out/share/monotone"
50+ patchShebangs "$out/share/${pname}-${version}"
51+
52+ 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
3353 '';
3454
3555 #doCheck = true; # some tests fail (and they take VERY long)
@@ -38,6 +58,6 @@ stdenv.mkDerivation rec {
3858 description = "A free distributed version control system";
3959 maintainers = [ maintainers.raskin ];
4060 platforms = platforms.unix;
41− license = licenses.gpl2;
61+ license = licenses.gpl2Plus;
4262 };
4363}