diff options
Diffstat (limited to 'pkgs/misc/drivers')
-rw-r--r-- | pkgs/misc/drivers/gutenprint/default.nix | 91 | ||||
-rw-r--r-- | pkgs/misc/drivers/m3d-linux/default.nix | 25 |
2 files changed, 52 insertions, 64 deletions
diff --git a/pkgs/misc/drivers/gutenprint/default.nix b/pkgs/misc/drivers/gutenprint/default.nix index 98776c0c42b0..5be7f5ecff4d 100644 --- a/pkgs/misc/drivers/gutenprint/default.nix +++ b/pkgs/misc/drivers/gutenprint/default.nix @@ -1,78 +1,41 @@ # this package was called gimp-print in the past -{ fetchurl, stdenv, pkgconfig, composableDerivation, cups -, libtiff, libpng, makeWrapper, openssl, gimp }: +{ stdenv, lib, fetchurl, pkgconfig +, ijs, makeWrapper +, gimp2Support ? true, gimp +, cupsSupport ? true, cups, libusb, perl +}: -let - version = "5.2.10"; - inherit (composableDerivation) edf wwf; -in - -composableDerivation.composableDerivation {} { - name = "gutenprint-${version}"; +stdenv.mkDerivation rec { + name = "gutenprint-5.2.11"; src = fetchurl { - url = "mirror://sourceforge/gimp-print/gutenprint-${version}.tar.bz2"; - sha256 = "0n8f6vpadnagrp6yib3mca1c3lgwl4vmma16s44riyrd84mka7s3"; + url = "mirror://sourceforge/gimp-print/${name}.tar.bz2"; + sha256 = "1yadw96rgp1z0jv1wxrz6cds36nb693w3xlv596xw9r5w394r8y1"; }; - # gimp, gui is still not working (TODO) - buildInputs = [ makeWrapper openssl pkgconfig ]; + nativeBuildInputs = [ makeWrapper pkgconfig ]; + buildInputs = + [ ijs ] + ++ lib.optionals gimp2Support [ gimp.gtk gimp ] + ++ lib.optionals cupsSupport [ cups libusb perl ]; + + configureFlags = lib.optionals cupsSupport [ + "--disable-static-genppd" # should be harmless on NixOS + ]; - configureFlags = ["--enable-static-genppd"]; - NIX_CFLAGS_COMPILE="-include stdio.h"; - - #preConfigure = '' - # configureFlags="--with-cups=$out/usr-cups $configureFlags" - #''; - - /* - is this recommended? without it this warning is printed: + enableParallelBuilding = true; - ***WARNING: Use of --disable-static-genppd or --disable-static - when building CUPS is very dangerous. The build may - fail when building the PPD files, or may *SILENTLY* - build incorrect PPD files or cause other problems. - Please review the README and release notes carefully! - */ + # Testing is very, very long. + # doCheck = true; - installPhase = '' - eval "make install $installArgs" - mkdir -p $out/lib/cups - ln -s $out/filter $out/lib/cups/ - wrapProgram $out/filter/rastertogutenprint.5.2 --prefix LD_LIBRARY_PATH : $out/lib - wrapProgram $out/sbin/cups-genppd.5.2 --prefix LD_LIBRARY_PATH : $out/lib - ''; + installFlags = + lib.optionals cupsSupport [ "cups_conf_datadir=$(out)/share/cups" "cups_conf_serverbin=$(out)/lib/cups" "cups_conf_serverroot=$(out)/etc/cups" ] + ++ lib.optionals gimp2Support [ "gimp2_plug_indir=$(out)/${gimp.name}-plugins" ]; - meta = { + meta = with stdenv.lib; { description = "Ghostscript and cups printer drivers"; homepage = http://sourceforge.net/projects/gimp-print/; - license = "GPL"; + license = licenses.gpl2; + platforms = platforms.linux; }; - - mergeAttrBy = { installArgs = stdenv.lib.concat; }; - - # most interpreters aren't tested yet.. (see python for example how to do it) - flags = - wwf { - name = "gimp2"; - enable = { - buildInputs = [gimp gimp.gtk]; - installArgs = [ "gimp2_plug_indir=$out/${gimp.name}-plugins" ]; - }; - } - // { - cups = { - set = { - buildInputs = [cups libtiff libpng ]; - installArgs = [ "cups_conf_datadir=$out cups_conf_serverbin=$out cups_conf_serverroot=$out"]; - }; - }; - } - ; - - cfg = { - gimp2Support = true; - cupsSupport = true; - }; - } diff --git a/pkgs/misc/drivers/m3d-linux/default.nix b/pkgs/misc/drivers/m3d-linux/default.nix new file mode 100644 index 000000000000..0e970e30d589 --- /dev/null +++ b/pkgs/misc/drivers/m3d-linux/default.nix @@ -0,0 +1,25 @@ +{ stdenv, fetchFromGitHub }: + +stdenv.mkDerivation { + name = "M3D-Linux-2016-01-20"; + + src = fetchFromGitHub { + owner = "donovan6000"; + repo = "M3D-Linux"; + rev = "d0bbb0379c52a88af55740a937edc92af162cdf6"; + sha256 = "0fwzb9mf04bw5wxabh3js7nir60kfq8iz7kcigw6c233aadwg03i"; + }; + + installPhase = '' + install -Dm755 m3d-linux $out/bin/m3d-linux + install -Dm755 90-m3d-local.rules $out/lib/udev/rules.d/90-m3d-local.rules + ''; + + meta = with stdenv.lib; { + homepage = https://github.com/donovan6000/M3D-Linux; + description = "A Linux program that can communicate with the Micro 3D printer"; + license = licenses.gpl2; + platforms = platforms.linux; + maintainers = with maintainers; [ abbradar ]; + }; +} |