Compare commits

...

15 Commits

Author SHA1 Message Date
68a5c49062 add instructions for making packages 2026-07-10 12:06:59 +10:00
e9be85d5fd Merge branch 'main' of https://chookspace.com/Comet/Nebula 2026-07-10 12:03:58 +10:00
8540f184aa updated readme with info 2026-07-10 12:03:52 +10:00
9edb9ce768 change author of socket lib 2026-07-10 11:46:30 +10:00
446fdcca15 Update package_index.json 2026-07-10 11:44:34 +10:00
86d72fadda bump version number 2026-07-07 11:12:24 +10:00
b9d720a944 Merge branch 'main' of https://chookspace.com/Comet/Nebula 2026-07-07 11:11:36 +10:00
dadd86183b bugfix to neb build 2026-07-07 11:11:28 +10:00
d22abc2ae5 remove test lib 2026-07-04 20:10:47 +10:00
5d3c86f976 update readme with icon 2026-07-04 20:10:03 +10:00
269e34c1ac nebula icon 2026-07-04 20:06:45 +10:00
dc8f7a5d76 add "build" command 2026-07-04 20:04:09 +10:00
cb5991f342 Merge branch 'main' of https://chookspace.com/Comet/Nebula 2026-07-04 19:33:24 +10:00
1ff39cdbb2 update readme 2026-07-04 19:33:17 +10:00
672b919071 added the ability to install libs written in comet
also made it so you don't have to build comet to install the headers
2026-07-04 19:31:25 +10:00
10 changed files with 368 additions and 34 deletions

View File

