push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,63 @@
{
lib,
stdenv,
autoAddDriverRunpath,
cudaPackages,
fetchFromGitHub,
versionCheckHook,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "mfaktc";
version = "0.23.6";
src = fetchFromGitHub {
owner = "primesearch";
repo = "mfaktc";
tag = "${finalAttrs.version}";
fetchSubmodules = true;
hash = "sha256-+oO2zMGxcnkEUlD1q5Sy79aXp7BtGTTsvbKjPqBt7sw=";
};
enableParallelBuilding = true;
buildInputs = [
cudaPackages.cuda_nvcc
cudaPackages.cuda_cudart
autoAddDriverRunpath
];
makeFlags = [
"-C"
"src"
];
installPhase = ''
runHook preInstall
install -Dm755 mfaktc -t $out/bin
install -Dm755 mfaktc.ini -t $out/share
runHook postInstall
'';
doInstallCheck = true;
nativeInstallCheckInputs = [
versionCheckHook
];
versionCheckProgramArg = "-h";
meta = {
description = "Trial Factoring program using CUDA for GIMPS";
longDescription = ''
CUDA Program for trial factoring Mersenne primes. Intented for use with GIMPS through autoprimenet.py.
Note that the mfaktc.ini file, which is in $out/share, must be symlinked to your working directory.
'';
homepage = "https://github.com/primesearch/mfaktc";
downloadPage = "https://github.com/primesearch/mfaktc/releases/tag/${finalAttrs.version}";
maintainers = with lib.maintainers; [ dstremur ];
license = lib.licenses.gpl3Plus;
platforms = [ "x86_64-linux" ];
mainProgram = "mfaktc";
};
})

View File

@@ -0,0 +1,51 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
pkg-config,
qt6,
libvlc,
libvlcpp,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "mfaomp";
version = "0.4.3";
src = fetchFromGitHub {
owner = "Neurofibromin";
repo = "mfaomp";
tag = "v${finalAttrs.version}";
hash = "sha256-b8eIG5UC1i4yfHSStNwhgIttTS+g511RmFJ5OYxeYvM=";
};
nativeBuildInputs = [
cmake
pkg-config
qt6.wrapQtAppsHook
];
buildInputs = [
qt6.qtbase
qt6.qtmultimedia
qt6.qtwebengine
qt6.qtsvg
libvlc
libvlcpp
];
cmakeFlags = [
(lib.cmakeBool "USE_SYSTEM_PROVIDED_LIBVLCPP" true)
(lib.cmakeBool "USE_FETCHED_LIBVLCPP" false)
];
meta = {
description = "Multiple Files At Once Media Player";
homepage = "https://github.com/Neurofibromin/mfaomp";
license = lib.licenses.gpl3Plus;
maintainers = with lib.maintainers; [ neurofibromin ];
platforms = lib.platforms.linux;
mainProgram = "mfaomp";
};
})

View File

@@ -0,0 +1,89 @@
{
lib,
stdenv,
fetchurl,
dpkg,
makeWrapper,
coreutils,
gnugrep,
gnused,
mfc465cnlpr,
pkgsi686Linux,
psutils,
}:
stdenv.mkDerivation rec {
pname = "mfc465cncupswrapper";
version = "1.0.1-1";
src = fetchurl {
url = "https://download.brother.com/welcome/dlf006134/${pname}-${version}.i386.deb";
sha256 = "59a62ed3cf10f1565c08ace55832bd48bd5034f7067662870edf7ff3bf0cb76a";
};
unpackPhase = ''
dpkg-deb -x $src $out
'';
nativeBuildInputs = [
dpkg
makeWrapper
];
dontBuild = true;
installPhase = ''
lpr=${mfc465cnlpr}/usr/local/Brother/Printer/mfc465cn
dir=$out/usr/local/Brother/Printer/mfc465cn
interpreter=${pkgsi686Linux.glibc.out}/lib/ld-linux.so.2
patchelf --set-interpreter "$interpreter" "$dir/cupswrapper/brcupsconfpt1"
substituteInPlace $dir/cupswrapper/cupswrappermfc465cn \
--replace "mkdir -p /usr" ": # mkdir -p /usr" \
--replace '/''${printer_model}' "/mfc465cn" \
--replace 'br''${printer_model}' "brmfc465cn" \
--replace 'brlpdwrapper''${printer_model}' "brlpdwrappermfc465cn" \
--replace 'filter''${printer_model}' "filtermfc465cn" \
--replace ' ''${printer_name}' " MFC465CN" \
--replace ' ''${device_name}' " MFC-465CN" \
--replace '(''${device_name}' "(MFC-465CN" \
--replace ':''${device_name}' ":MFC-465CN" \
--replace '/''${device_name}' "/MFC-465CN" \
--replace 'BR''${pcfilename}' "BR465" \
--replace '/''${device_model}' "/Printer" \
--replace '/usr/lib64/cups/filter/brlpdwrappermfc465cn' "$out/lib/cups/filter/brlpdwrappermfc465cn" \
--replace '/usr/local/Brother/Printer/mfc465cn/lpd/filtermfc465cn' "$lpr/lpd/filtermfc465cn" \
--replace '/usr/share/ppd/brmfc465cn.ppd' "$dir/cupswrapper/brmfc465.ppd" \
--replace '/usr/share/cups/model/brmfc465cn.ppd' "$dir/cupswrapper/brmfc465.ppd" \
--replace '/usr/lib/cups/filter/brlpdwrappermfc465cn' "$out/usr/lib/cups/filter/brlpdwrappermfc465cn" \
--replace 'nup="psnup' "nup=\"${psutils}/bin/psnup" \
--replace '/usr/bin/psnup' "${psutils}/bin/psnup" \
--replace '/usr/local/Brother/Printer/mfc465cn/cupswrapper/brcupsconfpt1' "$dir/cupswrapper/brcupsconfpt1" \
--replace '/usr/local/Brother/Printer/mfc465cn/inf' "$lpr/inf"
# Create the PPD file from the cupswrapper file
sed -n '/ENDOFPPDFILE1/,/ENDOFPPDFILE1/p' "$dir/cupswrapper/cupswrappermfc465cn" | head -n -1 | tail -n +2 > $dir/cupswrapper/brmfc465.ppd
sed -n '/ENDOFPPDFILE_END/,/ENDOFPPDFILE_END/p' "$dir/cupswrapper/cupswrappermfc465cn" | head -n -1 | tail -n +2 >> $dir/cupswrapper/brmfc465.ppd
chmod 644 $dir/cupswrapper/brmfc465.ppd
mkdir -p $out/lib/cups/filter
mkdir -p $out/share/cups/model
ln $dir/cupswrapper/cupswrappermfc465cn $out/lib/cups/filter
ln $dir/cupswrapper/brmfc465.ppd $out/share/cups/model
sed -n '/!ENDOFWFILTER!/,/!ENDOFWFILTER!/p' "$dir/cupswrapper/cupswrappermfc465cn" | sed '1 br; b; :r s/.*/printer_model=mfc465cn; cat <<!ENDOFWFILTER!/' | bash > $out/lib/cups/filter/brlpdwrappermfc465cn
sed -i "/#! \/bin\/sh/a PATH=${
lib.makeBinPath [
coreutils
gnused
gnugrep
]
}:\$PATH" $out/lib/cups/filter/brlpdwrappermfc465cn
chmod 755 $out/lib/cups/filter/brlpdwrappermfc465cn
'';
meta = with lib; {
description = "Brother MFC-465CN CUPS wrapper driver";
homepage = "http://www.brother.com/";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
license = licenses.gpl2Plus;
platforms = platforms.linux;
maintainers = with maintainers; [ phrogg ];
};
}

