mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-06 04:53:27 +00:00
571c71e6f7
We are migrating packages that meet below requirements: 1. using `callPackage` 2. called path is a directory 3. overriding set is empty (`{ }`) 4. not containing path expressions other than relative path (to makenixpkgs-vet happy) 5. not referenced by nix files outside of the directory, other than`pkgs/top-level/all-packages.nix` 6. not referencing nix files outside of the directory 7. not referencing `default.nix` (since it's changed to `package.nix`) 8. `outPath` doesn't change after migration The tool is here: https://github.com/Aleksanaa/by-name-migrate.
60 lines
1.7 KiB
Nix
60 lines
1.7 KiB
Nix
{ lib, stdenv, fetchurl, mfcj470dwlpr, makeWrapper, bash }:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "mfcj470dw-cupswrapper";
|
|
version = "3.0.0-1";
|
|
|
|
src = fetchurl {
|
|
url = "https://download.brother.com/welcome/dlf006866/mfcj470dw_cupswrapper_GPL_source_${version}.tar.gz";
|
|
sha256 = "b88f9b592723a00c024129560367f40a560ca3cba06fd99512ab368dd6855853";
|
|
};
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
buildInputs = [
|
|
bash # shebang
|
|
];
|
|
|
|
makeFlags = [ "-C" "brcupsconfpt1" "all" ];
|
|
|
|
postPatch = ''
|
|
WRAPPER=cupswrapper/cupswrappermfcj470dw
|
|
|
|
substituteInPlace $WRAPPER \
|
|
--replace-fail /opt "${mfcj470dwlpr}/opt" \
|
|
--replace-fail /usr "${mfcj470dwlpr}/usr" \
|
|
--replace-fail /etc "$out/etc"
|
|
|
|
substituteInPlace $WRAPPER \
|
|
--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/
|
|
|
|
mkdir -p $TARGETFOLDER
|
|
mkdir -p $PPDFOLDER
|
|
mkdir -p $FILTERFOLDER
|
|
|
|
cp brcupsconfpt1/brcupsconfpt1 $TARGETFOLDER
|
|
cp cupswrapper/cupswrappermfcj470dw $TARGETFOLDER
|
|
cp PPD/brother_mfcj470dw_printer_en.ppd $PPDFOLDER
|
|
|
|
ln -s ${mfcj470dwlpr}/lib/cups/filter/brother_lpdwrapper_mfcj470dw $FILTERFOLDER/
|
|
|
|
runHook postInstall
|
|
'';
|
|
|
|
meta = {
|
|
homepage = "http://www.brother.com/";
|
|
description = "Brother MFC-J470DW CUPS wrapper driver";
|
|
license = lib.licenses.gpl2Plus;
|
|
platforms = lib.platforms.linux;
|
|
downloadPage = "http://support.brother.com/g/b/downloadlist.aspx?c=us&lang=en&prod=mfcj470dw_us_eu_as&os=128";
|
|
maintainers = [ lib.maintainers.yochai ];
|
|
};
|
|
}
|