diff options
author | Vladimír Čunát <vcunat@gmail.com> | 2016-10-20 23:03:45 +0200 |
---|---|---|
committer | Vladimír Čunát <vcunat@gmail.com> | 2016-10-20 23:04:10 +0200 |
commit | 4d5b89300296951f207ad2fcad35d1596fe7a319 (patch) | |
tree | c334e4de0e8264c9897deb2ade31aaade779ac0b /pkgs/misc | |
parent | 171bcc5274b41226e5943247db1afb2e7559e23e (diff) | |
parent | 4094d63dea7fafb8529ceaaa195f8e81e5dbe8a3 (diff) | |
download | nixlib-4d5b89300296951f207ad2fcad35d1596fe7a319.tar nixlib-4d5b89300296951f207ad2fcad35d1596fe7a319.tar.gz nixlib-4d5b89300296951f207ad2fcad35d1596fe7a319.tar.bz2 nixlib-4d5b89300296951f207ad2fcad35d1596fe7a319.tar.lz nixlib-4d5b89300296951f207ad2fcad35d1596fe7a319.tar.xz nixlib-4d5b89300296951f207ad2fcad35d1596fe7a319.tar.zst nixlib-4d5b89300296951f207ad2fcad35d1596fe7a319.zip |
Merge #19081: gnome-3.22
Also master commits are brought in.
Diffstat (limited to 'pkgs/misc')
-rw-r--r-- | pkgs/misc/cups/drivers/mfcj6510dwcupswrapper/default.nix | 65 | ||||
-rw-r--r-- | pkgs/misc/cups/drivers/mfcj6510dwlpr/default.nix | 89 | ||||
-rw-r--r-- | pkgs/misc/themes/arc/default.nix | 25 | ||||
-rw-r--r-- | pkgs/misc/themes/vertex/default.nix | 31 |
4 files changed, 189 insertions, 21 deletions
diff --git a/pkgs/misc/cups/drivers/mfcj6510dwcupswrapper/default.nix b/pkgs/misc/cups/drivers/mfcj6510dwcupswrapper/default.nix new file mode 100644 index 000000000000..fbb523409187 --- /dev/null +++ b/pkgs/misc/cups/drivers/mfcj6510dwcupswrapper/default.nix @@ -0,0 +1,65 @@ +{ stdenv, fetchurl, mfcj6510dwlpr, makeWrapper}: + +stdenv.mkDerivation rec { + name = "mfcj6510dw-cupswrapper-${version}"; + version = "3.0.0-1"; + + src = fetchurl { + url = "http://download.brother.com/welcome/dlf006814/mfcj6510dw_cupswrapper_GPL_source_${version}.tar.gz"; + sha256 = "0y5iffybxjin8injrdmc9n9hl4s6b8n6ck76m1z78bzi88vwmhai"; + }; + + nativeBuildInputs = [ makeWrapper ]; + buildInputs = [ mfcj6510dwlpr ]; + + buildPhase = '' + cd brcupsconfig + make all + cd .. + ''; + + installPhase = '' + 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 "\$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 "/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" \ + # "${mfcj6510dwlpr}/opt/brother/Printers/mfcj6510dw/inf/brmfcj6510dwrc" \ + # --replace "/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_" + #substituteInPlace $CPUSFILTERFOLDER/brother_lpdwrapper_mfcj6510dw \ + # --replace "$``{printer_model``}" "mfcj6510dw" \ + # --replace "$``{printer_name``}" "MFCJ6510DW" + ''; + + cleanPhase = '' + cd brcupsconfpt1 + make clean + ''; + + meta = with stdenv.lib; { + homepage = http://www.brother.com/; + description = "Brother MFC-J6510DW CUPS wrapper driver"; + license = with licenses; gpl2; + 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 ]; + }; +} diff --git a/pkgs/misc/cups/drivers/mfcj6510dwlpr/default.nix b/pkgs/misc/cups/drivers/mfcj6510dwlpr/default.nix new file mode 100644 index 000000000000..ee14e4a52db9 --- /dev/null +++ b/pkgs/misc/cups/drivers/mfcj6510dwlpr/default.nix @@ -0,0 +1,89 @@ +{ stdenv, fetchurl, pkgsi686Linux, dpkg, makeWrapper, coreutils, gnused, gawk, file, cups, patchelf, utillinux, vimNox +, ghostscript, a2ps }: + +# Why: +# The executable "brprintconf_mfcj6510dw" 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_mfcj6510dw", whereby it will search for "/opt/brother/Printers/mfcj6510dw/inf/brmfcj6510dwfunc". +# For NixOS, we want to change the string to the store path of brmfcj6510dwfunc and brmfcj6510dwrc 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 "brmfcj6510dwfunc" and "brmfcj6510dwrc", 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_mfcj6510dw in the shell. + +stdenv.mkDerivation rec { + name = "mfcj6510dwlpr-${version}"; + version = "3.0.0-1"; + + src = fetchurl { + url = "http://download.brother.com/welcome/dlf006614/mfcj6510dwlpr-${version}.i386.deb"; + sha256 = "1ccvx393pqavsgzd8igrzlin5jrsf01d3acyvwqd1d0yz5jgqy6d"; + }; + + nativeBuildInputs = [ makeWrapper ]; + buildInputs = [ cups ghostscript dpkg a2ps ]; + + unpackPhase = "true"; + + brprintconf_mfcj6510dw_script = '' + #!/bin/sh + cd $(mktemp -d) + ln -s @out@/usr/bin/brprintconf_mfcj6510dw_patched brprintconf_mfcj6510dw_patched + ln -s @out@/opt/brother/Printers/mfcj6510dw/inf/brmfcj6510dwfunc brmfcj6510dwfunc + ln -s @out@/opt/brother/Printers/mfcj6510dw/inf/brmfcj6510dwrc brmfcj6510dwrc + ./brprintconf_mfcj6510dw_patched "$@" + ''; + + installPhase = '' + dpkg-deb -x $src $out + substituteInPlace $out/opt/brother/Printers/mfcj6510dw/lpd/filtermfcj6510dw \ + --replace /opt "$out/opt" + substituteInPlace $out/opt/brother/Printers/mfcj6510dw/lpd/psconvertij2 \ + --replace "GHOST_SCRIPT=`which gs`" "GHOST_SCRIPT=${ghostscript}/bin/gs" + substituteInPlace $out/opt/brother/Printers/mfcj6510dw/inf/setupPrintcapij \ + --replace "/opt/brother/Printers" "$out/opt/brother/Printers" \ + --replace "printcap.local" "printcap" + + patchelf --set-interpreter ${pkgsi686Linux.stdenv.cc.libc.out}/lib/ld-linux.so.2 \ + --set-rpath $out/opt/brother/Printers/mfcj6510dw/inf:$out/opt/brother/Printers/mfcj6510dw/lpd \ + $out/opt/brother/Printers/mfcj6510dw/lpd/brmfcj6510dwfilter + patchelf --set-interpreter ${pkgsi686Linux.stdenv.cc.libc.out}/lib/ld-linux.so.2 $out/usr/bin/brprintconf_mfcj6510dw + + #stripping the hardcoded path. + ${utillinux}/bin/hexdump -ve '1/1 "%.2X"' $out/usr/bin/brprintconf_mfcj6510dw | \ + sed 's.2F6F70742F62726F746865722F5072696E746572732F25732F696E662F6272257366756E63.62726d66636a36353130647766756e63000000000000000000000000000000000000000000.' | \ + sed 's.2F6F70742F62726F746865722F5072696E746572732F25732F696E662F627225737263.62726D66636A3635313064777263000000000000000000000000000000000000000000.' | \ + ${vimNox}/bin/xxd -r -p > $out/usr/bin/brprintconf_mfcj6510dw_patched + chmod +x $out/usr/bin/brprintconf_mfcj6510dw_patched + #executing from current dir. segfaults if it's not r\w. + mkdir -p $out/bin + echo -n "$brprintconf_mfcj6510dw_script" > $out/bin/brprintconf_mfcj6510dw + chmod +x $out/bin/brprintconf_mfcj6510dw + substituteInPlace $out/bin/brprintconf_mfcj6510dw --replace @out@ $out + + mkdir -p $out/lib/cups/filter/ + ln -s $out/opt/brother/Printers/mfcj6510dw/lpd/filtermfcj6510dw $out/lib/cups/filter/brother_lpdwrapper_mfcj6510dw + + wrapProgram $out/opt/brother/Printers/mfcj6510dw/lpd/psconvertij2 \ + --prefix PATH ":" ${ stdenv.lib.makeBinPath [ coreutils gnused gawk ] } + wrapProgram $out/opt/brother/Printers/mfcj6510dw/lpd/filtermfcj6510dw \ + --prefix PATH ":" ${ stdenv.lib.makeBinPath [ coreutils gnused file ghostscript a2ps ] } + ''; + + meta = with stdenv.lib; { + homepage = http://www.brother.com/; + description = "Brother MFC-J6510DW LPR driver"; + license = with licenses; unfree; + 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 ]; + }; +} diff --git a/pkgs/misc/themes/arc/default.nix b/pkgs/misc/themes/arc/default.nix index b7ff36c0917c..09599604a472 100644 --- a/pkgs/misc/themes/arc/default.nix +++ b/pkgs/misc/themes/arc/default.nix @@ -1,14 +1,15 @@ { stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, gnome3, gtk-engine-murrine }: stdenv.mkDerivation rec { - version = "2016-06-06"; - name = "arc-gtk-theme-${version}"; + name = "${pname}-${version}"; + pname = "arc-theme"; + version = "2016-10-13"; src = fetchFromGitHub { owner = "horst3180"; - repo = "arc-theme"; - rev = "d24a7b5b4eb25e1a094bdf4e125332cfb8e2c8c1"; - sha256 = "07rf21xhyz3if4n5ccmzmjf9rz9w7wkvci7ccivhh6lkillfbxgi"; + repo = pname; + rev = "a9ce9d56ae61f23592fa4a8c200085dde7b43e07"; + sha256 = "02w8nckd4q548shdgml9ndnbnq1g7nq6v8df89mx4l3lc9r6354y"; }; nativeBuildInputs = [ autoreconfHook pkgconfig ]; @@ -17,13 +18,21 @@ stdenv.mkDerivation rec { preferLocalBuild = true; - configureFlags = "--with-gnome=${gnome3.version} "; + configureFlags = [ "--disable-unity" "--with-gnome=${gnome3.version}" ]; + + postInstall = '' + mkdir -p $out/share/plank/themes + cp -r extra/*-Plank $out/share/plank/themes + mkdir -p $out/share/doc/$pname/Chrome + cp -r extra/Chrome/*.crx $out/share/doc/$pname/Chrome + cp AUTHORS README.md $out/share/doc/$pname/ + ''; meta = with stdenv.lib; { description = "A flat theme with transparent elements for GTK 3, GTK 2 and Gnome-Shell"; - homepage = "https://github.com/horst3180/Arc-theme"; + homepage = "https://github.com/horst3180/arc-theme"; license = licenses.gpl3; - platforms = platforms.linux; + platforms = platforms.unix; maintainers = with maintainers; [ simonvandel romildo ]; }; } diff --git a/pkgs/misc/themes/vertex/default.nix b/pkgs/misc/themes/vertex/default.nix index 7c6778a40d54..fe48bb14d40c 100644 --- a/pkgs/misc/themes/vertex/default.nix +++ b/pkgs/misc/themes/vertex/default.nix @@ -1,33 +1,38 @@ -{ stdenv, fetchFromGitHub, autoreconfHook, gtk3, pkgconfig }: +{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, gnome3, gtk-engine-murrine }: stdenv.mkDerivation rec { - name = "theme-vertex-${version}"; - version = "20160329"; + name = "${pname}-${version}"; + pname = "theme-vertex"; + version = "20161009"; src = fetchFromGitHub { owner = "horst3180"; - repo = "Vertex-theme"; - rev = version; - sha256 = "1zafnbxn9hgi4lmi254iw9jyhifcqijxa7cymwjpyy0jfa6sm1qj"; + repo = "vertex-theme"; + rev = "c861918a7fccf6d0768d45d790a19a13bb23485e"; + sha256 = "13abgl18m04sj44gqipxbagpan4jqral65w59rgnhb6ldxgnhg33"; }; - buildInputs = [ autoreconfHook gtk3 pkgconfig ]; + nativeBuildInputs = [ autoreconfHook pkgconfig ]; - configureFlags = "--disable-unity"; + buildInputs = [ gtk-engine-murrine ]; + + configureFlags = [ "--disable-unity" "--with-gnome=${gnome3.version}" ]; postInstall = '' - mkdir -p $out/share/doc/theme-vertex - cp AUTHORS COPYING README.md $out/share/doc/theme-vertex/ + mkdir -p $out/share/plank/themes + cp -r extra/*-Plank $out/share/plank/themes - mkdir -p $out/share/doc/theme-vertex/extra - cp -r extra/{Chrome,Firefox} $out/share/doc/theme-vertex/extra + mkdir -p $out/share/doc/$pname/Chrome + cp -r extra/Chrome/*.crx $out/share/doc/$pname/Chrome + cp -r extra/Firefox $out/share/doc/$pname + cp AUTHORS README.md $out/share/doc/$pname/ ''; meta = with stdenv.lib; { inherit (src.meta) homepage; description = "Theme for GTK 3, GTK 2, Gnome-Shell, and Cinnamon"; license = licenses.gpl3; - maintainers = [ maintainers.rycee ]; platforms = platforms.unix; + maintainers = with maintainers; [ rycee romildo ]; }; } |