From e4ac6f6ab2d07a376eabaa0d8903dc427a37b7b8 Mon Sep 17 00:00:00 2001 From: Roberto Di Remigio Date: Sat, 18 Nov 2017 21:38:27 +0100 Subject: [PATCH 01/17] hdf5_1_8: init at 1.8.18 --- pkgs/tools/misc/hdf5/1_8.nix | 71 +++++++++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 6 +++ 2 files changed, 77 insertions(+) create mode 100644 pkgs/tools/misc/hdf5/1_8.nix diff --git a/pkgs/tools/misc/hdf5/1_8.nix b/pkgs/tools/misc/hdf5/1_8.nix new file mode 100644 index 00000000000..20f207f59cf --- /dev/null +++ b/pkgs/tools/misc/hdf5/1_8.nix @@ -0,0 +1,71 @@ +{ stdenv +, fetchurl +, gcc +, removeReferencesTo +, cpp ? false +, gfortran ? null +, zlib ? null +, szip ? null +, mpi ? null +, enableShared ? true +}: + +# cpp and mpi options are mutually exclusive +# (--enable-unsupported could be used to force the build) +assert !cpp || mpi == null; + +# No point splitting version 1.8.18 into multiple outputs. +# The library /lib/libhdf5.so has a reference to gcc-wrapper + +let inherit (stdenv.lib) optional optionals; in + +stdenv.mkDerivation rec { + version = "1.8.18"; + name = "hdf5-${version}"; + src = fetchurl { + url = "https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8/${name}/src/${name}.tar.bz2"; + sha256 = "13542vrnl1p35n8vbq0wzk40vddmm33q5nh04j98c7r1yjnxxih1"; + }; + + passthru = { + mpiSupport = (mpi != null); + inherit mpi; + }; + + nativeBuildInputs = [ removeReferencesTo ]; + + buildInputs = [] + ++ optional (gfortran != null) gfortran + ++ optional (szip != null) szip; + + propagatedBuildInputs = [] + ++ optional (zlib != null) zlib + ++ optional (mpi != null) mpi; + + configureFlags = [] + ++ optional cpp "--enable-cxx" + ++ optional (gfortran != null) "--enable-fortran" + ++ optional (szip != null) "--with-szlib=${szip}" + ++ optionals (mpi != null) ["--enable-parallel" "CC=${mpi}/bin/mpicc"] + ++ optional enableShared "--enable-shared"; + + patches = [./bin-mv.patch]; + + postInstall = '' + find "$out" -type f -exec remove-references-to -t ${stdenv.cc} '{}' + + ''; + + meta = { + description = "Data model, library, and file format for storing and managing data"; + longDescription = '' + HDF5 supports an unlimited variety of datatypes, and is designed for flexible and efficient + I/O and for high volume and complex data. HDF5 is portable and is extensible, allowing + applications to evolve in their use of HDF5. The HDF5 Technology suite includes tools and + applications for managing, manipulating, viewing, and analyzing data in the HDF5 format. + ''; + license = stdenv.lib.licenses.free; # BSD-like + homepage = https://www.hdfgroup.org/HDF5/; + platforms = stdenv.lib.platforms.unix; + broken = (gfortran != null) && stdenv.isDarwin; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index cd309f4c1bf..1f032dd42a8 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2582,6 +2582,12 @@ with pkgs; mpi = null; }; + hdf5_1_8 = callPackage ../tools/misc/hdf5/1_8.nix { + gfortran = null; + szip = null; + mpi = null; + }; + hdf5-mpi = appendToName "mpi" (hdf5.override { szip = null; mpi = pkgs.openmpi; From 443faefdfb251d4b02fd5b1265e66a015e082aa6 Mon Sep 17 00:00:00 2001 From: Roberto Di Remigio Date: Sat, 18 Nov 2017 21:41:55 +0100 Subject: [PATCH 02/17] hdf5_1_8: 1.8.18 -> 1.8.19 --- pkgs/tools/misc/hdf5/1_8.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/misc/hdf5/1_8.nix b/pkgs/tools/misc/hdf5/1_8.nix index 20f207f59cf..ea8a77c381b 100644 --- a/pkgs/tools/misc/hdf5/1_8.nix +++ b/pkgs/tools/misc/hdf5/1_8.nix @@ -20,11 +20,11 @@ assert !cpp || mpi == null; let inherit (stdenv.lib) optional optionals; in stdenv.mkDerivation rec { - version = "1.8.18"; + version = "1.8.19"; name = "hdf5-${version}"; src = fetchurl { url = "https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8/${name}/src/${name}.tar.bz2"; - sha256 = "13542vrnl1p35n8vbq0wzk40vddmm33q5nh04j98c7r1yjnxxih1"; + sha256 = "0f3jfbqpaaq21ighi40qzs52nb52kc2d2yjk541rjmsx20b3ih2r" ; }; passthru = { From 98a748485ea6ae12027a3725b46fda5439b6e33b Mon Sep 17 00:00:00 2001 From: Roberto Di Remigio Date: Sat, 18 Nov 2017 21:45:59 +0100 Subject: [PATCH 03/17] hdf5_1_8: add fortran2003 option --- pkgs/tools/misc/hdf5/1_8.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/tools/misc/hdf5/1_8.nix b/pkgs/tools/misc/hdf5/1_8.nix index ea8a77c381b..14c8ca23433 100644 --- a/pkgs/tools/misc/hdf5/1_8.nix +++ b/pkgs/tools/misc/hdf5/1_8.nix @@ -4,6 +4,7 @@ , removeReferencesTo , cpp ? false , gfortran ? null +, fortran2003 ? false , zlib ? null , szip ? null , mpi ? null @@ -14,6 +15,9 @@ # (--enable-unsupported could be used to force the build) assert !cpp || mpi == null; +# Need a Fortran compiler for Fortran2003 bindings +assert fortran2003 -> gfortran != null; + # No point splitting version 1.8.18 into multiple outputs. # The library /lib/libhdf5.so has a reference to gcc-wrapper @@ -45,6 +49,7 @@ stdenv.mkDerivation rec { configureFlags = [] ++ optional cpp "--enable-cxx" ++ optional (gfortran != null) "--enable-fortran" + ++ optional fortran2003 "--enable-fortran2003" ++ optional (szip != null) "--with-szlib=${szip}" ++ optionals (mpi != null) ["--enable-parallel" "CC=${mpi}/bin/mpicc"] ++ optional enableShared "--enable-shared"; From eb43cc569aaa40cbac25905f1adba8cc974bdbd4 Mon Sep 17 00:00:00 2001 From: Roberto Di Remigio Date: Fri, 17 Nov 2017 23:14:31 +0100 Subject: [PATCH 04/17] hdf5: 1.8.18 -> 1.10.1 --- pkgs/tools/misc/hdf5/default.nix | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/pkgs/tools/misc/hdf5/default.nix b/pkgs/tools/misc/hdf5/default.nix index 1b979bae090..2c1ba43a558 100644 --- a/pkgs/tools/misc/hdf5/default.nix +++ b/pkgs/tools/misc/hdf5/default.nix @@ -14,17 +14,14 @@ # (--enable-unsupported could be used to force the build) assert !cpp || mpi == null; -# No point splitting version 1.8.18 into multiple outputs. -# The library /lib/libhdf5.so has a reference to gcc-wrapper - let inherit (stdenv.lib) optional optionals; in stdenv.mkDerivation rec { - version = "1.8.18"; + version = "1.10.1"; name = "hdf5-${version}"; src = fetchurl { - url = "https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8/${name}/src/${name}.tar.bz2"; - sha256 = "13542vrnl1p35n8vbq0wzk40vddmm33q5nh04j98c7r1yjnxxih1"; + url = "https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.10/${name}/src/${name}.tar.bz2"; + sha256 = "1wpbi15za7kbsvih88kfcxblw412pjndl16x88dgnqr47piy2p4w"; }; passthru = { @@ -59,8 +56,8 @@ stdenv.mkDerivation rec { description = "Data model, library, and file format for storing and managing data"; longDescription = '' HDF5 supports an unlimited variety of datatypes, and is designed for flexible and efficient - I/O and for high volume and complex data. HDF5 is portable and is extensible, allowing - applications to evolve in their use of HDF5. The HDF5 Technology suite includes tools and + I/O and for high volume and complex data. HDF5 is portable and is extensible, allowing + applications to evolve in their use of HDF5. The HDF5 Technology suite includes tools and applications for managing, manipulating, viewing, and analyzing data in the HDF5 format. ''; license = stdenv.lib.licenses.free; # BSD-like From ed9dc1f18780621ad5d5498b9cd7caa5c71787b1 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Fri, 24 Nov 2017 00:25:54 +0100 Subject: [PATCH 05/17] nixos/libinput: load configuration file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In order for libinput to be used with Xorg, its configuration file needs to be added to environment similarly to how evdev one’s is. Closes: #31670 --- nixos/modules/services/x11/hardware/libinput.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/nixos/modules/services/x11/hardware/libinput.nix b/nixos/modules/services/x11/hardware/libinput.nix index 44555cb6e2a..5aecdef812e 100644 --- a/nixos/modules/services/x11/hardware/libinput.nix +++ b/nixos/modules/services/x11/hardware/libinput.nix @@ -198,6 +198,13 @@ in { environment.systemPackages = [ pkgs.xorg.xf86inputlibinput ]; + environment.etc = [ + (let cfgPath = "X11/xorg.conf.d/40-libinput.conf"; in { + source = pkgs.xorg.xf86inputlibinput.out + "/share/" + cfgPath; + target = cfgPath; + }) + ]; + services.udev.packages = [ pkgs.libinput ]; services.xserver.config = From 8bfa14f5a79cd849b3239172b3c3b49812a4358b Mon Sep 17 00:00:00 2001 From: Patrick Chilton Date: Fri, 24 Nov 2017 21:00:41 +0100 Subject: [PATCH 06/17] cnijfilter: add 4.00 --- .../cups/drivers/cnijfilter_4_00/default.nix | 150 ++++++++++++++++++ .../patches/cnijfilter-3.80-1-cups-1.6.patch | 62 ++++++++ .../patches/cnijfilter-3.80-6-cups-1.6.patch | 87 ++++++++++ .../patches/cnijfilter-4.00-4-ppd.patch | 10 ++ .../cnijfilter-4.00-5-abi_x86_32.patch | 45 ++++++ .../patches/cnijfilter-4.00-6-headers.patch | 11 ++ pkgs/top-level/all-packages.nix | 4 + 7 files changed, 369 insertions(+) create mode 100644 pkgs/misc/cups/drivers/cnijfilter_4_00/default.nix create mode 100644 pkgs/misc/cups/drivers/cnijfilter_4_00/patches/cnijfilter-3.80-1-cups-1.6.patch create mode 100644 pkgs/misc/cups/drivers/cnijfilter_4_00/patches/cnijfilter-3.80-6-cups-1.6.patch create mode 100644 pkgs/misc/cups/drivers/cnijfilter_4_00/patches/cnijfilter-4.00-4-ppd.patch create mode 100644 pkgs/misc/cups/drivers/cnijfilter_4_00/patches/cnijfilter-4.00-5-abi_x86_32.patch create mode 100644 pkgs/misc/cups/drivers/cnijfilter_4_00/patches/cnijfilter-4.00-6-headers.patch diff --git a/pkgs/misc/cups/drivers/cnijfilter_4_00/default.nix b/pkgs/misc/cups/drivers/cnijfilter_4_00/default.nix new file mode 100644 index 00000000000..2856aee4a5d --- /dev/null +++ b/pkgs/misc/cups/drivers/cnijfilter_4_00/default.nix @@ -0,0 +1,150 @@ +{ stdenv, lib, fetchzip, + autoconf, automake, libtool, + cups, popt, libtiff, libpng, + ghostscript, glib, libusb, libxml2 }: + +/* this derivation is basically just a transcription of the rpm .spec + file included in the tarball */ + +let arch = + if stdenv.system == "x86_64-linux" then "64" + else if stdenv.system == "i686-linux" then "32" + else abort "Unsupported architecture"; + +in stdenv.mkDerivation rec { + name = "cnijfilter-${version}"; + + /* important note about versions: cnijfilter packages seem to use + versions in a non-standard way. the version indicates which + printers are supported in the package. so this package should + not be "upgraded" in the usual way. + + instead, if you want to include another version supporting your + printer, you should try to abstract out the common things (which + should be pretty much everything except the version and the 'pr' + and 'pr_id' values to loop over). */ + version = "4.00"; + + src = fetchzip { + url = "http://gdlp01.c-wss.com/gds/5/0100005515/01/cnijfilter-source-4.00-1.tar.gz"; + sha256 = "1f6vpx1z3qa88590i5m0s49j9n90vpk81xmw6pvj0nfd3qbvzkya"; + }; + + buildInputs = [ autoconf libtool automake + cups popt libtiff libpng + ghostscript glib libusb libxml2 ]; + + # patches from https://github.com/tokiclover/bar-overlay/tree/master/net-print/cnijfilter + patches = [ + ./patches/cnijfilter-3.80-1-cups-1.6.patch + ./patches/cnijfilter-3.80-6-cups-1.6.patch + ./patches/cnijfilter-4.00-4-ppd.patch + ./patches/cnijfilter-4.00-5-abi_x86_32.patch + ./patches/cnijfilter-4.00-6-headers.patch + ]; + + postPatch = '' + sed -i "s|/usr/lib/cups/backend|$out/lib/cups/backend|" backend/src/Makefile.am; + sed -i "s|/usr/lib/cups/backend|$out/lib/cups/backend|" backendnet/backend/Makefile.am; + sed -i "s|/usr/lib/cups/backend|$out/lib/cups/backend|" cnijbe/src/Makefile.am; + sed -i "s|/usr|$out|" backend/src/cnij_backend_common.c; + sed -i "s|/usr/bin|${ghostscript}/bin|" pstocanonij/filter/pstocanonij.c; + ''; + + configurePhase = '' + cd libs + ./autogen.sh --prefix=$out + + cd ../bscc2sts + ./autogen.sh + + cd ../cnijnpr + ./autogen.sh --prefix=$out --enable-libpath=$out/lib/bjlib + + cd ../cngpij + ./autogen.sh --prefix=$out --enable-progpath=$out/bin + + cd ../cngpijmnt + ./autogen.sh --prefix=$out --enable-progpath=$out/bin + + cd ../pstocanonij + ./autogen.sh --prefix=$out --enable-progpath=$out/bin + + cd ../backend + ./autogen.sh --prefix=$out + + cd ../backendnet + ./autogen.sh --prefix=$out --enable-libpath=$out/lib/bjlib --enable-progpath=$out/bin + + cd ../cmdtocanonij + ./autogen.sh --prefix=$out --datadir=$out/share + + cd ../cnijbe + ./autogen.sh --prefix=$out --enable-progpath=$out/bin + + cd ../lgmon2 + substituteInPlace src/Makefile.am \ + --replace /usr/include/libusb-1.0 \ + ${libusb.dev}/include/libusb-1.0 + ./autogen.sh --prefix=$out --enable-libpath=$out/lib/bjlib --enable-progpath=$out/bin + + cd ..; + + sed -e "s,cnijlgmon2_LDADD =,cnijlgmon2_LDADD = -L../../com/libs_bin${arch}," \ + -i lgmon2/src/Makefile.am || die + ''; + + preInstall = '' + mkdir -p $out/bin $out/lib/cups/filter $out/share/cups/model; + ''; + + postInstall = '' + set -o xtrace + for pr in mg2400 mg2500 mg3500 mg5500 mg6400 mg6500 mg7100 p200; do + cd ppd; + ./autogen.sh --prefix=$out --program-suffix=$pr + make clean; + make; + make install; + + cd ../cnijfilter; + ./autogen.sh --prefix=$out --program-suffix=$pr --enable-libpath=/var/lib/cups/path/lib/bjlib --enable-binpath=$out/bin; + make clean; + make; + make install; + + cd ..; + done; + + mkdir -p $out/lib/bjlib; + for pr_id in 423 424 425 426 427 428 429 430; do + install -c -m 755 $pr_id/database/* $out/lib/bjlib; + install -c -s -m 755 $pr_id/libs_bin${arch}/*.so.* $out/lib; + done; + + pushd $out/lib; + for so_file in *.so.*; do + ln -s $so_file ''${so_file/.so.*/}.so; + patchelf --set-rpath $out/lib $so_file; + done; + popd; + ''; + + /* the tarball includes some pre-built shared libraries. we run + 'patchelf --set-rpath' on them just a few lines above, so that + they can find each other. but that's not quite enough. some of + those libraries load each other in non-standard ways -- they + don't list each other in the DT_NEEDED section. so, if the + standard 'patchelf --shrink-rpath' (from + pkgs/development/tools/misc/patchelf/setup-hook.sh) is run on + them, it undoes the --set-rpath. this prevents that. */ + dontPatchELF = true; + + meta = with lib; { + description = "Canon InkJet printer drivers for the MG2400 MG2500 MG3500 MG5500 MG6400 MG6500 MG7100 and P200 series."; + homepage = https://www.canon-europe.com/support/consumer_products/products/fax__multifunctionals/inkjet/pixma_mg_series/pixma_mg5550.aspx?type=drivers&driverdetailid=tcm:13-1094072; + license = licenses.unfree; + platforms = platforms.linux; + maintainers = with maintainers; [ chpatrick ]; + }; +} diff --git a/pkgs/misc/cups/drivers/cnijfilter_4_00/patches/cnijfilter-3.80-1-cups-1.6.patch b/pkgs/misc/cups/drivers/cnijfilter_4_00/patches/cnijfilter-3.80-1-cups-1.6.patch new file mode 100644 index 00000000000..dfc0bb2268c --- /dev/null +++ b/pkgs/misc/cups/drivers/cnijfilter_4_00/patches/cnijfilter-3.80-1-cups-1.6.patch @@ -0,0 +1,62 @@ +--- a/cngpij/cngpij/bjcups.c ++++ a/cngpij/cngpij/bjcups.c +@@ -698,8 +719,8 @@ + else { + pRequest = ippNew(); + +- pRequest->request.op.operation_id = CUPS_GET_PRINTERS; +- pRequest->request.op.request_id = 1; ++ ippSetOperation(pRequest, CUPS_GET_PRINTERS); ++ ippSetRequestId(pRequest, 1); + + pLanguage = bjcupsLangDefault(); // cupsLangDefault() -> bjcupsLangDefault() for cups-1.1.19 + +@@ -708,29 +729,29 @@ + ippAddString(pRequest, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, NULL); + + if ((pResponse = cupsDoRequest(pHTTP, pRequest, "/")) != NULL) { +- if (pResponse->request.status.status_code > IPP_OK_CONFLICT) { ++ if (ippGetStatusCode(pResponse) > IPP_OK_CONFLICT) { + fputs("ERROR: IPP ERROR\n", stderr); + goto onErr; + } + else { +- pAttribute = pResponse->attrs; ++ pAttribute = ippFirstAttribute(pResponse); + + while (pAttribute != NULL) { +- while (pAttribute != NULL && pAttribute->group_tag != IPP_TAG_PRINTER) { +- pAttribute = pAttribute->next; ++ while (pAttribute != NULL && ippGetGroupTag(pAttribute) != IPP_TAG_PRINTER) { ++ pAttribute = ippNextAttribute(pResponse); + } + if (pAttribute == NULL) { + break; + } + +- while (pAttribute != NULL && pAttribute->group_tag == IPP_TAG_PRINTER) { +- if (strcmp(pAttribute->name, "printer-name") == 0 && pAttribute->value_tag == IPP_TAG_NAME) { +- pPrinter = pAttribute->values[0].string.text; ++ while (pAttribute != NULL && ippGetGroupTag(pAttribute) == IPP_TAG_PRINTER) { ++ if (strcmp(ippGetName(pAttribute), "printer-name") == 0 && ippGetValueTag(pAttribute) == IPP_TAG_NAME) { ++ pPrinter = ippGetString(pAttribute, 0, NULL); + } +- if (strcmp(pAttribute->name, "device-uri") == 0 && pAttribute->value_tag == IPP_TAG_URI) { +- pDUri = pAttribute->values[0].string.text; ++ if (strcmp(ippGetName(pAttribute), "device-uri") == 0 && ippGetValueTag(pAttribute) == IPP_TAG_URI) { ++ pDUri = ippGetString(pAttribute, 0, NULL); + } +- pAttribute = pAttribute->next; ++ pAttribute = ippNextAttribute(pResponse); + } + + if (strcasecmp(pDestName, pPrinter) == 0) { +@@ -739,7 +760,7 @@ + } + + if (pAttribute != NULL) +- pAttribute = pAttribute->next; ++ pAttribute = ippNextAttribute(pResponse); + } + } + diff --git a/pkgs/misc/cups/drivers/cnijfilter_4_00/patches/cnijfilter-3.80-6-cups-1.6.patch b/pkgs/misc/cups/drivers/cnijfilter_4_00/patches/cnijfilter-3.80-6-cups-1.6.patch new file mode 100644 index 00000000000..6b51d4837d4 --- /dev/null +++ b/pkgs/misc/cups/drivers/cnijfilter_4_00/patches/cnijfilter-3.80-6-cups-1.6.patch @@ -0,0 +1,87 @@ +diff --git a/cngpijmnt/src/getipc.c b/cngpijmnt/src/getipc.c +index 8688032..54c7933 100755 +--- a/cngpijmnt/src/getipc.c ++++ b/cngpijmnt/src/getipc.c +@@ -42,7 +42,7 @@ int GetIPCData(LPIPCU pipc, char *sname) + int server_fd; + int client_fd; + char buf[128]; +- size_t len; ++ socklen_t len; + short ret = RET_ERROR; + + if( (server_fd = socket(PF_UNIX, SOCK_STREAM, 0)) < 0 ) + +--- a/cngpijmnt/src/main.c 2016-11-12 23:39:03.534855723 +0100 ++++ b/cngpijmnt/src/main.c 2016-11-12 23:47:02.521847145 +0100 +@@ -308,8 +308,8 @@ + *pResponse; // Pointer to CUPS IPP response. + ipp_attribute_t *pAttribute; // Pointer to CUPS attributes. + cups_lang_t *pLanguage; // Pointer to language. +- char *pPrinter = NULL; // Pointer to printer name. +- char *pDUri = NULL; // Pointer to Device uri. ++ const char *pPrinter = NULL; // Pointer to printer name. ++ const char *pDUri = NULL; // Pointer to Device uri. + short retVal = -1; // Return value. + /*** Parameters end ***/ + +@@ -321,8 +321,8 @@ + else { + pRequest = ippNew(); + +- pRequest->request.op.operation_id = CUPS_GET_PRINTERS; +- pRequest->request.op.request_id = 1; ++ ippSetOperation(pRequest, CUPS_GET_PRINTERS); ++ ippSetRequestId(pRequest, 1); + + pLanguage = bjcupsLangDefault(); // cupsLangDefault() -> bjcupsLangDefault() for cups-1.1.19 + +@@ -331,29 +331,29 @@ + ippAddString(pRequest, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, NULL); + + if ((pResponse = cupsDoRequest(pHTTP, pRequest, "/")) != NULL) { +- if (pResponse->request.status.status_code > IPP_OK_CONFLICT) { ++ if (ippGetStatusCode(pResponse) > IPP_OK_CONFLICT) { + fputs("ERROR: IPP ERROR\n", stderr); + goto onErr; + } + else { +- pAttribute = pResponse->attrs; ++ pAttribute = ippFirstAttribute(pResponse); + + while (pAttribute != NULL) { +- while (pAttribute != NULL && pAttribute->group_tag != IPP_TAG_PRINTER) { +- pAttribute = pAttribute->next; ++ while (pAttribute != NULL && ippGetGroupTag(pAttribute) != IPP_TAG_PRINTER) { ++ pAttribute = ippNextAttribute(pResponse); + } + if (pAttribute == NULL) { + break; + } + +- while (pAttribute != NULL && pAttribute->group_tag == IPP_TAG_PRINTER) { +- if (strcmp(pAttribute->name, "printer-name") == 0 && pAttribute->value_tag == IPP_TAG_NAME) { +- pPrinter = pAttribute->values[0].string.text; ++ while (pAttribute != NULL && ippGetGroupTag(pAttribute) == IPP_TAG_PRINTER) { ++ if (strcmp(ippGetName(pAttribute), "printer-name") == 0 && ippGetValueTag(pAttribute) == IPP_TAG_NAME) { ++ pPrinter = ippGetString(pAttribute, 0, NULL); + } +- if (strcmp(pAttribute->name, "device-uri") == 0 && pAttribute->value_tag == IPP_TAG_URI) { +- pDUri = pAttribute->values[0].string.text; ++ if (strcmp(ippGetName(pAttribute), "device-uri") == 0 && ippGetValueTag(pAttribute) == IPP_TAG_URI) { ++ pDUri = ippGetString(pAttribute, 0, NULL); + } +- pAttribute = pAttribute->next; ++ pAttribute = ippNextAttribute(pResponse); + } + + if (strcasecmp(pDestName, pPrinter) == 0) { +@@ -362,7 +362,7 @@ + } + + if (pAttribute != NULL) +- pAttribute = pAttribute->next; ++ pAttribute = ippNextAttribute(pResponse); + } + } + diff --git a/pkgs/misc/cups/drivers/cnijfilter_4_00/patches/cnijfilter-4.00-4-ppd.patch b/pkgs/misc/cups/drivers/cnijfilter_4_00/patches/cnijfilter-4.00-4-ppd.patch new file mode 100644 index 00000000000..92bef72ba05 --- /dev/null +++ b/pkgs/misc/cups/drivers/cnijfilter_4_00/patches/cnijfilter-4.00-4-ppd.patch @@ -0,0 +1,10 @@ +--- a/backend/src/cnij_backend_common.c 2016-11-13 00:08:34.600824006 +0100 ++++ a/backend/src/cnij_backend_common.c 2016-11-13 00:08:52.037823694 +0100 +@@ -37,6 +37,7 @@ + // CUPS Header + #include + #include ++#include + + // Header file for CANON + #include "cnij_backend_common.h" diff --git a/pkgs/misc/cups/drivers/cnijfilter_4_00/patches/cnijfilter-4.00-5-abi_x86_32.patch b/pkgs/misc/cups/drivers/cnijfilter_4_00/patches/cnijfilter-4.00-5-abi_x86_32.patch new file mode 100644 index 00000000000..dc85801a256 --- /dev/null +++ b/pkgs/misc/cups/drivers/cnijfilter_4_00/patches/cnijfilter-4.00-5-abi_x86_32.patch @@ -0,0 +1,45 @@ +--- a/backendnet/configure.in 2014-08-11 08:38:46.034984462 +0200 ++++ a/backendnet/configure.in 2014-08-11 08:35:42.902985813 +0200 +@@ -19,7 +19,11 @@ + AC_DEFINE_UNQUOTED(BJLIB_PATH, "$enable_libpath") + AC_SUBST(BJLIB_PATH) + +-ARC=`getconf LONG_BIT` ++case "$ABI" in ++ x86) ARC=32;; ++ amd64) ARC=64;; ++ *) ARC=`getconf LONG_BIT`;; ++esac + AC_SUBST(ARC) + + # Checks for programs. +--- a/cnijfilter/configure.in 2014-08-11 08:39:44.426984031 +0200 ++++ a/cnijfilter/configure.in 2014-08-11 08:35:19.788985984 +0200 +@@ -43,7 +43,11 @@ + esac + AC_SUBST(CNCL_LIB_ID) + +-ARC=`getconf LONG_BIT` ++case "$ABI" in ++ x86) ARC=32;; ++ amd64) ARC=64;; ++ *) ARC=`getconf LONG_BIT`;; ++esac + AC_SUBST(ARC) + + AC_PROG_CC +--- a/cnijnpr/configure.in 2014-08-11 08:41:12.712983380 +0200 ++++ a/cnijnpr/configure.in 2014-08-11 08:40:44.354983589 +0200 +@@ -37,7 +37,11 @@ + + CFLAGS="-O2" + +-ARC=`getconf LONG_BIT` ++case "$ABI" in ++ x86) ARC=32;; ++ amd64) ARC=64;; ++ *) ARC=`getconf LONG_BIT`;; ++esac + AC_SUBST(ARC) + + AC_OUTPUT(Makefile diff --git a/pkgs/misc/cups/drivers/cnijfilter_4_00/patches/cnijfilter-4.00-6-headers.patch b/pkgs/misc/cups/drivers/cnijfilter_4_00/patches/cnijfilter-4.00-6-headers.patch new file mode 100644 index 00000000000..7dba7999511 --- /dev/null +++ b/pkgs/misc/cups/drivers/cnijfilter_4_00/patches/cnijfilter-4.00-6-headers.patch @@ -0,0 +1,11 @@ +--- a/cnijnpr/src/cnijnpr.c 2016-11-13 21:51:33.844977618 +0100 ++++ a/cnijnpr/src/cnijnpr.c 2016-11-13 21:52:03.129977094 +0100 +@@ -34,6 +34,8 @@ + #include + #include + #include ++#include ++#include + #include + #include + diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b5ffb39b8ca..2ea3b7c3c3d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -19233,6 +19233,10 @@ with pkgs; # this driver ships with pre-compiled 32-bit binary libraries cnijfilter_2_80 = callPackage_i686 ../misc/cups/drivers/cnijfilter_2_80 { }; + cnijfilter_4_00 = callPackage ../misc/cups/drivers/cnijfilter_4_00 { + libusb = libusb1; + }; + cnijfilter2 = callPackage ../misc/cups/drivers/cnijfilter2 { libusb = libusb1; }; From dfa4fbb98b944a691ee5d18d8ff0c43a4a5f2ddd Mon Sep 17 00:00:00 2001 From: adisbladis Date: Sat, 25 Nov 2017 11:55:11 +0800 Subject: [PATCH 07/17] traefik: 1.3.8 -> 1.4.4 --- pkgs/servers/traefik/default.nix | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/pkgs/servers/traefik/default.nix b/pkgs/servers/traefik/default.nix index f1fb1a34fc2..d0d0efa9aa6 100644 --- a/pkgs/servers/traefik/default.nix +++ b/pkgs/servers/traefik/default.nix @@ -1,24 +1,19 @@ -{ stdenv, buildGoPackage, fetchurl, bash, go-bindata}: +{ stdenv, buildGoPackage, fetchFromGitHub, bash, go-bindata}: buildGoPackage rec { name = "traefik-${version}"; - version = "1.3.8"; + version = "1.4.4"; goPackagePath = "github.com/containous/traefik"; - src = fetchurl { - url = "https://github.com/containous/traefik/releases/download/v${version}/traefik-v${version}.src.tar.gz"; - sha256 = "6fce36dd30bb5ae5f91e69f2950f22fe7a74b920e80c6b441a0721122f6a6174"; + src = fetchFromGitHub { + owner = "containous"; + repo = "traefik"; + rev = "v${version}"; + sha256 = "114861v8kg77zwnf742n25h7c4fly3i52inqx1kcpqs074rqm1wn"; }; buildInputs = [ go-bindata bash ]; - unpackPhase = '' - runHook preUnpack - mkdir traefik - tar -C traefik -xvzf $src - export sourceRoot="traefik" - runHook postUnpack - ''; buildPhase = '' runHook preBuild From cb05c04f4e9b7753cc5f252d331bb0b9a62c83a9 Mon Sep 17 00:00:00 2001 From: Pierre Carrier Date: Fri, 24 Nov 2017 13:07:36 -0500 Subject: [PATCH 08/17] minijail: init at android-8.0.0_r34 --- lib/maintainers.nix | 1 + pkgs/tools/system/minijail/default.nix | 39 ++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 3 files changed, 42 insertions(+) create mode 100644 pkgs/tools/system/minijail/default.nix diff --git a/lib/maintainers.nix b/lib/maintainers.nix index d798d6d315b..d33ffac7918 100644 --- a/lib/maintainers.nix +++ b/lib/maintainers.nix @@ -487,6 +487,7 @@ patternspandemic = "Brad Christensen "; pawelpacana = "Paweł Pacana "; pbogdan = "Piotr Bogdan "; + pcarrier = "Pierre Carrier "; periklis = "theopompos@gmail.com"; pesterhazy = "Paulus Esterhazy "; peterhoeg = "Peter Hoeg "; diff --git a/pkgs/tools/system/minijail/default.nix b/pkgs/tools/system/minijail/default.nix new file mode 100644 index 00000000000..c47d40cef2b --- /dev/null +++ b/pkgs/tools/system/minijail/default.nix @@ -0,0 +1,39 @@ +{ stdenv, fetchgit, libcap }: + +stdenv.mkDerivation rec { + shortname = "minijail"; + name = "${shortname}-${version}"; + version = "android-8.0.0_r34"; + + src = fetchgit { + url = "https://android.googlesource.com/platform/external/minijail"; + rev = version; + sha256 = "1d0q08cgks6h6ffsw3zw8dz4rm9y2djj2pwwy3xi6flx7vwy0psf"; + }; + + buildInputs = [ libcap ]; + + makeFlags = [ "LIBDIR=$(out)/lib" ]; + + preConfigure = '' + substituteInPlace common.mk --replace /bin/echo echo + sed -i '/#include / d' signal_handler.c + ''; + + installPhase = '' + mkdir -p $out/lib + cp -v *.so $out/lib + mkdir -p $out/include + cp -v libminijail.h $out/include + mkdir -p $out/bin + cp minijail0 $out/bin + ''; + + meta = { + homepage = https://android.googlesource.com/platform/external/minijail/; + description = "Sandboxing library and application using Linux namespaces and capabilities"; + license = stdenv.lib.licenses.bsd3; + maintainers = with stdenv.lib.maintainers; [pcarrier]; + platforms = stdenv.lib.platforms.linux; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 5d69015b748..3a81a1ead15 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3372,6 +3372,8 @@ with pkgs; miniball = callPackage ../development/libraries/miniball { }; + minijail = callPackage ../tools/system/minijail { }; + minixml = callPackage ../development/libraries/minixml { }; mir-qualia = callPackage ../tools/text/mir-qualia { From e2349070aca95bc96f1091c9142634c065f2925b Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Sat, 25 Nov 2017 09:31:37 +0100 Subject: [PATCH 09/17] octaveFull: always use openblasCompat on darwin Haven't tested this, but considering `octave` on darwin also uses openblasCompat, we may want it here as well. --- pkgs/top-level/all-packages.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index eaf9d64d72a..8db247dfec9 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6595,6 +6595,7 @@ with pkgs; octaveFull = (lowPrio (callPackage ../development/interpreters/octave { qt = qt4; overridePlatforms = ["x86_64-linux" "x86_64-darwin"]; + openblas = if stdenv.isDarwin then openblasCompat else openblas; })); ocropus = callPackage ../applications/misc/ocropus { }; From cb9bf1c8541f68513eb446c89e763657a6a9a1ef Mon Sep 17 00:00:00 2001 From: Kier Davis Date: Fri, 24 Nov 2017 00:03:22 +0000 Subject: [PATCH 10/17] PySolFC: init at 2.0 PySolFC is a solitaire game written in Python, supporting thousands of solitaire variants. --- pkgs/games/pysolfc/default.nix | 39 ++++++++++++++++++++++++ pkgs/games/pysolfc/pysolfc-datadir.patch | 19 ++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 3 files changed, 60 insertions(+) create mode 100644 pkgs/games/pysolfc/default.nix create mode 100644 pkgs/games/pysolfc/pysolfc-datadir.patch diff --git a/pkgs/games/pysolfc/default.nix b/pkgs/games/pysolfc/default.nix new file mode 100644 index 00000000000..85424ebea9b --- /dev/null +++ b/pkgs/games/pysolfc/default.nix @@ -0,0 +1,39 @@ +{ fetchurl, python2, stdenv }: + +with python2.pkgs; + +buildPythonApplication rec { + pname = "PySolFC"; + version = "2.0"; + + src = fetchurl { + url = "mirror://sourceforge/pysolfc/${pname}-${version}.tar.bz2"; + sha256 = "0v0v8iflw55f5mghglkw80j8b7lv1hffjassfhqc4y84dmz8xjyv"; + }; + + patches = [ + ./pysolfc-datadir.patch + ]; + + propagatedBuildInputs = [ + tkinter + ]; + + # No tests in archive + doCheck = false; + + postInstall = '' + # executables should not have an extension + pushd $out/bin + mv pysol.py pysol + rm pysol.pyc + popd + ''; + + meta = with stdenv.lib; { + description = "A collection of more than 1000 solitaire card games"; + homepage = http://pysolfc.sourceforge.net/; + license = licenses.gpl3; + maintainers = with maintainers; [ kierdavis ]; + }; +} diff --git a/pkgs/games/pysolfc/pysolfc-datadir.patch b/pkgs/games/pysolfc/pysolfc-datadir.patch new file mode 100644 index 00000000000..d9f1cf4e09f --- /dev/null +++ b/pkgs/games/pysolfc/pysolfc-datadir.patch @@ -0,0 +1,19 @@ +diff --git a/pysollib/util.py b/pysollib/util.py +index 8de3f00..26f4bc7 100644 +--- a/pysollib/util.py ++++ b/pysollib/util.py +@@ -110,13 +110,7 @@ class DataLoader: + head, tail = os.path.split(argv0) + if not head: + head = os.curdir +- # dir where placed startup script +- path.append(head) +- path.append(os.path.join(head, "data")) +- path.append(os.path.join(head, os.pardir, "data")) +- # dir where placed pysol package +- path.append(os.path.join(sys.path[0], "data")) +- path.append(os.path.join(sys.path[0], "pysollib", "data")) ++ path.append(os.path.join(head, "..", "share", "PySolFC")) + # from settings.py + path.extend(DATA_DIRS) + # check path for valid directories diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 8db247dfec9..831cf45b511 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -18080,6 +18080,8 @@ with pkgs; privateer = callPackage ../games/privateer { }; + pysolfc = callPackage ../games/pysolfc { }; + qweechat = callPackage ../applications/networking/irc/qweechat { }; qqwing = callPackage ../games/qqwing { }; From 88dfc0333a5268fe6312c02175d569984383d007 Mon Sep 17 00:00:00 2001 From: Joerg Thalheim Date: Sat, 25 Nov 2017 09:31:41 +0000 Subject: [PATCH 11/17] luaPackages.vicious: 2.2.0 -> 2.3.0 cc @makefu --- pkgs/top-level/lua-packages.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/top-level/lua-packages.nix b/pkgs/top-level/lua-packages.nix index ef58b7988df..e3eaa7c7f58 100644 --- a/pkgs/top-level/lua-packages.nix +++ b/pkgs/top-level/lua-packages.nix @@ -655,13 +655,13 @@ let vicious = stdenv.mkDerivation rec { name = "vicious-${version}"; - version = "2.2.0"; + version = "2.3.0"; src = fetchFromGitHub { owner = "Mic92"; repo = "vicious"; rev = "v${version}"; - sha256 = "0dhy0vklrhqrnmxb9pyqbfvkwwy86lwysk93pzg1j1zwprx366fj"; + sha256 = "1mrd8c46ljilag8dljvnagaxnjnab8bmg9mcbnwvrivgjzgf6a1k"; }; buildInputs = [ lua ]; From f008d1c30593652d00c47d99e0dc87c46e0db917 Mon Sep 17 00:00:00 2001 From: Pascal Bach Date: Sun, 19 Nov 2017 22:48:20 +0100 Subject: [PATCH 12/17] riot-web: 0.12.6 -> 0.13.1 --- .../networking/instant-messengers/riot/riot-web.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/networking/instant-messengers/riot/riot-web.nix b/pkgs/applications/networking/instant-messengers/riot/riot-web.nix index db0d874c589..2965ce86cc9 100644 --- a/pkgs/applications/networking/instant-messengers/riot/riot-web.nix +++ b/pkgs/applications/networking/instant-messengers/riot/riot-web.nix @@ -2,11 +2,11 @@ stdenv.mkDerivation rec { name= "riot-web-${version}"; - version = "0.12.6"; + version = "0.13.1"; src = fetchurl { url = "https://github.com/vector-im/riot-web/releases/download/v${version}/riot-v${version}.tar.gz"; - sha256 = "00hxjhnsm4622hv46xm7lc81kbnzi2iz77qppwma14cbh63jbilv"; + sha256 = "19g0d3wqmz4vj9flf7pfgfvm2qf2w3jhxp9qdyfbiwd670h5wjlv"; }; installPhase = '' From e36962a0025a3c435e98d4c235b7e72e9d1cd42e Mon Sep 17 00:00:00 2001 From: Kjetil Orbekk Date: Tue, 21 Nov 2017 17:24:55 -0500 Subject: [PATCH 13/17] munin: 2.0.33 -> 2.0.34 --- pkgs/servers/monitoring/munin/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/servers/monitoring/munin/default.nix b/pkgs/servers/monitoring/munin/default.nix index 7882572b6c8..6fa59871e3c 100644 --- a/pkgs/servers/monitoring/munin/default.nix +++ b/pkgs/servers/monitoring/munin/default.nix @@ -3,14 +3,14 @@ }: stdenv.mkDerivation rec { - version = "2.0.33"; + version = "2.0.34"; name = "munin-${version}"; src = fetchFromGitHub { owner = "munin-monitoring"; repo = "munin"; rev = version; - sha256 = "0rs05b7926mjd58sdry33i91m1h3v3svl0wg2gmhljl8wqidac5w"; + sha256 = "0mb5m0nc3nr9781d3s99sjdssmvkv37gxyplzr6d73i4hi31m7fr"; }; buildInputs = [ From c164d835364ab0b366eade41e67e6ecfab56af7a Mon Sep 17 00:00:00 2001 From: Kjetil Orbekk Date: Tue, 21 Nov 2017 17:38:11 -0500 Subject: [PATCH 14/17] munin-node: add patch to preserve environment variables --- pkgs/servers/monitoring/munin/default.nix | 2 + .../munin/preserve_environment.patch | 41 +++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 pkgs/servers/monitoring/munin/preserve_environment.patch diff --git a/pkgs/servers/monitoring/munin/default.nix b/pkgs/servers/monitoring/munin/default.nix index 6fa59871e3c..078c2318eef 100644 --- a/pkgs/servers/monitoring/munin/default.nix +++ b/pkgs/servers/monitoring/munin/default.nix @@ -67,6 +67,8 @@ stdenv.mkDerivation rec { # https://github.com/munin-monitoring/munin/pull/134 ./adding_servicedir_munin-node.patch + + ./preserve_environment.patch ]; preBuild = '' diff --git a/pkgs/servers/monitoring/munin/preserve_environment.patch b/pkgs/servers/monitoring/munin/preserve_environment.patch new file mode 100644 index 00000000000..ef66f48ecb4 --- /dev/null +++ b/pkgs/servers/monitoring/munin/preserve_environment.patch @@ -0,0 +1,41 @@ +commit d94c29b7397362857b81d8c877a989fdb28490d8 +Author: Kjetil Orbekk +Date: Tue Nov 21 15:37:42 2017 -0500 + + Keep environment variables instead of overwriting them. + +diff --git a/common/lib/Munin/Common/Defaults.pm b/common/lib/Munin/Common/Defaults.pm +index 131f52c0..bbf42697 100644 +--- a/common/lib/Munin/Common/Defaults.pm ++++ b/common/lib/Munin/Common/Defaults.pm +@@ -71,7 +71,7 @@ sub export_to_environment { + + my %defaults = %{$class->get_defaults()}; + while (my ($k, $v) = each %defaults) { +- $ENV{$k} = $v; ++ $ENV{$k} = $ENV{$k} || $v; + } + + return +diff --git a/node/lib/Munin/Node/Service.pm b/node/lib/Munin/Node/Service.pm +index 1b4f6114..be58bd77 100644 +--- a/node/lib/Munin/Node/Service.pm ++++ b/node/lib/Munin/Node/Service.pm +@@ -122,7 +122,7 @@ sub export_service_environment { + # We append the USER to the MUNIN_PLUGSTATE, to avoid CVE-2012-3512 + my $uid = $self->_resolve_uid($service); + my $user = getpwuid($uid); +- $ENV{MUNIN_PLUGSTATE} = "$Munin::Common::Defaults::MUNIN_PLUGSTATE/$user"; ++ $ENV{MUNIN_PLUGSTATE} = "$ENV{MUNIN_PLUGSTATE}/$user"; + + # Provide a consistent default state-file. + $ENV{MUNIN_STATEFILE} = "$ENV{MUNIN_PLUGSTATE}/$service-$ENV{MUNIN_MASTER_IP}"; +@@ -243,7 +243,7 @@ sub exec_service + + # XXX - Create the statedir for the user + my $uid = $self->_resolve_uid($service); +- Munin::Node::OS->mkdir_subdir("$Munin::Common::Defaults::MUNIN_PLUGSTATE", $uid); ++ Munin::Node::OS->mkdir_subdir("$ENV{MUNIN_PLUGSTATE}", $uid); + + $self->change_real_and_effective_user_and_group($service); + From a2dc37c7d1390d8aad8e2d888feb5bcd28656f4a Mon Sep 17 00:00:00 2001 From: Kjetil Orbekk Date: Thu, 23 Nov 2017 21:27:15 -0500 Subject: [PATCH 15/17] munin-node: patch to configure plugin-conf.d Add a new patch (adding_sconfdir_munin-node.patch) to be able to configure the location of plugin-conf.d (otherwise it has to be configured at build time). This patch is very similar to the existing 'adding_servicedir_munin-node.patch'. --- .../munin/adding_sconfdir_munin-node.patch | 41 +++++++++++++++++++ pkgs/servers/monitoring/munin/default.nix | 1 + 2 files changed, 42 insertions(+) create mode 100644 pkgs/servers/monitoring/munin/adding_sconfdir_munin-node.patch diff --git a/pkgs/servers/monitoring/munin/adding_sconfdir_munin-node.patch b/pkgs/servers/monitoring/munin/adding_sconfdir_munin-node.patch new file mode 100644 index 00000000000..6e14d613703 --- /dev/null +++ b/pkgs/servers/monitoring/munin/adding_sconfdir_munin-node.patch @@ -0,0 +1,41 @@ +commit af5fa3623bb9a73052f9154be4a0f38c60ea42a2 +Author: Kjetil Orbekk +Date: Thu Nov 23 21:21:36 2017 -0500 + + node: add --sconfdir to set plugin configuration dir + +diff --git a/node/sbin/munin-node b/node/sbin/munin-node +index 909c8c4e..0ccf3941 100755 +--- a/node/sbin/munin-node ++++ b/node/sbin/munin-node +@@ -100,9 +100,11 @@ sub parse_args + my @ORIG_ARGV = @ARGV; + + my $servicedir_cmdline; ++ my $sconfdir_cmdline; + print_usage_and_exit() unless GetOptions( + "config=s" => \$conffile, + "servicedir=s" => \$servicedir_cmdline, ++ "sconfdir=s" => \$sconfdir_cmdline, + "debug!" => \$DEBUG, + "pidebug!" => \$PIDEBUG, + "paranoia!" => \$paranoia, +@@ -112,6 +114,7 @@ sub parse_args + + # We untaint the args brutally, since the sysadm should know what he does + $servicedir = $1 if defined $servicedir_cmdline && $servicedir_cmdline =~ m/(.*)/; ++ $sconfdir = $1 if defined $sconfdir_cmdline && $sconfdir_cmdline =~ m/(.*)/; + + # Reset ARGV (for HUPing) + @ARGV = @ORIG_ARGV; +@@ -175,6 +178,10 @@ Use EfileE as configuration file. [@@CONFDIR@@/munin-node.conf] + + Override plugin directory [@@CONFDIR@@/plugins/] + ++=item B<< --sconfdir >> ++ ++Override plugin configuration directory [@@CONFDIR@@/plugin-conf.d/] ++ + =item B< --[no]paranoia > + + Only run plugins owned by root. Check permissions as well. [--noparanoia] diff --git a/pkgs/servers/monitoring/munin/default.nix b/pkgs/servers/monitoring/munin/default.nix index 078c2318eef..77e7b66fc39 100644 --- a/pkgs/servers/monitoring/munin/default.nix +++ b/pkgs/servers/monitoring/munin/default.nix @@ -68,6 +68,7 @@ stdenv.mkDerivation rec { # https://github.com/munin-monitoring/munin/pull/134 ./adding_servicedir_munin-node.patch + ./adding_sconfdir_munin-node.patch ./preserve_environment.patch ]; From bd3e49a80ec70a9619d339a03a39ba3f580fba04 Mon Sep 17 00:00:00 2001 From: Kjetil Orbekk Date: Tue, 21 Nov 2017 12:40:40 -0500 Subject: [PATCH 16/17] nixos/munin: fix broken plugin wrappers The munin-node service used wrapProgram to inject environment variables. This doesn't work because munin plugins depend on argv[0], which is overwritten when the executable is a script with a shebang line (example below). This commit removes the wrappers and instead passes the required environment variables to munin-node. Eliminating the wrappers resulted in some broken plugins, e.g., meminfo and hddtemp_smartctl. That was fixed with the per-plugin configuration. Example: The plugin if_eth0 is a symlink to /.../plugins/if_, which uses $0 to determine that it should monitor traffic on the eth0 interface. if_ is a wrapped program, and runs `exec -a "$0" .if_-wrapped` .if_-wrapped has a "#!/nix/.../bash" line, which results in bash changing $0, and as a result the plugin thinks my interface is called "-wrapped". --- nixos/modules/services/monitoring/munin.nix | 68 ++++++++++----------- 1 file changed, 31 insertions(+), 37 deletions(-) diff --git a/nixos/modules/services/monitoring/munin.nix b/nixos/modules/services/monitoring/munin.nix index cc6d51f0ef1..358ffd431dd 100644 --- a/nixos/modules/services/monitoring/munin.nix +++ b/nixos/modules/services/monitoring/munin.nix @@ -17,40 +17,6 @@ let nodeCfg = config.services.munin-node; cronCfg = config.services.munin-cron; - muninPlugins = pkgs.stdenv.mkDerivation { - name = "munin-available-plugins"; - buildCommand = '' - mkdir -p $out - - cp --preserve=mode ${pkgs.munin}/lib/plugins/* $out/ - - for file in $out/*; do - case "$file" in - */plugin.sh|*/plugins.history) - chmod +x "$file" - continue;; - esac - - # read magic makers from the file - family=$(sed -nr 's/.*#%#\s+family\s*=\s*(\S+)\s*/\1/p' $file) - cap=$(sed -nr 's/.*#%#\s+capabilities\s*=\s*(.+)/\1/p' $file) - - wrapProgram $file \ - --set PATH "/run/wrappers/bin:/run/current-system/sw/bin" \ - --set MUNIN_LIBDIR "${pkgs.munin}/lib" \ - --set MUNIN_PLUGSTATE "/var/run/munin" - - # munin uses markers to tell munin-node-configure what a plugin can do - echo "#%# family=$family" >> $file - echo "#%# capabilities=$cap" >> $file - done - - # NOTE: we disable disktstats because plugin seems to fail and it hangs html generation (100% CPU + memory leak) - rm -f $out/diskstats - ''; - buildInputs = [ pkgs.makeWrapper ]; - }; - muninConf = pkgs.writeText "munin.conf" '' dbdir /var/lib/munin @@ -83,6 +49,29 @@ let ${nodeCfg.extraConfig} ''; + + pluginConf = pkgs.writeText "munin-plugin-conf" + '' + [hddtemp_smartctl] + user root + group root + + [meminfo] + user root + group root + + [ipmi*] + user root + group root + ''; + + pluginConfDir = pkgs.stdenv.mkDerivation { + name = "munin-plugin-conf.d"; + buildCommand = '' + mkdir $out + ln -s ${pluginConf} $out/nixos-config + ''; + }; in { @@ -179,17 +168,22 @@ in description = "Munin Node"; after = [ "network.target" ]; wantedBy = [ "multi-user.target" ]; - path = [ pkgs.munin ]; + path = with pkgs; [ munin smartmontools "/run/current-system/sw" "/run/wrappers" ]; + environment.MUNIN_LIBDIR = "${pkgs.munin}/lib"; environment.MUNIN_PLUGSTATE = "/var/run/munin"; + environment.MUNIN_LOGDIR = "/var/log/munin"; preStart = '' echo "updating munin plugins..." mkdir -p /etc/munin/plugins rm -rf /etc/munin/plugins/* - PATH="/run/wrappers/bin:/run/current-system/sw/bin" ${pkgs.munin}/sbin/munin-node-configure --shell --families contrib,auto,manual --config ${nodeConf} --libdir=${muninPlugins} --servicedir=/etc/munin/plugins 2>/dev/null | ${pkgs.bash}/bin/bash + ${pkgs.munin}/bin/munin-node-configure --suggest --shell --families contrib,auto,manual --config ${nodeConf} --libdir=${pkgs.munin}/lib/plugins --servicedir=/etc/munin/plugins --sconfdir=${pluginConfDir} 2>/dev/null | ${pkgs.bash}/bin/bash + + # NOTE: we disable disktstats because plugin seems to fail and it hangs html generation (100% CPU + memory leak) + rm /etc/munin/plugins/diskstats || true ''; serviceConfig = { - ExecStart = "${pkgs.munin}/sbin/munin-node --config ${nodeConf} --servicedir /etc/munin/plugins/"; + ExecStart = "${pkgs.munin}/sbin/munin-node --config ${nodeConf} --servicedir /etc/munin/plugins/ --sconfdir=${pluginConfDir}"; }; }; From c177b838dfc3bc9a7744fc8c49fc0833de6c8c40 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Fri, 24 Nov 2017 00:51:23 +0100 Subject: [PATCH 17/17] nixos/xserver: let X choose the xkb rules With libinput used for keyboard, base rules produce incorrect keyboard layouts. We are removing the option as recommended in the XKB configuration guide [1] to let X server choose the ruleset. It looks like it chooses evdev rules which seem to work for some reason [1]: https://www.x.org/releases/X11R7.6/doc/xorg-docs/input/XKB-Config.html#id2521360 --- nixos/modules/services/x11/xserver.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/nixos/modules/services/x11/xserver.nix b/nixos/modules/services/x11/xserver.nix index 7d544e153e9..1049f810ad2 100644 --- a/nixos/modules/services/x11/xserver.nix +++ b/nixos/modules/services/x11/xserver.nix @@ -700,7 +700,6 @@ in Section "InputClass" Identifier "Keyboard catchall" MatchIsKeyboard "on" - Option "XkbRules" "base" Option "XkbModel" "${cfg.xkbModel}" Option "XkbLayout" "${cfg.layout}" Option "XkbOptions" "${cfg.xkbOptions}"