Skip to content

Commit

Permalink
Merge pull request #24 from getchoo
Browse files Browse the repository at this point in the history
use a makefile
  • Loading branch information
kreatoo authored Feb 15, 2023
2 parents c938134 + f2e0d25 commit 63d61f9
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 68 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:

- name: Build packages
run: |
./build.sh deps
./build.sh kreastrap
./src/kreastrap/kreastrap buildPackages
make deps
make kreastrap
./out/kreastrap buildPackages
12 changes: 5 additions & 7 deletions .github/workflows/build-rootfs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ jobs:
mkdir /out
ln -s /out /work/out
cd /work
./build.sh deps
./build.sh kreastrap
/work/src/kreastrap/kreastrap rootfs --buildType=nocc --arch=amd64
make deps
make kreastrap
./out/kreastrap rootfs --buildType=nocc --arch=amd64
cd /out
tar -czvf /work/kreato-linux-nocc-"$(date +%d-%m-%Y)"-amd64.tar.gz *
Expand All @@ -54,9 +54,8 @@ jobs:

- name: Build builder rootfs tarball
run: |
rm -rf /out/*
cd /work
/work/src/kreastrap/kreastrap rootfs --buildType=builder --arch=amd64
./out/kreastrap rootfs --buildType=builder --arch=amd64
cd /out
tar -czvf /work/kreato-linux-builder-"$(date +%d-%m-%Y)"-amd64.tar.gz *
Expand All @@ -72,9 +71,8 @@ jobs:

- name: Build server rootfs tarball
run: |
rm -rf /out/*
cd /work
/work/src/kreastrap/kreastrap rootfs --buildType=server --arch=amd64
./out/kreastrap rootfs --buildType=server --arch=amd64
cd /out
tar -czvf /work/kreato-linux-builder-"$(date +%d-%m-%Y)"-amd64.tar.gz *
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ jobs:
- uses: jiro4989/setup-nim-action@v1
with:
nim-version: 'stable' # default is 'stable'
- run: ./build.sh deps
- run: ./build.sh kpkg
- run: make deps
- run: make kpkg
- uses: actions/upload-artifact@v3
with:
name: kpkg
path: ${{ github.workspace }}/out/*

- run: |
./build.sh tests
make purr
sudo ./out/kpkg # This is done to generate the config, purr cant seem to generate them by itself for now
sudo ./out/purr
21 changes: 21 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
SRCDIR = $(shell pwd)/src
PREFIX = ./out

nimbuild = nim c -d:release -d:branch=master --threads:on -d:ssl -o=$(PREFIX)/$1 $(SRCDIR)/$1/$1.nim
tasks = kpkg chkupd kreastrap mari purr

all: $(tasks)

deps:
nimble install cligen libsha httpbeast -y

$(tasks)::
$(call nimbuild,$@)

purr:: kpkg

prettify:
find $(SRCDIR) -type f -name '*.nim' | xargs nimpretty

clean:
rm -rf $(PREFIX)
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@ There are a couple of build variables;

## kpkg
`kpkg` is a rewrite of the nyaa2 package manager. It is written in Nim, and is mainly for use with Kreato Linux.
`kpkg` is heavily inspired by package managers such as `kiss`, `dnf` and `pacman`. Run `./build.sh kpkg` to build.
`kpkg` is heavily inspired by package managers such as `kiss`, `dnf` and `pacman`. Run `make kpkg` to build.

## kreastrap
There is also kreastrap v3, a rootfs building utility.
You can build it by running `./build.sh kreastrap`. The binary will be located on `src/kreastrap/kreastrap`.
You can build it by running `make kreastrap`. The binary will be located on `src/kreastrap/kreastrap`.

## mari
Mari is a very simple http server that uses httpbeast. It is mainly used to run Kreato Linux binary repository. You can build it by running `./build.sh mari`. The binary will be located on the usual `out` folder.
Mari is a very simple http server that uses httpbeast. It is mainly used to run Kreato Linux binary repository. You can build it by running `make mari`. The binary will be located on the usual `out` folder.

## purr
purr is kpkg's testing utility. You can build it by running `./build.sh tests`. The binary will be located on the usual `out` folder.
purr is kpkg's testing utility. You can build it by running `make tests`. The binary will be located on the usual `out` folder.

## chkupd
chkupd is a tool to check if a package is up-to-date on a kpkg repository. It also has the ability to attempt to autoupdate the package. You can build it by running `./build.sh chkupd`. The binary will be located on the usual `out` folder.
chkupd is a tool to check if a package is up-to-date on a kpkg repository. It also has the ability to attempt to autoupdate the package. You can build it by running `make chkupd`. The binary will be located on the usual `out` folder.

# License
Licensed under GPLv3. Check LICENSE file for details
Expand Down
47 changes: 0 additions & 47 deletions build.sh

This file was deleted.

6 changes: 3 additions & 3 deletions src/chkupd/backends/repology.nim
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# chkupd v3 repology backend
import json, strutils, os, libsha/sha256
include ../../kpkg/src/modules/logger
include ../../kpkg/src/modules/downloader
include ../../kpkg/src/modules/runparser
include ../../kpkg/modules/logger
include ../../kpkg/modules/downloader
include ../../kpkg/modules/runparser

proc repologyCheck(package: string, repo: string, autoUpdate = false,
skipIfDownloadFails = true) =
Expand Down

0 comments on commit 63d61f9

Please sign in to comment.