Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

rcm: Use Nix store path for RCM_LIB

The shell scripts in the rcm package use a relative path in order to
find the rcm.sh library. That works fine when rcm is installed with
nix-env -- ~/.nix-profile/share/rcm exists as expected -- but does not
work when installed via /etc/nixos/configuration.nix. In the
system-wide case, /run/current-system/sw/share does not contain the rcm
directory.

+81 -4
+13 -4
pkgs/tools/misc/rcm/default.nix
··· 1 1 { stdenv, fetchurl }: 2 2 3 - stdenv.mkDerivation rec { 3 + stdenv.mkDerivation { 4 4 name = "rcm-1.2.3"; 5 5 6 6 src = fetchurl { ··· 8 8 sha256 = "0gwpclbc152jkclj3w83s2snx3dcgljwr75q1z8czl3yar7d8bsh"; 9 9 }; 10 10 11 - meta = { 11 + patches = [ ./fix-rcmlib-path.patch ]; 12 + 13 + postPatch = '' 14 + for f in bin/*.in; do 15 + substituteInPlace $f --subst-var-by rcm $out 16 + done 17 + ''; 18 + 19 + meta = with stdenv.lib; { 12 20 description = "Management Suite for Dotfiles"; 13 21 homepage = https://github.com/thoughtbot/rcm; 14 - license = stdenv.lib.licenses.bsd3; 22 + license = licenses.bsd3; 23 + maintainers = with maintainers; [ malyn ]; 15 24 }; 16 - } 25 + }
+68
pkgs/tools/misc/rcm/fix-rcmlib-path.patch
··· 1 + *** rcm-1.2.3/bin/lsrc.in.orig 2014-05-09 04:57:39.000000000 -0700 2 + --- rcm-1.2.3/bin/lsrc.in 2015-01-24 14:27:48.786595479 -0800 3 + *************** 4 + *** 1,6 **** 5 + #!@SHELL@ 6 + 7 + ! : ${RCM_LIB:=$(dirname "$0")/../share/rcm} 8 + . "$RCM_LIB/rcm.sh" 9 + 10 + pushdir() { 11 + --- 1,6 ---- 12 + #!@SHELL@ 13 + 14 + ! RCM_LIB=@rcm@/share/rcm 15 + . "$RCM_LIB/rcm.sh" 16 + 17 + pushdir() { 18 + *** rcm-1.2.3/bin/mkrc.in.orig 2014-05-09 04:57:39.000000000 -0700 19 + --- rcm-1.2.3/bin/mkrc.in 2015-01-24 14:27:48.786595479 -0800 20 + *************** 21 + *** 1,6 **** 22 + #!@SHELL@ 23 + 24 + ! : ${RCM_LIB:=$(dirname "$0")/../share/rcm} 25 + . "$RCM_LIB/rcm.sh" 26 + 27 + destination() { 28 + --- 1,6 ---- 29 + #!@SHELL@ 30 + 31 + ! RCM_LIB=@rcm@/share/rcm 32 + . "$RCM_LIB/rcm.sh" 33 + 34 + destination() { 35 + *** rcm-1.2.3/bin/rcdn.in.orig 2014-05-09 04:57:39.000000000 -0700 36 + --- rcm-1.2.3/bin/rcdn.in 2015-01-24 14:27:48.786595479 -0800 37 + *************** 38 + *** 1,6 **** 39 + #!@SHELL@ 40 + 41 + ! : ${RCM_LIB:=$(dirname "$0")/../share/rcm} 42 + . "$RCM_LIB/rcm.sh" 43 + 44 + remove_link() { 45 + --- 1,6 ---- 46 + #!@SHELL@ 47 + 48 + ! RCM_LIB=@rcm@/share/rcm 49 + . "$RCM_LIB/rcm.sh" 50 + 51 + remove_link() { 52 + *** rcm-1.2.3/bin/rcup.in.orig 2014-05-09 04:57:39.000000000 -0700 53 + --- rcm-1.2.3/bin/rcup.in 2015-01-24 14:27:48.786595479 -0800 54 + *************** 55 + *** 1,6 **** 56 + #!@SHELL@ 57 + 58 + ! : ${RCM_LIB:=$(dirname "$0")/../share/rcm} 59 + . "$RCM_LIB/rcm.sh" 60 + 61 + link_or_copy() { 62 + --- 1,6 ---- 63 + #!@SHELL@ 64 + 65 + ! RCM_LIB=@rcm@/share/rcm 66 + . "$RCM_LIB/rcm.sh" 67 + 68 + link_or_copy() {