Skip to content

Commit

Permalink
32 bit
Browse files Browse the repository at this point in the history
  • Loading branch information
ahqsoftwares committed Nov 27, 2024
1 parent 2b84aa5 commit ddc02c6
Show file tree
Hide file tree
Showing 15 changed files with 162 additions and 111 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,18 @@ jobs:
- target: x86_64-pc-windows-msvc
runner: windows-latest

- target: i686-pc-windows-msvc
runner: windows-latest

- target: aarch64-pc-windows-msvc
runner: windows-latest

- target: x86_64-unknown-linux-gnu
runner: ubuntu-latest

- target: i686-unknown-linux-gnu
runner: ubuntu-latest

- target: aarch64-unknown-linux-gnu
runner: ubuntu-22.04

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ jobs:
pnpm install
pnpm build
cp ./*.sh ./.vitepress/dist/
cp ./*.ps1 ./.vitepress/dist/
cp ../leadman_unix.sh ./.vitepress/dist/install.sh
cp ../leadman_windows.ps1 ./.vitepress/dist/install.ps1
cp ./*.svg ./.vitepress/dist/
working-directory: web

Expand Down
2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
".\\Cargo.toml",
".\\interpreter\\Cargo.toml",
".\\lead\\Cargo.toml",
".\\lead_docs_cli\\Cargo.toml",
".\\leadman\\Cargo.toml",
".\\packages\\core\\Cargo.toml",
".\\packages\\std\\Cargo.toml",
".\\macros\\Cargo.toml"
Expand Down
4 changes: 4 additions & 0 deletions lead_docs_cli/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
rustflags = []

[target.aarch64-unknown-linux-gnu]
linker = "aarch64-linux-gnu-gcc"
8 changes: 8 additions & 0 deletions lead_docs_cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[package]
name = "lead_docs"
version = "0.0.0-dev-lead-lang"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
3 changes: 3 additions & 0 deletions lead_docs_cli/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
println!("⚠️ Under Construction ⚠️");
}
1 change: 1 addition & 0 deletions leadman/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ rust-version = "1.81"
chalk_rs = "1.0.1"
chrono = "0.4.38"
dirs = "5.0.1"
fs_extra = "1.3.0"
indicatif = "0.17.9"
inquire = { version = "0.7.5", default-features = false, features = [
"console",
Expand Down
4 changes: 3 additions & 1 deletion leadman/src/create/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::{env::current_exe, fs, path::PathBuf};
use chalk_rs::Chalk;
use inquire::Select;

use crate::utils::{get_latest_pre, get_releases, postinstall};
use crate::{install::install, utils::{get_latest_pre, get_releases, postinstall}};

use dirs::home_dir;

Expand Down Expand Up @@ -62,6 +62,8 @@ pub async fn create(chalk: &mut Chalk) {

println!(" Installing Lead Language v{}", &version.tag_name);

install(version);

let dir = dir.to_str().unwrap();

postinstall(&dir).await;
Expand Down
5 changes: 5 additions & 0 deletions leadman/src/install/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
use crate::utils::ReleaseData;

pub fn install(release: ReleaseData) {

}
13 changes: 13 additions & 0 deletions leadman/src/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,19 @@ pub async fn get_latest_pre(data: Vec<ReleaseData>) -> (ReleaseData, ReleaseData
)
}

pub async fn get_release(tag: &str) -> ReleaseData {
let release = CLIENT
.get(format!("{}/{}", RELEASES, tag))
.send()
.await
.expect("Something went wrong!")
.json::<ReleaseData>()
.await
.expect("Something went wrong while parsing it!");

release
}

pub async fn get_releases() -> Vec<ReleaseData> {
let release = CLIENT
.get(RELEASES)
Expand Down
72 changes: 0 additions & 72 deletions leadman_unix.bash

This file was deleted.

79 changes: 79 additions & 0 deletions leadman_unix.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
#!/usr/bin/env bash

os=$(uname)
arch=$(uname -m)

BLUE="\e[34m"
RED="\e[31m"
GREEN="\e[32m"
ENDCOLOR="\e[0m"

info="${BLUE}[INFO]${ENDCOLOR}"
err="${RED}[ERRR]${ENDCOLOR}"
succ="${GREEN}[SUCC]${ENDCOLOR}"

download=""

echo -e $info Checking OS

tag_name=$(([[ $TAG_NAME != "" ]] && echo $TAG_NAME) || echo "latest")
echo -e $info Found Lead Language Version: $tag_name
if [[ $os == 'Linux' || $os == 'Darwin' || $os == 'FreeBSD' ]]; then
echo -e "$info $os detected"
case "$arch" in
x86_64)
if [[ $os == 'FreeBSD' ]]; then
echo -e "$info Lead Docs will fallback to using CLI on FreeBSD systems"
fi
target="${arch}-unknown-linux-gnu"
[[ $os == 'Darwin' ]] && target="${arch}-apple-darwin"
[[ $os == 'FreeBSD' ]] && target="${arch}-unknown-freebsd"
echo -e "$info Getting Leadman $target"
download="https://github.com/ahq-softwares/lead/releases/$([[ $tag_name == 'latest' ]] && echo 'latest/download' || echo "download/$tag_name")/leadman_$target"
;;
aarch64)
if [[ $os == 'FreeBSD' ]]; then
echo -e "$err aarch64 version of Lead Lang is not supported on FreeBSD"
exit 1
elif [[ $os == 'Linux' ]]; then
echo -e "$info Lead Docs will fallback to using CLI on Linux aarch64 systems"
fi
target="${arch}-apple-darwin"
[[ $os == 'Linux' ]] && target="${arch}-unknown-linux-gnu"
echo -e "$info Getting Leadman $target"
download="https://github.com/ahq-softwares/lead/releases/$([[ $tag_name == 'latest' ]] && echo 'latest/download' || echo "download/$tag_name")/leadman_$target"
;;
*)
echo -e "$err Unsupported architecture: $arch"
exit 1
;;
esac
else
echo -e "$err Unsupported OS: $os"
exit 1
fi
tmp=$(mktemp -d 2>/dev/null || mktemp -d -t 'mytmpdir')
echo -e $info Downloading Leadman $download
curl -L $download -o $tmp/leadman_init
chmod +x $tmp/leadman_init
echo -e $info Starting leadman
$tmp/leadman_init create
rm $tmp/leadman_init
rmdir $tmp
echo -e $succ Successfully installed 🎉
2 changes: 2 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ fn main() {

if !target.contains("bsd") && !target.contains("aarch64-unknown-linux-gnu") {
dir.push(PathBuf::from_str("./lead_docs").unwrap());
} else {
dir.push(PathBuf::from_str("./lead_docs_cli").unwrap());
}

for path in dir {
Expand Down
1 change: 1 addition & 0 deletions ver.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const values = [
"./lead/Cargo.toml",
"./leadman/Cargo.toml",
"./lead_docs/Cargo.toml",
"./lead_docs_cli/Cargo.toml",
"./packages/core/Cargo.toml",
"./packages/std/Cargo.toml",
"./interpreter/Cargo.toml",
Expand Down
69 changes: 33 additions & 36 deletions web/download.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,41 @@ sidebar: true

Lead lang is distributed by **leadman**. This article shares the script to install leadman.

## Install

:::tabs
== Linux / macOS / FreeBSD

```sh
curl -fsSL https://ahq-softwares.github.io/lead/install.sh | bash
```

== Windows (Powershell)

```sh
irm https://ahq-softwares.github.io/lead/install.ps1 | iex
```

:::

## Supported OS with Architectures

| OS | Architecture | Supported | Notes |
| ------- | :------------: | :-------: | :------------------------------ |
| Windows | x64 || |
| | arm64 || |
| | i686 (32-bit) || 32 bit is not longer widespread |
| macOS | x64 || |
| | arm64 || |
| Linux⭐ | x64 || |
| | i686 (32-bit) || 32 bit is not longer widespread |
| | arm64 | 🟨 | CI failed with lead_docs |
| | armv7 (32-bit) || 32 bit is not longer widespread |
| FreeBSD | x64 | 🟨 | Cannot be built with lead docs |
| | i686 (32-bit) || 32 bit is not longer widespread |
| | arm64 || |
| | armv7 (32-bit) || 32 bit is not longer widespread |
| NetBSD | x64 || Verified to not work |
| | i686 (32-bit) || 32 bit is not longer widespread |
| | arm64 || |
| | armv7 (32-bit) || 32 bit is not longer widespread |
| OS | Architecture | Supported | Notes |
| ------- | :------------------- | :-------: | :----------------------------- |
| Windows | x64 || |
| | arm64 || |
| | i686 (32-bit) || |
| macOS | x64 || |
| | arm64 || |
| Linux⭐ | x64 || |
| | i686, armv7 (32-bit) || |
| | arm64 | 🟨 | CI failed with lead_docs |
| FreeBSD | x64 | 🟨 | Cannot be built with lead docs |
| | i686, armv7 (32-bit) || |
| | arm64 || |
| NetBSD | x64 || Verified to not work |
| | i686, armv7 (32-bit) || |
| | arm64 || |

✅: Fully Supported

Expand All @@ -46,20 +60,3 @@ You must have the following installed for **lead docs** desktop application
You might follow [this](https://tauri.app/start/prerequisites/#linux)

:::

## Install

:::tabs
== Linux / macOS

```sh
curl -fsSL https://ahq-softwares.github.io/lead/install.sh | bash
```

== Windows (Powershell)

```sh
irm https://ahq-softwares.github.io/lead/install.ps1 | iex
```

:::

0 comments on commit ddc02c6

Please sign in to comment.