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