beebium-server 0.1.5__py3-none-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- beebium/server/__init__.py +44 -0
- beebium/server/_bundle/bin/acorn-rtc.dll +0 -0
- beebium/server/_bundle/bin/acorn-scsi.dll +0 -0
- beebium/server/_bundle/bin/beebium-model-b-plus-128k.exe +0 -0
- beebium/server/_bundle/bin/beebium-model-b-plus.exe +0 -0
- beebium/server/_bundle/bin/beebium-model-b-romram.exe +0 -0
- beebium/server/_bundle/bin/beebium-model-b.exe +0 -0
- beebium/server/_bundle/bin/beebium_extension_api.dll +0 -0
- beebium/server/_bundle/bin/beebium_extension_ui_proto.dll +0 -0
- beebium/server/_bundle/bin/extensions/acorn-rtc/manifest.json +26 -0
- beebium/server/_bundle/bin/extensions/acorn-scsi/manifest.json +9 -0
- beebium/server/_bundle/bin/extensions/ip232-serial/manifest.json +43 -0
- beebium/server/_bundle/bin/extensions/loopback-serial/manifest.json +8 -0
- beebium/server/_bundle/bin/extensions/piconet/manifest.json +16 -0
- beebium/server/_bundle/bin/extensions/rfc2217-client-serial/manifest.json +55 -0
- beebium/server/_bundle/bin/extensions/rfc2217-server-serial/manifest.json +28 -0
- beebium/server/_bundle/bin/extensions/rpc-serial/manifest.json +16 -0
- beebium/server/_bundle/bin/extensions/scsi-hard-disc/manifest.json +28 -0
- beebium/server/_bundle/bin/extensions/test-scratch-ram/manifest.json +7 -0
- beebium/server/_bundle/bin/ip232-serial.dll +0 -0
- beebium/server/_bundle/bin/loopback-serial.dll +0 -0
- beebium/server/_bundle/bin/piconet.dll +0 -0
- beebium/server/_bundle/bin/rfc2217-client-serial.dll +0 -0
- beebium/server/_bundle/bin/rfc2217-server-serial.dll +0 -0
- beebium/server/_bundle/bin/rpc-serial.dll +0 -0
- beebium/server/_bundle/bin/scsi-hard-disc.dll +0 -0
- beebium/server/_bundle/bin/test-scratch-ram.dll +0 -0
- beebium/server/_bundle/share/beebium/presets/model-b-disc.preset.beebium +19 -0
- beebium/server/_bundle/share/beebium/presets/model-b-disc.thumbnail.png +0 -0
- beebium/server/_bundle/share/beebium/presets/model-b-plus-128k.preset.beebium +5 -0
- beebium/server/_bundle/share/beebium/presets/model-b-plus-128k.thumbnail.png +0 -0
- beebium/server/_bundle/share/beebium/presets/model-b-plus.preset.beebium +5 -0
- beebium/server/_bundle/share/beebium/presets/model-b-plus.thumbnail.png +0 -0
- beebium/server/_bundle/share/beebium/presets/model-b-romram-disc.preset.beebium +19 -0
- beebium/server/_bundle/share/beebium/presets/model-b-romram-disc.thumbnail.png +0 -0
- beebium/server/_bundle/share/beebium/presets/model-b.preset.beebium +5 -0
- beebium/server/_bundle/share/beebium/presets/model-b.thumbnail.png +0 -0
- beebium/server/_bundle/share/beebium/roms/acorn-adfs_1_30.rom +0 -0
- beebium/server/_bundle/share/beebium/roms/acorn-anfs_4_18.rom +0 -0
- beebium/server/_bundle/share/beebium/roms/acorn-dfs_2_26.rom +0 -0
- beebium/server/_bundle/share/beebium/roms/acorn-dnfs_3_02.rom +0 -0
- beebium/server/_bundle/share/beebium/roms/acorn-mos_1_20.rom +0 -0
- beebium/server/_bundle/share/beebium/roms/acorn-mos_2_0.rom +0 -0
- beebium/server/_bundle/share/beebium/roms/acorn-nfs_3_65.rom +0 -0
- beebium/server/_bundle/share/beebium/roms/acorn-tube-6502_1_10.rom +0 -0
- beebium/server/_bundle/share/beebium/roms/amx-super-rom_3_41.rom +0 -0
- beebium/server/_bundle/share/beebium/roms/bbc-basic_2.rom +0 -0
- beebium/server/_bundle/share/beebium/roms/comal_1_0.rom +0 -0
- beebium/server/_bundle/share/beebium/roms/commstar_1_40_SN882A.rom +0 -0
- beebium/server/_bundle/share/beebium/roms/snapper.rom +0 -0
- beebium/server/_launch.py +57 -0
- beebium/server/_paths.py +89 -0
- beebium/server/_version.py +15 -0
- beebium/server/py.typed +0 -0
- beebium_server-0.1.5.dist-info/METADATA +43 -0
- beebium_server-0.1.5.dist-info/RECORD +59 -0
- beebium_server-0.1.5.dist-info/WHEEL +4 -0
- beebium_server-0.1.5.dist-info/entry_points.txt +5 -0
- beebium_server-0.1.5.dist-info/licenses/COPYING.txt +674 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Copyright 2026 Robert Smallshire <robert@smallshire.org.uk>
|
|
2
|
+
#
|
|
3
|
+
# This file is part of Beebium.
|
|
4
|
+
#
|
|
5
|
+
# Beebium is free software: you can redistribute it and/or modify it under the terms of the
|
|
6
|
+
# GNU General Public License as published by the Free Software Foundation, either version 3 of the
|
|
7
|
+
# License, or (at your option) any later version. Beebium is distributed in the hope that it will
|
|
8
|
+
# be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
9
|
+
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
10
|
+
# You should have received a copy of the GNU General Public License along with Beebium.
|
|
11
|
+
# If not, see <https://www.gnu.org/licenses/>.
|
|
12
|
+
|
|
13
|
+
"""Prebuilt Beebium server binaries, shipped as a platform wheel.
|
|
14
|
+
|
|
15
|
+
import beebium.server
|
|
16
|
+
|
|
17
|
+
beebium.server.__version__
|
|
18
|
+
beebium.server.executable_filepath(variant="model-b") # ensured executable
|
|
19
|
+
beebium.server.rom_dirpath()
|
|
20
|
+
beebium.server.preset_dirpath()
|
|
21
|
+
beebium.server.variants()
|
|
22
|
+
beebium.server.bundle_dirpath()
|
|
23
|
+
|
|
24
|
+
This package is dependency-free and usable without the `beebium` client; the
|
|
25
|
+
client discovers it (when installed) as one of its server installations.
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
from beebium.server._paths import (
|
|
29
|
+
__version__,
|
|
30
|
+
bundle_dirpath,
|
|
31
|
+
executable_filepath,
|
|
32
|
+
preset_dirpath,
|
|
33
|
+
rom_dirpath,
|
|
34
|
+
variants,
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
__all__ = [
|
|
38
|
+
"__version__",
|
|
39
|
+
"bundle_dirpath",
|
|
40
|
+
"executable_filepath",
|
|
41
|
+
"preset_dirpath",
|
|
42
|
+
"rom_dirpath",
|
|
43
|
+
"variants",
|
|
44
|
+
]
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "acorn-rtc",
|
|
3
|
+
"display_name": "Acorn Real-Time Clock",
|
|
4
|
+
"description": "Acorn User Port Real Time Clock Module (SAF3019P)",
|
|
5
|
+
"library": "acorn-rtc",
|
|
6
|
+
"attaches_to": ["user-port"],
|
|
7
|
+
"cli": "acorn-rtc",
|
|
8
|
+
"parameters": [
|
|
9
|
+
{
|
|
10
|
+
"key": "time",
|
|
11
|
+
"type": "string",
|
|
12
|
+
"description": "Set emulated clock to absolute datetime (e.g. 1985-03-15T10:30)"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"key": "offset",
|
|
16
|
+
"type": "string",
|
|
17
|
+
"description": "Offset from host local time (e.g. -10y, +5h, -365d)"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"key": "layout",
|
|
21
|
+
"type": "string",
|
|
22
|
+
"description": "Register layout: '4bit-year-in-r1' (Acorn original), '7bit-year-in-r7' (L3 v1.26), '7bit-year-in-r1r5' (BeebMaster Y2KFIX)",
|
|
23
|
+
"default": "4bit-year-in-r1"
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ip232-serial",
|
|
3
|
+
"display_name": "IP232 Serial",
|
|
4
|
+
"description": "Connect the BBC serial port (RS423) to a tcpser-style IP232 server over TCP",
|
|
5
|
+
"library": "ip232-serial",
|
|
6
|
+
"attaches_to": ["serial-port"],
|
|
7
|
+
"cli": "ip232-serial",
|
|
8
|
+
"parameters": [
|
|
9
|
+
{
|
|
10
|
+
"key": "url",
|
|
11
|
+
"type": "string",
|
|
12
|
+
"description": "IP232 server endpoint as [scheme://]host:port (e.g. url=\"ip232://bbs.example.com:25232\"); alternative to host/port, cannot be combined with them"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"key": "host",
|
|
16
|
+
"type": "string",
|
|
17
|
+
"description": "IP232 server hostname or address (default localhost; alternative to url)"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"key": "port",
|
|
21
|
+
"type": "integer",
|
|
22
|
+
"description": "IP232 server TCP port (default 25232; alternative to url)"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"key": "mode",
|
|
26
|
+
"type": "string",
|
|
27
|
+
"default": "ip232",
|
|
28
|
+
"description": "'ip232' (0xFF-escaped, persistent connection) or 'raw' (pure byte pipe, connect/disconnect on RTS)"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"key": "handshake",
|
|
32
|
+
"type": "boolean",
|
|
33
|
+
"default": "true",
|
|
34
|
+
"description": "convey the BBC's RTS line to the server via the 0xFF escape (ip232 mode only)"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"key": "tx_buffer",
|
|
38
|
+
"type": "integer",
|
|
39
|
+
"default": "4096",
|
|
40
|
+
"description": "transmit buffer size in bytes; the BBC's /CTS asserts at/above it"
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "piconet",
|
|
3
|
+
"display_name": "Piconet",
|
|
4
|
+
"description": "Piconet USB-CDC bridge to a real Econet network",
|
|
5
|
+
"library": "piconet",
|
|
6
|
+
"cli": "piconet",
|
|
7
|
+
"extension_kind": "econet-transport",
|
|
8
|
+
"parameters": [
|
|
9
|
+
{
|
|
10
|
+
"key": "device_path",
|
|
11
|
+
"type": "filepath",
|
|
12
|
+
"description": "Serial device path (e.g. /dev/tty.usbmodem101)",
|
|
13
|
+
"required": true
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "rfc2217-client-serial",
|
|
3
|
+
"display_name": "RFC 2217 Serial (client)",
|
|
4
|
+
"description": "Connect the BBC serial port (RS423) to a remote RFC 2217 access server over TCP",
|
|
5
|
+
"library": "rfc2217-client-serial",
|
|
6
|
+
"attaches_to": ["serial-port"],
|
|
7
|
+
"cli": "rfc2217-client-serial",
|
|
8
|
+
"parameters": [
|
|
9
|
+
{
|
|
10
|
+
"key": "url",
|
|
11
|
+
"type": "string",
|
|
12
|
+
"description": "Access-server endpoint as [scheme://]host:port (e.g. url=\"rfc2217://ser2net.local:4001\"); alternative to host/port, cannot be combined with them"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"key": "host",
|
|
16
|
+
"type": "string",
|
|
17
|
+
"description": "RFC 2217 access-server hostname or address (alternative to url)"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"key": "port",
|
|
21
|
+
"type": "integer",
|
|
22
|
+
"description": "RFC 2217 access-server TCP port (alternative to url)"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"key": "baud",
|
|
26
|
+
"type": "integer",
|
|
27
|
+
"default": "19200",
|
|
28
|
+
"description": "baud rate to set on the remote UART (real hardware)"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"key": "framing",
|
|
32
|
+
"type": "string",
|
|
33
|
+
"default": "8N1",
|
|
34
|
+
"description": "remote UART framing as <data><parity><stop> (data 5-8; parity N/O/E/M/S; stop 1/2), e.g. 8N1 or 7E1"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"key": "flow",
|
|
38
|
+
"type": "string",
|
|
39
|
+
"default": "none",
|
|
40
|
+
"description": "remote UART flow control: none, rtscts (hardware) or xonxoff"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"key": "dtr",
|
|
44
|
+
"type": "boolean",
|
|
45
|
+
"default": "true",
|
|
46
|
+
"description": "assert DTR on the remote UART (many devices/modems need it; the BBC connector has no DTR pin)"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"key": "tx_buffer",
|
|
50
|
+
"type": "integer",
|
|
51
|
+
"default": "4096",
|
|
52
|
+
"description": "transmit buffer size in bytes; the BBC's /CTS asserts at/above it"
|
|
53
|
+
}
|
|
54
|
+
]
|
|
55
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "rfc2217-server-serial",
|
|
3
|
+
"display_name": "RFC 2217 Serial (server)",
|
|
4
|
+
"description": "Expose the emulated BBC serial port (RS423) to RFC 2217 clients over TCP",
|
|
5
|
+
"library": "rfc2217-server-serial",
|
|
6
|
+
"attaches_to": ["serial-port"],
|
|
7
|
+
"cli": "rfc2217-server-serial",
|
|
8
|
+
"parameters": [
|
|
9
|
+
{
|
|
10
|
+
"key": "bind",
|
|
11
|
+
"type": "string",
|
|
12
|
+
"default": "127.0.0.1",
|
|
13
|
+
"description": "listen address; the service is UNAUTHENTICATED plain Telnet, so bind to a wider address only behind SSH/WireGuard"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"key": "port",
|
|
17
|
+
"type": "integer",
|
|
18
|
+
"required": true,
|
|
19
|
+
"description": "TCP port to listen on"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"key": "tx_buffer",
|
|
23
|
+
"type": "integer",
|
|
24
|
+
"default": "4096",
|
|
25
|
+
"description": "transmit buffer size in bytes; the BBC's /CTS asserts at/above it"
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "rpc-serial",
|
|
3
|
+
"display_name": "RPC Serial",
|
|
4
|
+
"description": "Client-driven serial peer: inject/collect bytes via the RpcSerial service",
|
|
5
|
+
"library": "rpc-serial",
|
|
6
|
+
"attaches_to": ["serial-port"],
|
|
7
|
+
"cli": "rpc-serial",
|
|
8
|
+
"parameters": [
|
|
9
|
+
{
|
|
10
|
+
"key": "tx_buffer",
|
|
11
|
+
"type": "integer",
|
|
12
|
+
"default": "4096",
|
|
13
|
+
"description": "transmit buffer size in bytes; the BBC's /CTS asserts at/above it"
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "scsi-hard-disc",
|
|
3
|
+
"display_name": "SCSI Hard Disc",
|
|
4
|
+
"description": "SCSI hard disc target (DAT+DSC image)",
|
|
5
|
+
"library": "scsi-hard-disc",
|
|
6
|
+
"attaches_to": ["scsi"],
|
|
7
|
+
"cli": "scsi-hdd",
|
|
8
|
+
"parameters": [
|
|
9
|
+
{
|
|
10
|
+
"key": "scsi-id",
|
|
11
|
+
"type": "integer",
|
|
12
|
+
"position": 0,
|
|
13
|
+
"default": "0",
|
|
14
|
+
"description": "SCSI target ID (0-7)"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"key": "image",
|
|
18
|
+
"type": "filepath",
|
|
19
|
+
"position": 1,
|
|
20
|
+
"description": "Path to DAT disc image file"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"key": "adapter-id",
|
|
24
|
+
"type": "string",
|
|
25
|
+
"description": "ID of SCSI adapter to attach to"
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"model": "model-b",
|
|
3
|
+
"name": "BBC Model B (Disc)",
|
|
4
|
+
"release_date": "1982",
|
|
5
|
+
"storage": {
|
|
6
|
+
"fdc_socket": {
|
|
7
|
+
"id": "acorn-1770"
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
"sideways_bank": {
|
|
11
|
+
"slots": [
|
|
12
|
+
{
|
|
13
|
+
"slot": 14,
|
|
14
|
+
"type": "rom",
|
|
15
|
+
"image_uri": "acorn-dfs_2_26.rom"
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|
|
19
|
+
}
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"model": "model-b-romram",
|
|
3
|
+
"name": "BBC Model B with ROM/RAM Board (Disc)",
|
|
4
|
+
"release_date": "1984",
|
|
5
|
+
"storage": {
|
|
6
|
+
"fdc_socket": {
|
|
7
|
+
"id": "acorn-1770"
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
"sideways_bank": {
|
|
11
|
+
"slots": [
|
|
12
|
+
{
|
|
13
|
+
"slot": 14,
|
|
14
|
+
"type": "rom",
|
|
15
|
+
"image_uri": "acorn-dfs_2_26.rom"
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|
|
19
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Copyright 2026 Robert Smallshire <robert@smallshire.org.uk>
|
|
2
|
+
#
|
|
3
|
+
# This file is part of Beebium.
|
|
4
|
+
#
|
|
5
|
+
# Beebium is free software: you can redistribute it and/or modify it under the terms of the
|
|
6
|
+
# GNU General Public License as published by the Free Software Foundation, either version 3 of the
|
|
7
|
+
# License, or (at your option) any later version. Beebium is distributed in the hope that it will
|
|
8
|
+
# be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
9
|
+
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
10
|
+
# You should have received a copy of the GNU General Public License along with Beebium.
|
|
11
|
+
# If not, see <https://www.gnu.org/licenses/>.
|
|
12
|
+
|
|
13
|
+
"""Console-script entry points for the bundled server binaries.
|
|
14
|
+
|
|
15
|
+
`pip install beebium-server` puts `beebium-model-b` (and the three other
|
|
16
|
+
variants) on PATH. On POSIX each is a thin ``os.execv`` of the matching binary,
|
|
17
|
+
so signals, exit code and stdout behave exactly as the bare binary. Windows has
|
|
18
|
+
no exec that preserves console signal semantics -- ``os.execv`` there spawns a
|
|
19
|
+
fresh process and mishandles Ctrl-C and the exit code for the shim -- so on
|
|
20
|
+
Windows the server is run as a child and its exit code is propagated. Either
|
|
21
|
+
way a client that needs precise signal delivery should launch the binary from
|
|
22
|
+
beebium.server.executable_filepath() directly rather than through the shim.
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
from __future__ import annotations
|
|
26
|
+
|
|
27
|
+
import os
|
|
28
|
+
import sys
|
|
29
|
+
|
|
30
|
+
from beebium.server._paths import executable_filepath
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def _exec(variant: str) -> None:
|
|
34
|
+
filepath = executable_filepath(variant)
|
|
35
|
+
argv = [str(filepath), *sys.argv[1:]]
|
|
36
|
+
if sys.platform == "win32":
|
|
37
|
+
import subprocess
|
|
38
|
+
|
|
39
|
+
completed = subprocess.run(argv)
|
|
40
|
+
sys.exit(completed.returncode)
|
|
41
|
+
os.execv(str(filepath), argv)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def model_b() -> None:
|
|
45
|
+
_exec("model-b")
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def model_b_plus() -> None:
|
|
49
|
+
_exec("model-b-plus")
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def model_b_plus_128k() -> None:
|
|
53
|
+
_exec("model-b-plus-128k")
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def model_b_romram() -> None:
|
|
57
|
+
_exec("model-b-romram")
|
beebium/server/_paths.py
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# Copyright 2026 Robert Smallshire <robert@smallshire.org.uk>
|
|
2
|
+
#
|
|
3
|
+
# This file is part of Beebium.
|
|
4
|
+
#
|
|
5
|
+
# Beebium is free software: you can redistribute it and/or modify it under the terms of the
|
|
6
|
+
# GNU General Public License as published by the Free Software Foundation, either version 3 of the
|
|
7
|
+
# License, or (at your option) any later version. Beebium is distributed in the hope that it will
|
|
8
|
+
# be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
9
|
+
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
10
|
+
# You should have received a copy of the GNU General Public License along with Beebium.
|
|
11
|
+
# If not, see <https://www.gnu.org/licenses/>.
|
|
12
|
+
|
|
13
|
+
"""Locate the server binaries and data shipped inside this wheel.
|
|
14
|
+
|
|
15
|
+
The bundle under ``_bundle/`` is the release tarball laid out verbatim
|
|
16
|
+
(``bin/ lib/ share/``), so the server's own relative discovery of ROMs, presets,
|
|
17
|
+
extensions and ABI libraries works unchanged -- the binaries do not know they
|
|
18
|
+
are inside a Python package.
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
from __future__ import annotations
|
|
22
|
+
|
|
23
|
+
import os
|
|
24
|
+
import sys
|
|
25
|
+
from pathlib import Path
|
|
26
|
+
|
|
27
|
+
from beebium.server._version import __version__
|
|
28
|
+
|
|
29
|
+
__all__ = [
|
|
30
|
+
"__version__",
|
|
31
|
+
"bundle_dirpath",
|
|
32
|
+
"executable_filepath",
|
|
33
|
+
"preset_dirpath",
|
|
34
|
+
"rom_dirpath",
|
|
35
|
+
"variants",
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
# The machine variants, as the suffix of the binary name (beebium-<variant>).
|
|
39
|
+
# "model-b" is the default everywhere, matching the client.
|
|
40
|
+
_VARIANTS = ("model-b", "model-b-plus", "model-b-plus-128k", "model-b-romram")
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def variants() -> tuple[str, ...]:
|
|
44
|
+
"""The machine variants shipped in this wheel."""
|
|
45
|
+
return _VARIANTS
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def bundle_dirpath() -> Path:
|
|
49
|
+
"""Path to the bundled install tree (its ``bin/ lib/ share/`` root)."""
|
|
50
|
+
return Path(__file__).resolve().parent / "_bundle"
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def _executable_name(variant: str) -> str:
|
|
54
|
+
name = f"beebium-{variant}"
|
|
55
|
+
if sys.platform == "win32":
|
|
56
|
+
name += ".exe"
|
|
57
|
+
return name
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
def executable_filepath(variant: str = "model-b") -> Path:
|
|
61
|
+
"""Path to a bundled server executable, ensured executable.
|
|
62
|
+
|
|
63
|
+
Zip entries carry Unix mode bits and pip preserves them, so the binary
|
|
64
|
+
normally arrives executable. As belt and braces this repairs a missing
|
|
65
|
+
execute bit (a one-time, idempotent chmod) for installers that drop it.
|
|
66
|
+
|
|
67
|
+
Raises:
|
|
68
|
+
ValueError: if ``variant`` is not one of ``variants()``.
|
|
69
|
+
FileNotFoundError: if the binary is missing from the bundle.
|
|
70
|
+
"""
|
|
71
|
+
if variant not in _VARIANTS:
|
|
72
|
+
raise ValueError(f"unknown variant {variant!r}; expected one of {', '.join(_VARIANTS)}")
|
|
73
|
+
filepath = bundle_dirpath() / "bin" / _executable_name(variant)
|
|
74
|
+
if not filepath.exists():
|
|
75
|
+
raise FileNotFoundError(f"server binary not found in the bundle: {filepath}")
|
|
76
|
+
if sys.platform != "win32" and not os.access(filepath, os.X_OK):
|
|
77
|
+
mode = filepath.stat().st_mode
|
|
78
|
+
filepath.chmod(mode | 0o111) # add execute for user/group/other
|
|
79
|
+
return filepath
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def rom_dirpath() -> Path:
|
|
83
|
+
"""Path to the bundled ROM directory (``share/beebium/roms``)."""
|
|
84
|
+
return bundle_dirpath() / "share" / "beebium" / "roms"
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
def preset_dirpath() -> Path:
|
|
88
|
+
"""Path to the bundled preset directory (``share/beebium/presets``)."""
|
|
89
|
+
return bundle_dirpath() / "share" / "beebium" / "presets"
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Copyright 2026 Robert Smallshire <robert@smallshire.org.uk>
|
|
2
|
+
#
|
|
3
|
+
# This file is part of Beebium.
|
|
4
|
+
#
|
|
5
|
+
# Beebium is free software: you can redistribute it and/or modify it under the terms of the
|
|
6
|
+
# GNU General Public License as published by the Free Software Foundation, either version 3 of the
|
|
7
|
+
# License, or (at your option) any later version. Beebium is distributed in the hope that it will
|
|
8
|
+
# be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
9
|
+
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
10
|
+
# You should have received a copy of the GNU General Public License along with Beebium.
|
|
11
|
+
# If not, see <https://www.gnu.org/licenses/>.
|
|
12
|
+
|
|
13
|
+
"""Single source of truth for the beebium-server version (bumped by bump-my-version)."""
|
|
14
|
+
|
|
15
|
+
__version__ = "0.1.5"
|
beebium/server/py.typed
ADDED
|
File without changes
|