View File

@@ -0,0 +1,77 @@
{
stdenv,
lib,
fetchurl,
dpkg,
makeWrapper,
coreutils,
file,
gawk,
ghostscript,
gnused,
pkgsi686Linux,
}:
stdenv.mkDerivation rec {
pname = "mfc465cnlpr";
version = "1.0.1-1";
src = fetchurl {
url = "https://download.brother.com/welcome/dlf006132/${pname}-${version}.i386.deb";
sha256 = "cfe0289510bf36bee6014286ea78b1ebc6bbb948dbfd3aee02f0664a7743f99b";
};
unpackPhase = ''
dpkg-deb -x $src $out
'';
nativeBuildInputs = [
dpkg
makeWrapper
];
dontBuild = true;
installPhase = ''
dir=$out/usr/local/Brother/Printer/mfc465cn
patchelf --set-interpreter ${pkgsi686Linux.glibc.out}/lib/ld-linux.so.2 $dir/lpd/brmfc465cnfilter
wrapProgram $dir/inf/setupPrintcapij \
--prefix PATH : ${
lib.makeBinPath [
coreutils
]
}
substituteInPlace $dir/lpd/filtermfc465cn \
--replace "BR_PRT_PATH=" "BR_PRT_PATH=\"$dir/\" #"
wrapProgram $dir/lpd/filtermfc465cn \
--prefix PATH : ${
lib.makeBinPath [
coreutils
file
ghostscript
gnused
]
}
substituteInPlace $dir/lpd/psconvertij2 \
--replace '`which gs`' "${ghostscript}/bin/gs"
wrapProgram $dir/lpd/psconvertij2 \
--prefix PATH : ${
lib.makeBinPath [
gnused
gawk
]
}
chmod -R a+w $dir/inf/
'';
meta = with lib; {
description = "Brother MFC-465CN LPR printer driver";
homepage = "http://www.brother.com/";
license = licenses.unfree;
maintainers = with maintainers; [ phrogg ];
platforms = [
"i686-linux"
"x86_64-linux"
];
};
}

View File

@@ -0,0 +1,83 @@
{
lib,
stdenv,
fetchurl,
dpkg,
makeWrapper,
coreutils,
gnugrep,
gnused,
mfc5890cnlpr,
pkgsi686Linux,
psutils,
}:
stdenv.mkDerivation rec {
pname = "mfc5890cncupswrapper";
version = "1.1.2-2";
src = fetchurl {
url = "https://download.brother.com/welcome/dlf006170/${pname}-${version}.i386.deb";
hash = "sha256-UOCwzB09/a1/2rliY+hTrslSvO5ztVj51auisPx7OIQ=";
};
unpackPhase = ''
dpkg-deb -x $src $out
'';
nativeBuildInputs = [
dpkg
makeWrapper
];
dontBuild = true;
installPhase = ''
lpr=${mfc5890cnlpr}/usr/local/Brother/Printer/mfc5890cn
dir=$out/usr/local/Brother/Printer/mfc5890cn
interpreter=${pkgsi686Linux.glibc.out}/lib/ld-linux.so.2
patchelf --set-interpreter "$interpreter" "$dir/cupswrapper/brcupsconfpt1"
#comment out lpadmin commands to prohibit changes to CUPS config by just installing this driver.
substituteInPlace $dir/cupswrapper/cupswrappermfc5890cn \
--replace "lpadmin" "#lpadmin" \
--replace "/usr/" "$out/usr/"
#mfc5890cnlpr is a dependency of this package. Link all files of mfc5890cnlpr into the $out/usr folder, as other scripts depend on these files being present.
#Ideally, we would use substituteInPlace for each file this package actually requires. But the scripts of Brother use variables to dynamically build the paths
#at runtime, making this approach more complex. Hence, the easier route of simply linking all files was choosen.
find "$lpr" -type f -exec sh -c "mkdir -vp \$(echo '{}' | sed 's|$lpr|$dir|g' | xargs dirname) && ln -s '{}' \$(echo '{}' | sed 's|$lpr|$dir|g')" \;
mkdir -p $out/usr/share/ppd/
mkdir -p $out/usr/lib64/cups/filter
sed -i '941,972d' $dir/cupswrapper/cupswrappermfc5890cn
$dir/cupswrapper/cupswrappermfc5890cn
chmod +x $out/usr/lib64/cups/filter/brlpdwrappermfc5890cn
wrapProgram $out/usr/lib64/cups/filter/brlpdwrappermfc5890cn --prefix PATH : ${
lib.makeBinPath [
coreutils
psutils
gnugrep
gnused
]
}
mkdir -p $out/lib/cups/filter
mkdir -p $out/share/cups/model
ln $out/usr/lib64/cups/filter/brlpdwrappermfc5890cn $out/lib/cups/filter
ln $dir/cupswrapper/cupswrappermfc5890cn $out/lib/cups/filter
ln $out/usr/share/ppd/brmfc5890cn.ppd $out/share/cups/model
'';
meta = with lib; {
description = "Brother MFC-5890CN CUPS wrapper driver";
longDescription = "Brother MFC-5890CN CUPS wrapper driver. Use the connection string 'lpd://\${IP_ADDRESS}/binary_p1' when connecting to this printer via the network.";
homepage = "http://www.brother.com/";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
license = licenses.gpl2Plus;
platforms = platforms.linux;
maintainers = with maintainers; [ martinramm ];
};
}

View File

@@ -0,0 +1,85 @@
{
stdenv,
a2ps,
lib,
fetchurl,
dpkg,
makeWrapper,
coreutils,
file,
gawk,
ghostscript,
gnused,
pkgsi686Linux,
}:
stdenv.mkDerivation rec {
pname = "mfc5890cnlpr";
version = "1.1.2-2";
src = fetchurl {
url = "https://download.brother.com/welcome/dlf006168/${pname}-${version}.i386.deb";
sha256 = "119h3s1p9pv83mrfv6cmxpc0v33xf8c9nw5clj9yafv3aizxy6dp";
};
unpackPhase = ''
dpkg-deb -x $src $out
'';
nativeBuildInputs = [
dpkg
makeWrapper
];
dontBuild = true;
installPhase = ''
dir=$out/usr/local/Brother/Printer/mfc5890cn
patchelf --set-interpreter ${pkgsi686Linux.glibc.out}/lib/ld-linux.so.2 $dir/lpd/brmfc5890cnfilter
wrapProgram $dir/inf/setupPrintcapij \
--prefix PATH : ${
lib.makeBinPath [
coreutils
]
}
substituteInPlace $dir/lpd/filtermfc5890cn \
--replace "/usr/" "$out/usr/"
wrapProgram $dir/lpd/filtermfc5890cn \
--prefix PATH : ${
lib.makeBinPath [
a2ps
coreutils
file
ghostscript
gnused
]
}
substituteInPlace $dir/lpd/psconvertij2 \
--replace '`which gs`' "${ghostscript}/bin/gs"
wrapProgram $dir/lpd/psconvertij2 \
--prefix PATH : ${
lib.makeBinPath [
gnused
gawk
]
}
'';
meta = with lib; {
description = "Brother MFC-5890CN LPR printer driver";
homepage = "http://www.brother.com/";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
license = licenses.unfree;
maintainers = with maintainers; [ martinramm ];
platforms = [
"i686-linux"
"x86_64-linux"
];
};
}

