1
0
mirror of https://github.com/lxsang/DiyaSDK.git synced 2024-06-18 11:20:15 +02:00

initial commit

This commit is contained in:
Dany LE 2022-02-15 22:08:44 +01:00
parent b4919d7c65
commit 4fdbe6ec81
78 changed files with 1611700 additions and 20 deletions

22
.gitignore vendored
View File

@ -1,18 +1,4 @@
# Build and Release Folders
bin-debug/
bin-release/
[Oo]bj/
[Bb]in/
# Other files and folders
.settings/
# Executables
*.swf
*.air
*.ipa
*.apk
# Project files, i.e. `.project`, `.actionScriptProperties` and `.flexProperties`
# should NOT be excluded as they contain compiler settings and other important
# information for Eclipse / Flash Builder.
64/builder
64/tmp
32/builder
32/tmp

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
32/bootstrap/Jobs.hermes Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
64/bootstrap/Jobs.hermes Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

1579234
PharoDebug.log Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,2 +1,40 @@
# DiyaSDK
SDK for Diya
Hermes-Extensions.hermes # load from base bootstrap
Kernel-Chronology-Extras.hermes
Jobs.hermes
Collections-Arithmetic.hermes
Collections-Atomic.hermes
Collections-DoubleLinkedList.hermes
Zinc-Resource-Meta-Core.hermes
Zinc-Character-Encoding-Core.hermes --no-fail-on-undeclared --on-duplication=ignore
FileSystem-Core.hermes --no-fail-on-undeclared
FileSystem-Disk.hermes
FileSystem-Memory.hermes
Compression.hermes --no-fail-on-undeclared
FileSystem-Zip.hermes
Multilingual-Encodings.hermes
Multilingual-Languages.hermes --no-fail-on-undeclared
Multilingual-TextConversion.hermes
# we need the kernel to update things
Kernel.hermes --no-fail-on-undeclared --on-duplication=ignore
Text-Core.hermes --no-fail-on-undeclared
Fonts-Abstract.hermes
Fonts-Infrastructure.hermes --no-fail-on-undeclared
AST-Core.hermes --on-duplication=ignore --no-fail-on-undeclared
Debugging-Core.hermes --no-fail-on-undeclared
OpalCompiler-Core.hermes --on-duplication=ignore
Alien-Core.hermes
System-Model.hermes
PragmaCollector.hermes
UnifiedFFI.hermes --on-duplication=ignore
Graphics-Primitives.hermes --no-fail-on-undeclared
Graphics-Transformations.Hermes
Graphics-Canvas.hermes --no-fail-on-undeclared
Graphics-Display-Objects.hermes --no-fail-on-undeclared
TraitsV2 --on-duplication=ignore# from boot strap WARN we may not need this
TraitsV2 --on-duplication=ignore # from new system WARN we may not need this
FreeType --no-fail-on-undeclared
EmbeddedFreeType
Text-Scanning.hermes
loadHermes Multilingual-OtherLanguages.hermes --no-fail-on-undeclared
Multilingual-TextConverterOtherLanguages.hermes
# extra graphic support

230
build_base_image_70.sh Executable file
View File

