From cc232721ad21e4f714467c56dfe064207e77db61 Mon Sep 17 00:00:00 2001 From: david Date: Mon, 5 Oct 2026 23:08:45 -0300 Subject: rewrote basic functionality to C. there are no colors just yet --- .github/dependabot.yml | 10 - .github/workflows/ci.yml | 32 -- .github/workflows/package-win.yml | 285 ------------ .github/workflows/package.yml | 170 ------- .github/workflows/release.yml | 265 ----------- .gitignore | 33 +- Cargo.lock | 682 ---------------------------- Cargo.toml | 37 -- Makefile | 28 ++ README.md | 132 +----- defs/all.h | 15 + defs/mikuart.h | 737 +++++++++++++++++++++++++++++++ src/color.rs | 617 -------------------------- src/colors.c | 3 + src/main.c | 357 +++++++++++++++ src/main.rs | 905 -------------------------------------- src/mikuart.rs | 703 ----------------------------- tests/integration_tests.rs | 129 ------ 18 files changed, 1154 insertions(+), 3986 deletions(-) delete mode 100644 .github/dependabot.yml delete mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/package-win.yml delete mode 100644 .github/workflows/package.yml delete mode 100644 .github/workflows/release.yml delete mode 100644 Cargo.lock delete mode 100644 Cargo.toml create mode 100644 Makefile create mode 100644 defs/all.h create mode 100644 defs/mikuart.h delete mode 100644 src/color.rs create mode 100644 src/colors.c create mode 100644 src/main.c delete mode 100644 src/main.rs delete mode 100644 src/mikuart.rs delete mode 100644 tests/integration_tests.rs diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 98e44ee..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,10 +0,0 @@ -version: 2 -updates: - - package-ecosystem: "cargo" - directory: "/" - schedule: - interval: "weekly" - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "weekly" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 63e65ae..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: CI - -on: - push: - branches: [ main, master ] - pull_request: - branches: [ main, master ] - -env: - CARGO_TERM_COLOR: always - -jobs: - test: - name: Test - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - - - name: Check formatting - run: cargo fmt -- --check - - - name: Run clippy - run: cargo clippy --all-targets -- -D warnings - - - name: Run tests - run: cargo test --all-targets --verbose - - - name: Build - run: cargo build --verbose diff --git a/.github/workflows/package-win.yml b/.github/workflows/package-win.yml deleted file mode 100644 index 53ea743..0000000 --- a/.github/workflows/package-win.yml +++ /dev/null @@ -1,285 +0,0 @@ -name: Windows Installer Packaging (Inno Setup) - -on: - release: - types: [released] - workflow_dispatch: - inputs: - tag_name: - description: 'Release Tag (e.g., v1.0.0). Leave empty to use "latest".' - required: false - default: '' - -jobs: - package-windows: - runs-on: windows-latest - permissions: - contents: write - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - - name: Get Version from Cargo.toml - id: get_version - shell: pwsh - run: | - $VersionLine = Get-Content Cargo.toml | Select-String '^version\s*=\s*"(.*)"' - if ($VersionLine.Matches.Success) { - $Version = $VersionLine.Matches.Groups[1].Value - Write-Host "Found version in Cargo.toml: $Version" - "version=$Version" | Out-File -FilePath $env:GITHUB_OUTPUT -Append - } else { - Write-Error "Could not find version in Cargo.toml" - exit 1 - } - - - name: Determine Release Tag - id: get_tag - shell: pwsh - env: - GH_TOKEN: ${{ github.token }} - run: | - $TAG = "${{ inputs.tag_name }}" - if (-not $TAG) { $TAG = "${{ github.event.release.tag_name }}" } - - if (-not $TAG) { - Write-Host "No tag provided, fetching latest release..." - $TAG = $(gh release view --json tagName --jq .tagName) - } - - if (-not $TAG) { - Write-Error "Could not determine release tag." - exit 1 - } - - Write-Host "Using Tag: $TAG" - "tag=$TAG" | Out-File -FilePath $env:GITHUB_OUTPUT -Append - - - name: Download Release Assets - env: - GH_TOKEN: ${{ github.token }} - run: | - $TAG = "${{ steps.get_tag.outputs.tag }}" - $Version = "${{ steps.get_version.outputs.version }}" - - # Download the raw binaries - gh release download $TAG -p "mikusays-windows-x86_64-$Version.exe" - gh release download $TAG -p "mikusays-windows-aarch64-$Version.exe" - - # Rename to standard names for the Inno Script - mv "mikusays-windows-x86_64-$Version.exe" "mikusays-windows-x86_64.exe" - mv "mikusays-windows-aarch64-$Version.exe" "mikusays-windows-aarch64.exe" - - - name: Generate Inno Setup Script - shell: pwsh - run: | - $Version = "${{ steps.get_version.outputs.version }}" - $InstallerName = "mikusays-windows-inst-any-$Version" - - Write-Host "Generating Inno Setup script for version: $Version" - - $issContent = @' - [Setup] - AppName=mikusays - AppVersion=__VERSION__ - AppCopyright=2025 xxanqw - AppPublisher=xxanqw - AppPublisherURL=https://xxanqw.pp.ua/ - AppSupportURL=https://github.com/xxanqw/mikusays/issues - AppUpdatesURL=https://github.com/xxanqw/mikusays/releases/latest - - AppId={{A0ED7972-D08B-48CB-8331-729D1001FF16} - - DefaultDirName={localappdata}\Programs\mikusays - DefaultGroupName=Mikusays - DisableProgramGroupPage=yes - PrivilegesRequired=lowest - - ; -- Output Configuration -- - OutputBaseFilename=__OUTFILE__ - OutputDir=. - Compression=lzma2/ultra64 - SolidCompression=yes - - ; -- Architecture Configuration -- - ArchitecturesInstallIn64BitMode=x64compatible arm64 - ArchitecturesAllowed=x64compatible arm64 - - ChangesEnvironment=yes - - [Languages] - Name: "english"; MessagesFile: "compiler:Default.isl" - - [Files] - Source: "mikusays-windows-x86_64.exe"; DestDir: "{app}"; DestName: "mikusays.exe"; Check: IsX64; Flags: ignoreversion - Source: "mikusays-windows-aarch64.exe"; DestDir: "{app}"; DestName: "mikusays.exe"; Check: IsARM64; Flags: ignoreversion - - [Icons] - Name: "{group}\Mikusays"; Filename: "{app}\mikusays.exe" - Name: "{group}\Uninstall Mikusays"; Filename: "{uninstallexe}" - - [Code] - function IsX64: Boolean; - begin - Result := Is64BitInstallMode and (ProcessorArchitecture = paX64); - end; - - function IsARM64: Boolean; - begin - Result := Is64BitInstallMode and (ProcessorArchitecture = paARM64); - end; - - const - VC_REDIST_X64_URL = 'https://aka.ms/vs/17/release/vc_redist.x64.exe'; - VC_REDIST_ARM64_URL = 'https://aka.ms/vs/17/release/vc_redist.arm64.exe'; - - var - DownloadPage: TDownloadWizardPage; - - procedure InitializeWizard; - begin - DownloadPage := CreateDownloadPage(SetupMessage(msgWizardPreparing), SetupMessage(msgPreparingDesc), nil); - end; - - function NextButtonClick(CurPageID: Integer): Boolean; - var - RedistUrl, RedistFile: String; - ResultCode: Integer; - begin - Result := True; - - if CurPageID = wpReady then - begin - DownloadPage.Clear; - - if IsARM64 then - RedistUrl := VC_REDIST_ARM64_URL - else - RedistUrl := VC_REDIST_X64_URL; - - RedistFile := 'vc_redist.exe'; - - DownloadPage.Add(RedistUrl, RedistFile, ''); - DownloadPage.Show; - - try - try - DownloadPage.Download; - Exec(ExpandConstant('{tmp}\' + RedistFile), '/install /quiet /norestart', '', SW_HIDE, ewWaitUntilTerminated, ResultCode); - except - if MsgBox('Download of Visual C++ Redistributable failed: ' + GetExceptionMessage + #13#10#13#10 + 'Do you want to continue installation anyway?', mbError, MB_YESNO) = IDNO then - Result := False; - end; - finally - DownloadPage.Hide; - end; - end; - end; - - function NeedsAddPath(Param: string): boolean; - var - OrigPath: string; - begin - if not RegQueryStringValue(HKEY_CURRENT_USER, 'Environment', 'Path', OrigPath) then - begin - Result := True; - exit; - end; - Result := Pos(';' + Param + ';', ';' + OrigPath + ';') = 0; - end; - - procedure RemovePath(Param: string); - var - OrigPath: string; - P: Integer; - begin - if not RegQueryStringValue(HKEY_CURRENT_USER, 'Environment', 'Path', OrigPath) then - exit; - - P := Pos(';' + Param + ';', OrigPath); - if P > 0 then - begin - Delete(OrigPath, P + 1, Length(Param) + 1); - RegWriteExpandStringValue(HKEY_CURRENT_USER, 'Environment', 'Path', OrigPath); - exit; - end; - - if Pos(Param + ';', OrigPath) = 1 then - begin - Delete(OrigPath, 1, Length(Param) + 1); - RegWriteExpandStringValue(HKEY_CURRENT_USER, 'Environment', 'Path', OrigPath); - exit; - end; - - P := Pos(';' + Param, OrigPath); - if (P > 0) and (P = Length(OrigPath) - Length(Param)) then - begin - Delete(OrigPath, P, Length(Param) + 1); - RegWriteExpandStringValue(HKEY_CURRENT_USER, 'Environment', 'Path', OrigPath); - end; - end; - - procedure CurStepChanged(CurStep: TSetupStep); - var - OrigPath: string; - begin - if CurStep = ssPostInstall then - begin - if NeedsAddPath(ExpandConstant('{app}')) then - begin - if RegQueryStringValue(HKEY_CURRENT_USER, 'Environment', 'Path', OrigPath) then - begin - if OrigPath = '' then - OrigPath := ExpandConstant('{app}') - else - OrigPath := OrigPath + ';' + ExpandConstant('{app}'); - end - else - OrigPath := ExpandConstant('{app}'); - - RegWriteExpandStringValue(HKEY_CURRENT_USER, 'Environment', 'Path', OrigPath); - end; - end; - end; - - procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep); - begin - if CurUninstallStep = usUninstall then - begin - RemovePath(ExpandConstant('{app}')); - end; - end; - '@ - - $issContent = $issContent.Replace("__VERSION__", $Version) - $issContent = $issContent.Replace("__OUTFILE__", $InstallerName) - - Set-Content -Path "installer.iss" -Value $issContent - - - name: List workspace contents for debug - shell: pwsh - run: | - Write-Host "-- Workspace Contents --" - Get-ChildItem -File | ForEach-Object { Write-Host $_.Name } - - - name: Compile Installer - shell: cmd - run: '"C:\Program Files (x86)\Inno Setup 6\ISCC.exe" installer.iss' - - - name: Upload Installer to Release - env: - GH_TOKEN: ${{ github.token }} - run: | - $TAG = "${{ steps.get_tag.outputs.tag }}" - $Version = "${{ steps.get_version.outputs.version }}" - - # With OutputDir=. the file is in root - $UploadFile = "mikusays-windows-inst-any-$Version.exe" - - if (-not (Test-Path $UploadFile)) { - Write-Error "Could not find compiled installer at $UploadFile" - Get-ChildItem - exit 1 - } - - gh release upload $TAG $UploadFile --clobber diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml deleted file mode 100644 index 7c1867c..0000000 --- a/.github/workflows/package.yml +++ /dev/null @@ -1,170 +0,0 @@ -name: Build Packages -permissions: - contents: read - -on: - release: - types: [created] - workflow_dispatch: - inputs: - release_tag: - description: 'Release tag to attach packages to (e.g., v0.1.3)' - required: false - type: string - -jobs: - build-deb: - name: Build DEB Package (${{ matrix.arch }}) - permissions: - contents: write - runs-on: ubuntu-latest - strategy: - matrix: - include: - - arch: x86_64 - target: x86_64-unknown-linux-gnu - - arch: aarch64 - target: aarch64-unknown-linux-gnu - steps: - - uses: actions/checkout@v4 - - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - targets: ${{ matrix.target }} - - - name: Install cross-compilation tools - if: matrix.arch == 'aarch64' - run: | - sudo apt-get update - sudo apt-get install -y gcc-aarch64-linux-gnu - - - name: Install cargo-deb - run: cargo install cargo-deb - - - name: Build DEB package - run: cargo deb --target ${{ matrix.target }} - env: - CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc - - - name: Find DEB package - id: find-deb - run: | - DEB_PATH=$(find target/${{ matrix.target }}/debian -name "*.deb" | head -n 1) - echo "path=$DEB_PATH" >> $GITHUB_OUTPUT - VERSION=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].version') - DEB_NAME="mikusays-debian-${{ matrix.arch }}-${VERSION}.deb" - echo "version=$VERSION" >> $GITHUB_OUTPUT - echo "name=$DEB_NAME" >> $GITHUB_OUTPUT - - - name: Upload DEB artifact - uses: actions/upload-artifact@v4 - with: - name: deb-package-${{ matrix.arch }} - path: ${{ steps.find-deb.outputs.path }} - - - name: Upload to release - if: github.event_name == 'release' || github.event.inputs.release_tag - env: - GH_TOKEN: ${{ github.token }} - RELEASE_TAG: ${{ github.event.release.tag_name || github.event.inputs.release_tag }} - run: | - install -m 0644 "${{ steps.find-deb.outputs.path }}" \ - "$RUNNER_TEMP/${{ steps.find-deb.outputs.name }}" - gh release upload "$RELEASE_TAG" \ - "$RUNNER_TEMP/${{ steps.find-deb.outputs.name }}" \ - --repo "$GITHUB_REPOSITORY" \ - --clobber - - build-rpm: - name: Build RPM Package (${{ matrix.arch }}) - permissions: - contents: write - runs-on: ubuntu-latest - strategy: - matrix: - include: - - arch: x86_64 - target: x86_64-unknown-linux-gnu - - arch: aarch64 - target: aarch64-unknown-linux-gnu - steps: - - uses: actions/checkout@v4 - - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - targets: ${{ matrix.target }} - - - name: Install cross-compilation tools - if: matrix.arch == 'aarch64' - run: | - sudo apt-get update - sudo apt-get install -y gcc-aarch64-linux-gnu - - - name: Install cargo-generate-rpm - run: cargo install cargo-generate-rpm - - - name: Build release binary - run: cargo build --release --target ${{ matrix.target }} - env: - CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc - - - name: Strip binary - run: | - if [ "${{ matrix.arch }}" = "aarch64" ]; then - aarch64-linux-gnu-strip target/${{ matrix.target }}/release/mikusays - else - strip target/${{ matrix.target }}/release/mikusays - fi - - - name: Generate RPM package - run: cargo generate-rpm --target ${{ matrix.target }} - - - name: Find RPM package - id: find-rpm - run: | - RPM_PATH=$(find target/${{ matrix.target }}/generate-rpm -name "*.rpm" | head -n 1) - echo "path=$RPM_PATH" >> $GITHUB_OUTPUT - VERSION=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].version') - RPM_NAME="mikusays-redhat-${{ matrix.arch }}-${VERSION}.rpm" - echo "version=$VERSION" >> $GITHUB_OUTPUT - echo "name=$RPM_NAME" >> $GITHUB_OUTPUT - - - name: Upload RPM artifact - uses: actions/upload-artifact@v4 - with: - name: rpm-package-${{ matrix.arch }} - path: ${{ steps.find-rpm.outputs.path }} - - - name: Upload to release - if: github.event_name == 'release' || github.event.inputs.release_tag - env: - GH_TOKEN: ${{ github.token }} - RELEASE_TAG: ${{ github.event.release.tag_name || github.event.inputs.release_tag }} - run: | - install -m 0644 "${{ steps.find-rpm.outputs.path }}" \ - "$RUNNER_TEMP/${{ steps.find-rpm.outputs.name }}" - gh release upload "$RELEASE_TAG" \ - "$RUNNER_TEMP/${{ steps.find-rpm.outputs.name }}" \ - --repo "$GITHUB_REPOSITORY" \ - --clobber - - notify-package-repository: - name: Notify package repository - runs-on: ubuntu-latest - needs: [build-deb, build-rpm] - if: github.event_name == 'release' || github.event.inputs.release_tag - permissions: - contents: read - steps: - - name: Dispatch exact release tag - env: - GH_TOKEN: ${{ secrets.RELEASE_TOKEN }} - RELEASE_TAG: ${{ github.event.release.tag_name || github.event.inputs.release_tag }} - run: | - if ! gh api --method POST repos/xxanqw/apt-repository/dispatches \ - --raw-field event_type=new-release \ - --field "client_payload[tag_name]=$RELEASE_TAG"; then - echo "::warning::Could not dispatch apt-repository; its daily schedule will publish the release. Check RELEASE_TOKEN if immediate updates are required." - fi diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 8ed17a4..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,265 +0,0 @@ -name: Cross-platform Build - -on: - push: - tags: [ 'v*' ] - workflow_dispatch: - -permissions: - contents: write - -jobs: - extract-version: - name: Extract Version - runs-on: ubuntu-latest - outputs: - version: ${{ steps.get_version.outputs.version }} - version_valid: ${{ steps.validate_version.outputs.valid }} - steps: - - uses: actions/checkout@v4 - - - name: Get version from Cargo.toml - id: get_version - run: | - VERSION=$(grep '^version =' Cargo.toml | sed -E 's/version = "([^"]+)"/\1/') - echo "Extracted version: $VERSION" - echo "version=$VERSION" >> $GITHUB_OUTPUT - - - name: Validate SemVer - id: validate_version - run: | - VERSION=${{ steps.get_version.outputs.version }} - # Comprehensive SemVer validation regex - # Supports: MAJOR.MINOR.PATCH-PRERELEASE+BUILD - # Where PRERELEASE can be: alpha, beta, rc.1, etc. - # Where BUILD can be: build.123, sha.abc123, etc. - if [[ ! $VERSION =~ ^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-([0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*))?(\+([0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*))?$ ]]; then - echo "Error: Version '$VERSION' is not a valid SemVer string" - echo "valid=false" >> $GITHUB_OUTPUT - exit 1 - else - echo "Version '$VERSION' is valid SemVer" - echo "valid=true" >> $GITHUB_OUTPUT - fi - - build-windows: - name: Build Windows - runs-on: windows-latest - needs: extract-version - strategy: - matrix: - target: - - x86_64-pc-windows-msvc - - aarch64-pc-windows-msvc - steps: - - uses: actions/checkout@v4 - - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - targets: ${{ matrix.target }} - - - name: Build - run: cargo build --release --target ${{ matrix.target }} - - - name: Prepare artifact - run: | - mkdir artifacts - $arch = "${{ matrix.target }}".Split('-')[0] - $version = "${{ needs.extract-version.outputs.version }}" - copy "target\${{ matrix.target }}\release\mikusays.exe" "artifacts\mikusays-windows-$arch-$version.exe" - - - name: Upload artifact - uses: actions/upload-artifact@v4 - with: - name: mikusays-windows-${{ matrix.target }} - path: artifacts\* - build-linux: - name: Build Linux - runs-on: ubuntu-latest - needs: extract-version - strategy: - matrix: - include: - - target: x86_64-unknown-linux-gnu - arch: x64 - - target: aarch64-unknown-linux-gnu - arch: arm64 - steps: - - uses: actions/checkout@v4 - - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - targets: ${{ matrix.target }} - - - name: Install cross-compilation tools - if: matrix.target == 'aarch64-unknown-linux-gnu' - run: | - sudo apt-get update - sudo apt-get install -y gcc-aarch64-linux-gnu - echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV - - - name: Build - run: cargo build --release --target ${{ matrix.target }} - - - name: Strip binary - run: | - if [[ "${{ matrix.target }}" == "aarch64-unknown-linux-gnu" ]]; then - aarch64-linux-gnu-strip target/${{ matrix.target }}/release/mikusays - else - strip target/${{ matrix.target }}/release/mikusays - fi - - - name: Prepare artifact - run: | - mkdir -p artifacts staging - version="${{ needs.extract-version.outputs.version }}" - stem="mikusays-linux-${{ matrix.arch }}-$version" - cp target/${{ matrix.target }}/release/mikusays "staging/$stem" - chmod 755 "staging/$stem" - tar -C staging -czf "artifacts/$stem.tar.gz" "$stem" - - - name: Verify artifact - run: | - version="${{ needs.extract-version.outputs.version }}" - stem="mikusays-linux-${{ matrix.arch }}-$version" - extract_dir="$(mktemp -d)" - tar -tzf "artifacts/$stem.tar.gz" | grep -Fx "$stem" - tar -xzf "artifacts/$stem.tar.gz" -C "$extract_dir" - test -x "$extract_dir/$stem" - - - name: Upload artifact - uses: actions/upload-artifact@v4 - with: - name: mikusays-linux-${{ matrix.arch }} - path: artifacts/* - build-macos: - name: Build macOS - runs-on: macos-latest - needs: extract-version - strategy: - matrix: - include: - - target: x86_64-apple-darwin - arch: x64 - - target: aarch64-apple-darwin - arch: arm64 - steps: - - uses: actions/checkout@v4 - - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - targets: ${{ matrix.target }} - - - name: Build - run: cargo build --release --target ${{ matrix.target }} - - - name: Strip binary - run: strip target/${{ matrix.target }}/release/mikusays - - - name: Prepare artifact - run: | - mkdir -p artifacts staging - version="${{ needs.extract-version.outputs.version }}" - stem="mikusays-macos-${{ matrix.arch }}-$version" - cp target/${{ matrix.target }}/release/mikusays "staging/$stem" - chmod 755 "staging/$stem" - tar -C staging -czf "artifacts/$stem.tar.gz" "$stem" - - - name: Verify artifact - run: | - version="${{ needs.extract-version.outputs.version }}" - stem="mikusays-macos-${{ matrix.arch }}-$version" - extract_dir="$(mktemp -d)" - tar -tzf "artifacts/$stem.tar.gz" | grep -Fx "$stem" - tar -xzf "artifacts/$stem.tar.gz" -C "$extract_dir" - test -x "$extract_dir/$stem" - - - name: Upload artifact - uses: actions/upload-artifact@v4 - with: - name: mikusays-macos-${{ matrix.arch }} - path: artifacts/* - - create-release: - name: Create Release - runs-on: ubuntu-latest - needs: [extract-version, build-windows, build-linux, build-macos] - if: startsWith(github.ref, 'refs/tags/v') && needs.extract-version.outputs.version_valid == 'true' - steps: - - uses: actions/checkout@v4 - - - name: Download all artifacts - uses: actions/download-artifact@v4 - with: - path: artifacts - merge-multiple: true - - - name: Display structure of downloaded files - run: ls -R artifacts - - - name: Create Release - uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3 - with: - files: artifacts/mikusays-* - draft: false - prerelease: false - generate_release_notes: true - body: | - ## Downloads - - ### Windows - - **x64**: `mikusays-windows-x86_64-${{ needs.extract-version.outputs.version }}.exe` - - **ARM64**: `mikusays-windows-aarch64-${{ needs.extract-version.outputs.version }}.exe` - - ### Windows Installer - - **Any**: `mikusays-windows-inst-any-${{ needs.extract-version.outputs.version }}.exe` - - ### Linux (tar.gz) - - **x64**: `mikusays-linux-x64-${{ needs.extract-version.outputs.version }}.tar.gz` - - **ARM64**: `mikusays-linux-arm64-${{ needs.extract-version.outputs.version }}.tar.gz` - - ### Debian Package - - **x64 Debian Package**: `mikusays-debian-x86_64-${{ needs.extract-version.outputs.version }}.deb` - - **ARM64 Debian Package**: `mikusays-debian-aarch64-${{ needs.extract-version.outputs.version }}.deb` - - ### RedHat (RPM) Package - - **x64 RPM Package**: `mikusays-redhat-x86_64-${{ needs.extract-version.outputs.version }}.rpm` - - **ARM64 RPM Package**: `mikusays-redhat-aarch64-${{ needs.extract-version.outputs.version }}.rpm` - - ### Repository for Debian / Ubuntu / Fedora / RHEL / CentOS - Information on how to add it available here https://apt.xxanqw.pp.ua - - ### macOS (tar.gz) - - **Intel (x64)**: `mikusays-macos-x64-${{ needs.extract-version.outputs.version }}.tar.gz` - - **Apple Silicon (ARM64)**: `mikusays-macos-arm64-${{ needs.extract-version.outputs.version }}.tar.gz` - - ## Usage - ```bash - # Download and extract the appropriate archive on Linux/macOS: - archive="mikusays-linux-x64-${{ needs.extract-version.outputs.version }}.tar.gz" - tar -xzf "$archive" - - # Run the program: - "./${archive%.tar.gz}" "Hello, World!" - - # If Gatekeeper blocks an unsigned macOS binary: - xattr -d com.apple.quarantine "./${archive%.tar.gz}" - ``` - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Notify package managers - env: - GH_TOKEN: ${{ secrets.RELEASE_TOKEN }} - RELEASE_TAG: v${{ needs.extract-version.outputs.version }} - run: | - for repository in xxanqw/scoop-bucket xxanqw/homebrew-mikusays; do - if ! gh api --method POST "repos/$repository/dispatches" \ - --raw-field event_type=new-release \ - --field "client_payload[tag_name]=$RELEASE_TAG"; then - echo "::warning::Could not dispatch $repository; its four-hour schedule will pick up the release. Check RELEASE_TOKEN if immediate updates are required." - fi - done diff --git a/.gitignore b/.gitignore index 4b18fc9..17fb64e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,30 +1,3 @@ -# Rust -/target/ - -# IDE -.vscode/ -.idea/ -*.swp -*.swo -*~ - -# OS -.DS_Store -Thumbs.db - -# Build artifacts -*.exe -*.dll -*.so -*.dylib - -# Backup files -*.bak -*.backup - -# Log files -*.log - -# Temporary files -*.tmp -*.temp +# build stuff +obj/ +build/ diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index 8626b3d..0000000 --- a/Cargo.lock +++ /dev/null @@ -1,682 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 4 - -[[package]] -name = "anstream" -version = "0.6.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "301af1932e46185686725e0fad2f8f2aa7da69dd70bf6ecc44d6b703844a3933" -dependencies = [ - "anstyle", - "anstyle-parse", - "anstyle-query", - "anstyle-wincon", - "colorchoice", - "is_terminal_polyfill", - "utf8parse", -] - -[[package]] -name = "anstyle" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "862ed96ca487e809f1c8e5a8447f6ee2cf102f846893800b20cebdf541fc6bbd" - -[[package]] -name = "anstyle-parse" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" -dependencies = [ - "utf8parse", -] - -[[package]] -name = "anstyle-query" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8bdeb6047d8983be085bab0ba1472e6dc604e7041dbf6fcd5e71523014fae9" -dependencies = [ - "windows-sys 0.59.0", -] - -[[package]] -name = "anstyle-wincon" -version = "3.0.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "403f75924867bb1033c59fbf0797484329750cfbe3c4325cd33127941fabc882" -dependencies = [ - "anstyle", - "once_cell_polyfill", - "windows-sys 0.59.0", -] - -[[package]] -name = "autocfg" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" - -[[package]] -name = "bitflags" -version = "2.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" - -[[package]] -name = "cfg-if" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" - -[[package]] -name = "clap" -version = "4.5.57" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6899ea499e3fb9305a65d5ebf6e3d2248c5fab291f300ad0a704fbe142eae31a" -dependencies = [ - "clap_builder", - "clap_derive", -] - -[[package]] -name = "clap_builder" -version = "4.5.57" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b12c8b680195a62a8364d16b8447b01b6c2c8f9aaf68bee653be34d4245e238" -dependencies = [ - "anstream", - "anstyle", - "clap_lex", - "strsim", -] - -[[package]] -name = "clap_derive" -version = "4.5.55" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a92793da1a46a5f2a02a6f4c46c6496b28c43638adea8306fcb0caa1634f24e5" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "clap_lex" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b94f61472cee1439c0b966b47e3aca9ae07e45d070759512cd390ea2bebc6675" - -[[package]] -name = "colorchoice" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" - -[[package]] -name = "convert_case" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb402b8d4c85569410425650ce3eddc7d698ed96d39a73f941b08fb63082f1e7" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "crossterm" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8b9f2e4c67f833b660cdb0a3523065869fb35570177239812ed4c905aeff87b" -dependencies = [ - "bitflags", - "crossterm_winapi", - "derive_more", - "document-features", - "mio", - "parking_lot", - "rustix", - "signal-hook", - "signal-hook-mio", - "winapi", -] - -[[package]] -name = "crossterm_winapi" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acdd7c62a3665c7f6830a51635d9ac9b23ed385797f70a83bb8bafe9c572ab2b" -dependencies = [ - "winapi", -] - -[[package]] -name = "derive_more" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "093242cf7570c207c83073cf82f79706fe7b8317e98620a47d5be7c3d8497678" -dependencies = [ - "derive_more-impl", -] - -[[package]] -name = "derive_more-impl" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" -dependencies = [ - "convert_case", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "document-features" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95249b50c6c185bee49034bcb378a49dc2b5dff0be90ff6616d31d64febab05d" -dependencies = [ - "litrs", -] - -[[package]] -name = "errno" -version = "0.3.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad" -dependencies = [ - "libc", - "windows-sys 0.60.2", -] - -[[package]] -name = "getrandom" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" -dependencies = [ - "cfg-if", - "libc", - "r-efi", - "wasi 0.14.2+wasi-0.2.4", -] - -[[package]] -name = "heck" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" - -[[package]] -name = "is_terminal_polyfill" -version = "1.70.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" - -[[package]] -name = "libc" -version = "0.2.174" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" - -[[package]] -name = "linux-raw-sys" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" - -[[package]] -name = "litrs" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" - -[[package]] -name = "lock_api" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" - -[[package]] -name = "mikusays" -version = "0.1.5" -dependencies = [ - "clap", - "crossterm", - "rand", - "unicode-width", - "winapi", -] - -[[package]] -name = "mio" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c" -dependencies = [ - "libc", - "log", - "wasi 0.11.1+wasi-snapshot-preview1", - "windows-sys 0.59.0", -] - -[[package]] -name = "once_cell_polyfill" -version = "1.70.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad" - -[[package]] -name = "parking_lot" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "smallvec", - "windows-targets 0.52.6", -] - -[[package]] -name = "ppv-lite86" -version = "0.2.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" -dependencies = [ - "zerocopy", -] - -[[package]] -name = "proc-macro2" -version = "1.0.95" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "r-efi" -version = "5.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" - -[[package]] -name = "rand" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" -dependencies = [ - "rand_chacha", - "rand_core", -] - -[[package]] -name = "rand_chacha" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" -dependencies = [ - "ppv-lite86", - "rand_core", -] - -[[package]] -name = "rand_core" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" -dependencies = [ - "getrandom", -] - -[[package]] -name = "redox_syscall" -version = "0.5.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8af0dde094006011e6a740d4879319439489813bd0bcdc7d821beaeeff48ec" -dependencies = [ - "bitflags", -] - -[[package]] -name = "rustix" -version = "1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11181fbabf243db407ef8df94a6ce0b2f9a733bd8be4ad02b4eda9602296cac8" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.60.2", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "signal-hook" -version = "0.3.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d881a16cf4426aa584979d30bd82cb33429027e42122b169753d6ef1085ed6e2" -dependencies = [ - "libc", - "signal-hook-registry", -] - -[[package]] -name = "signal-hook-mio" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34db1a06d485c9142248b7a054f034b349b212551f3dfd19c94d45a754a217cd" -dependencies = [ - "libc", - "mio", - "signal-hook", -] - -[[package]] -name = "signal-hook-registry" -version = "1.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9203b8055f63a2a00e2f593bb0510367fe707d7ff1e5c872de2f537b339e5410" -dependencies = [ - "libc", -] - -[[package]] -name = "smallvec" -version = "1.15.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" - -[[package]] -name = "strsim" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" - -[[package]] -name = "syn" -version = "2.0.104" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "unicode-ident" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" - -[[package]] -name = "unicode-segmentation" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" - -[[package]] -name = "unicode-width" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254" - -[[package]] -name = "utf8parse" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" - -[[package]] -name = "wasi" -version = "0.11.1+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" - -[[package]] -name = "wasi" -version = "0.14.2+wasi-0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" -dependencies = [ - "wit-bindgen-rt", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-sys" -version = "0.60.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" -dependencies = [ - "windows-targets 0.53.2", -] - -[[package]] -name = "windows-targets" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" -dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm 0.52.6", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", -] - -[[package]] -name = "windows-targets" -version = "0.53.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c66f69fcc9ce11da9966ddb31a40968cad001c5bedeb5c2b82ede4253ab48aef" -dependencies = [ - "windows_aarch64_gnullvm 0.53.0", - "windows_aarch64_msvc 0.53.0", - "windows_i686_gnu 0.53.0", - "windows_i686_gnullvm 0.53.0", - "windows_i686_msvc 0.53.0", - "windows_x86_64_gnu 0.53.0", - "windows_x86_64_gnullvm 0.53.0", - "windows_x86_64_msvc 0.53.0", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" - -[[package]] -name = "windows_i686_gnu" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" - -[[package]] -name = "windows_i686_msvc" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" - -[[package]] -name = "wit-bindgen-rt" -version = "0.39.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" -dependencies = [ - "bitflags", -] - -[[package]] -name = "zerocopy" -version = "0.8.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1039dd0d3c310cf05de012d8a39ff557cb0d23087fd44cad61df08fc31907a2f" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.8.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ecf5b4cc5364572d7f4c329661bcc82724222973f2cab6f050a4e5c22f75181" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] diff --git a/Cargo.toml b/Cargo.toml deleted file mode 100644 index 3bf4f61..0000000 --- a/Cargo.toml +++ /dev/null @@ -1,37 +0,0 @@ -[package] -name = "mikusays" -version = "0.1.5" -edition = "2024" -description = "A \"cowsay\" clone with Hatsune Miku ASCII art and speech bubbles." -license = "MIT" - -[package.metadata.deb] -maintainer = "Ivan Potiienko " -copyright = "2025, xxanqw " -license-file = ["LICENSE", "4"] -extended-description = """\ -A cowsay clone featuring Hatsune Miku ASCII art with speech bubbles. \ -Create fun terminal messages with various Miku styles.""" -depends = "$auto" -section = "utils" -priority = "optional" -assets = [ - ["target/release/mikusays", "usr/bin/", "755"], - ["README.md", "usr/share/doc/mikusays/", "644"], -] - -[package.metadata.generate-rpm] -assets = [ - { source = "target/release/mikusays", dest = "/usr/bin/mikusays", mode = "755" }, - { source = "README.md", dest = "/usr/share/doc/mikusays/README.md", mode = "644" }, -] - -[dependencies] -crossterm = "0.29" -unicode-width = "0.2.2" -rand = "0.9.2" -clap = { version = "4.5.57", features = ["derive"] } -# sysinfo removed; using env var heuristics instead - -# Windows console API to enable virtual terminal processing (ANSI) -winapi = { version = "0.3", features = ["consoleapi", "wincon", "processenv", "handleapi", "winbase"] } diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..8509a27 --- /dev/null +++ b/Makefile @@ -0,0 +1,28 @@ +CC = gcc +CFLAGS = -Wall -Wextra -O2 -pipe +TARGET = build/mikusays +SRC = $(wildcard src/*.c) +OBJ = $(SRC:%.c=obj/%.o) +PREFIX = /usr/local + +$(TARGET): $(OBJ) + @mkdir -p $(@D) + $(CC) $(CFLAGS) -o $(TARGET) $(OBJ) $(LDLIBS) + +install: $(TARGET) + mkdir -p $(DESTDIR)$(PREFIX)/bin + install -m 755 $(TARGET) $(DESTDIR)$(PREFIX)/bin/$(notdir $(TARGET)) + +uninstall: + rm -f $(DESTDIR)$(PREFIX)/bin/$(notdir $(TARGET)) + +obj/%.o: %.c + @mkdir -p $(@D) + $(CC) $(CFLAGS) -c $< -o $@ + +clean: + rm -f $(TARGET) $(OBJ) + +run: + make + build/mikusaysc "this is a test" diff --git a/README.md b/README.md index a182761..4524665 100644 --- a/README.md +++ b/README.md @@ -1,146 +1,36 @@
- - # MikuSays 🎤 A `cowsay` clone with Hatsune Miku ASCII art and speech bubbles. - -**NOW WITH** -COLORS +(originally written in rust, rewriten in C) -[![GitHub release (latest by date)](https://img.shields.io/github/v/release/xxanqw/mikusays?style=for-the-badge)](https://github.com/xxanqw/mikusays/releases/latest) -[![AUR Package Version](https://img.shields.io/aur/version/mikusays?style=for-the-badge)](https://aur.archlinux.org/packages/mikusays) -
## Usage ```bash -Usage: mikusays [OPTIONS] [TEXT] +mikusays "Hello, World!" # Chooses random style -Arguments: - [TEXT] Text to display in the speech bubble +mikusays "World is Mine!" --style 4 -Options: - -s, --style