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: Nathan Parsons <nathan@parsons.digital>
This commit is contained in:
Nathan Parsons 2022-07-22 21:16:37 +01:00 committed by GitHub
parent aeed5a4f93
commit 308b5776a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 33 additions and 4 deletions

@ -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

@ -0,0 +1,14 @@
# 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[])