View File

@@ -0,0 +1,76 @@
{
lib,
stdenv,
fetchurl,
dpkg,
makeWrapper,
coreutils,
gnugrep,
gnused,
mfc9140cdnlpr,
pkgsi686Linux,
psutils,
}:
stdenv.mkDerivation rec {
pname = "mfc9140cdncupswrapper";
version = "1.1.4-0";
src = fetchurl {
url = "https://download.brother.com/welcome/dlf100407/${pname}-${version}.i386.deb";
sha256 = "18aramgqgra1shdhsa75i0090hk9i267gvabildwsk52kq2b96c6";
};
unpackPhase = ''
dpkg-deb -x $src $out
'';
nativeBuildInputs = [
dpkg
makeWrapper
];
dontBuild = true;
installPhase = ''
lpr=${mfc9140cdnlpr}/opt/brother/Printers/mfc9140cdn
dir=$out/opt/brother/Printers/mfc9140cdn
interpreter=${pkgsi686Linux.glibc.out}/lib/ld-linux.so.2
patchelf --set-interpreter "$interpreter" "$dir/cupswrapper/brcupsconfpt1"
substituteInPlace $dir/cupswrapper/cupswrappermfc9140cdn \
--replace "mkdir -p /usr" ": # mkdir -p /usr" \
--replace '/opt/brother/''${device_model}/''${printer_model}/lpd/filter''${printer_model}' "$lpr/lpd/filtermfc9140cdn" \
--replace '/usr/share/ppd/Brother/brother_''${printer_model}_printer_en.ppd' "$dir/cupswrapper/brother_mfc9140cdn_printer_en.ppd" \
--replace '/usr/share/cups/model/Brother/brother_''${printer_model}_printer_en.ppd' "$dir/cupswrapper/brother_mfc9140cdn_printer_en.ppd" \
--replace '/opt/brother/Printers/''${printer_model}/' "$lpr/" \
--replace 'nup="psnup' "nup=\"${psutils}/bin/psnup" \
--replace '/usr/bin/psnup' "${psutils}/bin/psnup"
mkdir -p $out/lib/cups/filter
mkdir -p $out/share/cups/model
ln $dir/cupswrapper/cupswrappermfc9140cdn $out/lib/cups/filter
ln $dir/cupswrapper/brother_mfc9140cdn_printer_en.ppd $out/share/cups/model
sed -n '/!ENDOFWFILTER!/,/!ENDOFWFILTER!/p' "$dir/cupswrapper/cupswrappermfc9140cdn" | sed '1 br; b; :r s/.*/printer_model=mfc9140cdn; cat <<!ENDOFWFILTER!/' | bash > $out/lib/cups/filter/brother_lpdwrapper_mfc9140cdn
sed -i "/#! \/bin\/sh/a PATH=${
lib.makeBinPath [
coreutils
gnused
gnugrep
]
}:\$PATH" $out/lib/cups/filter/brother_lpdwrapper_mfc9140cdn
chmod +x $out/lib/cups/filter/brother_lpdwrapper_mfc9140cdn
'';
meta = with lib; {
description = "Brother MFC-9140CDN CUPS wrapper driver";
homepage = "http://www.brother.com/";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
license = licenses.gpl2Plus;
platforms = platforms.linux;
maintainers = with maintainers; [ hexa ];
};
}

View File

@@ -0,0 +1,84 @@
{
stdenv,
lib,
fetchurl,
dpkg,
makeWrapper,
coreutils,
file,
gawk,
ghostscript,
gnused,
pkgsi686Linux,
}:
stdenv.mkDerivation rec {
pname = "mfc9140cdnlpr";
version = "1.1.2-1";
src = fetchurl {
url = "https://download.brother.com/welcome/dlf100405/${pname}-${version}.i386.deb";
sha256 = "1wqx8njrv078fc3vlq90qyrfg3cw9kr9m6f3qvfnkhq1f95fbslh";
};
unpackPhase = ''
dpkg-deb -x $src $out
'';
nativeBuildInputs = [
dpkg
makeWrapper
];
dontBuild = true;
installPhase = ''
dir=$out/opt/brother/Printers/mfc9140cdn
patchelf --set-interpreter ${pkgsi686Linux.glibc.out}/lib/ld-linux.so.2 $dir/lpd/brmfc9140cdnfilter
wrapProgram $dir/inf/setupPrintcapij \
--prefix PATH : ${
lib.makeBinPath [
coreutils
]
}
substituteInPlace $dir/lpd/filtermfc9140cdn \
--replace "BR_CFG_PATH=" "BR_CFG_PATH=\"$dir/\" #" \
--replace "BR_LPD_PATH=" "BR_LPD_PATH=\"$dir/\" #"
wrapProgram $dir/lpd/filtermfc9140cdn \
--prefix PATH : ${
lib.makeBinPath [
coreutils
file
ghostscript
gnused
]
}
substituteInPlace $dir/lpd/psconvertij2 \
--replace '`which gs`' "${ghostscript}/bin/gs"
wrapProgram $dir/lpd/psconvertij2 \
--prefix PATH : ${
lib.makeBinPath [
gnused
gawk
]
}
'';
meta = with lib; {
description = "Brother MFC-9140CDN LPR printer driver";
homepage = "http://www.brother.com/";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
license = licenses.unfree;
maintainers = with maintainers; [ hexa ];
platforms = [
"i686-linux"
"x86_64-linux"
];
};
}

View File

@@ -0,0 +1,70 @@
{
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 ];
};
}

View File

