mirror of https://gitlab.com/nakst/essence
add automation files
This commit is contained in:
parent
a5029119f2
commit
eb2eab872f
|
@ -0,0 +1,104 @@
|
||||||
|
#!/bin/bash
|
||||||
|
set -eux
|
||||||
|
|
||||||
|
# TODO:
|
||||||
|
# Copy the source onto the drive for self hosting.
|
||||||
|
# Producing installer images (including for real hardware).
|
||||||
|
|
||||||
|
cd essence
|
||||||
|
COMMIT=`git log | head -n 1 | cut -b 8-14`
|
||||||
|
|
||||||
|
# Setup config files.
|
||||||
|
mkdir -p bin root
|
||||||
|
echo "accepted_license=1" >> bin/build_config.ini
|
||||||
|
echo "automated_build=1" >> bin/build_config.ini
|
||||||
|
echo "Flag.DEBUG_BUILD=0" >> bin/config.ini
|
||||||
|
echo "Flag.ENABLE_POSIX_SUBSYSTEM=1" >> bin/config.ini
|
||||||
|
echo "General.wallpaper=0:/Demo Content/Abstract.jpg" >> bin/config.ini
|
||||||
|
echo "General.window_color=5" >> bin/config.ini
|
||||||
|
|
||||||
|
# Setup toolchain, build the system and ports.
|
||||||
|
./start.sh get-source prefix https://github.com/nakst/build-gcc/releases/download/gcc-11.1.0/gcc-x86_64-essence.tar.xz
|
||||||
|
./start.sh setup-pre-built-toolchain
|
||||||
|
./start.sh build-optimised
|
||||||
|
./start.sh build-optional-ports > /dev/null
|
||||||
|
|
||||||
|
# Copy a few sample files.
|
||||||
|
mkdir -p root/Demo\ Content
|
||||||
|
cp -r res/Sample\ Images/* root/Demo\ Content/
|
||||||
|
cp -r help root/Demo\ Content/
|
||||||
|
cp bin/noodle.rom root/Demo\ Content/Noodle.uxn
|
||||||
|
cp res/A\ Study\ in\ Scarlet.txt root/Demo\ Content/
|
||||||
|
cp res/Theme\ Source.dat root/Demo\ Content/Theme.designer
|
||||||
|
cp res/Flip.* root/Demo\ Content/
|
||||||
|
cp res/Teapot.obj root/Demo\ Content/
|
||||||
|
cp res/Fonts/Atkinson\ Hyperlegible\ Regular.ttf root/Demo\ Content/
|
||||||
|
|
||||||
|
# Copy API samples.
|
||||||
|
mkdir -p root/API\ Samples
|
||||||
|
python util/automation/genapisamples.py
|
||||||
|
|
||||||
|
# Enable extra applications.
|
||||||
|
echo "util/designer2.ini" >> bin/extra_applications.ini
|
||||||
|
echo "util/build_core.ini" >> bin/extra_applications.ini
|
||||||
|
echo "ports/uxn/emulator.ini" >> bin/extra_applications.ini
|
||||||
|
echo "ports/bochs/bochs.ini" >> bin/extra_applications.ini
|
||||||
|
echo "ports/mesa/obj_viewer.ini" >> bin/extra_applications.ini
|
||||||
|
|
||||||
|
# Build the extra applications.
|
||||||
|
./start.sh build-optimised
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
# Create a virtual machine file.
|
||||||
|
mkdir -p ova
|
||||||
|
qemu-img convert -f raw essence/bin/drive -O vmdk -o adapter_type=lsilogic,subformat=streamOptimized,compat6 ova/Essence-disk001.vmdk
|
||||||
|
python essence/util/automation/genovf.py > ova/Essence.ovf
|
||||||
|
cd ova
|
||||||
|
tar -cf Essence.ova Essence.ovf Essence-disk001.vmdk
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
# Copy licenses.
|
||||||
|
mkdir -p Essence Essence/Licenses
|
||||||
|
cp essence/LICENSE.md Essence/Licenses/Essence\ License.txt
|
||||||
|
cp essence/util/nanosvg.h Essence/Licenses/
|
||||||
|
cp essence/util/hsluv.h Essence/Licenses/
|
||||||
|
cp essence/util/stb_*.h Essence/Licenses/
|
||||||
|
cp essence/shared/stb_*.h Essence/Licenses/
|
||||||
|
cp essence/res/Fonts/Hack\ License.md Essence/Licenses/
|
||||||
|
cp essence/res/Fonts/Inter\ License.txt Essence/Licenses/
|
||||||
|
cp essence/res/Fonts/Atkinson\ Hyperlegible\ License.txt Essence/Licenses/
|
||||||
|
cp essence/res/Fonts/OpenDyslexic\ License.txt Essence/Licenses/
|
||||||
|
cp essence/res/elementary\ Icons\ License.txt Essence/Licenses/
|
||||||
|
cp essence/res/Sample\ Images/Licenses.txt Essence/Licenses/Sample\ Images.txt
|
||||||
|
cp essence/res/Keyboard\ Layouts/License.txt Essence/Licenses/Keyboard\ Layouts.txt
|
||||||
|
cp essence/ports/acpica/licensing.txt Essence/Licenses/ACPICA.txt
|
||||||
|
cp essence/ports/bochs/COPYING Essence/Licenses/Bochs.txt
|
||||||
|
cp essence/ports/efitoolkit/LICENSE Essence/Licenses/EFI.txt
|
||||||
|
cp essence/ports/freetype/FTL.TXT Essence/Licenses/FreeType.txt
|
||||||
|
cp essence/ports/harfbuzz/LICENSE Essence/Licenses/HarfBuzz.txt
|
||||||
|
cp essence/ports/md4c/LICENSE.md Essence/Licenses/Md4c.txt
|
||||||
|
cp essence/ports/musl/COPYRIGHT Essence/Licenses/Musl.txt
|
||||||
|
cp essence/ports/uxn/LICENSE Essence/Licenses/Uxn.txt
|
||||||
|
cp essence/bin/BusyBox\ License.txt Essence/Licenses/BusyBox.txt
|
||||||
|
cp -r essence/bin/FFmpeg\ License Essence/Licenses/
|
||||||
|
cp essence/bin/Mesa\ License.html Essence/Licenses/Mesa.html
|
||||||
|
cp essence/bin/Nasm\ License.txt Essence/Licenses/Nasm.txt
|
||||||
|
cp essence/bin/GCC\ License.txt Essence/Licenses/GCC.txt
|
||||||
|
cp essence/bin/Binutils\ License.txt Essence/Licenses/Binutils.txt
|
||||||
|
cp essence/bin/GMP\ License.txt Essence/Licenses/GMP.txt
|
||||||
|
cp essence/bin/MPFR\ License.txt Essence/Licenses/GMPF.txt
|
||||||
|
cp essence/bin/MPC\ License.txt Essence/Licenses/MPC.txt
|
||||||
|
|
||||||
|
# Compress the result.
|
||||||
|
mv ova/Essence.ova Essence/
|
||||||
|
mv essence/bin/drive Essence/
|
||||||
|
tar -cJf Essence.tar.xz Essence/
|
||||||
|
echo $COMMIT > essence/bin/commit.txt
|
||||||
|
rm -rf essence/cross essence/.git essence/bin/cache essence/bin/freetype essence/bin/harfbuzz essence/bin/musl essence/root/Applications/POSIX/lib
|
||||||
|
tar -cJf debug_info.tar.xz essence
|
||||||
|
|
||||||
|
# Set outputs for workflow.
|
||||||
|
echo "::set-output name=OUTPUT_BINARY::Essence.tar.xz"
|
||||||
|
echo "::set-output name=DEBUG_OUTPUT_BINARY::debug_info.tar.xz"
|
||||||
|
echo "::set-output name=RELEASE_NAME::essence-`date +%Y_%m_%d`-${COMMIT}"
|
||||||
|
echo "::set-output name=COMMIT::${COMMIT}"
|
|
@ -0,0 +1,20 @@
|
||||||
|
#!/bin/bash
|
||||||
|
set -eux
|
||||||
|
|
||||||
|
cd essence
|
||||||
|
mkdir -p bin root
|
||||||
|
echo "accepted_license=1" >> bin/build_config.ini
|
||||||
|
echo "automated_build=1" >> bin/build_config.ini
|
||||||
|
echo "Flag.DEBUG_BUILD=0" >> bin/config.ini
|
||||||
|
echo "BuildCore.NoImportPOSIX=1" >> bin/config.ini
|
||||||
|
echo "BuildCore.RequiredFontsOnly=1" >> bin/config.ini
|
||||||
|
echo "Emulator.PrimaryDriveMB=32" >> bin/config.ini
|
||||||
|
echo "Emulator.PrimaryDriveMB=32" >> bin/config.ini
|
||||||
|
echo "Dependency.ACPICA=0" >> bin/config.ini
|
||||||
|
echo "Dependency.stb_image=0" >> bin/config.ini
|
||||||
|
echo "Dependency.stb_image_write=0" >> bin/config.ini
|
||||||
|
echo "Dependency.stb_sprintf=0" >> bin/config.ini
|
||||||
|
echo "Dependency.FreeTypeAndHarfBuzz=0" >> bin/config.ini
|
||||||
|
./start.sh get-source prefix https://github.com/nakst/build-gcc/releases/download/gcc-11.1.0/gcc-x86_64-essence.tar.xz
|
||||||
|
./start.sh setup-pre-built-toolchain
|
||||||
|
./start.sh build-optimised
|
|
@ -0,0 +1,39 @@
|
||||||
|
import os
|
||||||
|
for config_file in os.listdir('apps/samples'):
|
||||||
|
if config_file.endswith('.ini'):
|
||||||
|
source_file = config_file.split('.')[0] + '.c'
|
||||||
|
if not os.path.exists('apps/samples/' + source_file):
|
||||||
|
source_file = config_file.split('.')[0] + '.cpp'
|
||||||
|
if not os.path.exists('apps/samples/' + source_file):
|
||||||
|
continue
|
||||||
|
application_name = None
|
||||||
|
with open('apps/samples/' + config_file, 'r') as config_fd:
|
||||||
|
config = config_fd.read().split('\n')
|
||||||
|
config_section = ''
|
||||||
|
for config_line in config:
|
||||||
|
if len(config_line) > 0 and config_line[0] == '[':
|
||||||
|
config_section = config_line
|
||||||
|
elif config_section == '[general]' and config_line.startswith('name='):
|
||||||
|
application_name = config_line[5:]
|
||||||
|
if not application_name:
|
||||||
|
continue
|
||||||
|
print(application_name, source_file, config_file)
|
||||||
|
folder = 'root/API Samples/' + application_name
|
||||||
|
try:
|
||||||
|
os.mkdir(folder)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
with open('apps/samples/' + source_file, 'r') as source_fd:
|
||||||
|
with open(folder + '/' + source_file, 'w') as source_dest_fd:
|
||||||
|
source_dest_fd.write(source_fd.read())
|
||||||
|
with open('apps/samples/' + config_file, 'r') as config_fd:
|
||||||
|
with open(folder + '/make.build_core', 'w') as config_dest_fd:
|
||||||
|
config = config_fd.read().split('\n')
|
||||||
|
config_section = ''
|
||||||
|
for config_line in config:
|
||||||
|
if len(config_line) > 0 and config_line[0] == '[':
|
||||||
|
config_section = config_line
|
||||||
|
if config_section == '[build]' and config_line.startswith('source='):
|
||||||
|
config_dest_fd.write('source=' + source_file + '\n')
|
||||||
|
else:
|
||||||
|
config_dest_fd.write(config_line + '\n')
|
|
@ -0,0 +1,14 @@
|
||||||
|
import os
|
||||||
|
import uuid
|
||||||
|
template = open('essence/util/automation/template.ovf','r').read().split('$')
|
||||||
|
uuid1 = uuid.uuid4()
|
||||||
|
uuid2 = uuid.uuid4()
|
||||||
|
print(template[0], end='')
|
||||||
|
print(os.path.getsize('essence/bin/drive'), end='')
|
||||||
|
print(template[1], end='')
|
||||||
|
print(uuid1, end='')
|
||||||
|
print(template[2], end='')
|
||||||
|
print(uuid2, end='')
|
||||||
|
print(template[3], end='')
|
||||||
|
print(uuid1, end='')
|
||||||
|
print(template[4], end='')
|
|
@ -0,0 +1,15 @@
|
||||||
|
#!/bin/bash
|
||||||
|
set -eux
|
||||||
|
|
||||||
|
# TODO:
|
||||||
|
# Run stress tests.
|
||||||
|
|
||||||
|
cd essence
|
||||||
|
mkdir -p bin
|
||||||
|
echo "accepted_license=1" >> bin/build_config.ini
|
||||||
|
echo "desktop/api_tests.ini" >> bin/extra_applications.ini
|
||||||
|
echo `git log | head -n 1 | cut -b 8-14` > bin/commit.txt
|
||||||
|
./start.sh get-source prefix https://github.com/nakst/build-gcc/releases/download/gcc-11.1.0/gcc-x86_64-essence.tar.xz
|
||||||
|
./start.sh setup-pre-built-toolchain
|
||||||
|
./start.sh run-tests
|
||||||
|
rm -rf cross .git bin/cache bin/freetype bin/harfbuzz bin/musl root/Applications/POSIX/lib bin/drive
|
|
@ -0,0 +1,142 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<Envelope ovf:version="1.0" xml:lang="en-US" xmlns="http://schemas.dmtf.org/ovf/envelope/1" xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1" xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData" xmlns:vssd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:vbox="http://www.virtualbox.org/ovf/machine">
|
||||||
|
<References>
|
||||||
|
<File ovf:id="file1" ovf:href="Essence-disk001.vmdk"/>
|
||||||
|
</References>
|
||||||
|
<DiskSection>
|
||||||
|
<Info>List of the virtual disks used in the package</Info>
|
||||||
|
<Disk ovf:capacity="$" ovf:diskId="vmdisk1" ovf:fileRef="file1" ovf:format="http://www.vmware.com/interfaces/specifications/vmdk.html#streamOptimized" vbox:uuid="$"/>
|
||||||
|
</DiskSection>
|
||||||
|
<NetworkSection>
|
||||||
|
<Info>Logical networks used in the package</Info>
|
||||||
|
<Network ovf:name="NAT">
|
||||||
|
<Description>Logical network used by this appliance.</Description>
|
||||||
|
</Network>
|
||||||
|
</NetworkSection>
|
||||||
|
<VirtualSystem ovf:id="Essence2">
|
||||||
|
<Info>A virtual machine</Info>
|
||||||
|
<OperatingSystemSection ovf:id="105">
|
||||||
|
<Info>The kind of installed guest operating system</Info>
|
||||||
|
<Description>Windows7</Description>
|
||||||
|
<vbox:OSType ovf:required="false">Windows7_64</vbox:OSType>
|
||||||
|
</OperatingSystemSection>
|
||||||
|
<VirtualHardwareSection>
|
||||||
|
<Info>Virtual hardware requirements for a virtual machine</Info>
|
||||||
|
<System>
|
||||||
|
<vssd:ElementName>Virtual Hardware Family</vssd:ElementName>
|
||||||
|
<vssd:InstanceID>0</vssd:InstanceID>
|
||||||
|
<vssd:VirtualSystemIdentifier>Essence2</vssd:VirtualSystemIdentifier>
|
||||||
|
<vssd:VirtualSystemType>virtualbox-2.2</vssd:VirtualSystemType>
|
||||||
|
</System>
|
||||||
|
<Item>
|
||||||
|
<rasd:Caption>2 virtual CPU</rasd:Caption>
|
||||||
|
<rasd:Description>Number of virtual CPUs</rasd:Description>
|
||||||
|
<rasd:ElementName>2 virtual CPU</rasd:ElementName>
|
||||||
|
<rasd:InstanceID>1</rasd:InstanceID>
|
||||||
|
<rasd:ResourceType>3</rasd:ResourceType>
|
||||||
|
<rasd:VirtualQuantity>2</rasd:VirtualQuantity>
|
||||||
|
</Item>
|
||||||
|
<Item>
|
||||||
|
<rasd:AllocationUnits>MegaBytes</rasd:AllocationUnits>
|
||||||
|
<rasd:Caption>2048 MB of memory</rasd:Caption>
|
||||||
|
<rasd:Description>Memory Size</rasd:Description>
|
||||||
|
<rasd:ElementName>2048 MB of memory</rasd:ElementName>
|
||||||
|
<rasd:InstanceID>2</rasd:InstanceID>
|
||||||
|
<rasd:ResourceType>4</rasd:ResourceType>
|
||||||
|
<rasd:VirtualQuantity>2048</rasd:VirtualQuantity>
|
||||||
|
</Item>
|
||||||
|
<Item>
|
||||||
|
<rasd:Address>0</rasd:Address>
|
||||||
|
<rasd:Caption>sataController0</rasd:Caption>
|
||||||
|
<rasd:Description>SATA Controller</rasd:Description>
|
||||||
|
<rasd:ElementName>sataController0</rasd:ElementName>
|
||||||
|
<rasd:InstanceID>3</rasd:InstanceID>
|
||||||
|
<rasd:ResourceSubType>AHCI</rasd:ResourceSubType>
|
||||||
|
<rasd:ResourceType>20</rasd:ResourceType>
|
||||||
|
</Item>
|
||||||
|
<Item>
|
||||||
|
<rasd:Address>0</rasd:Address>
|
||||||
|
<rasd:Caption>usb</rasd:Caption>
|
||||||
|
<rasd:Description>USB Controller</rasd:Description>
|
||||||
|
<rasd:ElementName>usb</rasd:ElementName>
|
||||||
|
<rasd:InstanceID>4</rasd:InstanceID>
|
||||||
|
<rasd:ResourceType>23</rasd:ResourceType>
|
||||||
|
</Item>
|
||||||
|
<Item>
|
||||||
|
<rasd:AddressOnParent>3</rasd:AddressOnParent>
|
||||||
|
<rasd:AutomaticAllocation>false</rasd:AutomaticAllocation>
|
||||||
|
<rasd:Caption>sound</rasd:Caption>
|
||||||
|
<rasd:Description>Sound Card</rasd:Description>
|
||||||
|
<rasd:ElementName>sound</rasd:ElementName>
|
||||||
|
<rasd:InstanceID>5</rasd:InstanceID>
|
||||||
|
<rasd:ResourceSubType>ensoniq1371</rasd:ResourceSubType>
|
||||||
|
<rasd:ResourceType>35</rasd:ResourceType>
|
||||||
|
</Item>
|
||||||
|
<Item>
|
||||||
|
<rasd:AddressOnParent>0</rasd:AddressOnParent>
|
||||||
|
<rasd:Caption>disk1</rasd:Caption>
|
||||||
|
<rasd:Description>Disk Image</rasd:Description>
|
||||||
|
<rasd:ElementName>disk1</rasd:ElementName>
|
||||||
|
<rasd:HostResource>/disk/vmdisk1</rasd:HostResource>
|
||||||
|
<rasd:InstanceID>6</rasd:InstanceID>
|
||||||
|
<rasd:Parent>3</rasd:Parent>
|
||||||
|
<rasd:ResourceType>17</rasd:ResourceType>
|
||||||
|
</Item>
|
||||||
|
<Item>
|
||||||
|
<rasd:AutomaticAllocation>true</rasd:AutomaticAllocation>
|
||||||
|
<rasd:Caption>Ethernet adapter on 'NAT'</rasd:Caption>
|
||||||
|
<rasd:Connection>NAT</rasd:Connection>
|
||||||
|
<rasd:ElementName>Ethernet adapter on 'NAT'</rasd:ElementName>
|
||||||
|
<rasd:InstanceID>7</rasd:InstanceID>
|
||||||
|
<rasd:ResourceSubType>E1000</rasd:ResourceSubType>
|
||||||
|
<rasd:ResourceType>10</rasd:ResourceType>
|
||||||
|
</Item>
|
||||||
|
</VirtualHardwareSection>
|
||||||
|
<vbox:Machine ovf:required="false" version="1.15-linux" uuid="{$}" name="Essence2" OSType="Windows7_64" snapshotFolder="Snapshots" lastStateChange="2021-12-17T11:00:52Z">
|
||||||
|
<ovf:Info>Complete VirtualBox machine configuration in VirtualBox format</ovf:Info>
|
||||||
|
<ExtraData>
|
||||||
|
</ExtraData>
|
||||||
|
<Hardware>
|
||||||
|
<CPU count="2">
|
||||||
|
<PAE enabled="false"/>
|
||||||
|
<LongMode enabled="true"/>
|
||||||
|
<HardwareVirtExLargePages enabled="false"/>
|
||||||
|
</CPU>
|
||||||
|
<Memory RAMSize="2048"/>
|
||||||
|
<HID Pointing="USBTablet"/>
|
||||||
|
<Paravirt provider="Default"/>
|
||||||
|
<Display controller="VBoxSVGA" VRAMSize="27"/>
|
||||||
|
<VideoCapture screens="1" file="." fps="25"/>
|
||||||
|
<RemoteDisplay enabled="false"/>
|
||||||
|
<BIOS>
|
||||||
|
<IOAPIC enabled="true"/>
|
||||||
|
<SmbiosUuidLittleEndian enabled="true"/>
|
||||||
|
</BIOS>
|
||||||
|
<USB>
|
||||||
|
<Controllers>
|
||||||
|
<Controller name="OHCI" type="OHCI"/>
|
||||||
|
</Controllers>
|
||||||
|
</USB>
|
||||||
|
<Network>
|
||||||
|
<Adapter slot="0" enabled="true" cable="true" type="82540EM">
|
||||||
|
<NAT/>
|
||||||
|
</Adapter>
|
||||||
|
</Network>
|
||||||
|
<UART>
|
||||||
|
</UART>
|
||||||
|
<AudioAdapter controller="HDA" driver="ALSA" enabled="true" enabledIn="false"/>
|
||||||
|
<Clipboard/>
|
||||||
|
<GuestProperties>
|
||||||
|
<GuestProperty name="/VirtualBox/HostInfo/GUI/LanguageID" value="en_US" timestamp="1639738852241034000" flags=""/>
|
||||||
|
</GuestProperties>
|
||||||
|
</Hardware>
|
||||||
|
<StorageControllers>
|
||||||
|
<StorageController name="AHCI" type="AHCI" PortCount="2" useHostIOCache="false" Bootable="true" IDE0MasterEmulationPort="0" IDE0SlaveEmulationPort="1" IDE1MasterEmulationPort="2" IDE1SlaveEmulationPort="3">
|
||||||
|
<AttachedDevice type="HardDisk" hotpluggable="false" port="0" device="0">
|
||||||
|
<Image uuid="{$}"/>
|
||||||
|
</AttachedDevice>
|
||||||
|
</StorageController>
|
||||||
|
</StorageControllers>
|
||||||
|
</vbox:Machine>
|
||||||
|
</VirtualSystem>
|
||||||
|
</Envelope>
|
Loading…
Reference in New Issue