forked from AbleOS/ableos
minor fixes
This commit is contained in:
parent
1837fe5826
commit
01e5d8064f
|
@ -5,7 +5,7 @@ extern crate syn;
|
|||
use {
|
||||
proc_macro::TokenStream,
|
||||
quote::quote,
|
||||
syn::{parse::Parse, parse_macro_input, Expr, ItemFn, Token}
|
||||
syn::{parse::Parse, parse_macro_input, Expr, ItemFn, Token},
|
||||
};
|
||||
|
||||
struct KtestInput {
|
||||
|
|
|
@ -30,7 +30,7 @@ pub fn test_main() {
|
|||
Ok(name) => {
|
||||
info!("Test: {} passed", name);
|
||||
pass += 1;
|
||||
},
|
||||
}
|
||||
Err(name) => {
|
||||
error!("Test: {} failed", name);
|
||||
fail += 1;
|
||||
|
|
9
rlbuild/readme.md
Normal file
9
rlbuild/readme.md
Normal file
|
@ -0,0 +1,9 @@
|
|||
# RLBuild
|
||||
|
||||
|
||||
## Repos
|
||||
rlbuild was built with the ability to point to multiple repos to fetch packages
|
||||
|
||||
repos have a url in the format
|
||||
|
||||
repos.ablecorp.us/<repo_name>/<?sub_repo_name>/<pkg_name>
|
|
@ -1,7 +1,10 @@
|
|||
#![feature(slice_take)]
|
||||
#![allow(special_module_name)]
|
||||
|
||||
use std::{fs::{self, File}, io::Write};
|
||||
use std::{
|
||||
fs::{self, File},
|
||||
io::Write,
|
||||
};
|
||||
|
||||
use rlisp_library::{
|
||||
Environ,
|
||||
|
@ -9,6 +12,10 @@ use rlisp_library::{
|
|||
RispError, default_env, parse_eval,
|
||||
};
|
||||
|
||||
mod packages;
|
||||
|
||||
|
||||
|
||||
fn extend_environ<'a>(mut env: Environ<'a>) -> Environ<'a> {
|
||||
env.data.insert(
|
||||
"quit".to_string(),
|
||||
|
@ -83,21 +90,55 @@ fn extend_environ<'a>(mut env: Environ<'a>) -> Environ<'a> {
|
|||
"use-repo".to_string(),
|
||||
Expr::Func(|args: &[Expr]| -> Result<Expr, RispError> {
|
||||
let repo_name = &args[0].clone();
|
||||
let mut repo_name_str = repo_name.to_string();
|
||||
repo_name_str.remove(0);
|
||||
|
||||
|
||||
|
||||
let repo_url = &args[1].clone();
|
||||
let use_sources = &args[2].clone();
|
||||
|
||||
let msg = match use_sources {
|
||||
Bool(b) => match b {
|
||||
true => "building from sources.",
|
||||
false => "downloading binaries.",
|
||||
true => "build_from_src = true",
|
||||
false => "build_from_src = false",
|
||||
},
|
||||
_ => {
|
||||
panic!("AHHH");
|
||||
}
|
||||
};
|
||||
|
||||
let path = format!("out/system/repos");
|
||||
fs::create_dir_all(path).unwrap();
|
||||
|
||||
let path = format!("out/system/repos/{}.repo", repo_name_str);
|
||||
println!("repo name {} repo url {} {}", repo_name, repo_url, msg);
|
||||
|
||||
let mut file = File::create(path).unwrap();
|
||||
let msg = format!("url = {}\n{}", repo_url, msg);
|
||||
let _ = file.write(msg.as_bytes());
|
||||
|
||||
Ok(Expr::Bool(true))
|
||||
}),
|
||||
);
|
||||
env.data.insert(
|
||||
"bootloader-install".to_string(),
|
||||
Expr::Func(|_args: &[Expr]| -> Result<Expr, RispError> {
|
||||
// let loader_name = &args[1].clone();
|
||||
// let mut loader_name_str = loader_name.to_string();
|
||||
// loader_name_str.remove(0);
|
||||
|
||||
let path = format!("out/boot/limine");
|
||||
fs::create_dir_all(path).unwrap();
|
||||
|
||||
let path = format!("out/boot/limine/config.rl");
|
||||
let mut file = File::create(path).unwrap();
|
||||
let _ = file.write_all(b"()");
|
||||
|
||||
let path = format!("out/boot/limine/limine.conf");
|
||||
let mut file = File::create(path).unwrap();
|
||||
let _ = file.write_all(b"");
|
||||
|
||||
Ok(Expr::Bool(true))
|
||||
}),
|
||||
);
|
||||
|
@ -107,12 +148,27 @@ fn extend_environ<'a>(mut env: Environ<'a>) -> Environ<'a> {
|
|||
Expr::Func(|args: &[Expr]| -> Result<Expr, RispError> {
|
||||
let repo_name = &args[0].clone();
|
||||
let pkg_name = &args[1].clone();
|
||||
// let root_package_path = env.data.get("system-path").unwrap();
|
||||
let mut pkg_name_str = pkg_name.to_string();
|
||||
pkg_name_str.remove(0);
|
||||
|
||||
println!("installing package {} from repo {}", pkg_name, repo_name);
|
||||
let path = format!("out/programs/{}", pkg_name);
|
||||
println!(
|
||||
"installing package {} from repo {}",
|
||||
pkg_name_str, repo_name
|
||||
);
|
||||
let path = format!("out/programs/{}", pkg_name_str);
|
||||
fs::create_dir_all(path).unwrap();
|
||||
|
||||
let path = format!("out/programs/{}/src", pkg_name_str);
|
||||
fs::create_dir_all(path).unwrap();
|
||||
|
||||
|
||||
let path = format!("out/programs/{}/app.axe", pkg_name_str);
|
||||
let mut file = File::create(path).unwrap();
|
||||
|
||||
|
||||
let _ = file.write_all(b"");
|
||||
|
||||
|
||||
// TODO: build the code with the hblang compiler.
|
||||
// TODO: use the meta.rli to map dependencies.
|
||||
|
||||
|
@ -124,18 +180,19 @@ fn extend_environ<'a>(mut env: Environ<'a>) -> Environ<'a> {
|
|||
"pkg-configure".to_string(),
|
||||
Expr::Func(|args: &[Expr]| -> Result<Expr, RispError> {
|
||||
let pkg_name = &args[0].clone();
|
||||
let repo_name = &args[1].clone();
|
||||
println!("{}", repo_name);
|
||||
let mut pkg_name_str = pkg_name.to_string();
|
||||
pkg_name_str.remove(0);
|
||||
|
||||
println!("configuring package {}", pkg_name);
|
||||
println!("installing package {}.", pkg_name_str);
|
||||
let path = format!("out/programs/{}/config.rl", pkg_name_str);
|
||||
|
||||
println!("configuring package {}", pkg_name_str);
|
||||
// TODO: build the code with the hblang compiler.
|
||||
// TODO: use the meta.rli to map dependencies.
|
||||
let path = format!("out/programs/{}/config.rl", pkg_name);
|
||||
let mut file = File::create(path).unwrap();
|
||||
|
||||
let _ = file.write_all(b"()");
|
||||
|
||||
|
||||
Ok(Expr::Bool(true))
|
||||
}),
|
||||
);
|
||||
|
@ -251,5 +308,11 @@ fn main() {
|
|||
}
|
||||
}
|
||||
|
||||
let path = format!("out/system/config.rl");
|
||||
|
||||
let mut file = File::create(path).unwrap();
|
||||
|
||||
let _ = file.write_all(cfg.as_bytes());
|
||||
|
||||
// TODO: unmount the disk image here.
|
||||
}
|
||||
|
|
24
rlbuild/src/packages.rs
Normal file
24
rlbuild/src/packages.rs
Normal file
|
@ -0,0 +1,24 @@
|
|||
pub enum GitOrRepo {
|
||||
Git(String),
|
||||
Repo(String)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
pub struct Package {
|
||||
name: String,
|
||||
authors: Vec<String>,
|
||||
tags: Vec<String>,
|
||||
version: u8,
|
||||
depends: Vec<(String, String)>,
|
||||
git_or_repo: GitOrRepo,
|
||||
}
|
||||
impl Package{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -3,7 +3,7 @@ render := @use("lib:render")
|
|||
psf := @embed("sysdata:assets/consolefonts/tamsyn/10x20r.psf")
|
||||
|
||||
Assets := struct {
|
||||
font: render.text.Font
|
||||
font: render.text.Font,
|
||||
|
||||
new := fn(): Self {
|
||||
font := render.text.font_from_psf2(@bitcast(&psf), false)
|
||||
|
|
|
@ -4,7 +4,6 @@ sunset := @use("lib:sunset_proto")
|
|||
assets := @use("assets.hb")
|
||||
stn := @use("stn")
|
||||
|
||||
|
||||
Editor := struct {
|
||||
msg: ?^u8,
|
||||
|
||||
|
@ -16,7 +15,6 @@ Editor := struct {
|
|||
theme: theme.Theme,
|
||||
window: sunset.client.Window,
|
||||
|
||||
|
||||
new := fn(): Self {
|
||||
sunset.client.find_server()
|
||||
|
||||
|
@ -27,11 +25,11 @@ Editor := struct {
|
|||
stn.log.error("got no window")
|
||||
die
|
||||
}
|
||||
return Self.(null, assets.Assets.new() true, theme.Theme.new(), window)
|
||||
return Self.(null, assets.Assets.new(), true, theme.Theme.new(), window)
|
||||
}
|
||||
|
||||
clear := fn(self: Self): void {
|
||||
// self.window.surface.clear(self.theme.bg_color)
|
||||
self.window.surface.clear(self.theme.bg_color)
|
||||
}
|
||||
|
||||
frame_sync := fn(self: Self): void {
|
||||
|
@ -59,7 +57,6 @@ Editor := struct {
|
|||
frame_render := fn(self: Self): void {
|
||||
// TODO: Render text here with a loop to iterate through Ropes.
|
||||
|
||||
|
||||
if self.line_lines self.theme_render()
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,6 @@ rope := @use("rope.hb")
|
|||
theme := @use("theme.hb");
|
||||
.{Theme} := theme
|
||||
|
||||
|
||||
psf := @embed("sysdata:assets/consolefonts/tamsyn/10x20r.psf")
|
||||
img := @embed("sysdata:assets/wallpaper.qoi");
|
||||
.{Editor} := @use("editor.hb")
|
||||
|
@ -61,7 +60,6 @@ main := fn(): void {
|
|||
// +++ Input +++
|
||||
editor.handle_input()
|
||||
|
||||
|
||||
// +++ RENDER +++
|
||||
editor.frame_render()
|
||||
// if editor.line_lines editor.theme_render()
|
||||
|
|
|
@ -4,12 +4,10 @@ render := @use("lib:render")
|
|||
stn := @use("stn");
|
||||
.{log} := stn;
|
||||
|
||||
|
||||
Tools := struct {
|
||||
pen_size: u8 = 10,
|
||||
bg_colour: render.Color = render.WHITE,
|
||||
pen_colour: render.Color = render.BLACK,
|
||||
|
||||
}
|
||||
|
||||
main := fn(): void {
|
||||
|
|
|
@ -61,19 +61,19 @@ main := fn(): int {
|
|||
text_label.set_color(sunset.server.DECO_COLOUR, render.BLACK)
|
||||
|
||||
loop {
|
||||
mouse_event := intouch.recieve_mouse_event()
|
||||
if mouse_event != null {
|
||||
mouse.x = clamp(int, mouse.x + mouse_event.x_change, mouse.cursor_width + 1, @bitcast(screen.width - mouse.cursor_width - 1))
|
||||
mouse.y = clamp(int, mouse.y - mouse_event.y_change, mouse.cursor_width + 1, @bitcast(screen.height - mouse.cursor_width - 1))
|
||||
// mouse_event := intouch.recieve_mouse_event()
|
||||
// if mouse_event != null {
|
||||
// mouse.x = clamp(int, mouse.x + mouse_event.x_change, mouse.cursor_width + 1, @bitcast(screen.width - mouse.cursor_width - 1))
|
||||
// mouse.y = clamp(int, mouse.y - mouse_event.y_change, mouse.cursor_width + 1, @bitcast(screen.height - mouse.cursor_width - 1))
|
||||
|
||||
if mouse_event.left {
|
||||
text_label.set_label_text("LEFT CLICK")
|
||||
} else if mouse_event.middle {
|
||||
text_label.set_label_text("MIDDLE CLICK")
|
||||
} else if mouse_event.right {
|
||||
text_label.set_label_text("RIGHT CLICK")
|
||||
}
|
||||
}
|
||||
// if mouse_event.left {
|
||||
// text_label.set_label_text("LEFT CLICK")
|
||||
// } else if mouse_event.middle {
|
||||
// text_label.set_label_text("MIDDLE CLICK")
|
||||
// } else if mouse_event.right {
|
||||
// text_label.set_label_text("RIGHT CLICK")
|
||||
// }
|
||||
// }
|
||||
{
|
||||
screen.put_surface(wallpaper, .(0, 0), false)
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
'resolution 1024 768 24
|
||||
'timeout 10)
|
||||
|
||||
(bootloader-install 'bootloader-limine)
|
||||
|
||||
;;;;;;;;;;;;;
|
||||
;; DRIVERS ;;
|
||||
|
@ -43,6 +44,7 @@
|
|||
(pkg-install 'core 'vfsaur)
|
||||
|
||||
(pkg-install 'core 'angels-halo)
|
||||
(pkg-configure 'angels-halo)
|
||||
|
||||
(pkg-install 'core 'sunset)
|
||||
(pkg-install 'core 'cluster)
|
||||
|
|
|
@ -38,17 +38,17 @@ path = "boot:///ps2_mouse_driver.hbf"
|
|||
# [boot.limine.ableos.modules.ps2_driver]
|
||||
# path = "boot:///ps2_driver.hbf"
|
||||
|
||||
[boot.limine.ableos.modules.sunset_client]
|
||||
path = "boot:///sunset_client.hbf"
|
||||
# [boot.limine.ableos.modules.sunset_client]
|
||||
# path = "boot:///sunset_client.hbf"
|
||||
|
||||
[boot.limine.ableos.modules.adit]
|
||||
path = "boot:///adit.hbf"
|
||||
|
||||
[boot.limine.ableos.modules.ablefetch]
|
||||
path = "boot:///ablefetch.hbf"
|
||||
# [boot.limine.ableos.modules.ablefetch]
|
||||
# path = "boot:///ablefetch.hbf"
|
||||
|
||||
[boot.limine.ableos.modules.sketchpad]
|
||||
path = "boot:///sketchpad.hbf"
|
||||
# [boot.limine.ableos.modules.sketchpad]
|
||||
# path = "boot:///sketchpad.hbf"
|
||||
|
||||
# [boot.limine.ableos.modules.angels_halo]
|
||||
# path = "boot:///angels_halo.hbf"
|
||||
|
|
Loading…
Reference in a new issue