@@ -0,0 +1,73 @@
{
lib,
stdenv,
fetchurl,
mfcj6510dwlpr,
makeWrapper,
bash,
}:
stdenv.mkDerivation rec {
pname = "mfcj6510dw-cupswrapper";
version = "3.0.0-1";
src = fetchurl {
url = "https://download.brother.com/welcome/dlf006814/mfcj6510dw_cupswrapper_GPL_source_${version}.tar.gz";
sha256 = "0y5iffybxjin8injrdmc9n9hl4s6b8n6ck76m1z78bzi88vwmhai";
};
nativeBuildInputs = [ makeWrapper ];
buildInputs = [
bash # shebang
];
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
cp brcupsconfig/brcupsconfpt1 $TARGETFOLDER
cp scripts/cupswrappermfcj6510dw $TARGETFOLDER
sed -i -e '26,304d' $TARGETFOLDER/cupswrappermfcj6510dw
substituteInPlace $TARGETFOLDER/cupswrappermfcj6510dw \
--replace-fail "\$ppd_file_name" "$TARGETFOLDER/brother_mfcj6510dw_printer_en.ppd"
CPUSFILTERFOLDER=$out/lib/cups/filter
mkdir -p $TARGETFOLDER $CPUSFILTERFOLDER
ln -s ${mfcj6510dwlpr}/lib/cups/filter/brother_lpdwrapper_mfcj6510dw $out/lib/cups/filter/brother_lpdwrapper_mfcj6510dw
##TODO: Use the cups filter instead of the LPR one.
#cp scripts/cupswrappermfcj6510dw $CPUSFILTERFOLDER/brother_lpdwrapper_mfcj6510dw
#sed -i -e '110,258!d' $CPUSFILTERFOLDER/brother_lpdwrapper_mfcj6510dw
#sed -i -e '33,40d' $CPUSFILTERFOLDER/brother_lpdwrapper_mfcj6510dw
#sed -i -e '34,35d' $CPUSFILTERFOLDER/brother_lpdwrapper_mfcj6510dw
#substituteInPlace $CPUSFILTERFOLDER/brother_lpdwrapper_mfcj6510dw \
# --replace-fail "/opt/brother/$``{device_model``}/$``{printer_model``}/lpd/filter$``{printer_model``}" \
# "${mfcj6510dwlpr}/opt/brother/Printers/mfcj6510dw/lpd/filtermfcj6510dw" \
# --replace-fail "/opt/brother/Printers/$``{printer_model``}/inf/br$``{printer_model``}rc" \
# "${mfcj6510dwlpr}/opt/brother/Printers/mfcj6510dw/inf/brmfcj6510dwrc" \
# --replace-fail "/opt/brother/$``{device_model``}/$``{printer_model``}/cupswrapper/brcupsconfpt1" \
# "$out/opt/brother/Printers/mfcj6510dw/cupswrapper/brcupsconfpt1" \
# --replace-fail "/usr/share/cups/model/Brother/brother_" "$out/opt/brother/Printers/mfcj6510dw/cupswrapper/brother_"
#substituteInPlace $CPUSFILTERFOLDER/brother_lpdwrapper_mfcj6510dw \
# --replace-fail "$``{printer_model``}" "mfcj6510dw" \
# --replace-fail "$``{printer_name``}" "MFCJ6510DW"
runHook postInstall
'';
meta = with lib; {
homepage = "http://www.brother.com/";
description = "Brother MFC-J6510DW CUPS wrapper driver";
license = with licenses; gpl2Plus;
platforms = with platforms; linux;
downloadPage = "http://support.brother.com/g/b/downloadlist.aspx?c=us&lang=en&prod=mfcj6510dw_all&os=128";
maintainers = with maintainers; [ ramkromberg ];
};
}

View File

@@ -0,0 +1,57 @@
{
lib,
stdenv,
fetchurl,
mfcj880dwlpr,
makeWrapper,
bash,
}:
stdenv.mkDerivation rec {
pname = "mfcj880dw-cupswrapper";
version = "1.0.0-0";
src = fetchurl {
url = "https://download.brother.com/welcome/dlf102044/mfcj880dw_cupswrapper_GPL_source_${version}.tar.gz";
hash = "sha256-vykf4x1kr+rvtbDmBvS6+AxB2AAJ40syt31W91npz5Q=";
};
nativeBuildInputs = [ makeWrapper ];
buildInputs = [
bash # shebang
];
makeFlags = [
"-C"
"brcupsconfig"
"all"
];
installPhase = ''
runHook preInstall
TARGETFOLDER=$out/opt/brother/Printers/mfcj880dw/cupswrapper
mkdir -p $TARGETFOLDER
cp PPD/brother_mfcj880dw_printer_en.ppd $TARGETFOLDER
cp brcupsconfig/brcupsconfpt1 $TARGETFOLDER
cp cupswrapper/cupswrappermfcj880dw $TARGETFOLDER
sed -i -e '26,306d' $TARGETFOLDER/cupswrappermfcj880dw
substituteInPlace $TARGETFOLDER/cupswrappermfcj880dw \
--replace-fail "\$ppd_file_name" "$TARGETFOLDER/brother_mfcj880dw_printer_en.ppd"
CPUSFILTERFOLDER=$out/lib/cups/filter
mkdir -p $TARGETFOLDER $CPUSFILTERFOLDER
ln -s ${mfcj880dwlpr}/lib/cups/filter/brother_lpdwrapper_mfcj880dw $out/lib/cups/filter/brother_lpdwrapper_mfcj880dw
runHook postInstall
'';
meta = with lib; {
homepage = "http://www.brother.com/";
description = "Brother MFC-J880DW CUPS wrapper driver";
license = with licenses; gpl2;
platforms = with platforms; linux;
downloadPage = "https://support.brother.com/g/b/downloadlist.aspx?c=us&lang=en&prod=mfcj880dw_us_eu_as&os=128";
maintainers = with maintainers; [ _6543 ];
};
}

View File