@ -0,0 +1,230 @@
#! /bin/bash
set -e
[ -z "$1" ] && echo "Please specify 32 or 64 bits architectuure" && exit 1
echo "[Compiler] Adding more Kernel packages"
ARCH="$1"
W=$(dirname `realpath $0`)
BASE_DIR="$W/$ARCH"
rm "$BASE_DIR/tmp" -rf
mkdir -p "$BASE_DIR/tmp/resources/fonts"
cp $BASE_DIR/bootstrap/bootstrap7.0.image $BASE_DIR/tmp/chaos.image
cp $BASE_DIR/bootstrap/resources/fonts/* $BASE_DIR/tmp/resources/fonts
VM=$BASE_DIR/imgbuilder/pharo
IMG=$BASE_DIR/tmp/chaos.image
SRC_IMG=$BASE_DIR/imgbuilder/Pharo.image
#$VM $SRC_IMG $W/install.st --save --quit
cat << EOF > /tmp/export-packages.txt
System-Object Events
System-Sound
Hermes-Extensions
Kernel-Chronology-Extras
Kernel
Jobs
Collections-Abstract-Traits
Collections-Sequenceable
Collections-Arithmetic
Collections-Atomic
Collections-DoubleLinkedList
Zinc-Resource-Meta-Core
Zinc-Character-Encoding-Core
FileSystem-Core
FileSystem-Disk
FileSystem-Memory
Compression
UnifiedFFI
UnifiedFFI-Legacy
Alien-Core
PragmaCollector
System-Model
AST-Core
Debugging-Core
OpalCompiler-Core
FileSystem-Zip
Multilingual-Encodings
Multilingual-Languages
Multilingual-TextConversion
Multilingual-OtherLanguages
Multilingual-TextConverterOtherLanguages
Text-Scanning
Text-Core
Fonts-Abstract
Balloon
Graphics-Primitives
Graphics-Transformations
Graphics-Canvas
Graphics-Display Objects
Graphics-Files
Graphics-Fonts
Graphics-Shapes
Fonts-Infrastructure
TraitsV2
EmbeddedFreeType
FreeType
DeprecatedFileStream
System-FileRegistry
System-Clipboard
OSWindow-Core
OSWindow-SDL2
Slot-Core
System-Localization
StartupPreferences
Keymapping-Core
Keymapping-KeyCombinations
Keymapping-Pragmas
STON-Core
System-OSEnvironments
System-VMEvents
Network-Kernel
Math-Operations-Extensions
Kernel-Traits
AST-Core-Traits
Collections-Abstract-Traits
Transcript-Core-Traits
TraitsV2-Compatibility
CodeImportCommandLineHandlers
OSWindow-VM
Morphic-Core
System-Caching
MenuRegistration
Morphic-Base
Polymorph-Widgets
Text-Edition
Morphic-Widgets-Basic
Morphic-Widgets-ColorPicker
Morphic-Widgets-Extra
Morphic-Widgets-FastTable
Morphic-Widgets-List
Morphic-Widgets-Menubar
Morphic-Widgets-Pluggable
Morphic-Widgets-PolyTabs
Morphic-Widgets-Scrolling
Morphic-Widgets-Tabs
Morphic-Widgets-Taskbar
Morphic-Widgets-TickList
Morphic-Widgets-Tree
Morphic-Widgets-Windows
Regex-Core
System-History
Rubric
Text-Edition
Text-Diff
Images-Animated
Transcript-Core
Shout
Fonts-Chooser
Tool-FileList
EOF
echo "exporting packages..."
$VM $SRC_IMG $W/init.st --save --quit
while read pkg; do
echo "exporting .....$pkg"
$VM $SRC_IMG $W/export.st "$BASE_DIR/tmp" "$pkg" --quit
done < /tmp/export-packages.txt
#exit 1
echo "Creating image...."
$VM $IMG
cat << EOF > /tmp/packages.txt
../bootstrap/Hermes-Extensions.hermes
Kernel-Chronology-Extras.hermes
Jobs.hermes
Collections-Arithmetic.hermes
Collections-Atomic.hermes
Collections-DoubleLinkedList.hermes
DeprecatedFileStream.hermes --no-fail-on-undeclared
Zinc-Resource-Meta-Core.hermes
Zinc-Character-Encoding-Core.hermes --no-fail-on-undeclared --on-duplication=ignore
FileSystem-Core.hermes --no-fail-on-undeclared
FileSystem-Disk.hermes
FileSystem-Memory.hermes
Compression.hermes --no-fail-on-undeclared
FileSystem-Zip.hermes
Multilingual-Encodings.hermes
Multilingual-Languages.hermes --no-fail-on-undeclared
Multilingual-TextConversion.hermes --no-fail-on-undeclared
Text-Core.hermes --no-fail-on-undeclared
AST-Core.hermes --on-duplication=ignore --no-fail-on-undeclared
Debugging-Core.hermes --no-fail-on-undeclared
OpalCompiler-Core.hermes --on-duplication=ignore
../bootstrap/TraitsV2.hermes
Kernel-Traits.hermes
AST-Core-Traits.hermes
Collections-Abstract-Traits.hermes
Transcript-Core-Traits.hermes
TraitsV2-Compatibility.hermes
Alien-Core.hermes
System-Model.hermes
PragmaCollector.hermes
UnifiedFFI.hermes --on-duplication=ignore
Fonts-Abstract.hermes
Fonts-Infrastructure.hermes --no-fail-on-undeclared
Graphics-Primitives.hermes --no-fail-on-undeclared
Graphics-Transformations.hermes
Graphics-Canvas.hermes --no-fail-on-undeclared
Graphics-Display-Objects.hermes --no-fail-on-undeclared
FreeType.hermes --no-fail-on-undeclared
EmbeddedFreeType.hermes
Text-Scanning.hermes --no-fail-on-undeclared
Multilingual-OtherLanguages.hermes --no-fail-on-undeclared
Multilingual-TextConverterOtherLanguages.hermes
Graphics-Fonts.hermes --no-fail-on-undeclared
System-FileRegistry.hermes
Graphics-Files.hermes --no-fail-on-undeclared
Graphics-Shapes.hermes
System-Clipboard.hermes
Slot-Core.hermes --on-duplication=ignore
System-Localization.hermes
StartupPreferences.hermes
MenuRegistration.hermes --no-fail-on-undeclared
Keymapping-Core.hermes --no-fail-on-undeclared
Keymapping-KeyCombinations.hermes
STON-Core.hermes
System-OSEnvironments.hermes
System-VMEvents.hermes --no-fail-on-undeclared
Network-Kernel.hermes
UnifiedFFI-Legacy.hermes
Regex-Core.hermes
Math-Operations-Extensions.hermes
Morphic-Core.hermes --no-fail-on-undeclared
OSWindow-Core.hermes --no-fail-on-undeclared
OSWindow-VM.hermes
OSWindow-SDL2.hermes --no-fail-on-undeclared
System-Caching.hermes
System-History.hermes
Balloon.hermes --no-fail-on-undeclared
Morphic-Base.hermes --no-fail-on-undeclared
Morphic-Widgets-Extra.hermes
Morphic-Widgets-Scrolling.hermes --no-fail-on-undeclared
Morphic-Widgets-Basic.hermes
Morphic-Widgets-Windows.hermes --no-fail-on-undeclared
Morphic-Widgets-ColorPicker.hermes
Morphic-Widgets-List.hermes
Morphic-Widgets-Menubar.hermes
Morphic-Widgets-PolyTabs.hermes
Morphic-Widgets-Tabs.hermes
Morphic-Widgets-Pluggable.hermes --no-fail-on-undeclared
Morphic-Widgets-Tree.hermes --no-fail-on-undeclared
Text-Diff.hermes
Text-Edition.hermes --no-fail-on-undeclared
Polymorph-Widgets.hermes --no-fail-on-undeclared
Rubric.hermes --no-fail-on-undeclared
Morphic-Widgets-FastTable.hermes
Morphic-Widgets-Taskbar.hermes
Morphic-Widgets-TickList.hermes
CodeImportCommandLineHandlers.hermes
Images-Animated.hermes
Transcript-Core.hermes
Shout.hermes
Fonts-Chooser.hermes
Tool-FileList.hermes
System-Sound.hermes
System-Object-Events.hermes
EOF
# external lib at Math-Operations-Extensions.hermes
# install package
while read cmd; do
echo "loading $cmd"
$VM $IMG loadHermes $BASE_DIR/tmp/$cmd --save --quit
done < /tmp/packages.txt

35
build_base_image_diya.sh Executable file
View File

@ -0,0 +1,35 @@
#! /bin/bash
set -e
[ -z "$1" ] && echo "Please specify 32 or 64 bits architectuure" && exit 1
echo "[Compiler] Adding more Kernel packages"
ARCH="$1"
W=$(dirname `realpath $0`)
BASE_DIR="$W/$ARCH"
rm "$BASE_DIR/tmp" -rf
mkdir -p "$BASE_DIR/tmp/"
cp $BASE_DIR/bootstrap/bootstrap.image $BASE_DIR/tmp/diya.image
cp $W/unicode/* $BASE_DIR/tmp/
VM=$BASE_DIR/builder/pharo
IMG=$BASE_DIR/tmp/diya.image
SRC_IMG=$BASE_DIR/builder/Pharo.image
if [ ! -e "$SRC_IMG" ]; then
mkdir -p "$BASE_DIR/builder/"
cd "$BASE_DIR/builder/"
curl https://get.pharo.org/$ARCH/70+vm | bash
cd $W
fi
$VM $SRC_IMG $W/install.st --quit
NAME="Diya-Bootstrap"
$VM $SRC_IMG $W/export.st "$BASE_DIR/tmp" "$NAME" --quit
echo "Creating image...."
$VM $IMG
$VM $IMG loadHermes $BASE_DIR/bootstrap/Hermes-Extensions.hermes \
$BASE_DIR/bootstrap/TraitsV2.hermes \
$BASE_DIR/tmp/$NAME.hermes --on-duplication=ignore \
--no-fail-on-undeclared --save --quit
#init the image
$VM $IMG init --save

124
export.st Normal file
View File

@ -0,0 +1,124 @@
|pkgn dest pkg fileReference fileName writer core hePackage ignoresClasses|
FFIMethodRegistry resetAll.
dest := Smalltalk arguments first.
pkgn := Smalltalk arguments at:2.
core := HEPackage new.
core classes: OrderedCollection new.
core traits: OrderedCollection new.
core extensionMethods: OrderedCollection new.
core packageName: pkgn.
packages := #(
'Kernel-Chronology-Extras'
'Jobs'
'Collections-Arithmetic'
'Ring-Deprecated-Core-Kernel'
'Math-Operations-Extensions'
'Collections-Atomic'
'Collections-DoubleLinkedList'
'DeprecatedFileStream'
'Zinc-Resource-Meta-Core'
'Zinc-Character-Encoding-Core'
'FileSystem-Core'
'FileSystem-Disk'
'FileSystem-Memory'
'Compression'
'FileSystem-Zip'
'Multilingual-Encodings'
'Multilingual-Languages'
'Multilingual-TextConversion'
'Text-Core'
'AST-Core'
'Debugging-Core'
'OpalCompiler-Core'
'Kernel-Traits'
'AST-Core-Traits'
'Collections-Abstract-Traits'
'Transcript-Core-Traits'
'TraitsV2-Compatibility'
'Alien-Core'
'System-Model'
'PragmaCollector'
'UnifiedFFI'
'UnifiedFFI-Legacy'
'Slot-Core'
'System-Localization'
'STON-Core'
'Diya'
"
'Graphics-Primitives'
'Graphics-Transformations'
'Graphics-Canvas'
'FreeType'
'Graphics-Display Objects'
'EmbeddedFreeType'
'Text-Scanning'
'Multilingual-OtherLanguages'
'Multilingual-TextConverterOtherLanguages'
'Graphics-Fonts'
'System-FileRegistry'
'Graphics-Files'
'Graphics-Shapes'"
).
ignoresClasses := {
RGCommentDefinition.
RGMethodDefinition.
ChangeRecord.
PluggableListMorph.
TextLine.
TransformMorph.
StringMorph.
AthensCairoSDLSurface.
SourceFileArray.
GlyphForm
}.
packages do:[:name | |pkg trait classes extensionMethods|
Transcript show: 'Processing package ',name;cr.
FFIMethodRegistry resetAll.
pkg := RPackageOrganizer default packageNamed: name asSymbol.
traits := (pkg definedClasses select: #isTrait) do: [ :e | core traits add:(HETrait for: e) ].
(pkg definedClasses reject: #isTrait) do: [ :e |
(ignoresClasses includes:e superclass) ifFalse:[
core addClass: (HEClass for: e) ].
].
pkg extensionMethods do: [ :e |
(ignoresClasses includes:e classBinding value) ifFalse:[
core extensionMethods add:(HEMethod for: e)
]
].
].
"SDL binding class"
pkg := RPackageOrganizer default packageNamed: 'OSWindow-SDL2' asSymbol.
(pkg classNamesForClassTag: 'Bindings') do:[:e|
(ignoresClasses includes:e asClass) ifFalse:[
core addClass:(HEClass for:e asClass) ]].
"FreeType binding class"
pkg := RPackageOrganizer default packageNamed: 'FreeType' asSymbol.
(pkg classNamesForClassTag: 'Base') do:[:e|
(ignoresClasses includes:e asClass) ifFalse:[
core addClass:(HEClass for:e asClass) ]].
(pkg classNamesForClassTag: 'Bindings') do:[:e|
(ignoresClasses includes:e asClass) ifFalse:[
core addClass:(HEClass for:e asClass) ]].
"fixing some missing classes"
core addClass: (HEClass for:OSWindowPlatformSpecificHandle);
addClass: (HEClass for:ChunkWriteStream);
addClass: (HEClass for:ChunkReadStream);
addClass: (HEClass for:STCommandLineHandler)
.
fileReference := (dest,'/',(pkgn replaceAll: Character space with: $-),'.hermes') asFileReference.
fileName := fileReference fullName.
writer := HEBinaryReaderWriter new
stream: (File openForWriteFileNamed:fileName);
yourself.
core writeInto: writer.
writer stream flush.
Transcript show: 'File exported to ', dest, '/', pkgn, '.hermes'; cr.

2
init.st Normal file
View File

@ -0,0 +1,2 @@
FFIMethodRegistry resetAll.
Smalltalk garbageCollect

25
install.st Normal file
View File

@ -0,0 +1,25 @@
|change|
change := false.
HEBinaryReaderWriter ifNil:[
[
Metacello new
repository: 'github://tesonep/hermes';
baseline:'Hermes';
load
] on: Warning do: #resume.
change := true.
].
DiyaBoot ifNil:[
[
Metacello new
repository: 'github://lxsang/Diya-API';
baseline:'Diya';
load
] on: Warning do: #resume.
change := true.
].
change ifTrue:[
Smalltalk snapshot: true andQuit: true.
].

File diff suppressed because it is too large Load Diff

30592
unicode/UnicodeData.txt Normal file

File diff suppressed because it is too large Load Diff