feat: big refactor

This commit is contained in:
Jacob Bachmann 2024-09-07 15:10:22 +02:00
parent 2c09c21833
commit ebedec9768
No known key found for this signature in database
GPG key ID: 7753026D577922A6
159 changed files with 1927 additions and 2222 deletions

View file

@ -1,17 +1,17 @@
{ pkgsi686Linux
, stdenv
, fetchurl
, dpkg
, makeWrapper
, coreutils
, ghostscript
, gnugrep
, gnused
, which
, perl
, lib
{
pkgsi686Linux,
stdenv,
fetchurl,
dpkg,
makeWrapper,
coreutils,
ghostscript,
gnugrep,
gnused,
which,
perl,
lib,
}:
let
model = "mfcl3750cdw";
version = "1.0.2-0";
@ -20,14 +20,16 @@ let
sha256 = "3a0d5f09a265208fdd1b8266ef36286ec294c7a4befa327be81141efabe8590b";
};
reldir = "opt/brother/Printers/${model}/";
in
rec {
driver = pkgsi686Linux.stdenv.mkDerivation rec {
inherit src version;
name = "${model}drv-${version}";
nativeBuildInputs = [ dpkg makeWrapper ];
nativeBuildInputs = [
dpkg
makeWrapper
];
unpackPhase = "dpkg-deb -x $src $out";
@ -38,9 +40,15 @@ rec {
--replace "BR_PRT_PATH =~" "BR_PRT_PATH = \"$dir\"; #" \
--replace "PRINTER =~" "PRINTER = \"${model}\"; #"
wrapProgram $dir/lpd/filter_${model} \
--prefix PATH : ${lib.makeBinPath [
coreutils ghostscript gnugrep gnused which
]}
--prefix PATH : ${
lib.makeBinPath [
coreutils
ghostscript
gnugrep
gnused
which
]
}
# need to use i686 glibc here, these are 32bit proprietary binaries
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
$dir/lpd/brmfcl3750cdwfilter
@ -51,7 +59,10 @@ rec {
homepage = "http://www.brother.com/";
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
license = lib.licenses.unfree;
platforms = [ "x86_64-linux" "i686-linux" ];
platforms = [
"x86_64-linux"
"i686-linux"
];
maintainers = [ lib.maintainers.bchmnn ];
};
};
@ -60,7 +71,10 @@ rec {
inherit version src;
name = "${model}cupswrapper-${version}";
nativeBuildInputs = [ dpkg makeWrapper ];
nativeBuildInputs = [
dpkg
makeWrapper
];
unpackPhase = "dpkg-deb -x $src $out";
@ -74,7 +88,13 @@ rec {
--replace "PRINTER =~" "PRINTER = \"${model}\"; #"
wrapProgram $dir/cupswrapper/brother_lpdwrapper_${model} \
--prefix PATH : ${lib.makeBinPath [ coreutils gnugrep gnused ]}
--prefix PATH : ${
lib.makeBinPath [
coreutils
gnugrep
gnused
]
}
mkdir -p $out/lib/cups/filter
mkdir -p $out/share/cups/model
@ -91,9 +111,11 @@ rec {
homepage = "http://www.brother.com/";
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
license = lib.licenses.gpl2;
platforms = [ "x86_64-linux" "i686-linux" ];
platforms = [
"x86_64-linux"
"i686-linux"
];
maintainers = [ lib.maintainers.bchmnn ];
};
};
}