Skip to content

Commit

Permalink
Bring back Python port
Browse files Browse the repository at this point in the history
  • Loading branch information
fido2020 committed Jan 31, 2022
1 parent 96c5e38 commit 5965245
Show file tree
Hide file tree
Showing 5 changed files with 137 additions and 15 deletions.
38 changes: 24 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,22 @@ jobs:
echo "Commit Hash:"
cat llvm-hash.txt
- name: Cache the toolchain and sysroot
- name: Cache the toolchain
uses: actions/cache@v2
with:
key: ${{ runner.os }}-lemon-toolchain
path: |
**/Build/tool-builds
**/Toolchain
**/mlibc
key: ${{ runner.os }}-lemon-toolchain-${{ hashFiles('llvm-hash.txt') }}
restore-keys: |
${{ runner.os }}-lemon-toolchain-${{ hashFiles('llvm-hash.txt') }}
- name: Cache packages
uses: actions/cache@v2
with:
key: ${{ runner.os }}-lemon-pkgs
path: |
**/Build/pkg-builds
**/Ports
- name: Init xbstrap
run: |
Expand All @@ -61,13 +67,12 @@ jobs:
- name: Build the toolchain
run: |
cd Build
xbstrap regenerate lemon-llvm binutils --recursive
xbstrap install-tool --all
xbstrap install-tool -u --all
- name: Building system
run: |
cd Build
xbstrap install lemon-base
xbstrap install -u --recursive lemon-base
- name: Building disk image
run: |
Expand Down Expand Up @@ -100,16 +105,22 @@ jobs:
echo "Commit Hash:"
cat llvm-hash.txt
- name: Cache the toolchain and sysroot
- name: Cache the toolchain
uses: actions/cache@v2
with:
key: ${{ runner.os }}-lemon-toolchain
path: |
**/Build/tool-builds
**/Toolchain
**/mlibc
key: ${{ runner.os }}-lemon-toolchain-${{ hashFiles('llvm-hash.txt') }}
restore-keys: |
${{ runner.os }}-lemon-toolchain-${{ hashFiles('llvm-hash.txt') }}
- name: Cache packages
uses: actions/cache@v2
with:
key: ${{ runner.os }}-lemon-pkgs
path: |
**/Build/pkg-builds
**/Ports
- name: Init xbstrap
run: |
Expand All @@ -120,13 +131,12 @@ jobs:
- name: Build the toolchain
run: |
cd Build
xbstrap regenerate lemon-llvm binutils --recursive
xbstrap install-tool --all
xbstrap install-tool -u --all
- name: Building system
run: |
cd Build
xbstrap install lemon-base nyancat curl busybox binutils lemondoom
xbstrap install -u --recursive lemon-base nyancat curl busybox binutils lemondoom
- name: Building disk image
run: |
Expand Down
35 changes: 34 additions & 1 deletion Ports/packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -271,5 +271,38 @@ packages:
- args: ['ninja', 'install']
environ:
DESTDIR: '@THIS_COLLECT_DIR@'


- name: python
from_source: python
tools_required:
- host-llvm
- host-pkgconfig
pkgs_required:
- mlibc
- libexpat
- libffi
- libressl
- zlib
configure:
- args:
- '@THIS_SOURCE_DIR@/configure'
- '--host=x86_64-lemon'
- '--build=x86_64'
- '--prefix=/system'
- '--enable-shared'
- '--disable-ipv6'
- '--without-ensurepip'
- '--with-sysroot=@SYSROOT_DIR@'
- '--with-system-ffi'
- '--with-system-expat'
environ:
ac_cv_file__dev_ptmx: 'yes'
ac_cv_file__dev_ptc: 'no'
CC: 'clang'
CXX: 'clang++'
build:
- args: ['make', '-j@PARALLELISM@']
- args: ['make', 'install']
environ:
DESTDIR: '@THIS_COLLECT_DIR@'

1 change: 1 addition & 0 deletions Scripts/docker-bootstrap-site.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
container:
runtime: docker
image: lemontoolchain
allow_containerless: true
src_mount: /var/LemonOS
build_mount: /var/LemonOS/Build
13 changes: 13 additions & 0 deletions bootstrap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,19 @@ sources:
'@BUILD_ROOT@/tools/host-automake/share/automake-1.16/config.sub',
'@THIS_SOURCE_DIR@/icu4c/source']

- name: python
subdir: 'Ports'
git: 'https://github.com/python/cpython'
tag: 'v3.8.2'
version: '3.8.2'
patch-path-strip: 1
tools_required:
- host-libtool
- host-pkgconfig
regenerate:
- args: ['autoreconf', '-f', '-i']
- args: ['cp', '@BUILD_ROOT@/tools/host-automake/share/automake-1.16/config.sub', '@THIS_SOURCE_DIR@/']

tools:
- name: host-automake
from_source: automake
Expand Down
65 changes: 65 additions & 0 deletions patches/python/0001-Add-LemonOS-specific-changes.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
From f18dba045f7a53f2e5d8675ab657a8460c6f3b7f Mon Sep 17 00:00:00 2001
From: JJ Roberts-White <[email protected]>
Date: Mon, 31 Jan 2022 12:14:36 +1100
Subject: [PATCH] Add LemonOS specific changes

---
configure.ac | 14 ++++++++++++++
1 file changed, 14 insertions(+)

diff --git a/configure.ac b/configure.ac
index e57ef7c..5eede17 100644
--- a/configure.ac
+++ b/configure.ac
@@ -379,6 +379,9 @@ then
*-*-cygwin*)
ac_sys_system=Cygwin
;;
+ *-*-lemon*)
+ ac_sys_system=Lemon
+ ;;
*-*-vxworks*)
ac_sys_system=VxWorks
;;
@@ -431,6 +434,9 @@ if test "$cross_compiling" = yes; then
*-*-vxworks*)
_host_cpu=$host_cpu
;;
+ *-*-lemon*)
+ _host_cpu=$host_cpu
+ ;;
*)
# for now, limit cross builds to known configurations
MACHDEP="unknown"
@@ -2641,6 +2647,9 @@ then
CYGWIN*)
LDSHARED="gcc -shared -Wl,--enable-auto-image-base"
LDCXXSHARED="g++ -shared -Wl,--enable-auto-image-base";;
+ Lemon*)
+ LDSHARED='$(CC) -shared'
+ LDCXXSHARED='$(CXX) -shared';;
*) LDSHARED="ld";;
esac
fi
@@ -2676,6 +2685,9 @@ then
then CCSHARED="-fPIC"
else CCSHARED="-Kpic -belf"
fi;;
+ Lemon*)
+ CCSHARED="-fPIC"
+ ;;
VxWorks*)
CCSHARED="-fpic -D__SO_PICABILINUX__ -ftls-model=global-dynamic"
esac
@@ -2738,6 +2750,8 @@ then
LINKFORSHARED='-Wl,-E -N 2048K';;
VxWorks*)
LINKFORSHARED='--export-dynamic';;
+ Lemon*)
+ LINKFORSHARED='-export-dynamic';;
esac
fi
AC_MSG_RESULT($LINKFORSHARED)
--
2.34.1

0 comments on commit 5965245

Please sign in to comment.