From 72def8dad282f8e059a52ddd7bda814caf3b070c Mon Sep 17 00:00:00 2001 From: Artturin Date: Mon, 26 Feb 2024 19:10:09 +0200 Subject: {mfcj6510,mfcj470}dwcupswrapper: cleanup `cleanupPhase` doesn't exist --- .../cups/drivers/mfcj470dwcupswrapper/default.nix | 35 ++++++++++------------ .../cups/drivers/mfcj6510dwcupswrapper/default.nix | 35 ++++++++++------------ 2 files changed, 32 insertions(+), 38 deletions(-) diff --git a/pkgs/misc/cups/drivers/mfcj470dwcupswrapper/default.nix b/pkgs/misc/cups/drivers/mfcj470dwcupswrapper/default.nix index dc54611d335a..767597548991 100644 --- a/pkgs/misc/cups/drivers/mfcj470dwcupswrapper/default.nix +++ b/pkgs/misc/cups/drivers/mfcj470dwcupswrapper/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, mfcj470dwlpr, makeWrapper}: +{ lib, stdenv, fetchurl, mfcj470dwlpr, makeWrapper, bash }: stdenv.mkDerivation rec { pname = "mfcj470dw-cupswrapper"; @@ -10,27 +10,27 @@ stdenv.mkDerivation rec { }; nativeBuildInputs = [ makeWrapper ]; - buildInputs = [ mfcj470dwlpr ]; + buildInputs = [ + bash # shebang + ]; - patchPhase = '' + makeFlags = [ "-C" "brcupsconfpt1" "all" ]; + + postPatch = '' WRAPPER=cupswrapper/cupswrappermfcj470dw substituteInPlace $WRAPPER \ - --replace /opt "${mfcj470dwlpr}/opt" \ - --replace /usr "${mfcj470dwlpr}/usr" \ - --replace /etc "$out/etc" + --replace-fail /opt "${mfcj470dwlpr}/opt" \ + --replace-fail /usr "${mfcj470dwlpr}/usr" \ + --replace-fail /etc "$out/etc" substituteInPlace $WRAPPER \ - --replace "cp " "cp -p " - ''; - - buildPhase = '' - cd brcupsconfpt1 - make all - cd .. - ''; + --replace-fail "cp " "cp -p " + ''; installPhase = '' + runHook preInstall + TARGETFOLDER=$out/opt/brother/Printers/mfcj470dw/cupswrapper/ PPDFOLDER=$out/share/cups/model/ FILTERFOLDER=$out/lib/cups/filter/ @@ -44,12 +44,9 @@ stdenv.mkDerivation rec { cp PPD/brother_mfcj470dw_printer_en.ppd $PPDFOLDER ln -s ${mfcj470dwlpr}/lib/cups/filter/brother_lpdwrapper_mfcj470dw $FILTERFOLDER/ - ''; - cleanPhase = '' - cd brcupsconfpt1 - make clean - ''; + runHook postInstall + ''; meta = { homepage = "http://www.brother.com/"; diff --git a/pkgs/misc/cups/drivers/mfcj6510dwcupswrapper/default.nix b/pkgs/misc/cups/drivers/mfcj6510dwcupswrapper/default.nix index 1653ced85c5a..4e6f37112087 100644 --- a/pkgs/misc/cups/drivers/mfcj6510dwcupswrapper/default.nix +++ b/pkgs/misc/cups/drivers/mfcj6510dwcupswrapper/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, mfcj6510dwlpr, makeWrapper}: +{ lib, stdenv, fetchurl, mfcj6510dwlpr, makeWrapper, bash }: stdenv.mkDerivation rec { pname = "mfcj6510dw-cupswrapper"; @@ -10,15 +10,15 @@ stdenv.mkDerivation rec { }; nativeBuildInputs = [ makeWrapper ]; - buildInputs = [ mfcj6510dwlpr ]; + buildInputs = [ + bash # shebang + ]; - buildPhase = '' - cd brcupsconfig - make all - cd .. - ''; + makeFlags = [ "-C" "brcupsconfig" "all" ]; installPhase = '' + runHook preInstall + TARGETFOLDER=$out/opt/brother/Printers/mfcj6510dw/cupswrapper mkdir -p $TARGETFOLDER cp PPD/brother_mfcj6510dw_printer_en.ppd $TARGETFOLDER @@ -26,7 +26,7 @@ stdenv.mkDerivation rec { cp scripts/cupswrappermfcj6510dw $TARGETFOLDER sed -i -e '26,304d' $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 mkdir -p $TARGETFOLDER $CPUSFILTERFOLDER @@ -37,22 +37,19 @@ stdenv.mkDerivation rec { #sed -i -e '33,40d' $CPUSFILTERFOLDER/brother_lpdwrapper_mfcj6510dw #sed -i -e '34,35d' $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" \ - # --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" \ - # --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" \ - # --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 \ - # --replace "$``{printer_model``}" "mfcj6510dw" \ - # --replace "$``{printer_name``}" "MFCJ6510DW" - ''; + # --replace-fail "$``{printer_model``}" "mfcj6510dw" \ + # --replace-fail "$``{printer_name``}" "MFCJ6510DW" - cleanPhase = '' - cd brcupsconfpt1 - make clean - ''; + runHook postInstall + ''; meta = with lib; { homepage = "http://www.brother.com/"; -- cgit 1.4.1