Skip to content
het-bestPublic

About

Modern source based package manager for GNU/Linux

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

31 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cross package manager

Modern source based package manager for GNU/Linux written in C++ 20.

Cross has been heavenly inspired by kiss package manager. It has similar commands and package syntax to it but was written in c++ and with additional features, such as:

  • Advanced information about packages
  • Auto fetching new package versions (currently supports GitHub, gitlab, download.gnome.org, ketnel.org and ftp.gnu.org)
  • Safe installing (probability of you breaking something because of p.m. is extremely low)
  • Additional arguments to commands: you can enable verbose input, do not install dependencies etc.
  • Mirrors support
  • etc...

Compiling

Cross requires:

  • Cmake >= 3.20 (older versions can still work but are not tested)
  • C++ 20
  • ninja
  • curl (if WITH_LIBCURL set to ON)

The building is as simple as

cmake -S . -B build
cmake --build build

And for installing

sudo cmake --install build

Compile arguments

Option Description Value
WITH_LIBCURL Compile cross-pkg with libcurl instead of calling curl/wget command line utility (TURNING THIS OFF ALLOWS VULNERABILITIES TO BE EXPLOITED) ON
DEV_MODE Enable developer features for testing OFF

Using cross-pkg

After you compiled and installed cross you can run cross-pkg h to get all commands and cross-pkg h [cmd]to get information about command arguments

Making package

Package is made from one .crs file with a couple of fields:

-desc-

Required Description for package (must be in one line)

-version-

Required Package version (must be in one line)

-sources-

Optional but pretty much required Package source with url+ or git+ prefix, one source per line

After source you can specify directory to move source info, directory will be created relevant to cache/pkg/source directory

Also git+ prefix can have @ symbol with commit has after it to checkout to required commit git+https://github.com/het-best/cross-pkg.git@e409b4beaac991fe5c702070862f406e0a7cc3d9 /some/dir/

-depends-

Optional Package dependencies, one package per line

-group-

Optional Package groups, very specific use cases and do not do anything yet

-build-

Required Build script, first argument when calling this script is set to package install dir

-after-install-

Optional Script to run after installing

-before-remove-

Optional Script to run before removing

-after-remove-

Optional Script to run after removing

Example package script

-desc-
	Modern source based package manager for GNU/Linux written in C++ 20.
-version-
	1.0
-sources-
	git+https://codeberg.org/hetbest/cross-pkg.git@c92e3d7d9a3994d38a35cf9abedd06fab19de177
-depends-
	cmake
	gcc
-group-
	pkg
-build-
	cmake -S . -B build \
		-D CMAKE_INSTALL_PREFIX=/usr \
		-D CMAKE_BUILD_TYPE=Release
	
	cmake --build build
	DESTDIR="$1" cmake --install build
-after-install-
	echo "This is after-install script!"
-before-remove-
	echo "This is before-remove script!"
-after-remove-
	echo "This is after-remove script!"

Configuring mirrors

To add mirror to some source you need to create file with your host name, just domain name, without protocol or anything else in /var/db/cross/mirrors. You need to specify mirrors one per line, just with domain, for example:

/var/db/cross/mirrors/ftp.gnu.org:

sunsite.icm.edu.pl
ftp-stud.fht-esslingen.de
mirrors.kernel.org

About

Modern source based package manager for GNU/Linux

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Contributors

Languages