@@ -0,0 +1,129 @@
{
lib,
stdenv,
fetchurl,
pkgsi686Linux,
dpkg,
makeWrapper,
coreutils,
gnused,
gawk,
file,
cups,
util-linux,
xxd,
runtimeShell,
ghostscript,
a2ps,
}:
# Why:
# The executable "brprintconf_mfcj880dw" binary is looking for "/opt/brother/Printers/%s/inf/br%sfunc" and "/opt/brother/Printers/%s/inf/br%src".
# Whereby, %s is printf(3) string substitution for stdin's arg0 (the command's own filename) from the 10th char forwards, as a runtime dependency.
# e.g. Say the filename is "0123456789ABCDE", the runtime will be looking for /opt/brother/Printers/ABCDE/inf/brABCDEfunc.
# Presumably, the binary was designed to be deployed under the filename "printconf_mfcj880dw", whereby it will search for "/opt/brother/Printers/mfcj880dw/inf/brmfcj880dwfunc".
# For NixOS, we want to change the string to the store path of brmfcj880dwfunc and brmfcj880dwrc but we're faced with two complications:
# 1. Too little room to specify the nix store path. We can't even take advantage of %s by renaming the file to the store path hash since the variable is too short and can't contain the whole hash.
# 2. The binary needs the directory it's running from to be r/w.
# What:
# As such, we strip the path and substitution altogether, leaving only "brmfcj880dwfunc" and "brmfcj880dwrc", while filling the leftovers with nulls.
# Fully null terminating the cstrings is necessary to keep the array the same size and preventing overflows.
# We then use a shell script to link and execute the binary, func and rc files in a temporary directory.
# How:
# In the package, we dump the raw binary as a string of search-able hex values using hexdump. We execute the substitution with sed. We then convert the hex values back to binary form using xxd.
# We also write a shell script that invoked "mktemp -d" to produce a r/w temporary directory and link what we need in the temporary directory.
# Result:
# The user can run brprintconf_mfcj880dw in the shell.
stdenv.mkDerivation rec {
pname = "mfcj880dwlpr";
version = "1.0.0-0";
src = fetchurl {
url = "https://download.brother.com/welcome/dlf102038/mfcj880dwlpr-${version}.i386.deb";
hash = "sha256-FoCzAfZgpAf+C2n13lnHRz0tZtxHKhWJsM2fUXNr/qc=";
};
nativeBuildInputs = [ makeWrapper ];
buildInputs = [
cups
ghostscript
dpkg
a2ps
];
dontUnpack = true;
brprintconf_mfcj880dw_script = ''
#!${runtimeShell}
cd $(mktemp -d)
ln -s @out@/usr/bin/brprintconf_mfcj880dw_patched brprintconf_mfcj880dw_patched
ln -s @out@/opt/brother/Printers/mfcj880dw/inf/brmfcj880dwfunc brmfcj880dwfunc
ln -s @out@/opt/brother/Printers/mfcj880dw/inf/brmfcj880dwrc brmfcj880dwrc
./brprintconf_mfcj880dw_patched "$@"
'';
installPhase = ''
dpkg-deb -x $src $out
substituteInPlace $out/opt/brother/Printers/mfcj880dw/lpd/filtermfcj880dw \
--replace-fail /opt "$out/opt"
substituteInPlace $out/opt/brother/Printers/mfcj880dw/lpd/psconvertij2 \
--replace-fail "GHOST_SCRIPT=`which gs`" "GHOST_SCRIPT=${ghostscript}/bin/gs"
substituteInPlace $out/opt/brother/Printers/mfcj880dw/inf/setupPrintcapij \
--replace-fail "/opt/brother/Printers" "$out/opt/brother/Printers" \
--replace-fail "printcap.local" "printcap"
patchelf --set-interpreter ${pkgsi686Linux.stdenv.cc.libc.out}/lib/ld-linux.so.2 \
--set-rpath $out/opt/brother/Printers/mfcj880dw/inf:$out/opt/brother/Printers/mfcj880dw/lpd \
$out/opt/brother/Printers/mfcj880dw/lpd/brmfcj880dwfilter
patchelf --set-interpreter ${pkgsi686Linux.stdenv.cc.libc.out}/lib/ld-linux.so.2 $out/usr/bin/brprintconf_mfcj880dw
#stripping the hardcoded path.
# /opt/brother/Printers/%s/inf/br%sfunc -> brmfcj880dwfunc
# /opt/brother/Printers/%s/inf/br%src -> brmfcj880dwrc
${util-linux}/bin/hexdump -ve '1/1 "%.2X"' $out/usr/bin/brprintconf_mfcj880dw | \
sed 's.2F6F70742F62726F746865722F5072696E746572732F25732F696E662F6272257366756E63.62726d66636a383830647766756e6300000000000000000000000000000000000000000000.' | \
sed 's.2F6F70742F62726F746865722F5072696E746572732F25732F696E662F627225737263.62726d66636a3838306477726300000000000000000000000000000000000000000000.' | \
${xxd}/bin/xxd -r -p > $out/usr/bin/brprintconf_mfcj880dw_patched
chmod +x $out/usr/bin/brprintconf_mfcj880dw_patched
#executing from current dir. segfaults if it's not r\w.
mkdir -p $out/bin
echo -n "$brprintconf_mfcj880dw_script" > $out/bin/brprintconf_mfcj880dw
chmod +x $out/bin/brprintconf_mfcj880dw
substituteInPlace $out/bin/brprintconf_mfcj880dw --replace-fail @out@ $out
# NOTE: opt/brother/Printers/mfcj880dw/lpd/brmfcj880dwfilter also has cardcoded paths, but we can not simply replace them
mkdir -p $out/lib/cups/filter/
ln -s $out/opt/brother/Printers/mfcj880dw/lpd/filtermfcj880dw $out/lib/cups/filter/brother_lpdwrapper_mfcj880dw
wrapProgram $out/opt/brother/Printers/mfcj880dw/lpd/psconvertij2 \
--prefix PATH ":" ${
lib.makeBinPath [
coreutils
gnused
gawk
]
}
wrapProgram $out/opt/brother/Printers/mfcj880dw/lpd/filtermfcj880dw \
--prefix PATH ":" ${
lib.makeBinPath [
coreutils
gnused
file
ghostscript
a2ps
]
}
'';
meta = with lib; {
description = "Brother MFC-J880DW LPR driver";
downloadPage = "https://support.brother.com/g/b/downloadlist.aspx?c=us&lang=en&prod=mfcj880dw_us_eu_as&os=128";
homepage = "http://www.brother.com/";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
license = with licenses; unfree;
maintainers = with maintainers; [ _6543 ];
platforms = with platforms; linux;
};
}

View File

@@ -0,0 +1,64 @@
{
coreutils,
dpkg,
fetchurl,
gnugrep,
gnused,
makeWrapper,
mfcl2700dnlpr,
perl,
lib,
stdenv,
}:
stdenv.mkDerivation rec {
pname = "mfcl2700dncupswrapper";
version = "3.2.0-1";
src = fetchurl {
url = "https://download.brother.com/welcome/dlf102086/mfcl2700dncupswrapper-${version}.i386.deb";
sha256 = "07w48mah0xbv4h8vsh1qd5cd4b463bx8y6gc5x9pfgsxsy6h6da1";
};
nativeBuildInputs = [
dpkg
makeWrapper
];
dontUnpack = true;
installPhase = ''
dpkg-deb -x $src $out
basedir=${mfcl2700dnlpr}/opt/brother/Printers/MFCL2700DN
dir=$out/opt/brother/Printers/MFCL2700DN
substituteInPlace $dir/cupswrapper/brother_lpdwrapper_MFCL2700DN \
--replace /usr/bin/perl ${perl}/bin/perl \
--replace "basedir =~" "basedir = \"$basedir\"; #" \
--replace "PRINTER =~" "PRINTER = \"MFCL2700DN\"; #"
wrapProgram $dir/cupswrapper/brother_lpdwrapper_MFCL2700DN \
--prefix PATH : ${
lib.makeBinPath [
coreutils
gnugrep
gnused
]
}
mkdir -p $out/lib/cups/filter
mkdir -p $out/share/cups/model
ln $dir/cupswrapper/brother_lpdwrapper_MFCL2700DN $out/lib/cups/filter
ln $dir/cupswrapper/brother-MFCL2700DN-cups-en.ppd $out/share/cups/model
'';
meta = {
description = "Brother MFC-L2700DN CUPS wrapper driver";
homepage = "http://www.brother.com/";
license = lib.licenses.gpl2Plus;
maintainers = [ lib.maintainers.tv ];
platforms = lib.platforms.linux;
};
}

View File