@@ -1,3 +1,64 @@
# Nebula
# Nebula <img src="icon/icon.svg" width = 24>
The package manager for the Comet programming language.
The package manager for the Comet programming language.
## Installation
Nebula can be installed using `pipx` with the following command:
> pipx install nebpkg
or from `pip`:
> pip3 install nebpkg
## Usage
Nebula has several subcommands. Type `neb --help` to see the help menu.
### Getting package index
> neb pull
### Installing a package
> neb install <package_name>
You can provide a version with an @ symbol:
> neb install io@0.1.0
### Uninstalling a package
> neb uninstall <package_name>
### Searching for packages
> neb search <query>
By default the command won't show packages you already have installed, you can include installed packages with the `--show-installed` option.
### Listing installed packages
> neb list
### Building a package
You can use Nebula to build your package you're developing in C. Run the following command from the root of your package, and ensure you have a `src` directory:
> neb build .
You can replace the `.` with a directory if you want to build a directory as a package.
## How do I make a package?
There are some templates that you can use created by the Comet group. There is a [tutorial](https://chookspace.com/Comet/Comet/wiki/External+Libs+-+Table+of+Contents.-) on the [Comet repo's wiki](https://chookspace.com/Comet/Comet/wiki) with documentation on creating external libraries.
## Getting a package on Nebula
First, create a repository with your package. Once you've done that, submit a pull request with a commit editting the `package_index.json` file in the Nebula repository. Add the following the the index:
```json
...
"your_package_name": {
"repository": "https://chookspace.com/owner of the package/your package name",
"description": "description here",
"gitAuthor": "owner of the package"
}
}
```
Your package will be checked and if all is well, added to the Nebula index!

BIN
icon/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

213
icon/icon.svg Normal file
View File

@@ -0,0 +1,213 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="108.14108mm"
height="108.9766mm"
viewBox="0 0 108.14108 108.9766"
version="1.1"
id="svg1"
inkscape:version="1.4.4 (dcaf3e7d9e, 2026-05-05)"
sodipodi:docname="nebula.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview1"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="mm"
inkscape:zoom="0.98466434"
inkscape:cx="320.41376"
inkscape:cy="536.73112"
inkscape:window-width="1902"
inkscape:window-height="1182"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="layer1">
<inkscape:page
x="0"
y="0"
width="108.14108"
height="108.9766"
id="page2"
margin="0"
bleed="0" />
</sodipodi:namedview>
<defs
id="defs1">
<linearGradient
id="linearGradient18"
inkscape:collect="always">
<stop
style="stop-color:#8700ff;stop-opacity:1;"
offset="0"
id="stop18" />
<stop
style="stop-color:#8700ff;stop-opacity:0;"
offset="1"
id="stop19" />
</linearGradient>
<linearGradient
id="linearGradient12"
inkscape:collect="always">
<stop
style="stop-color:#1700ff;stop-opacity:1;"
offset="0"
id="stop12" />
<stop
style="stop-color:#d000ff;stop-opacity:0.99730557;"
offset="1"
id="stop13" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient12"
id="linearGradient13"
x1="52.299892"
y1="174.64995"
x2="158.8015"
y2="66.563499"
gradientUnits="userSpaceOnUse" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient18"
id="linearGradient19"
x1="56.807556"
y1="161.30161"
x2="132.94005"
y2="97.902985"
gradientUnits="userSpaceOnUse" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient12"
id="linearGradient2"
gradientUnits="userSpaceOnUse"
x1="52.299892"
y1="174.64995"
x2="158.8015"
y2="66.563499" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient12"
id="linearGradient3"
gradientUnits="userSpaceOnUse"
x1="52.299892"
y1="174.64995"
x2="158.8015"
y2="66.563499" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient12"
id="linearGradient4"
gradientUnits="userSpaceOnUse"
x1="52.299892"
y1="174.64995"
x2="158.8015"
y2="66.563499" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient12"
id="linearGradient5"
gradientUnits="userSpaceOnUse"
x1="52.299892"
y1="174.64995"
x2="158.8015"
y2="66.563499" />
</defs>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-52.675344,-65.589562)">
<g
id="g11"
style="fill:url(#linearGradient5);fill-opacity:1">
<path
sodipodi:type="star"
style="fill:url(#linearGradient2);fill-opacity:1;stroke-width:1;stroke-opacity:0"
id="path1-3"
inkscape:flatsided="false"
sodipodi:sides="5"
sodipodi:cx="68.465317"
sodipodi:cy="37.402348"
sodipodi:r1="16.365551"
sodipodi:r2="27.275919"
sodipodi:arg1="1.6056659"
sodipodi:arg2="2.2339844"
inkscape:rounded="0.1"
inkscape:randomized="0"
d="M 67.894773,53.75795 C 66.194219,53.698629 53.014289,59.94424 51.67338,58.896687 50.332472,57.849134 53.202988,43.549541 52.733906,41.913887 52.264825,40.278233 42.252073,29.673375 42.833991,28.074383 43.41591,26.475392 57.902669,24.786598 59.313315,23.83503 60.72396,22.883461 67.715669,10.083687 69.416223,10.143009 c 1.700554,0.05932 7.783347,13.315183 9.124256,14.362735 1.340908,1.047553 15.674774,3.741716 16.143855,5.37737 0.469082,1.635654 -10.258304,11.517021 -10.840223,13.116012 -0.581918,1.598992 1.285189,16.06385 -0.125456,17.015418 -1.410646,0.951568 -14.123329,-6.197272 -15.823882,-6.256594 z"
inkscape:transform-center-x="-0.27412446"
inkscape:transform-center-y="3.605856"
transform="matrix(0.5797936,-0.00236781,-0.00388735,0.56613416,32.464348,60.533216)" />
<path
sodipodi:type="star"
style="fill:url(#linearGradient3);fill-opacity:1;stroke-width:1;stroke-opacity:0"
id="path1-3-1"
inkscape:flatsided="false"
sodipodi:sides="5"
sodipodi:cx="68.465317"
sodipodi:cy="37.402348"
sodipodi:r1="16.365551"
sodipodi:r2="27.275919"
sodipodi:arg1="1.6056659"
sodipodi:arg2="2.2339844"
inkscape:rounded="0.1"
inkscape:randomized="0"
d="M 67.894773,53.75795 C 66.194219,53.698629 53.014289,59.94424 51.67338,58.896687 50.332472,57.849134 53.202988,43.549541 52.733906,41.913887 52.264825,40.278233 42.252073,29.673375 42.833991,28.074383 43.41591,26.475392 57.902669,24.786598 59.313315,23.83503 60.72396,22.883461 67.715669,10.083687 69.416223,10.143009 c 1.700554,0.05932 7.783347,13.315183 9.124256,14.362735 1.340908,1.047553 15.674774,3.741716 16.143855,5.37737 0.469082,1.635654 -10.258304,11.517021 -10.840223,13.116012 -0.581918,1.598992 1.285189,16.06385 -0.125456,17.015418 -1.410646,0.951568 -14.123329,-6.197272 -15.823882,-6.256594 z"
inkscape:transform-center-x="0.43596454"
inkscape:transform-center-y="4.9929336"
transform="matrix(0.54571461,0.19586168,-0.19707368,0.53074001,99.342937,61.979313)" />
<path
sodipodi:type="star"
style="fill:url(#linearGradient4);fill-opacity:1;stroke-width:1;stroke-opacity:0"
id="path1-3-3"
inkscape:flatsided="false"
sodipodi:sides="5"
sodipodi:cx="68.465317"
sodipodi:cy="37.402348"
sodipodi:r1="16.365551"
sodipodi:r2="27.275919"
sodipodi:arg1="1.6056659"
sodipodi:arg2="2.2339844"
inkscape:rounded="0.1"
inkscape:randomized="0"
d="M 67.894773,53.75795 C 66.194219,53.698629 53.014289,59.94424 51.67338,58.896687 50.332472,57.849134 53.202988,43.549541 52.733906,41.913887 52.264825,40.278233 42.252073,29.673375 42.833991,28.074383 43.41591,26.475392 57.902669,24.786598 59.313315,23.83503 60.72396,22.883461 67.715669,10.083687 69.416223,10.143009 c 1.700554,0.05932 7.783347,13.315183 9.124256,14.362735 1.340908,1.047553 15.674774,3.741716 16.143855,5.37737 0.469082,1.635654 -10.258304,11.517021 -10.840223,13.116012 -0.581918,1.598992 1.285189,16.06385 -0.125456,17.015418 -1.410646,0.951568 -14.123329,-6.197272 -15.823882,-6.256594 z"
inkscape:transform-center-x="-0.91616451"
inkscape:transform-center-y="4.8624556"
transform="matrix(0.52700569,-0.24172553,0.23038527,0.51715145,101.8511,156.59301)" />
</g>
<path
style="fill:url(#linearGradient19);fill-opacity:1;stroke:none;stroke-width:1;stroke-opacity:1"
d="m 52.791748,117.03625 77.250592,-51.44669 30.77409,56.29114 -59.35035,52.13764 z"
id="path18"
sodipodi:nodetypes="ccccc" />
<path
sodipodi:type="star"
style="fill:url(#linearGradient13);fill-opacity:1;stroke-width:1;stroke-opacity:0"
id="path1"
inkscape:flatsided="false"
sodipodi:sides="5"
sodipodi:cx="68.465317"
sodipodi:cy="37.402348"
sodipodi:r1="16.365551"
sodipodi:r2="27.275919"
sodipodi:arg1="1.6056659"
sodipodi:arg2="2.2339844"
inkscape:rounded="0.1"
inkscape:randomized="0"
d="M 67.894773,53.75795 C 66.194219,53.698629 53.014289,59.94424 51.67338,58.896687 50.332472,57.849134 53.202988,43.549541 52.733906,41.913887 52.264825,40.278233 42.252073,29.673375 42.833991,28.074383 43.41591,26.475392 57.902669,24.786598 59.313315,23.83503 60.72396,22.883461 67.715669,10.083687 69.416223,10.143009 c 1.700554,0.05932 7.783347,13.315183 9.124256,14.362735 1.340908,1.047553 15.674774,3.741716 16.143855,5.37737 0.469082,1.635654 -10.258304,11.517021 -10.840223,13.116012 -0.581918,1.598992 1.285189,16.06385 -0.125456,17.015418 -1.410646,0.951568 -14.123329,-6.197272 -15.823882,-6.256594 z"
inkscape:transform-center-x="-0.54843388"
inkscape:transform-center-y="11.364464"
transform="matrix(1.425898,0.3038747,-0.31194838,1.3889937,0.467795,65.035221)" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 9.0 KiB

