about summary refs log tree commit diff
path: root/pkgs/applications/version-management
diff options
context:
space:
mode:
authorShea Levy <shea@shealevy.com>2014-11-21 16:12:33 -0500
committerShea Levy <shea@shealevy.com>2014-11-21 16:12:33 -0500
commit5c7c63af66d5b772d97d5ffda09df9cf2ef96f8b (patch)
treec1960eacb8a2901b453fa3a5ab0b85d25c01016a /pkgs/applications/version-management
parent40274943347d8d5223935ed358712d87119c9f46 (diff)
Add src revision control software
Diffstat (limited to 'pkgs/applications/version-management')
-rw-r--r--pkgs/applications/version-management/src/default.nix38
-rw-r--r--pkgs/applications/version-management/src/path.patch30
2 files changed, 68 insertions, 0 deletions
diff --git a/pkgs/applications/version-management/src/default.nix b/pkgs/applications/version-management/src/default.nix
new file mode 100644
index 0000000000000..d3b0ee9131be9
--- /dev/null
+++ b/pkgs/applications/version-management/src/default.nix
@@ -0,0 +1,38 @@
+{ stdenv, fetchurl, python, rcs, git }:
+
+stdenv.mkDerivation rec {
+  name = "src-0.12";
+
+  src = fetchurl {
+    url = "http://www.catb.org/~esr/src/${name}.tar.gz";
+    sha256 = "1w8k9z2dxim99nniid9kjsc5lzri7m4sd0n819y73aqcdi54lr1s";
+  };
+
+  buildInputs = [ python ];
+
+  patches = [ ./path.patch ];
+
+  postPatch = ''
+    sed -i \
+      -e 's|@python@|${python}|' \
+      -e 's|@rcs@|${rcs}|' \
+      -e 's|@git@|${git}|' \
+      src srctest
+  '';
+
+  makeFlags = [ "prefix=$(out)" ];
+
+  doCheck = true;
+
+  meta = {
+    description = "Simple single-file revision control";
+
+    homepage = http://www.catb.org/~esr/src/;
+
+    license = [ stdenv.lib.licenses.bsd3 ];
+
+    maintainers = [ stdenv.lib.maintainers.shlevy ];
+
+    platforms = stdenv.lib.platforms.all;
+  };
+}
diff --git a/pkgs/applications/version-management/src/path.patch b/pkgs/applications/version-management/src/path.patch
new file mode 100644
index 0000000000000..05e643e9e0ffc
--- /dev/null
+++ b/pkgs/applications/version-management/src/path.patch
@@ -0,0 +1,30 @@
+diff -Naur src-0.12-orig/src src-0.12/src
+--- src-0.12-orig/src	2014-11-21 08:19:59.000000000 -0500
++++ src-0.12/src	2014-11-21 15:54:54.598113846 -0500
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python2
++#!@python@/bin/python
+ #
+ # src - simple revision control.
+ #
+@@ -58,6 +58,8 @@
+ 
+ import sys, os, subprocess, time, calendar, stat, glob, shutil, hashlib
+ 
++os.environ['PATH'] = "@rcs@/bin:@git@/bin:" + os.environ['PATH']
++
+ version="0.12"
+ 
+ def rfc3339(t):
+diff -Naur src-0.12-orig/srctest src-0.12/srctest
+--- src-0.12-orig/srctest	2014-11-21 08:12:00.000000000 -0500
++++ src-0.12/srctest	2014-11-21 15:58:31.370500990 -0500
+@@ -12,7 +12,7 @@
+ 
+ # Set the PATH to include the current directory, so the repository
+ # head version of src can always be tested.
+-PATH="$(pwd)":$PATH
++PATH="$(pwd)":@git@/bin:$PATH
+ 
+ trap "rm -fr $SANDBOX" 0 1 2 15
+