@@ -0,0 +1,70 @@
{
lib,
stdenv,
fetchurl,
dpkg,
makeWrapper,
coreutils,
gnugrep,
gnused,
perl,
mfcl2720dwlpr,
}:
stdenv.mkDerivation rec {
pname = "mfcl2720dwcupswrapper";
version = "3.2.0-1";
src = fetchurl {
url = "https://download.brother.com/welcome/dlf101802/${pname}-${version}.i386.deb";
sha256 = "6d131926ce22c51b1854d2b91e426cc7ecbf5d6dabd698ef51a417090e35c598";
};
nativeBuildInputs = [
dpkg
makeWrapper
];
dontUnpack = true;
installPhase = ''
dpkg-deb -x $src $out
basedir=${mfcl2720dwlpr}/opt/brother/Printers/MFCL2720DW
dir=$out/opt/brother/Printers/MFCL2720DW
substituteInPlace $dir/cupswrapper/brother_lpdwrapper_MFCL2720DW \
--replace /usr/bin/perl ${perl}/bin/perl \
--replace "basedir =~" "basedir = \"$basedir\"; #" \
--replace "PRINTER =~" "PRINTER = \"MFCL2720DW\"; #"
substituteInPlace $dir/cupswrapper/paperconfigml1 \
--replace /usr/bin/perl ${perl}/bin/perl
wrapProgram $dir/cupswrapper/brother_lpdwrapper_MFCL2720DW \
--prefix PATH : ${
lib.makeBinPath [
coreutils
gnugrep
gnused
]
}
mkdir -p $out/lib/cups/filter
mkdir -p $out/share/cups/model
ln $dir/cupswrapper/brother_lpdwrapper_MFCL2720DW $out/lib/cups/filter
ln $dir/cupswrapper/brother-MFCL2720DW-cups-en.ppd $out/share/cups/model
'';
meta = {
description = "Brother MFC-L2720DW CUPS wrapper driver";
homepage = "http://www.brother.com/";
license = lib.licenses.gpl2Plus;
platforms = [
"x86_64-linux"
"i686-linux"
];
maintainers = [ lib.maintainers.xeji ];
};
}

View File

@@ -0,0 +1,71 @@
{
pkgs,
lib,
stdenv,
fetchurl,
dpkg,
makeWrapper,
coreutils,
ghostscript,
gnugrep,
gnused,
which,
perl,
}:
stdenv.mkDerivation rec {
pname = "mfcl2720dwlpr";
version = "3.2.0-1";
src = fetchurl {
url = "https://download.brother.com/welcome/dlf101801/${pname}-${version}.i386.deb";
sha256 = "088217e9ad118ec1e7f3d3f8f60f3bd839fe2c7d7c1136b249e9ac648dc742af";
};
nativeBuildInputs = [
dpkg
makeWrapper
];
dontUnpack = true;
installPhase = ''
dpkg-deb -x $src $out
dir=$out/opt/brother/Printers/MFCL2720DW
substituteInPlace $dir/lpd/filter_MFCL2720DW \
--replace /usr/bin/perl ${perl}/bin/perl \
--replace "BR_PRT_PATH =~" "BR_PRT_PATH = \"$dir\"; #" \
--replace "PRINTER =~" "PRINTER = \"MFCL2720DW\"; #"
wrapProgram $dir/lpd/filter_MFCL2720DW \
--prefix PATH : ${
lib.makeBinPath [
coreutils
ghostscript
gnugrep
gnused
which
]
}
# need to use i686 glibc here, these are 32bit proprietary binaries
interpreter=${pkgs.pkgsi686Linux.glibc}/lib/ld-linux.so.2
patchelf --set-interpreter "$interpreter" $dir/inf/braddprinter
patchelf --set-interpreter "$interpreter" $dir/lpd/brprintconflsr3
patchelf --set-interpreter "$interpreter" $dir/lpd/rawtobr3
'';
meta = {
description = "Brother MFC-L2720DW lpr driver";
homepage = "http://www.brother.com/";
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
license = lib.licenses.unfree;
platforms = [
"x86_64-linux"
"i686-linux"
];
maintainers = [ lib.maintainers.xeji ];
};
}

View File

@@ -0,0 +1,68 @@
{
lib,
stdenv,
fetchurl,
dpkg,
makeWrapper,
coreutils,
gnugrep,
gnused,
perl,
mfcl2740dwlpr,
}:
stdenv.mkDerivation rec {
pname = "mfcl2740dwcupswrapper";
version = "3.2.0-1";
src = fetchurl {
url = "https://download.brother.com/welcome/dlf101726/${pname}-${version}.i386.deb";
sha256 = "078453e19f20ab6c7fc4d63c3e09f162f3d1410c04c23a294b6ffbd720b35ffb";
};
nativeBuildInputs = [
dpkg
makeWrapper
];
unpackPhase = "dpkg-deb -x $src $out";
installPhase = ''
basedir=${mfcl2740dwlpr}/opt/brother/Printers/MFCL2740DW
dir=$out/opt/brother/Printers/MFCL2740DW
substituteInPlace $dir/cupswrapper/brother_lpdwrapper_MFCL2740DW \
--replace /usr/bin/perl ${perl}/bin/perl \
--replace "basedir =~" "basedir = \"$basedir\"; #" \
--replace "PRINTER =~" "PRINTER = \"MFCL2740DW\"; #"
substituteInPlace $dir/cupswrapper/paperconfigml1 \
--replace /usr/bin/perl ${perl}/bin/perl
wrapProgram $dir/cupswrapper/brother_lpdwrapper_MFCL2740DW \
--prefix PATH : ${
lib.makeBinPath [
coreutils
gnugrep
gnused
]
}
mkdir -p $out/lib/cups/filter
mkdir -p $out/share/cups/model
ln $dir/cupswrapper/brother_lpdwrapper_MFCL2740DW $out/lib/cups/filter
ln $dir/cupswrapper/brother-MFCL2740DW-cups-en.ppd $out/share/cups/model
'';
meta = {
description = "Brother MFC-L2740DW CUPS wrapper driver";
homepage = "http://www.brother.com/";
license = lib.licenses.gpl2Plus;
platforms = [
"x86_64-linux"
"i686-linux"
];
maintainers = [ ];
};
}

View File

@@ -0,0 +1,69 @@
{
pkgsi686Linux,
lib,
stdenv,
fetchurl,
dpkg,
makeWrapper,
coreutils,
ghostscript,
gnugrep,
gnused,
which,
perl,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "mfcl2740dwlpr";
version = "3.2.0-1";
src = fetchurl {
url = "https://download.brother.com/welcome/dlf101727/mfcl2740dwlpr-${finalAttrs.version}.i386.deb";
hash = "sha256-EKK8ZyvVTnGLR486/H5H1FFVf31VExZ9OtNJo9AL/68=";
};
nativeBuildInputs = [
dpkg
makeWrapper
];
unpackPhase = "dpkg-deb -x $src $out";
installPhase = ''
dir=$out/opt/brother/Printers/MFCL2740DW
substituteInPlace $dir/lpd/filter_MFCL2740DW \
--replace /usr/bin/perl ${perl}/bin/perl \
--replace "BR_PRT_PATH =~" "BR_PRT_PATH = \"$dir\"; #" \
--replace "PRINTER =~" "PRINTER = \"MFCL2740DW\"; #"
wrapProgram $dir/lpd/filter_MFCL2740DW \
--prefix PATH : ${
lib.makeBinPath [
coreutils
ghostscript
gnugrep
gnused
which
]
}
# need to use i686 glibc here, these are 32bit proprietary binaries
interpreter=${pkgsi686Linux.glibc}/lib/ld-linux.so.2
patchelf --set-interpreter "$interpreter" $dir/inf/braddprinter
patchelf --set-interpreter "$interpreter" $dir/lpd/brprintconflsr3
patchelf --set-interpreter "$interpreter" $dir/lpd/rawtobr3
'';
meta = {
description = "Brother MFC-L2740DW lpr driver";
homepage = "http://www.brother.com/";
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
license = lib.licenses.unfree;
platforms = [
"x86_64-linux"
"i686-linux"
];
maintainers = [ ];
};
})