View File

@@ -8,7 +8,7 @@ There is also Github mirror of Comet if you would prefer that: https://github.co
## Usage
### Installing a Package
To install a package type:
To install a rock type:
```
neb install packageName
```
@@ -16,9 +16,17 @@ Or if you wish to install a particular version:
```
neb install packageName@1.0.0
```
(replace the number with the version number of the package you want to install)
(replace the number with the version number of the rock you want to install)
## Changelog
### 1.2.1
- Made `neb build` look for C files in a src/ folder instead of the current folder
### 1.2.0
- Add support for modules written in Comet
- Made it so that you don't have to build Comet to install the headers
- Added the `neb build` command to make it easier to develop rocks
### 1.1.0
- Switched from getting the latest commit of packages to getting the latest release
- Added the `uninstall` subcommand

33
neb/src/build.py Normal file
View File

@@ -0,0 +1,33 @@
from .util import libs_dir, print_error_message
from .console import console
import sys
import os
import glob
import pathlib
import subprocess
def build(args):
comet_libs_dir = libs_dir()
folder_path = pathlib.Path(args.path).resolve()
folder_name = folder_path.name
out_path = os.path.join(comet_libs_dir, f"{folder_name}.cometlib")
c_files = glob.glob(f"{args.path}/src/*.c", recursive=True)
if len(c_files) == 0:
print_error_message(f"No C files were found in that directory! [d white]({folder_name}/src)[/d white]")
sys.exit(1)
with console.status("Building", spinner="moon") as status:
try:
subprocess.run(
["gcc"] + c_files + ["-fPIC", "-shared", "-Wl,-undefined,symbol_lookup", "-o", out_path] + args.gcc_args,
check=True
)
except subprocess.CalledProcessError as e:
print_error_message(f"Failed to install [b]{folder_name}[/]: build failed!")
sys.exit(1)
console.log(f"[b][:white_check_mark:] Installed [green]{folder_name}[/green]![/b]")

