Merge pull request #291609 from Artturin/printcleanup1
{mfcj6510,mfcj470}dwcupswrapper: cleanup
This commit is contained in:
commit
70576b917e
@ -1,4 +1,4 @@
|
|||||||
{ lib, stdenv, fetchurl, mfcj470dwlpr, makeWrapper}:
|
{ lib, stdenv, fetchurl, mfcj470dwlpr, makeWrapper, bash }:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "mfcj470dw-cupswrapper";
|
pname = "mfcj470dw-cupswrapper";
|
||||||
@ -10,27 +10,27 @@ stdenv.mkDerivation rec {
|
|||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [ makeWrapper ];
|
nativeBuildInputs = [ makeWrapper ];
|
||||||
buildInputs = [ mfcj470dwlpr ];
|
buildInputs = [
|
||||||
|
bash # shebang
|
||||||
|
];
|
||||||
|
|
||||||
patchPhase = ''
|
makeFlags = [ "-C" "brcupsconfpt1" "all" ];
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
WRAPPER=cupswrapper/cupswrappermfcj470dw
|
WRAPPER=cupswrapper/cupswrappermfcj470dw
|
||||||
|
|
||||||
substituteInPlace $WRAPPER \
|
substituteInPlace $WRAPPER \
|
||||||
--replace /opt "${mfcj470dwlpr}/opt" \
|
--replace-fail /opt "${mfcj470dwlpr}/opt" \
|
||||||
--replace /usr "${mfcj470dwlpr}/usr" \
|
--replace-fail /usr "${mfcj470dwlpr}/usr" \
|
||||||
--replace /etc "$out/etc"
|
--replace-fail /etc "$out/etc"
|
||||||
|
|
||||||
substituteInPlace $WRAPPER \
|
substituteInPlace $WRAPPER \
|
||||||
--replace "cp " "cp -p "
|
--replace-fail "cp " "cp -p "
|
||||||
'';
|
'';
|
||||||
|
|
||||||
buildPhase = ''
|
|
||||||
cd brcupsconfpt1
|
|
||||||
make all
|
|
||||||
cd ..
|
|
||||||
'';
|
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
|
||||||
TARGETFOLDER=$out/opt/brother/Printers/mfcj470dw/cupswrapper/
|
TARGETFOLDER=$out/opt/brother/Printers/mfcj470dw/cupswrapper/
|
||||||
PPDFOLDER=$out/share/cups/model/
|
PPDFOLDER=$out/share/cups/model/
|
||||||
FILTERFOLDER=$out/lib/cups/filter/
|
FILTERFOLDER=$out/lib/cups/filter/
|
||||||
@ -44,12 +44,9 @@ stdenv.mkDerivation rec {
|
|||||||
cp PPD/brother_mfcj470dw_printer_en.ppd $PPDFOLDER
|
cp PPD/brother_mfcj470dw_printer_en.ppd $PPDFOLDER
|
||||||
|
|
||||||
ln -s ${mfcj470dwlpr}/lib/cups/filter/brother_lpdwrapper_mfcj470dw $FILTERFOLDER/
|
ln -s ${mfcj470dwlpr}/lib/cups/filter/brother_lpdwrapper_mfcj470dw $FILTERFOLDER/
|
||||||
'';
|
|
||||||
|
|
||||||
cleanPhase = ''
|
runHook postInstall
|
||||||
cd brcupsconfpt1
|
'';
|
||||||
make clean
|
|
||||||
'';
|
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
homepage = "http://www.brother.com/";
|
homepage = "http://www.brother.com/";
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ lib, stdenv, fetchurl, mfcj6510dwlpr, makeWrapper}:
|
{ lib, stdenv, fetchurl, mfcj6510dwlpr, makeWrapper, bash }:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "mfcj6510dw-cupswrapper";
|
pname = "mfcj6510dw-cupswrapper";
|
||||||
@ -10,15 +10,15 @@ stdenv.mkDerivation rec {
|
|||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [ makeWrapper ];
|
nativeBuildInputs = [ makeWrapper ];
|
||||||
buildInputs = [ mfcj6510dwlpr ];
|
buildInputs = [
|
||||||
|
bash # shebang
|
||||||
|
];
|
||||||
|
|
||||||
buildPhase = ''
|
makeFlags = [ "-C" "brcupsconfig" "all" ];
|
||||||
cd brcupsconfig
|
|
||||||
make all
|
|
||||||
cd ..
|
|
||||||
'';
|
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
|
||||||
TARGETFOLDER=$out/opt/brother/Printers/mfcj6510dw/cupswrapper
|
TARGETFOLDER=$out/opt/brother/Printers/mfcj6510dw/cupswrapper
|
||||||
mkdir -p $TARGETFOLDER
|
mkdir -p $TARGETFOLDER
|
||||||
cp PPD/brother_mfcj6510dw_printer_en.ppd $TARGETFOLDER
|
cp PPD/brother_mfcj6510dw_printer_en.ppd $TARGETFOLDER
|
||||||
@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
|
|||||||
cp scripts/cupswrappermfcj6510dw $TARGETFOLDER
|
cp scripts/cupswrappermfcj6510dw $TARGETFOLDER
|
||||||
sed -i -e '26,304d' $TARGETFOLDER/cupswrappermfcj6510dw
|
sed -i -e '26,304d' $TARGETFOLDER/cupswrappermfcj6510dw
|
||||||
substituteInPlace $TARGETFOLDER/cupswrappermfcj6510dw \
|
substituteInPlace $TARGETFOLDER/cupswrappermfcj6510dw \
|
||||||
--replace "\$ppd_file_name" "$TARGETFOLDER/brother_mfcj6510dw_printer_en.ppd"
|
--replace-fail "\$ppd_file_name" "$TARGETFOLDER/brother_mfcj6510dw_printer_en.ppd"
|
||||||
|
|
||||||
CPUSFILTERFOLDER=$out/lib/cups/filter
|
CPUSFILTERFOLDER=$out/lib/cups/filter
|
||||||
mkdir -p $TARGETFOLDER $CPUSFILTERFOLDER
|
mkdir -p $TARGETFOLDER $CPUSFILTERFOLDER
|
||||||
@ -37,22 +37,19 @@ stdenv.mkDerivation rec {
|
|||||||
#sed -i -e '33,40d' $CPUSFILTERFOLDER/brother_lpdwrapper_mfcj6510dw
|
#sed -i -e '33,40d' $CPUSFILTERFOLDER/brother_lpdwrapper_mfcj6510dw
|
||||||
#sed -i -e '34,35d' $CPUSFILTERFOLDER/brother_lpdwrapper_mfcj6510dw
|
#sed -i -e '34,35d' $CPUSFILTERFOLDER/brother_lpdwrapper_mfcj6510dw
|
||||||
#substituteInPlace $CPUSFILTERFOLDER/brother_lpdwrapper_mfcj6510dw \
|
#substituteInPlace $CPUSFILTERFOLDER/brother_lpdwrapper_mfcj6510dw \
|
||||||
# --replace "/opt/brother/$``{device_model``}/$``{printer_model``}/lpd/filter$``{printer_model``}" \
|
# --replace-fail "/opt/brother/$``{device_model``}/$``{printer_model``}/lpd/filter$``{printer_model``}" \
|
||||||
# "${mfcj6510dwlpr}/opt/brother/Printers/mfcj6510dw/lpd/filtermfcj6510dw" \
|
# "${mfcj6510dwlpr}/opt/brother/Printers/mfcj6510dw/lpd/filtermfcj6510dw" \
|
||||||
# --replace "/opt/brother/Printers/$``{printer_model``}/inf/br$``{printer_model``}rc" \
|
# --replace-fail "/opt/brother/Printers/$``{printer_model``}/inf/br$``{printer_model``}rc" \
|
||||||
# "${mfcj6510dwlpr}/opt/brother/Printers/mfcj6510dw/inf/brmfcj6510dwrc" \
|
# "${mfcj6510dwlpr}/opt/brother/Printers/mfcj6510dw/inf/brmfcj6510dwrc" \
|
||||||
# --replace "/opt/brother/$``{device_model``}/$``{printer_model``}/cupswrapper/brcupsconfpt1" \
|
# --replace-fail "/opt/brother/$``{device_model``}/$``{printer_model``}/cupswrapper/brcupsconfpt1" \
|
||||||
# "$out/opt/brother/Printers/mfcj6510dw/cupswrapper/brcupsconfpt1" \
|
# "$out/opt/brother/Printers/mfcj6510dw/cupswrapper/brcupsconfpt1" \
|
||||||
# --replace "/usr/share/cups/model/Brother/brother_" "$out/opt/brother/Printers/mfcj6510dw/cupswrapper/brother_"
|
# --replace-fail "/usr/share/cups/model/Brother/brother_" "$out/opt/brother/Printers/mfcj6510dw/cupswrapper/brother_"
|
||||||
#substituteInPlace $CPUSFILTERFOLDER/brother_lpdwrapper_mfcj6510dw \
|
#substituteInPlace $CPUSFILTERFOLDER/brother_lpdwrapper_mfcj6510dw \
|
||||||
# --replace "$``{printer_model``}" "mfcj6510dw" \
|
# --replace-fail "$``{printer_model``}" "mfcj6510dw" \
|
||||||
# --replace "$``{printer_name``}" "MFCJ6510DW"
|
# --replace-fail "$``{printer_name``}" "MFCJ6510DW"
|
||||||
'';
|
|
||||||
|
|
||||||
cleanPhase = ''
|
runHook postInstall
|
||||||
cd brcupsconfpt1
|
'';
|
||||||
make clean
|
|
||||||
'';
|
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
homepage = "http://www.brother.com/";
|
homepage = "http://www.brother.com/";
|
||||||
|
Loading…
Reference in New Issue
Block a user