View File

@@ -0,0 +1,10 @@
--- a/opt/brother/Printers/MFCL5750DW/cupswrapper/lpdwrapper 2020-01-29 08:26:18.000000000 +0100
+++ b/opt/brother/Printers/MFCL5750DW/cupswrapper/lpdwrapper 2023-12-29 14:12:44.522567053 +0100
@@ -383,6 +383,7 @@
close $temprch;
`cp $basedir/inf/br${PRINTER}rc $TEMPRC`;
+`chmod 666 $TEMPRC`;
$ENV{BRPRINTERRCFILE} = $TEMPRC;
logprint( 0 , "TEMPRC = $TEMPRC\n");

View File

@@ -0,0 +1,119 @@
{
lib,
stdenvNoCC,
fetchurl,
dpkg,
autoPatchelfHook,
makeWrapper,
perl,
gnused,
ghostscript,
file,
coreutils,
gnugrep,
which,
}:
let
arches = [
"x86_64"
"i686"
"armv7l"
];
runtimeDeps = [
ghostscript
file
gnused
gnugrep
coreutils
which
];
in
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "mfcl5750dw";
version = "3.5.1-1";
nativeBuildInputs = [
dpkg
makeWrapper
autoPatchelfHook
];
buildInputs = [ perl ];
src = fetchurl {
url = "https://download.brother.com/welcome/dlf102614/mfcl5750dwcupswrapper-${finalAttrs.version}.i386.deb";
sha256 = "afe6d18e17d26348f3b8a4f9a003107984940c429a7dd193054303a21f5e65b5";
};
lpr_src = fetchurl {
url = "https://download.brother.com/welcome/dlf102613/mfcl5750dwlpr-${finalAttrs.version}.i386.deb";
sha256 = "b1b9c1f9ae8522a65fdd2db1e760aed835807ba593d001ac5471635a157cd1f1";
};
unpackPhase = ''
dpkg-deb -x $src .
dpkg-deb -x $lpr_src .
'';
patches = [
# The brother lpdwrapper uses a temporary file to convey the printer settings.
# The original settings file will be copied with "400" permissions and the "brprintconflsr3"
# binary cannot alter the temporary file later on. This fixes the permissions so the can be modified.
# Since this is all in briefly in the temporary directory of systemd-cups and not accessible by others,
# it shouldn't be a security concern.
./fix-perm.patch
];
installPhase = ''
runHook preInstall
mkdir -p $out
cp -ar opt $out/opt
# delete unnecessary files for the current architecture
''
+ lib.concatMapStrings (arch: ''
echo Deleting files for ${arch}
rm -r "$out/opt/brother/Printers/MFCL5750DW/lpd/${arch}"
'') (builtins.filter (arch: arch != stdenvNoCC.hostPlatform.linuxArch) arches)
+ ''
# bundled scripts don't understand the arch subdirectories for some reason
ln -s \
"$out/opt/brother/Printers/MFCL5750DW/lpd/${stdenvNoCC.hostPlatform.linuxArch}/"* \
"$out/opt/brother/Printers/MFCL5750DW/lpd/"
# Fix global references and replace auto discovery mechanism with hardcoded values
substituteInPlace $out/opt/brother/Printers/MFCL5750DW/lpd/lpdfilter \
--replace "my \$BR_PRT_PATH =" "my \$BR_PRT_PATH = \"$out/opt/brother/Printers/MFCL5750DW\"; #" \
--replace "PRINTER =~" "PRINTER = \"MFCL5750DW\"; #"
substituteInPlace $out/opt/brother/Printers/MFCL5750DW/cupswrapper/lpdwrapper \
--replace "my \$basedir = C" "my \$basedir = \"$out/opt/brother/Printers/MFCL5750DW\" ; #" \
--replace "PRINTER =~" "PRINTER = \"MFCL5750DW\"; #"
# Make sure all executables have the necessary runtime dependencies available
find "$out" -executable -and -type f | while read file; do
wrapProgram "$file" --prefix PATH : "${lib.makeBinPath runtimeDeps}"
done
# Symlink filter and ppd into a location where CUPS will discover it
mkdir -p $out/lib/cups/filter
mkdir -p $out/share/cups/model
mkdir -p $out/etc/opt/brother/Printers/MFCL5750DW/inf
ln -s $out/opt/brother/Printers/MFCL5750DW/inf/brMFCL5750DWrc \
$out/etc/opt/brother/Printers/MFCL5750DW/inf/brMFCL5750DWrc
ln -s \
$out/opt/brother/Printers/MFCL5750DW/cupswrapper/lpdwrapper \
$out/lib/cups/filter/brother_lpdwrapper_MFCL5750DW
ln -s \
$out/opt/brother/Printers/MFCL5750DW/cupswrapper/brother-MFCL5750DW-cups-en.ppd \
$out/share/cups/model/
runHook postInstall
'';
meta = {
homepage = "https://www.brother.com/";
description = "Brother MFCL5750DW CUPS driver";
license = lib.licenses.unfree;
platforms = map (arch: "${arch}-linux") arches;
maintainers = with lib.maintainers; [ qdlmcfresh ];
};
})

View File

@@ -0,0 +1,64 @@
{
coreutils,
dpkg,
fetchurl,
gnugrep,
gnused,
makeWrapper,
mfcl8690cdwlpr,
perl,
lib,
stdenv,
}:
stdenv.mkDerivation rec {
pname = "mfcl8690cdwcupswrapper";
version = "1.4.0-0";
src = fetchurl {
url = "http://download.brother.com/welcome/dlf103250/${pname}-${version}.i386.deb";
sha256 = "1bl9r8mmj4vnanwpfjqgq3c9lf2v46wp5k6r2n9iqprf7ldd1kb2";
};
nativeBuildInputs = [
dpkg
makeWrapper
];
dontUnpack = true;
installPhase = ''
dpkg-deb -x $src $out
basedir=${mfcl8690cdwlpr}/opt/brother/Printers/mfcl8690cdw
dir=$out/opt/brother/Printers/mfcl8690cdw
substituteInPlace $dir/cupswrapper/brother_lpdwrapper_mfcl8690cdw \
--replace /usr/bin/perl ${perl}/bin/perl \
--replace "basedir =~" "basedir = \"$basedir/\"; #" \
--replace "PRINTER =~" "PRINTER = \"mfcl8690cdw\"; #"
wrapProgram $dir/cupswrapper/brother_lpdwrapper_mfcl8690cdw \
--prefix PATH : ${
lib.makeBinPath [
coreutils
gnugrep
gnused
]
}
mkdir -p $out/lib/cups/filter
mkdir -p $out/share/cups/model
ln $dir/cupswrapper/brother_lpdwrapper_mfcl8690cdw $out/lib/cups/filter
ln $dir/cupswrapper/brother_mfcl8690cdw_printer_en.ppd $out/share/cups/model
'';
meta = {
description = "Brother MFC-L8690CDW CUPS wrapper driver";
homepage = "http://www.brother.com/";
license = lib.licenses.unfree;
platforms = lib.platforms.linux;
maintainers = [ ];
};
}

View File

