Skip to content

Commit

Permalink
chore: init
Browse files Browse the repository at this point in the history
  • Loading branch information
adamperkowski committed Jan 10, 2025
0 parents commit af54d69
Show file tree
Hide file tree
Showing 12 changed files with 202 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github: adamperkowski
custom: "https://adamperkowski.dev/donate"
49 changes: 49 additions & 0 deletions .github/workflows/jule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Jule CI
on:
push:
branches: ["main"]
pull_request:
workflow_dispatch:

jobs:
jule:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'

- name: Install JuleC
run: |
mkdir julec
cd julec
bash <(curl -s https://raw.githubusercontent.com/julelang/julec-ir/main/compile-ir.sh)
echo "$(pwd)/jule-master/bin" >> $GITHUB_PATH
cd ..
- name: Install JuleFmt
run: |
git clone https://github.com/julelang/julefmt.git --depth=1
cd julefmt
mkdir -p bin
julec --opt-deadcode -o bin/julefmt ./src
echo "$(pwd)/bin" >> $GITHUB_PATH
cd ..
- name: Build
run: |
make
- name: Test
run: |
make test
- name: Format
run: |
make format
- name: Clean up
run: |
make clean
rm -rf julec julefmt
- name: Check formatting
run: |
git diff --quiet || { echo 'Please run `make format` and push the changes.' exit 1; }
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**/*.out
**/dist
**/build
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "cliq"]
path = cliq
url = https://github.com/adamperkowski/cliq.git
[submodule "colorify"]
path = colorify
url = https://github.com/lareii/colorify.git
28 changes: 28 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
BSD 3-Clause License

Copyright (c) 2025, Adam Perkowski

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 changes: 30 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# jpu
# Copyright 2025 Adam Perkowski.
# Use of this source code is governed by the BSD 3-Clause License.
# See the LICENSE file for details.

JULEC = julec

BINARY = jpu

JULECFLAGS = -o build/$(BINARY)

all: build

build:
mkdir -p build
$(JULEC) $(JULECFLAGS) .

run: build
./build/$(BINARY)

test:
$(JULEC) test .

format:
julefmt -w .

clean:
rm -rf bin dist

.PHONY: all build run test format clean
48 changes: 48 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# JuleProtonUp (jpu)
A lightweight and fast tool for installing, updating and managing [Proton], [Proton-GE] and [Wine] versions.

jpu is written in [Jule], which is a low-level, compiled, memory-safe fast programming language.<br>
The tool's main goal is to provide a **faster** [ProtonUp] implementation. The original project is written in Python, which is quite slow.

## Installation

### Arch Linux
[jpu](https://aur.archlinux.org/packages/jpu) is available on the AUR. You can install it using an AUR helper, e.g. paru:
```sh
paru -S jpu
```

### Manual
You can either download the pre-built binaries from [GitHub releases](https://github.com/adamperkowski/jpu/releases) or [build from source](#building-from-source).<br>
With the binary downloaded, you can move it to a directory in your `PATH` variable, e.g. `/usr/bin`:
```sh
sudo mv jpu /usr/bin
```

## Usage
Documentation WIP...

## Building from source
To build jpu from source, you need to have the JuleC compiler (and [make]) installed. Please refer to [Jule's Manual][julec_installation].<br>
With the repository cloned and the submodules initialized with:
```sh
git submodule update --init
```
you can build the tool by running either:
```sh
make
```
or
```sh
mkdir -p build
julec . -o build/jpu
```
The `jpu` binary will be located in the `build` directory.

[Proton]: https://github.com/ValveSoftware/Proton
[Proton-GE]: https://github.com/GloriousEggroll/proton-ge-custom
[Wine]: https://www.winehq.org
[Jule]: https://jule.dev
[ProtonUp]: https://github.com/AUNaseef/protonup
[make]: https://www.gnu.org/software/make
[julec_installation]: https://manual.jule.dev/getting-started/installation/linux.html
1 change: 1 addition & 0 deletions cliq
Submodule cliq added at 380d78
1 change: 1 addition & 0 deletions colorify
Submodule colorify added at 46e6c7
8 changes: 8 additions & 0 deletions jpu/jpu.jule
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// jpu API
// Copyright 2025 Adam Perkowski.
// Use of this source code is governed by the BSD 3-Clause License.
// See the LICENSE file for details.

fn GetProton() {
println("Getting Proton...")
}
Empty file added jule.mod
Empty file.
26 changes: 26 additions & 0 deletions main.jule
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// jpu CLI
// Copyright 2025 Adam Perkowski.
// Use of this source code is governed by the BSD 3-Clause License.
// See the LICENSE file for details.

use "cliq/cliq"
use "colorify"
use "jpu"
use "std/maps"
use "std/slices"

static argMap: map[int][2]str = {}
static infoMessage = colorify::Colorify("*", colorify::Style{
Foreground: colorify::Foreground.Blue,
Background: colorify::Background.Black,
})

fn main() {
mut cliq := cliq::Init(argMap)
cliq.Parse(false)

if !slices::Contains(maps::Values(cliq.Res), true) {
println(infoMessage + " No arguments provided. Assuming you want to update.")
jpu::GetProton()
}
}

0 comments on commit af54d69

Please sign in to comment.