2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, p7zip, win-virtio }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
2021-08-05 21:33:18 +00:00
|
|
|
version_usbdk = "1.0.22";
|
2020-04-24 23:36:52 +00:00
|
|
|
src_usbdk_x86 = fetchurl {
|
2021-08-05 21:33:18 +00:00
|
|
|
url = "https://www.spice-space.org/download/windows/UsbDk/UsbDk_${version_usbdk}_x86.msi";
|
|
|
|
sha256 = "1vr8kv37wz6p3xhawyhwxv0g7y89igkvx30zwmyvlgnkv3h5i317";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
src_usbdk_amd64 = fetchurl {
|
2021-08-05 21:33:18 +00:00
|
|
|
url = "https://www.spice-space.org/download/windows/UsbDk/UsbDk_${version_usbdk}_x64.msi";
|
|
|
|
sha256 = "19b64jv6pfimd54y0pphbs1xh25z41bbblz64ih6ag71w6azdxli";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-08-05 21:33:18 +00:00
|
|
|
version_qxlwddm = "0.21";
|
2020-04-24 23:36:52 +00:00
|
|
|
src_qxlwddm = fetchurl {
|
2021-08-05 21:33:18 +00:00
|
|
|
url = "https://www.spice-space.org/download/windows/qxl-wddm-dod/qxl-wddm-dod-${version_qxlwddm}/spice-qxl-wddm-dod-${version_qxlwddm}.zip";
|
|
|
|
sha256 = "0yjq54gxw3lcfghsfs4fzwipa9sgx5b1sn3fss6r5dm7pdvjp20q";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-08-05 21:33:18 +00:00
|
|
|
version_vdagent = "0.10.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
src_vdagent_x86 = fetchurl {
|
2021-08-05 21:33:18 +00:00
|
|
|
url = "https://www.spice-space.org/download/windows/vdagent/vdagent-win-${version_vdagent}/vdagent-win-${version_vdagent}-x86.zip";
|
|
|
|
sha256 = "142c0lqsqry9dclji2225ppclkn13gbjl1j0pzx8fp6hgy4i02c1";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
src_vdagent_amd64 = fetchurl {
|
2021-08-05 21:33:18 +00:00
|
|
|
url = "https://www.spice-space.org/download/windows/vdagent/vdagent-win-${version_vdagent}/vdagent-win-${version_vdagent}-x64.zip";
|
|
|
|
sha256 = "1x2wcvld531kv17a4ks7sh67nhzxzv7nkhpx391n5vj6d12i8g3i";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
# use version number of qxlwddm as qxlwddm is the most important component
|
2021-08-05 21:33:18 +00:00
|
|
|
pname = "win-spice";
|
|
|
|
version = version_qxlwddm;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-08-05 21:33:18 +00:00
|
|
|
dontUnpack = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPhase = ''
|
2021-08-05 21:33:18 +00:00
|
|
|
runHook preBuild
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
mkdir -p usbdk/x86 usbdk/amd64
|
2021-06-06 07:54:09 +00:00
|
|
|
(cd usbdk/x86; ${p7zip}/bin/7z x -y ${src_usbdk_x86})
|
|
|
|
(cd usbdk/amd64; ${p7zip}/bin/7z x -y ${src_usbdk_amd64})
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
mkdir -p vdagent/x86 vdagent/amd64
|
2021-08-05 21:33:18 +00:00
|
|
|
(cd vdagent/x86; ${p7zip}/bin/7z x -y ${src_vdagent_x86}; mv vdagent-win-${version_vdagent}-x86/* .; rm -r vdagent-win-${version_vdagent}-x86)
|
|
|
|
(cd vdagent/amd64; ${p7zip}/bin/7z x -y ${src_vdagent_amd64}; mv vdagent-win-${version_vdagent}-x64/* .; rm -r vdagent-win-${version_vdagent}-x64)
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
mkdir -p qxlwddm
|
2021-08-05 21:33:18 +00:00
|
|
|
(cd qxlwddm; ${p7zip}/bin/7z x -y ${src_qxlwddm}; cd w10)
|
|
|
|
|
|
|
|
runHook postBuild
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
installPhase =
|
|
|
|
let
|
|
|
|
copy_qxl = arch: version: "mkdir -p $out/${arch}/qxl; cp qxlwddm/${version}/${arch}/* $out/${arch}/qxl/. \n";
|
|
|
|
copy_usbdk = arch: "mkdir -p $out/${arch}/usbdk; cp usbdk/${arch}/* $out/${arch}/usbdk/. \n";
|
|
|
|
copy_vdagent = arch: "mkdir -p $out/${arch}/vdagent; cp vdagent/${arch}/* $out/${arch}/vdagent/. \n";
|
|
|
|
# SPICE needs vioserial
|
|
|
|
# TODO: Link windows version in win-spice (here) to version used in win-virtio.
|
|
|
|
# That way it would never matter whether vioserial is installed from win-virtio or win-spice.
|
|
|
|
copy_vioserial = arch: "mkdir -p $out/${arch}/vioserial; cp ${win-virtio}/${arch}/vioserial/* $out/${arch}/vioserial/. \n";
|
|
|
|
copy = arch: version: (copy_qxl arch version) + (copy_usbdk arch) + (copy_vdagent arch) + (copy_vioserial arch);
|
2021-08-05 21:33:18 +00:00
|
|
|
in ''
|
|
|
|
runHook preInstall
|
|
|
|
${(copy "amd64" "w10") + (copy "x86" "w10")}
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
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 SPICE Drivers";
|
|
|
|
homepage = "https://www.spice-space.org/";
|
|
|
|
license = [ licenses.asl20 ]; # See https://github.com/vrozenfe/qxl-dod
|
2022-07-14 12:49:19 +00:00
|
|
|
maintainers = [ ];
|
2022-06-26 10:26:21 +00:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|