2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchurl, kernel }:
|
2016-03-24 12:15:10 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2019-04-24 19:05:57 +01:00
|
|
|
name = "mxu11x0-1.4-${kernel.version}";
|
2016-03-24 12:15:10 +00:00
|
|
|
|
2019-04-24 19:05:57 +01:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://www.moxa.com/Moxa/media/PDIM/S100000385/moxa-uport-1000-series-linux-3.x-and-4.x-for-uport-11x0-series-driver-v1.4.tgz";
|
|
|
|
sha256 = "1hz9ygabbp8pv49k1j4qcsr0v3zw9xy0bh1akqgxp5v29gbdgxjl";
|
2016-03-24 12:15:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
sed -i -e "s/\$(uname -r).*/${kernel.modDirVersion}/g" driver/mxconf
|
|
|
|
sed -i -e "s/\$(shell uname -r).*/${kernel.modDirVersion}/g" driver/Makefile
|
|
|
|
sed -i -e 's|/lib/modules|${kernel.dev}/lib/modules|' driver/mxconf
|
|
|
|
sed -i -e 's|/lib/modules|${kernel.dev}/lib/modules|' driver/Makefile
|
|
|
|
'';
|
2021-01-19 21:20:11 +00:00
|
|
|
|
2016-03-24 12:15:10 +00:00
|
|
|
installPhase = ''
|
|
|
|
install -v -D -m 644 ./driver/mxu11x0.ko "$out/lib/modules/${kernel.modDirVersion}/kernel/drivers/usb/serial/mxu11x0.ko"
|
|
|
|
install -v -D -m 644 ./driver/mxu11x0.ko "$out/lib/modules/${kernel.modDirVersion}/misc/mxu11x0.ko"
|
|
|
|
'';
|
|
|
|
|
|
|
|
dontStrip = true;
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2016-03-29 11:22:14 +01:00
|
|
|
hardeningDisable = [ "pic" ];
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2016-03-24 12:15:10 +00:00
|
|
|
description = "MOXA UPort 11x0 USB to Serial Hub driver";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://www.moxa.com/en/products/industrial-edge-connectivity/usb-to-serial-converters-usb-hubs/usb-to-serial-converters/uport-1000-series";
|
2019-04-24 19:05:57 +01:00
|
|
|
license = licenses.gpl2Plus;
|
2016-03-24 12:15:10 +00:00
|
|
|
maintainers = with maintainers; [ uralbash ];
|
|
|
|
platforms = platforms.linux;
|
2021-05-25 08:43:39 +01:00
|
|
|
broken = kernel.kernelAtLeast "5.4";
|
2016-03-24 12:15:10 +00:00
|
|
|
};
|
|
|
|
}
|