diff --git a/mercurial.spec b/mercurial.spec index 708cfd1..6d6f60c 100644 --- a/mercurial.spec +++ b/mercurial.spec @@ -22,11 +22,13 @@ BuildRequires: pkgconfig BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-docutils +BuildRequires: rust-packaging Provides: hg = %{version}-%{release} Requires: python3 Requires: emacs-filesystem Recommends: python3-fb-re2 +Recommends: mercurial-rust = %{version}-%{release} %description Mercurial is a fast, lightweight source control management system designed @@ -67,11 +69,43 @@ Mercurial. When you type chg, a C program connects to that background process and executes Mercurial commands. +%package rust +Summary: Mercurial Rust extensions for speeding up certain operations +Requires: hg = %{version}-%{release} + +%description rust +The following operations are sped up when using Rust: + + - discovery of differences between repositories (pull/push) + - nodemap (see :hg:`help config.format.use-persistent-nodemap`) + - all commands using the dirstate (status, commit, diff, add, update, etc.) + - dirstate-v2 (see :hg:`help config.format.use-dirstate-v2`) + - iteration over ancestors in a graph + +More features are in the works, and improvements on the above listed are still +in progress. For more experimental work see the "rhg" section. + + %prep %setup -q -n %{name}-%{upstreamversion} +#sed -i setup.py -e "s/'cargo', 'rustc', '--release'/\0, '--offline'/g" + +pushd rust +#autosetup -n %{crate}-%{version_no_tilde} -p1 +echo +%cargo_prep +echo +#generate_buildrequires +echo +#cargo_generate_buildrequires -a +popd %build -PYTHON=%{python3} make all +pushd rust +%cargo_build -a +popd + +echo PYTHON=%{python3} make all # chg will invoke the 'hg' command - no direct Python dependency pushd contrib/chg @@ -79,8 +113,12 @@ make popd %install -%{python3} setup.py install -O1 --root %{buildroot} --prefix %{_prefix} --record=%{name}.files -make install-doc DESTDIR=%{buildroot} MANDIR=%{_mandir} +pushd rust +%cargo_install -a +popd + +echo %{python3} setup.py install -O1 --root %{buildroot} --prefix %{_prefix} --record=%{name}.files +echo make install-doc DESTDIR=%{buildroot} MANDIR=%{_mandir} grep -v -e 'hgk.py*' \ -e "%{python3_sitearch}/mercurial/" \ @@ -176,6 +214,8 @@ pathfix.py -pni "%{python3}" %{buildroot}%{_bindir}/hg-ssh %{_bindir}/chg %doc %attr(644,root,root) %{_mandir}/man?/chg.*.gz +%files rust +%{python3_sitearch}/mercurial/rustext.cpython-*-*-linux-gnu.so #%%check # This will now fail everytime. Mercurial is not ported properly for Python3