View File

@@ -90,27 +90,37 @@ def install(args):
print_error_message(f"Failed to install [b]{name}[/]: failed to read \"rock.json\" file: {e}")
sys.exit(1)
# build source code
rock_info = data.get("rock", {})
out_path = os.path.join(comet_libs_dir, f"{name}.cometlib")
try:
os.chdir(temp_dir)
os.chdir(temp_dir)
if rock_info.get("nativeComet") == True:
console.print(["cp"] + glob.glob("src/*", recursive=True) + [comet_libs_dir, "-r"])
subprocess.run(
["gcc"] + glob.glob("src/*.c", recursive=True) + ["-fPIC", "-shared", "-Wl,-undefined,symbol_lookup", "-o", out_path] + rock_info.get("gccArgs", []),
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
stdin=subprocess.PIPE,
["cp"] + glob.glob("src/*", recursive=True) + [comet_libs_dir, "-r"],
check=True
)
except KeyError as e:
print_error_message(f"Failed to install [b]{name}[/]: \"rock.json\" is missing the key \"{e.args[0]}\"")
sys.exit(1)
except subprocess.CalledProcessError as e:
print_error_message(f"Failed to install [b]{name}[/]: build failed: \"{e.stderr.decode()}\"")
sys.exit(1)
console.log(f"[d][:white_check_mark:] Built {name}.[/]")
console.log(f"[d][:white_check_mark:] Copied {name}.[/]")
else:
# build source code
out_path = os.path.join(comet_libs_dir, f"{name}.cometlib")
try:
subprocess.run(
["gcc"] + glob.glob("src/*.c", recursive=True) + ["-fPIC", "-shared", "-Wl,-undefined,symbol_lookup", "-o", out_path] + rock_info.get("gccArgs", []),
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
stdin=subprocess.PIPE,
check=True
)
except KeyError as e:
print_error_message(f"Failed to install [b]{name}[/]: \"rock.json\" is missing the key \"{e.args[0]}\"")
sys.exit(1)
except subprocess.CalledProcessError as e:
print_error_message(f"Failed to install [b]{name}[/]: build failed: \"{e.stderr.decode()}\"")
sys.exit(1)
console.log(f"[d][:white_check_mark:] Built {name}.[/]")
data_path = os.path.join(comet_libs_dir, "lib_data")

