From nobody Fri Feb 10 21:16:06 2023 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PD63V4tMrz3mtqk; Fri, 10 Feb 2023 21:16:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PD63V4MYzz3vMy; Fri, 10 Feb 2023 21:16:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676063766; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KkAIKFJ7pKPIDfdDPpbn9pIC68t7r/FXpdp8CIp7qIw=; b=WR3h4akiGzht1YUyff915y77Aev4rrm689KQpfqGlUhO/RupwgP50JXqZ4BB4itxA3kpaX +sLi8T2wSgoBWNt5eAe7X10goLnK1UqMoxf634qIVD0+VLqFLtrf9QvFV5QL777M/LGwp8 I8URCPQdc2OvDdxYPHI7dP5zmBwS7QAoM0ZNk6D85UHOu5nY6zl57EC8KipgTiwld5u9ZZ iLp+4bXr8XzP5QjfsLtdG0tsOJZpj6Hf2mZ/n5eIyeBknvHVFidohDIBph9SPJzs2YY4N4 wOTg1o/AI0IwBmGkXGfh/BHaGdQKDtdRppipWpr7oVbvYMyqdIDX4JhDKtwfCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676063766; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KkAIKFJ7pKPIDfdDPpbn9pIC68t7r/FXpdp8CIp7qIw=; b=DYhn8QvPc/49UjaI+YpF2MVYA2eAuGlEp83MfBeaMOqWcXMoxWu6jh30t67MIZ73G3+PpP tv3CtIWXuuuRy2XeZxdFYURt/2zL0DHn6sSAPXbeDqFjWkIHnQydhaElmGAktjgMgZoVMu O2V6Y0KJiGJ9azvAyJ3FbrqF8vEWc2gbnMJ8/GBfq92CXCqpdRZBfjgAVrlstL+KTiwuBV ItkKq55L0KVTqp4aWRjUgsbX1R34gKWMl1CC0xYJq1c38yNQe6rIf5XKQ9GSc0e0r7MRrj hmIW7sBI8f3UgPdLtP6FVvFJ1gmQ6P0nksQO7j4b5ScoMZeRpQ9b8rMdnhxRYA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676063766; a=rsa-sha256; cv=none; b=bp4rEbyZT9PlM9R/HtKrP1uOMwb5l75q0eyH6cerYNVbuuN//QgNVYPxL0mySUxyM7ZGVg Ph/2zMTFz8RiDz5RTSy9idp/jdtuhwAa6VdcCjADx8MFKKq4O1I8abk6CWFWiW3To8L+gu MlBEAMVTq9TyzE2b+aWeeJfbpPthxaBPlehkknScjUQObFiDvDAagFefDHvxgV1k3BMol1 N1XNvpJYe5SPBBDRLVpSEzT8Dq/CaXpkmOuZDDZEACiK/keInWMYoNu8aANH9Jfu8xxvsA q8OSEDra4G/HrrLyFEvK0ymAxeA13r1xiwxJxFm38b0c4tn1sERAGeT1kD4TdQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PD63V32lCzYSt; Fri, 10 Feb 2023 21:16:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 31ALG6sA002302; Fri, 10 Feb 2023 21:16:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31ALG642002301; Fri, 10 Feb 2023 21:16:06 GMT (envelope-from git) Date: Fri, 10 Feb 2023 21:16:06 GMT Message-Id: <202302102116.31ALG642002301@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Tijl Coosemans Subject: git: 67d92e052a36 - main - print/hplip: Port pcardext module to Python 3.x List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tijl X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 67d92e052a364083dc46c6d9a071bd22ee64a814 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by tijl: URL: https://cgit.FreeBSD.org/ports/commit/?id=67d92e052a364083dc46c6d9a071bd22ee64a814 commit 67d92e052a364083dc46c6d9a071bd22ee64a814 Author: Tijl Coosemans AuthorDate: 2023-02-10 20:22:42 +0000 Commit: Tijl Coosemans CommitDate: 2023-02-10 21:15:11 +0000 print/hplip: Port pcardext module to Python 3.x --- print/hplip/Makefile | 1 + print/hplip/files/patch-pcard_pcardext_pcardext.c | 54 +++++++++++++++++++++++ 2 files changed, 55 insertions(+) diff --git a/print/hplip/Makefile b/print/hplip/Makefile index 8e4e4ab51d06..b5d7277f7048 100644 --- a/print/hplip/Makefile +++ b/print/hplip/Makefile @@ -1,5 +1,6 @@ PORTNAME= hplip PORTVERSION= 3.22.10 +PORTREVISION= 1 CATEGORIES= print MASTER_SITES= SF diff --git a/print/hplip/files/patch-pcard_pcardext_pcardext.c b/print/hplip/files/patch-pcard_pcardext_pcardext.c new file mode 100644 index 000000000000..2b6ea5eb61d3 --- /dev/null +++ b/print/hplip/files/patch-pcard_pcardext_pcardext.c @@ -0,0 +1,54 @@ +--- pcard/pcardext/pcardext.c.orig 2022-10-27 13:08:44 UTC ++++ pcard/pcardext/pcardext.c +@@ -59,7 +59,7 @@ int ReadSector(int sector, int nsector, void *buf, int + if( result ) + { + Py_ssize_t len = 0; +- PyString_AsStringAndSize( result, &result_str, &len ); ++ PyBytes_AsStringAndSize( result, &result_str, &len ); + + if( len < nsector*FAT_HARDSECT ) + { +@@ -83,7 +83,7 @@ int WriteSector(int sector, int nsector, void *buf, in + { + result = PyObject_CallFunction( writesectorFunc, "iis#", sector, nsector, buf, size ); + +- return PyInt_AS_LONG( result ); ++ return PyLong_AS_LONG( result ); + } + + return 1; +@@ -208,7 +208,7 @@ PyObject * pcardext_read( PyObject * self, PyObject * + + if( FatReadFileExt( name, offset, len, buffer ) == len ) + { +- return PyString_FromStringAndSize( (char *)buffer, len ); ++ return PyBytes_FromStringAndSize( (char *)buffer, len ); + } + else + { +@@ -234,16 +234,16 @@ static PyMethodDef pcardext_methods[] = + }; + + +-static char pcardext_documentation[] = "Python extension for HP photocard services"; ++PyDoc_STRVAR(pcardext_documentation, "Python extension for HP photocard services"); + +-void initpcardext( void ) ++static struct PyModuleDef pcardext_module = { ++ PyModuleDef_HEAD_INIT, "pcardext", pcardext_documentation, -1, ++ pcardext_methods, ++}; ++ ++PyMODINIT_FUNC PyInit_pcardext( void ) + { +- PyObject * mod = Py_InitModule4( "pcardext", pcardext_methods, +- pcardext_documentation, (PyObject*)NULL, +- PYTHON_API_VERSION ); +- +- if (mod == NULL) +- return; ++ return PyModule_Create(&pcardext_module); + } + +