@@ -0,0 +1,72 @@
{
coreutils,
dpkg,
fetchurl,
file,
ghostscript,
gnugrep,
gnused,
makeWrapper,
perl,
pkgs,
lib,
stdenv,
which,
}:
stdenv.mkDerivation rec {
pname = "mfcl8690cdwlpr";
version = "1.3.0-0";
src = fetchurl {
url = "http://download.brother.com/welcome/dlf103241/${pname}-${version}.i386.deb";
sha256 = "0x8zd4b1psmw1znp2ibncs37xm5mljcy9yza2rx8jm8lp0a3l85v";
};
nativeBuildInputs = [
dpkg
makeWrapper
];
dontUnpack = true;
installPhase = ''
dpkg-deb -x $src $out
dir=$out/opt/brother/Printers/mfcl8690cdw
filter=$dir/lpd/filter_mfcl8690cdw
substituteInPlace $filter \
--replace /usr/bin/perl ${perl}/bin/perl \
--replace "BR_PRT_PATH =~" "BR_PRT_PATH = \"$dir/\"; #" \
--replace "PRINTER =~" "PRINTER = \"mfcl8690cdw\"; #"
wrapProgram $filter \
--prefix PATH : ${
lib.makeBinPath [
coreutils
file
ghostscript
gnugrep
gnused
which
]
}
# need to use i686 glibc here, these are 32bit proprietary binaries
interpreter=${pkgs.pkgsi686Linux.glibc}/lib/ld-linux.so.2
patchelf --set-interpreter "$interpreter" $dir/lpd/brmfcl8690cdwfilter
'';
meta = {
description = "Brother MFC-L8690CDW LPR printer driver";
homepage = "http://www.brother.com/";
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
license = lib.licenses.unfree;
maintainers = [ ];
platforms = [
"x86_64-linux"
"i686-linux"
];
};
}

View File

@@ -0,0 +1,29 @@
{
lib,
stdenv,
fetchurl,
pkg-config,
libnfc,
}:
stdenv.mkDerivation {
pname = "mfcuk";
version = "0.3.8";
src = fetchurl {
url = "https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/mfcuk/mfcuk-0.3.8.tar.gz";
sha256 = "0m9sy61rsbw63xk05jrrmnyc3xda0c3m1s8pg3sf8ijbbdv9axcp";
};
nativeBuildInputs = [ pkg-config ];
buildInputs = [ libnfc ];
meta = with lib; {
description = "MiFare Classic Universal toolKit";
mainProgram = "mfcuk";
license = licenses.gpl2Plus;
homepage = "https://github.com/nfc-tools/mfcuk";
maintainers = with maintainers; [ offline ];
platforms = platforms.unix;
};
}

View File

@@ -0,0 +1,41 @@
{
lib,
stdenv,
fetchFromGitHub,
autoreconfHook,
pkg-config,
libnfc,
xz,
}:
stdenv.mkDerivation {
pname = "mfoc-hardnested";
version = "0-unstable-2023-03-27";
src = fetchFromGitHub {
owner = "nfc-tools";
repo = "mfoc-hardnested";
rev = "a6007437405a0f18642a4bbca2eeba67c623d736";
hash = "sha256-YcUMS4wx5ML4yYiARyfm7T7nLomgG9YCSFj+ZUg5XZk=";
};
nativeBuildInputs = [
autoreconfHook
pkg-config
];
buildInputs = [
libnfc
xz
];
meta = with lib; {
description = "Fork of mfoc integrating hardnested code from the proxmark";
mainProgram = "mfoc-hardnested";
license = licenses.gpl2;
homepage = "https://github.com/nfc-tools/mfoc-hardnested";
changelog = "https://github.com/nfc-tools/mfoc-hardnested/blob/master/debian/changelog";
maintainers = with maintainers; [ azuwis ];
platforms = platforms.unix;
};
}

View File

@@ -0,0 +1,47 @@
{
lib,
stdenv,
fetchFromGitHub,
fetchpatch,
autoreconfHook,
pkg-config,
libnfc,
}:
stdenv.mkDerivation rec {
pname = "mfoc";
version = "0.10.7";
src = fetchFromGitHub {
owner = "nfc-tools";
repo = "mfoc";
rev = "mfoc-${version}";
sha256 = "0hbg1fn4000qdg1cfc7y8l0vh1mxlxcz7gapkcq54xp2l6kk1z65";
};
patches = [
(fetchpatch {
url = "https://github.com/nfc-tools/mfoc/commit/f13efb0a6deb1d97ba945d555a6a5d6be89b593f.patch";
sha256 = "109gqzp8rdsjvj0nra686vy0dpd2bl6q5v9m4v98cpxkbz496450";
})
(fetchpatch {
url = "https://github.com/nfc-tools/mfoc/commit/00eae36f891bc4580103e3b54f0bb5228af2cdef.patch";
sha256 = "1w56aj96g776f37j53jmf3hk21x4mqik3l2bmghrdp8drixc8bzk";
})
];
nativeBuildInputs = [
autoreconfHook
pkg-config
];
buildInputs = [ libnfc ];
meta = with lib; {
description = "Mifare Classic Offline Cracker";
mainProgram = "mfoc";
license = licenses.gpl2Plus;
homepage = "https://github.com/nfc-tools/mfoc";
maintainers = with maintainers; [ offline ];
platforms = platforms.unix;
};
}

View File

@@ -0,0 +1,76 @@
{
stdenv,
fetchFromGitHub,
lib,
makeWrapper,
autoreconfHook,
python3,
fontforge,
potrace,
texlive,
}:
/*
To use with a texlive distribution, ensure that the desired fonts and
the packages kpathsea, t1utils, metafont are available at runtime.
Possible overrides:
- potrace = autotrace
- fontforge = ghostscript (limited functionality)
- fontforge = null (limited functionality)
*/
stdenv.mkDerivation (finalAttrs: {
pname = "mftrace";
version = "1.2.20";
# https://lilypond.org/download/sources/mftrace/mftrace-1.2.20.tar.gz
# is incomplete, fetch repo and use autoconf instead
# see https://github.com/hanwen/mftrace/issues/13
src = fetchFromGitHub {
owner = "hanwen";
repo = "mftrace";
rev = "release/${finalAttrs.version}";
sha256 = "02ik25aczkbi10jrjlnxby3fmixxrwm2k5r4fkfif3bjfym7nqbc";
};
nativeBuildInputs = [
makeWrapper
autoreconfHook
python3
potrace
];
buildInputs = [
fontforge
potrace
];
postInstall = ''
wrapProgram $out/bin/mftrace --prefix PATH : ${lib.makeBinPath finalAttrs.buildInputs}
'';
# experimental texlive.combine support
# (note that only the bin/ folder will be combined into texlive)
passthru.tlDeps = with texlive; [
kpathsea
t1utils
metafont
];
meta = with lib; {
description = "Scalable PostScript Fonts for MetaFont";
longDescription = ''
mftrace is a small Python program that lets you trace a TeX bitmap
font into a PFA or PFB font (A PostScript Type1 Scalable Font) or
TTF (TrueType) font.
'';
homepage = "https://lilypond.org/mftrace/";
license = with licenses; [
gpl2Only
mit
];
maintainers = with maintainers; [ xworld21 ];
platforms = platforms.all;
};
})