View File

@@ -7,6 +7,7 @@ from .pull import pull
from .list import list_packages
from .uninstall import uninstall
from .search import search
from .build import build
def main() -> int:
@@ -31,6 +32,11 @@ def main() -> int:
uninstall_cmd = sub_parsers.add_parser(name="uninstall", description="uninstall an installed rock(s)")
uninstall_cmd.add_argument("names", help="name of the rocks to uninstall", nargs="+")
# build command
build_cmd = sub_parsers.add_parser(name="build", description="build a module")
build_cmd.add_argument("path", help="the path to build from")
build_cmd.add_argument("gcc_args", nargs=argparse.REMAINDER, help="args to give to gcc")
# search command
search_cmd = sub_parsers.add_parser(name="search", description="search for rocks")
search_cmd.add_argument("query", help="search query")
@@ -55,6 +61,8 @@ def main() -> int:
uninstall(args)
case "search":
search(args)
case "build":
build(args)
# really feeling like a C programmer lmao
return 0

View File

@@ -29,19 +29,20 @@ def get_needed_headers() -> bool:
console.log("[d][:white_check_mark:] Cloned Comet repo.[/]")
os.chdir(temp_dir)
status.update("Building Comet...")
result = subprocess.run(["make"], check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
if result.returncode != 0:
print_error_message(f"failed to build Comet: {result.stderr.decode()}")
console.log("[d][:white_check_mark:] Built Comet.[/]")
status.update("Installing...")
status.stop()
console.print("You may need to type your admin password: ")
result = subprocess.run(["sudo", "make", "install"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
result = subprocess.run("sudo mkdir /usr/local/include/comet -p", stderr=subprocess.PIPE, shell=True)
if result.returncode != 0:
print_error_message(f"failed to install: {result.stderr.decode()}")
return False
result = subprocess.run("sudo cp include/* /usr/local/include/comet -rf", stderr=subprocess.PIPE, shell=True)
if result.returncode != 0:
print_error_message(f"failed to install: {result.stderr.decode()}")
return False
console.log("[d][:white_check_mark:] Installed headers.[/]")
console.log("[b][:white_check_mark:] Comet headers are installed![/b]\n")

View File

@@ -4,9 +4,9 @@
"description": "Input / Output in Comet.",
"gitAuthor": "Comet"
},
"test": {
"repository": "https://chookspace.com/SpookyDervish/test",
"description": "Test rock for installing and using libraries written natively in Comet.",
"gitAuthor": "SpookyDervish"
"socket": {
"repository": "https://chookspace.com/Comet/socket",
"description": "Socket implementation in Comet.",
"gitAuthor": "Comet"
}
}

View File

@@ -5,7 +5,7 @@ with open("neb/README.md", "r") as f:
setup(
name="nebpkg",
version="1.1.0",
version="1.2.1",
description="Nebula, the package manager for the Comet programming language.",
classifiers=[
"Development Status :: 4 - Beta",