Unverified Commit 308b5776 authored by Nathan Parsons's avatar Nathan Parsons Committed by GitHub
Browse files

cnijfilter2: 6.10 -> 6.40 (#180681)

* cnijfilter2: 6.10 -> 6.40

* Fix compilation error related to duplicate definitions of GET_PROTOCOL

- Resolves the compilation issue reported at https://github.com/NixOS/nixpkgs/pull/180681#issuecomment-1192304711
- An identical issue was previously reported in Gentoo: https://bugs.gentoo.org/723186
- This patch is taken from the solution of Alfredo Tupone (https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=24688d64544b43f2c14be54531ad8764419dde09

)

Co-authored-by: default avatarNathan Parsons <nathan@parsons.digital>
parent aeed5a4f
Loading
Loading
Loading
Loading
+19 −4
Original line number Diff line number Diff line
@@ -4,11 +4,11 @@
stdenv.mkDerivation {
  pname = "cnijfilter2";

  version = "6.10";
  version = "6.40";

  src = fetchzip {
    url = "https://gdlp01.c-wss.com/gds/1/0100010921/01/cnijfilter2-source-6.10-1.tar.gz";
    sha256 = "0w121issdjxdv5i9ksa5m23if6pz1r9ql8p894f1pqn16w0kw1ix";
    url = "https://gdlp01.c-wss.com/gds/1/0100011381/01/cnijfilter2-source-6.40-1.tar.gz";
    sha256 = "3RoG83jLOsdTEmvUkkxb7wa8oBrJA4v1mGtxTGwSowU=";
  };

  nativeBuildInputs = [ automake autoconf ];
@@ -16,6 +16,10 @@ stdenv.mkDerivation {
    cups glib libxml2 libusb1 libtool
  ];

  patches = [
    ./patches/get_protocol.patch
  ];

  # lgmon3's --enable-libdir flag is used soley for specifying in which
  # directory the cnnnet.ini cache file should reside.
  # NixOS uses /var/cache/cups, and given the name, it seems like a reasonable
@@ -25,7 +29,7 @@ stdenv.mkDerivation {
  # $out/lib/cups/filter/libcnbpcnclapicom2.so
  buildPhase = ''
    mkdir -p $out/lib
    cp com/libs_bin64/* $out/lib
    cp com/libs_bin_x86_64/* $out/lib
    mkdir -p $out/lib/cups/filter
    ln -s $out/lib/libcnbpcnclapicom2.so $out/lib/cups/filter

@@ -51,6 +55,12 @@ stdenv.mkDerivation {
      make
    )

    (
      cd cmdtocanonij3
      ./autogen.sh --prefix=$out
      make
    )

    (
      cd cnijbe2
      substituteInPlace src/Makefile.am \
@@ -90,6 +100,11 @@ stdenv.mkDerivation {
      make install
    )

    (
      cd cmdtocanonij3
      make install
    )

    (
      cd cnijbe2
      make install
+14 −0
Original line number Diff line number Diff line
# Resolves the compilation issue reported at https://github.com/NixOS/nixpkgs/pull/180681#issuecomment-1192304711
# An identical issue was previously reported in Gentoo: https://bugs.gentoo.org/723186
# This patch is taken from the solution of Alfredo Tupone (https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=24688d64544b43f2c14be54531ad8764419dde09)
--- a/lgmon3/src/cnijlgmon3.c	2022-07-22 12:44:32.194641628 +0100
+++ b/lgmon3/src/cnijlgmon3.c	2022-07-22 12:43:53.954817724 +0100
@@ -55,7 +55,7 @@
 int (*GET_STATUS)(char *, int, int *, int * , char *);
 int (*GET_STATUS2)(char *, int, char *, int *, int * , char *, char *);
 int (*GET_STATUS2_MAINTENANCE)(char *, int, char *, int *, int * , char *, char *);
-int (*GET_PROTOCOL)(char *, size_t);
+static int (*GET_PROTOCOL)(char *, size_t);
 
 
  int main(int argc, char *argv[])