From nobody Wed Sep 27 13:43:07 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 4Rwd975BHPz4vTqr; Wed, 27 Sep 2023 13:43:07 +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 4Rwd974bS5z4cYV; Wed, 27 Sep 2023 13:43:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1695822187; 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=aMdrLwioUS7ac6n3aB88uOlr8nvEAYxlJHdJt62BtsQ=; b=u+1nq3Jm0Xt7RTvY74lTuOpEHsW4Rj0mQEoweCGJC2xAPl0w7pCqrzFxB5RaO4VrdcMgDs eRDqNRokqw0YGh6Ry2ZbN+BnOhZHILlf25yxUy2CW47y8JjBCn57uHJFtNIAkR1jcd/h1D PpoH1Lc003VW6sMP23p6FkkRj65VgTQLcMAmIdD4xv5nUOUL5rthl0JXKkxMn/rSwPBgen 9IjbGBwrFjI3uEKQGJsbyQOpYvOmYrZG/lMyPOL4MI59LDuyIymF37681f3ar/ORsUdZEm rz+Ivv1rqAOV+Nf+zvyj16Ev9+tSmIpocnVez+BmDxpnaZIpxMQWZ13MiaeTfA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1695822187; a=rsa-sha256; cv=none; b=OKNfB8lPJFiYiYHq3Zcgh874mqa+wIBsYjIb39GLcfz11aZMEfAp40MXJoVxMnzQDarqf3 199jzaxA+j6yMM2F2rZaLfp6ABxLZQI/2dkMe40qEwTJ1w+85cW9i0qta09PdUlmvKwAcW PIO+0dQLbGYzoyl4v9qzBRINCsl74eVczg2ql3b4NvGmc81rgKnMINOCQKan9/Vpv7Wytr oCzGwoZ3Fb5WzsDwJUg3sCTx2M8qCF2sCh5Cu5GWDlwlMc8KRz5nEL6zccO/CP+8cqmiYY 2WRV0e2zLYJxkkOgtw1Uv6fJSgnmIK4IoBmd04yzzjWH/NOjs6xKIs76ktxwmQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1695822187; 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=aMdrLwioUS7ac6n3aB88uOlr8nvEAYxlJHdJt62BtsQ=; b=PoqlWjm6wyAEZmcAyh6kUJaPD4HDWxy7aNjhhQ394aMboPk/hig63x6HMO+6VeL0lJ3PbC ocG2V26TLQ/fEDxdnVENMnMBymWJ+y9aTycOCjoPX2cKavEt1ZtU1E0D+EH5dKh2KiBHr2 bbonXvV/S6Ol/qMscnWyr7/aP56cjb/sH0J0HC8Fi+h3pY7q2ARD9x/Zgf7FFaUcuDneoO MoEUYE5Py/qHr5JTQbbAwebGU56cgAlevICNvgsok3FNxm+M7vUSH52d+0S+Dtmya+1r0H ccn1kqaiv2KhNdVskBwRHFxxFCHvrHdNYnmq2FXL06jzyl2fl/RMuwmOmkEVfw== 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 4Rwd973fDhzhDk; Wed, 27 Sep 2023 13:43:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 38RDh7iV007751; Wed, 27 Sep 2023 13:43:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 38RDh7pp007748; Wed, 27 Sep 2023 13:43:07 GMT (envelope-from git) Date: Wed, 27 Sep 2023 13:43:07 GMT Message-Id: <202309271343.38RDh7pp007748@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Piotr Kubaj Subject: git: edff56235598 - main - devel/blueprint-compiler: fix runtime on big-endian 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: pkubaj X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: edff56235598162920b98775d8d2445eaa35defe Auto-Submitted: auto-generated The branch main has been updated by pkubaj: URL: https://cgit.FreeBSD.org/ports/commit/?id=edff56235598162920b98775d8d2445eaa35defe commit edff56235598162920b98775d8d2445eaa35defe Author: Piotr Kubaj AuthorDate: 2023-09-27 06:40:47 +0000 Commit: Piotr Kubaj CommitDate: 2023-09-27 13:43:04 +0000 devel/blueprint-compiler: fix runtime on big-endian Upstream commits https://gitlab.gnome.org/jwestman/blueprint-compiler/-/commit/0c0219551026ec9aec5487891e07d1ced3a31112 and https://gitlab.gnome.org/jwestman/blueprint-compiler/-/commit/057c767fbb595bb31d025c76547045273948aab1. --- devel/blueprint-compiler/Makefile | 1 + .../files/patch-blueprintcompiler_gir.py | 13 ++++++++ .../files/patch-blueprintcompiler_typelib.py | 38 ++++++++++++++++++++++ 3 files changed, 52 insertions(+) diff --git a/devel/blueprint-compiler/Makefile b/devel/blueprint-compiler/Makefile index 1ad9b062b1b6..7084d92106e3 100644 --- a/devel/blueprint-compiler/Makefile +++ b/devel/blueprint-compiler/Makefile @@ -1,6 +1,7 @@ PORTNAME= blueprint-compiler DISTVERSIONPREFIX= v DISTVERSION= 0.10.0 +PORTREVISION= 1 CATEGORIES= devel MAINTAINER= jbeich@FreeBSD.org diff --git a/devel/blueprint-compiler/files/patch-blueprintcompiler_gir.py b/devel/blueprint-compiler/files/patch-blueprintcompiler_gir.py new file mode 100644 index 000000000000..48471f4d9a05 --- /dev/null +++ b/devel/blueprint-compiler/files/patch-blueprintcompiler_gir.py @@ -0,0 +1,13 @@ +--- blueprintcompiler/gir.py.orig 2023-09-26 21:07:04 UTC ++++ blueprintcompiler/gir.py +@@ -888,8 +888,8 @@ class Repository(GirNode): + return self.lookup_namespace(ns).get_type(dir_entry.DIR_ENTRY_NAME) + + def _resolve_type_id(self, type_id: int) -> GirType: +- if type_id & 0xFFFFFF == 0: +- type_id = (type_id >> 27) & 0x1F ++ if type_id & (0xFFFFFF if sys.byteorder == "little" else 0xFFFFFF00) == 0: ++ type_id = ((type_id >> 27) if sys.byteorder == "little" else type_id) & 0x1F + # simple type + if type_id == typelib.TYPE_BOOLEAN: + return BoolType() diff --git a/devel/blueprint-compiler/files/patch-blueprintcompiler_typelib.py b/devel/blueprint-compiler/files/patch-blueprintcompiler_typelib.py new file mode 100644 index 000000000000..4953a57016ef --- /dev/null +++ b/devel/blueprint-compiler/files/patch-blueprintcompiler_typelib.py @@ -0,0 +1,38 @@ +--- blueprintcompiler/typelib.py.orig 2023-07-21 20:06:18 UTC ++++ blueprintcompiler/typelib.py +@@ -61,7 +61,14 @@ class Field: + def __init__(self, offset: int, type: str, shift=0, mask=None): + self._offset = offset + self._type = type +- self._shift = shift ++ if not mask or sys.byteorder == "little": ++ self._shift = shift ++ elif self._type == "u8" or self._type == "i8": ++ self._shift = 8 - (shift + mask) ++ elif self._type == "u16" or self._type == "i16": ++ self._shift = 16 - (shift + mask) ++ else: ++ self._shift = 32 - (shift + mask) + self._mask = (1 << mask) - 1 if mask else None + self._name = f"{offset}__{type}__{shift}__{mask}" + +@@ -170,7 +177,7 @@ class Typelib: + OBJ_FINAL = Field(0x02, "u16", 3, 1) + OBJ_GTYPE_NAME = Field(0x08, "string") + OBJ_PARENT = Field(0x10, "dir_entry") +- OBJ_GTYPE_STRUCT = Field(0x14, "string") ++ OBJ_GTYPE_STRUCT = Field(0x12, "string") + OBJ_N_INTERFACES = Field(0x14, "u16") + OBJ_N_FIELDS = Field(0x16, "u16") + OBJ_N_PROPERTIES = Field(0x18, "u16") +@@ -255,7 +262,9 @@ class Typelib: + + def _int(self, size, signed) -> int: + return int.from_bytes( +- self._typelib_file[self._offset : self._offset + size], sys.byteorder ++ self._typelib_file[self._offset : self._offset + size], ++ sys.byteorder, ++ signed=signed, + ) + +