Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
cookbook
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
redox-os
cookbook
Commits
e03d15dd
Commit
e03d15dd
authored
5 months ago
by
bitstr0m
Committed by
Jeremy Soller
5 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Improve python310 recipe
parent
0bfabbde
No related branches found
Branches containing commit
No related tags found
1 merge request
!407
Improve python310 recipe
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
recipes/wip/dev/lang/python310/recipe.toml
+35
-4
35 additions, 4 deletions
recipes/wip/dev/lang/python310/recipe.toml
recipes/wip/dev/lang/python310/redox.patch
+90
-0
90 additions, 0 deletions
recipes/wip/dev/lang/python310/redox.patch
with
125 additions
and
4 deletions
recipes/wip/dev/lang/python310/recipe.toml
+
35
−
4
View file @
e03d15dd
#TODO not compiled or tested
#TODO Fix dynamic loading of C modules
#TODO Fix openssl dependency
#TODO Add additional dependencies (readline, ncurses, etc.)
[source]
tar
=
"https://www.python.org/ftp/python/3.10.13/Python-3.10.13.tar.xz"
patches
=
[
'redox.patch'
]
[build]
template
=
"custom"
dependencies
=
[
"openssl1"
,
]
dependencies
=
[]
script
=
"""
# Python cross-compilation requires the same Python version on the build machine
BUILDMACH_TARGET="$(gcc -dumpmachine)"
BUILDMACH_BUILD="${COOKBOOK_RECIPE}/target/${BUILDMACH_TARGET}/build"
BUILDMACH_STAGE="${COOKBOOK_RECIPE}/target/${BUILDMACH_TARGET}/stage"
# If this is a fresh build then we also rebuild the build machine version
# (Cookbook clean does not remove it so we have to do it manually)
if [ -z "$(ls -A .)" ]; then
rm -rf "${BUILDMACH_BUILD}" "${BUILDMACH_STAGE}"
fi
mkdir -p "${BUILDMACH_BUILD}"
mkdir -p "${BUILDMACH_STAGE}"
cd "${BUILDMACH_BUILD}"
# Use env that does not use the Redox build tools
env -i PATH="$PATH" CC=gcc "${COOKBOOK_SOURCE}/configure"
env -i PATH="$PATH" CC=gcc "${COOKBOOK_MAKE}" -j "${COOKBOOK_MAKE_JOBS}"
"${COOKBOOK_MAKE}" install DESTDIR="${BUILDMACH_STAGE}"
cd -
export PATH="${BUILDMACH_STAGE}/usr/local/bin:${PATH}"
# --enable-optimizations for release build
COOKBOOK_CONFIGURE_FLAGS+=(
--disable-ipv6
--build="${ARCH}"
ac_cv_file__dev_ptmx=no
ac_cv_file__dev_ptc=no
)
cookbook_configure
"""
This diff is collapsed.
Click to expand it.
recipes/wip/dev/lang/python310/redox.patch
0 → 100644
+
90
−
0
View file @
e03d15dd
diff -ur source-orig/configure source/configure
--- source-orig/configure 2023-08-24 13:46:25.000000000 +0100
+++ source/configure 2024-10-17 16:50:09.377036649 +0100
@@ -3347,6 +3347,9 @@
*-*-vxworks*)
ac_sys_system=VxWorks
;;
+ *-*-redox*)
+ ac_sys_system=Redox
+ ;;
*)
# for now, limit cross builds to known configurations
MACHDEP="unknown"
@@ -3371,6 +3374,7 @@
case $MACHDEP in
aix*) MACHDEP="aix";;
linux*) MACHDEP="linux";;
+ redox*) MACHDEP="redox";;
cygwin*) MACHDEP="cygwin";;
darwin*) MACHDEP="darwin";;
'') MACHDEP="unknown";;
@@ -3382,7 +3386,7 @@
if test "$cross_compiling" = yes; then
case "$host" in
- *-*-linux*)
+ *-*-linux*|*-*-redox*)
case "$host_cpu" in
arm*)
_host_cpu=arm
@@ -5989,7 +5993,7 @@
PY3LIBRARY=libpython3.so
fi
;;
- Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*|VxWorks*)
+ Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*|VxWorks*|Redox*)
LDLIBRARY='libpython$(LDVERSION).so'
BLDLIBRARY='-L. -lpython$(LDVERSION)'
RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
@@ -9787,7 +9791,7 @@
BLDSHARED="$LDSHARED"
fi
;;
- Linux*|GNU*|QNX*|VxWorks*)
+ Linux*|GNU*|QNX*|VxWorks*|Redox*)
LDSHARED='$(CC) -shared'
LDCXXSHARED='$(CXX) -shared';;
FreeBSD*)
@@ -9856,7 +9860,7 @@
else CCSHARED="+z";
fi;;
Linux-android*) ;;
- Linux*|GNU*) CCSHARED="-fPIC";;
+ Linux*|GNU*|Redox*) CCSHARED="-fPIC";;
FreeBSD*|NetBSD*|OpenBSD*|DragonFly*) CCSHARED="-fPIC";;
OpenUNIX*|UnixWare*)
if test "$GCC" = "yes"
@@ -9886,7 +9890,7 @@
LINKFORSHARED="-Wl,-E -Wl,+s";;
# LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";;
Linux-android*) LINKFORSHARED="-pie -Xlinker -export-dynamic";;
- Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic";;
+ Linux*|GNU*|Redox*) LINKFORSHARED="-Xlinker -export-dynamic";;
# -u libsys_s pulls in all symbols in libsys
Darwin/*)
LINKFORSHARED="$extra_undefs -framework CoreFoundation"
diff -ur source-orig/Include/pyport.h source/Include/pyport.h
--- source-orig/Include/pyport.h 2023-08-24 13:46:25.000000000 +0100
+++ source/Include/pyport.h 2024-10-17 17:34:54.514295923 +0100
@@ -843,7 +843,7 @@
# error "Py_TRACE_REFS ABI is not compatible with release and debug ABI"
#endif
-#if defined(__ANDROID__) || defined(__VXWORKS__)
+#if defined(__ANDROID__) || defined(__VXWORKS__) || defined(__redox__)
// Use UTF-8 as the locale encoding, ignore the LC_CTYPE locale.
// See _Py_GetLocaleEncoding(), PyUnicode_DecodeLocale()
// and PyUnicode_EncodeLocale().
diff -ur source-orig/Modules/timemodule.c source/Modules/timemodule.c
--- source-orig/Modules/timemodule.c 2023-08-24 13:46:25.000000000 +0100
+++ source/Modules/timemodule.c 2024-10-17 17:38:08.481699567 +0100
@@ -1453,7 +1453,7 @@
return 0;
}
-#elif defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_PROCESS_CPUTIME_ID)
+#elif defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_PROCESS_CPUTIME_ID) && defined(CLOCK_THREAD_CPUTIME_ID)
#define HAVE_THREAD_TIME
#if defined(__APPLE__) && defined(__has_attribute) && __has_attribute(availability)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment