Skip to content
This repository was archived by the owner on May 20, 2023. It is now read-only.

Commit 59d75cd

Browse files
foutrelissvntogit
authored andcommitted
upgpkg: virtualbox 6.1.30-3: fix build with Python 3.10
git-svn-id: file:///srv/repos/svn-community/svn@1068152 9fca08f4-af9d-4005-b8df-a31f2cc04f65
1 parent 52eb239 commit 59d75cd

File tree

3 files changed

+174
-5
lines changed

3 files changed

+174
-5
lines changed

trunk/002-python310.patch

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
# https://www.virtualbox.org/changeset/90537/vbox
2+
3+
Index: trunk/configure
4+
===================================================================
5+
--- trunk/configure (revision 90536)
6+
+++ trunk/configure (revision 90537)
7+
@@ -3,7 +3,7 @@
8+
# libraries VBox OSE depends on.
9+
10+
#
11+
-# Copyright (C) 2006-2020 Oracle Corporation
12+
+# Copyright (C) 2006-2021 Oracle Corporation
13+
#
14+
# This file is part of VirtualBox Open Source Edition (OSE), as
15+
# available from http://www.virtualbox.org. This file is free software;
16+
@@ -2043,7 +2043,7 @@
17+
}
18+
EOF
19+
found=
20+
- SUPPYTHONLIBS="python2.7 python2.6 python3.1 python3.2 python3.3 python3.4 python3.4m python3.5 python3.5m python3.6 python3.6m python3.7 python3.7m python3.8 python3.8m python3.9 python3.9m"
21+
+ SUPPYTHONLIBS="python2.7 python2.6 python3.1 python3.2 python3.3 python3.4 python3.4m python3.5 python3.5m python3.6 python3.6m python3.7 python3.7m python3.8 python3.8m python3.9 python3.9m python3.10 python3.10m"
22+
for p in $PYTHONDIR; do
23+
for d in $SUPPYTHONLIBS; do
24+
for b in lib/x86_64-linux-gnu lib/i386-linux-gnu lib64 lib/64 lib; do
25+
Index: trunk/src/libs/xpcom18a4/python/src/module/_xpcom.cpp
26+
===================================================================
27+
--- trunk/src/libs/xpcom18a4/python/src/module/_xpcom.cpp (revision 90536)
28+
+++ trunk/src/libs/xpcom18a4/python/src/module/_xpcom.cpp (revision 90537)
29+
@@ -84,7 +84,11 @@
30+
# define MANGLE_MODULE_INIT(a_Name) RT_CONCAT(a_Name, MODULE_NAME_SUFFIX)
31+
# endif
32+
# ifdef VBOX_PYXPCOM_VERSIONED
33+
-# if PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
34+
+# if PY_VERSION_HEX >= 0x030a0000 && PY_VERSION_HEX < 0x030b0000
35+
+# define MODULE_NAME MANGLE_MODULE_NAME("VBoxPython3_10")
36+
+# define initVBoxPython MANGLE_MODULE_INIT(PyInit_VBoxPython3_10)
37+
+
38+
+# elif PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
39+
# define MODULE_NAME MANGLE_MODULE_NAME("VBoxPython3_9")
40+
# define initVBoxPython MANGLE_MODULE_INIT(PyInit_VBoxPython3_9)
41+
42+
Index: trunk/src/libs/xpcom18a4/python/Makefile.kmk
43+
===================================================================
44+
--- trunk/src/libs/xpcom18a4/python/Makefile.kmk (revision 90536)
45+
+++ trunk/src/libs/xpcom18a4/python/Makefile.kmk (revision 90537)
46+
@@ -4,7 +4,7 @@
47+
#
48+
49+
#
50+
-# Copyright (C) 2009-2017 Oracle Corporation
51+
+# Copyright (C) 2009-2021 Oracle Corporation
52+
#
53+
# This file is part of VirtualBox Open Source Edition (OSE), as
54+
# available from http://www.virtualbox.org. This file is free software;
55+
@@ -20,7 +20,7 @@
56+
57+
#
58+
# List of supported Python versions, defining a number of
59+
-# VBOX_PYTHON[26|27|31|32|32M|33|33M|34|34M|35|35M|36|36M|37|37M|38|38M|39|39M|DEF]_[INC|LIB] variables
60+
+# VBOX_PYTHON[26|27|31|32|32M|33|33M|34|34M|35|35M|36|36M|37|37M|38|38M|39|39M|310|310M|DEF]_[INC|LIB] variables
61+
# which get picked up below.
62+
#
63+
ifeq ($(KBUILD_TARGET),darwin) # Relatively predictable, don't script.
64+
@@ -646,6 +646,52 @@
65+
endif
66+
endif
67+
68+
+ifdef VBOX_PYTHON310_INC
69+
+#
70+
+# Python 3.10 version
71+
+#
72+
+DLLS += VBoxPython3_10
73+
+VBoxPython3_10_EXTENDS = VBoxPythonBase
74+
+VBoxPython3_10_EXTENDS_BY = appending
75+
+VBoxPython3_10_TEMPLATE = XPCOM
76+
+VBoxPython3_10_INCS = $(VBOX_PYTHON310_INC)
77+
+VBoxPython3_10_LIBS = $(VBOX_PYTHON310_LIB)
78+
+
79+
+ ifdef VBOX_WITH_32_ON_64_MAIN_API
80+
+ ifdef VBOX_PYTHON310_LIB_X86
81+
+DLLS += VBoxPython3_10_x86
82+
+VBoxPython3_10_x86_EXTENDS = VBoxPythonBase_x86
83+
+VBoxPython3_10_x86_EXTENDS_BY = appending
84+
+VBoxPython3_10_x86_TEMPLATE = XPCOM
85+
+VBoxPython3_10_x86_INCS = $(VBOX_PYTHON310_INC)
86+
+VBoxPython3_10_x86_LIBS = $(VBOX_PYTHON310_LIB_X86)
87+
+ endif
88+
+ endif
89+
+endif
90+
+
91+
+ifdef VBOX_PYTHON310M_INC
92+
+#
93+
+# Python 3.10 version with pymalloc
94+
+#
95+
+DLLS += VBoxPython3_10m
96+
+VBoxPython3_10m_EXTENDS = VBoxPythonBase_m
97+
+VBoxPython3_10m_EXTENDS_BY = appending
98+
+VBoxPython3_10m_TEMPLATE = XPCOM
99+
+VBoxPython3_10m_INCS = $(VBOX_PYTHON310M_INC)
100+
+VBoxPython3_10m_LIBS = $(VBOX_PYTHON310M_LIB)
101+
+
102+
+ ifdef VBOX_WITH_32_ON_64_MAIN_API
103+
+ ifdef VBOX_PYTHON310M_LIB_X86
104+
+DLLS += VBoxPython3_10m_x86
105+
+VBoxPython3_10m_x86_EXTENDS = VBoxPythonBase_x86_m
106+
+VBoxPython3_10m_x86_EXTENDS_BY = appending
107+
+VBoxPython3_10m_x86_TEMPLATE_ = XPCOM
108+
+VBoxPython3_10m_x86_INCS = $(VBOX_PYTHON310M_INC)
109+
+VBoxPython3_10m_x86_LIBS = $(VBOX_PYTHON310M_LIB_X86)
110+
+ endif
111+
+ endif
112+
+endif
113+
+
114+
ifdef VBOX_PYTHONDEF_INC
115+
#
116+
# Python without versioning
117+
@@ -730,4 +776,3 @@
118+
119+
120+
include $(FILE_KBUILD_SUB_FOOTER)
121+
-
122+
Index: trunk/src/libs/xpcom18a4/python/gen_python_deps.py
123+
===================================================================
124+
--- trunk/src/libs/xpcom18a4/python/gen_python_deps.py (revision 90536)
125+
+++ trunk/src/libs/xpcom18a4/python/gen_python_deps.py (revision 90537)
126+
@@ -1,7 +1,7 @@
127+
#!/usr/bin/python
128+
129+
"""
130+
-Copyright (C) 2009-2016 Oracle Corporation
131+
+Copyright (C) 2009-2021 Oracle Corporation
132+
133+
This file is part of VirtualBox Open Source Edition (OSE), as
134+
available from http://www.virtualbox.org. This file is free software;
135+
@@ -16,7 +16,7 @@
136+
import os,sys
137+
from distutils.version import StrictVersion
138+
139+
-versions = ["2.6", "2.7", "3.1", "3.2", "3.2m", "3.3", "3.3m", "3.4", "3.4m", "3.5", "3.5m", "3.6", "3.6m", "3.7", "3.7m", "3.8", "3.8m", "3.9", "3.9m" ]
140+
+versions = ["2.6", "2.7", "3.1", "3.2", "3.2m", "3.3", "3.3m", "3.4", "3.4m", "3.5", "3.5m", "3.6", "3.6m", "3.7", "3.7m", "3.8", "3.8m", "3.9", "3.9m", "3.10", "3.10m" ]
141+
prefixes = ["/usr", "/usr/local", "/opt", "/opt/local"]
142+
known = {}
143+

trunk/003-pyunicode.patch

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# https://www.virtualbox.org/changeset/86623/vbox
2+
3+
Index: trunk/src/libs/xpcom18a4/python/src/PyXPCOM.h
4+
===================================================================
5+
--- trunk/src/libs/xpcom18a4/python/src/PyXPCOM.h (revision 86622)
6+
+++ trunk/src/libs/xpcom18a4/python/src/PyXPCOM.h (revision 86623)
7+
@@ -137,12 +137,14 @@
8+
# define PyInt_Check(o) PyLong_Check(o)
9+
# define PyInt_AsLong(o) PyLong_AsLong(o)
10+
# define PyNumber_Int(o) PyNumber_Long(o)
11+
-# ifndef PyUnicode_AsUTF8
12+
-# define PyUnicode_AsUTF8(o) _PyUnicode_AsString(o)
13+
+# if !defined(Py_LIMITED_API) && PY_VERSION_HEX <= 0x03030000 /* 3.3 added PyUnicode_AsUTF8AndSize */
14+
+# ifndef PyUnicode_AsUTF8
15+
+# define PyUnicode_AsUTF8(o) _PyUnicode_AsString(o)
16+
+# endif
17+
+# ifndef PyUnicode_AsUTF8AndSize
18+
+# define PyUnicode_AsUTF8AndSize(o,s) _PyUnicode_AsStringAndSize(o,s)
19+
+# endif
20+
# endif
21+
-# ifndef PyUnicode_AsUTF8AndSize
22+
-# define PyUnicode_AsUTF8AndSize(o,s) _PyUnicode_AsStringAndSize(o,s)
23+
-# endif
24+
typedef struct PyMethodChain
25+
{
26+
PyMethodDef *methods;

trunk/PKGBUILD

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pkgname=('virtualbox'
1010
'virtualbox-ext-vnc')
1111
pkgver=6.1.30
1212
_tarver=${pkgver}
13-
pkgrel=2
13+
pkgrel=3
1414
arch=('x86_64')
1515
url='https://virtualbox.org/'
1616
license=('GPL' 'custom')
@@ -65,6 +65,8 @@ source=("https://download.virtualbox.org/virtualbox/${pkgver}/VirtualBox-${_tarv
6565
'vboxweb.service'
6666
'vboxreload'
6767
'001-disable-update.patch'
68+
'002-python310.patch'
69+
'003-pyunicode.patch'
6870
'005-gsoap-build.patch'
6971
'006-rdesktop-vrdp-keymap-path.patch'
7072
'008-no-vboxvideo.patch'
@@ -87,6 +89,8 @@ sha256sums=('3c60a29375549ffc148aaebe859be91b27c19d6fa2deefde1373c4f6da8f18ef'
8789
'e6e875ef186578b53106d7f6af48e426cdaf1b4e86834f01696b8ef1c685787f'
8890
'4001b5927348fe669a541e80526d4f9ea91b883805f102f7d571edbb482a9b9d'
8991
'9ee947c9b5ec5b25f52d3e72340fc3a57ca6e65a604e15b669ac582a3fb0dc1b'
92+
'361a6de4fd91070f3e34d4a59b086a84c8a38c707f44b6db82b658d9076f69ce'
93+
'3bb1643a212b9ecb4d75e31add984a6b206f71a9f46f460007812d1ce648c1a0'
9094
'7d2da8fe10a90f76bbfc80ad1f55df4414f118cd10e10abfb76070326abebd46'
9195
'13c6ca9be0f91582445fd2a14a8c58a0625a15d9cb98cb6e8c2736d77ea976ab'
9296
'053bfeee8863f3ffdf2f0e3f9f0d77dc61dd32764700a97a7635fd8611e20491'
@@ -113,10 +117,6 @@ prepare() {
113117

114118
echo 'Use our CFLAGS'
115119
echo "VBOX_GCC_OPT=$CXXFLAGS" >> LocalConfig.kmk
116-
117-
# Fix Python 3.10 detection
118-
# (keep this for next python update, just comment!)
119-
sed -i 's/\(python3.9 python3.9m\)/\1 python3.10 python3.10m/' configure
120120
}
121121

122122
build() {

0 commit comments

Comments
 (0)