From 00c212fa8dbafdbc29b748274a111e230c904182 Mon Sep 17 00:00:00 2001 From: Matheus Date: Sun, 12 May 2024 14:16:23 -0300 Subject: [PATCH] ports: python --- host-recipes/python | 13 +++++ patches/python/jinx-working-patch.patch | 68 +++++++++++++++++++++++++ recipes/python | 17 +++++++ source-recipes/python | 9 ++++ 4 files changed, 107 insertions(+) create mode 100644 host-recipes/python create mode 100644 patches/python/jinx-working-patch.patch create mode 100644 recipes/python create mode 100644 source-recipes/python diff --git a/host-recipes/python b/host-recipes/python new file mode 100644 index 00000000..76df90ca --- /dev/null +++ b/host-recipes/python @@ -0,0 +1,13 @@ +name=python +from_source=python +revision=1 +imagedeps="base-devel" + +build() { + "${source_dir}/configure" --prefix=${prefix} + make -j${parallelism} +} + +package() { + make install DESTDIR=${dest_dir} +} diff --git a/patches/python/jinx-working-patch.patch b/patches/python/jinx-working-patch.patch new file mode 100644 index 00000000..70b67bbf --- /dev/null +++ b/patches/python/jinx-working-patch.patch @@ -0,0 +1,68 @@ +diff --git python-clean/config.sub python-workdir/config.sub +index d74fb6d..8e94c64 100755 +--- python-clean/config.sub ++++ python-workdir/config.sub +@@ -1718,7 +1718,7 @@ case $os in + # Now accept the basic system types. + # The portable systems comes first. + # Each alternative MUST end in a * to match a version number. +- gnu* | android* | bsd* | mach* | minix* | genix* | ultrix* | irix* \ ++ gnu* | astral* | android* | bsd* | mach* | minix* | genix* | ultrix* | irix* \ + | *vms* | esix* | aix* | cnk* | sunos | sunos[34]* \ + | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \ + | sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \ +diff --git python-clean/configure.ac python-workdir/configure.ac +index ac3be38..2443402 100644 +--- python-clean/configure.ac ++++ python-workdir/configure.ac +@@ -403,6 +403,9 @@ then + *-*-vxworks*) + ac_sys_system=VxWorks + ;; ++ *-*-astral*) ++ ac_sys_system=Astral ++ ;; + *) + # for now, limit cross builds to known configurations + MACHDEP="unknown" +@@ -452,6 +455,9 @@ if test "$cross_compiling" = yes; then + *-*-vxworks*) + _host_cpu=$host_cpu + ;; ++ *-*-astral*) ++ _host_cpu=$host_cpu ++ ;; + *) + # for now, limit cross builds to known configurations + MACHDEP="unknown" +@@ -2756,6 +2762,10 @@ then + CYGWIN*) + LDSHARED="gcc -shared -Wl,--enable-auto-image-base" + LDCXXSHARED="g++ -shared -Wl,--enable-auto-image-base";; ++ Astral*) ++ LDSHARED='$(CC) -shared' ++ LDCXXSHARED='$(CXX) -shared' ++ ;; + *) LDSHARED="ld";; + esac + fi +@@ -2793,6 +2803,10 @@ then + fi;; + VxWorks*) + CCSHARED="-fpic -D__SO_PICABILINUX__ -ftls-model=global-dynamic" ++ ;; ++ Astral*) ++ CCSHARED="-fPIC" ++ ;; + esac + fi + AC_MSG_RESULT($CCSHARED) +@@ -2862,6 +2876,8 @@ then + LINKFORSHARED='-Wl,-E -N 2048K';; + VxWorks*) + LINKFORSHARED='-Wl,-export-dynamic';; ++ Astral*) ++ LINKFORSHARED="-export-dynamic";; + esac + fi + AC_MSG_RESULT($LINKFORSHARED) diff --git a/recipes/python b/recipes/python new file mode 100644 index 00000000..633efc43 --- /dev/null +++ b/recipes/python @@ -0,0 +1,17 @@ +name=python +revision=1 +from_source=python +imagedeps="base-devel" +hostdeps="xgcc xbinutils pkgconfig python" +deps="mlibc mlibc-headers" + +build() { + echo "ac_cv_file__dev_ptmx=yes" > /tmp/configsite + echo "ac_cv_file__dev_ptc=no" >> /tmp/configsite + CONFIG_SITE=/tmp/configsite ${source_dir}/configure --prefix=${prefix} --host=x86_64-astral --build=x86_64 --with-build-python=python3 --disable-ipv6 --enable-shared + make -j${parallelism} +} + +package() { + make DESTDIR=${dest_dir} install +} diff --git a/source-recipes/python b/source-recipes/python new file mode 100644 index 00000000..fa851739 --- /dev/null +++ b/source-recipes/python @@ -0,0 +1,9 @@ +name=python +version=3.10.12 +source_method=tarball +tarball_url="https://www.python.org/ftp/python/${version}/Python-${version}.tar.xz" +tarball_sha512=5ea018e71bfe7872e02eaf8aef56d5583c0880e4ce5fbbdf8ea76da20c2e94ac6a3ba8badb4b7d1bc21853402a3b63541b04181737417b1626e786b696595cf5 +hostdeps="autoconf automake pkgconfig libtool autoconf-archive" +regenerate() { + autoreconf -fvi +}