mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-10-30 22:21:26 +00:00
vmTools.buildRPM: properly derive source name
This fixes e.g. building the rpm of patchelf as in pkgs/build-support/vm/test.nix. The glob won't work if there are multiple spec files but I don't think rpmbuild would work in that case either.
This commit is contained in:
parent
e0455e1e29
commit
55b883448e
@ -511,7 +511,6 @@ rec {
|
||||
|
||||
buildRPM = attrs: runInLinuxImage (stdenv.mkDerivation ({
|
||||
prePhases = [ "prepareImagePhase" "sysInfoPhase" ];
|
||||
dontUnpack = true;
|
||||
dontConfigure = true;
|
||||
|
||||
outDir = "rpms/${attrs.diskImage.name}";
|
||||
@ -536,9 +535,7 @@ rec {
|
||||
buildPhase = ''
|
||||
eval "$preBuild"
|
||||
|
||||
# Hacky: RPM looks for <basename>.spec inside the tarball, so
|
||||
# strip off the hash.
|
||||
srcName="$(stripHash "$src")"
|
||||
srcName="$(rpmspec --srpm -q --qf '%{source}' *.spec)"
|
||||
cp "$src" "$srcName" # `ln' doesn't work always work: RPM requires that the file is owned by root
|
||||
|
||||
export HOME=/tmp/home
|
||||
|
Loading…
Reference in New Issue
Block a user