2021-01-15 14:21:58 +01:00
|
|
|
{ lib, stdenv, fetchurl, mfcj470dwlpr, makeWrapper}:
|
2016-09-17 17:20:25 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "mfcj470dw-cupswrapper";
|
2016-09-17 17:20:25 +02:00
|
|
|
version = "3.0.0-1";
|
|
|
|
|
|
|
|
src = fetchurl {
|
2018-06-28 20:43:35 +02:00
|
|
|
url = "https://download.brother.com/welcome/dlf006866/mfcj470dw_cupswrapper_GPL_source_${version}.tar.gz";
|
2016-09-17 17:20:25 +02:00
|
|
|
sha256 = "b88f9b592723a00c024129560367f40a560ca3cba06fd99512ab368dd6855853";
|
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
buildInputs = [ mfcj470dwlpr ];
|
|
|
|
|
|
|
|
patchPhase = ''
|
|
|
|
WRAPPER=cupswrapper/cupswrappermfcj470dw
|
|
|
|
|
|
|
|
substituteInPlace $WRAPPER \
|
|
|
|
--replace /opt "${mfcj470dwlpr}/opt" \
|
|
|
|
--replace /usr "${mfcj470dwlpr}/usr" \
|
|
|
|
--replace /etc "$out/etc"
|
|
|
|
|
|
|
|
substituteInPlace $WRAPPER \
|
2021-12-01 13:49:34 +01:00
|
|
|
--replace "cp " "cp -p "
|
2016-09-17 17:20:25 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
cd brcupsconfpt1
|
|
|
|
make all
|
|
|
|
cd ..
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
TARGETFOLDER=$out/opt/brother/Printers/mfcj470dw/cupswrapper/
|
2021-12-01 13:49:34 +01:00
|
|
|
PPDFOLDER=$out/share/cups/model/
|
|
|
|
FILTERFOLDER=$out/lib/cups/filter/
|
|
|
|
|
|
|
|
mkdir -p $TARGETFOLDER
|
|
|
|
mkdir -p $PPDFOLDER
|
|
|
|
mkdir -p $FILTERFOLDER
|
2016-09-17 17:20:25 +02:00
|
|
|
|
|
|
|
cp brcupsconfpt1/brcupsconfpt1 $TARGETFOLDER
|
2021-12-01 13:49:34 +01:00
|
|
|
cp cupswrapper/cupswrappermfcj470dw $TARGETFOLDER
|
|
|
|
cp PPD/brother_mfcj470dw_printer_en.ppd $PPDFOLDER
|
|
|
|
|
|
|
|
ln -s ${mfcj470dwlpr}/lib/cups/filter/brother_lpdwrapper_mfcj470dw $FILTERFOLDER/
|
2016-09-17 17:20:25 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
cleanPhase = ''
|
|
|
|
cd brcupsconfpt1
|
|
|
|
make clean
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "http://www.brother.com/";
|
2016-09-17 17:20:25 +02:00
|
|
|
description = "Brother MFC-J470DW CUPS wrapper driver";
|
2021-01-15 14:21:58 +01:00
|
|
|
license = lib.licenses.gpl2;
|
|
|
|
platforms = lib.platforms.linux;
|
2020-04-01 03:11:51 +02:00
|
|
|
downloadPage = "http://support.brother.com/g/b/downloadlist.aspx?c=us&lang=en&prod=mfcj470dw_us_eu_as&os=128";
|
2021-01-15 14:21:58 +01:00
|
|
|
maintainers = [ lib.maintainers.yochai ];
|
2016-09-17 17:20:25 +02:00
|
|
|
};
|
|
|
|
}
|