2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, p7zip }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "win-qemu";
|
2020-04-24 23:36:52 +00:00
|
|
|
version = "0.1.105-1";
|
|
|
|
|
2021-08-05 21:33:18 +00:00
|
|
|
dontUnpack = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-12-06 16:07:01 +00:00
|
|
|
url = "https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/archive-virtio/virtio-win-${version}/virtio-win.iso";
|
2020-04-24 23:36:52 +00:00
|
|
|
sha256 = "065gz7s77y0q9kfqbr27451sr28rm9azpi88sqjkfph8c6r8q3wc";
|
|
|
|
};
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
${p7zip}/bin/7z x $src
|
2021-12-06 16:07:01 +00:00
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
installPhase =
|
|
|
|
let
|
|
|
|
copy_pvpanic = arch: version: "mkdir -p $out/${arch}/qemupanic; cp pvpanic/${version}/${arch}/* $out/${arch}/qemupanic/. \n";
|
|
|
|
copy_pciserial = arch: "mkdir -p $out/${arch}/qemupciserial; cp qemupciserial/* $out/${arch}/qemupciserial/. \n";
|
|
|
|
copy_agent = arch: ''
|
|
|
|
mkdir -p $out/${arch}/qemuagent
|
|
|
|
cp guest-agent/${if arch=="x86" then "qemu-ga-x86.msi" else "qemu-ga-x64.msi"} $out/${arch}/qemuagent/qemu-guest-agent.msi
|
|
|
|
(cd $out/${arch}/qemuagent; ${p7zip}/bin/7z x qemu-guest-agent.msi; rm qemu-guest-agent.msi)
|
2021-12-06 16:07:01 +00:00
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
copy = arch: version: (copy_pvpanic arch version) + (copy_pciserial arch) + (copy_agent arch);
|
|
|
|
in
|
2021-12-06 16:07:01 +00:00
|
|
|
(copy "amd64" "w8.1") + (copy "x86" "w8.1");
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Windows QEMU Drivers";
|
|
|
|
homepage = "https://fedoraproject.org/wiki/Windows_Virtio_Drivers";
|
|
|
|
maintainers = [ maintainers.tstrobel ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
license = licenses.gpl2;
|
|
|
|
};
|
|
|
|
}
|