Git Product home page Git Product logo

pkgxx's Introduction

pkg++

pkg++ builds packages native to your distribution by reading recipes or data from various sources.

pkg++ is written in Moonscript.

Executable usage

Usage: pkgxx [-v] [-q] [-a <arch>] [-l] [-w] [-n] [-d]
	   [-c <collection>] [-t] [-f] [-h] [<recipe>]

Packages builder.

Arguments:
   recipe                Path to the recipe of the package to build.

Options:
   -v, --verbose
   -q, --quiet
   -a <arch>, --arch <arch>
   -l, --lint            Print potential defects in the recipe instead of building.
   -w, --watch           Only checks whether the packages and recipes are up to date.
   -n, --no-deps         Do not build dependencies.
   -d, --deps            Check and install dependencies before building
   -c <collection>, --collection <collection>
   -t, --targets
   -f, --force           Force rebuild and repository inclusion.
   -h, --help            Show this help message and exit.

Library usage

pkg++ is designed to be usable as a Moonscript library upon which packaging tools can be built.

Examples of uses for such a library include:

  • automated imports from other repositories (language-level package management, other distributions, …);
  • scripted builds (automated testing, automated deployment, …);
  • integration within other tools, possibly packaging tools.

API documentation can be generated with LDoc (ldoc -X .). That documentation is however likely incomplete.

pkgxx = require "pkgxx"

pwd = do
	p = io.popen "pwd"
	s = p\read "*line"
	p\close!
	s

context = with pkgxx.newContext!
	-- Load pkg++’ default modules.
	-- Custom modules can be loaded or created with \loadModule {}.
	\loadModules!

	-- Some package formats want to know who built them.
	.builder = "Example <example@example>"

	.packageManager = "pacman"
	.distribution = "Arch"

	-- Where to store sources, packages and temporary files.
	.buildingDirectory = "#{pwd}/tmp"
	.packagesDirectory = pwd
	.sourcesDirectory =  pwd

recipe = with context\openRecipe "package.spec"
	\download!
	\build!
	\package!

context\close!

package.spec example

package.spec is the WIP recipe format for pkg++.

Work will be invested to support multiple recipe formats in the future.

name:     hello
version:  2.10
source:   https://ftp.gnu.org/gnu/hello/hello-%{version}.tar.gz

packager: Luka Vandervelden <lukc@upyum.com>
url:      https://www.gnu.org/software/hello/

dependencies:
- gettext
- ncurses

@configure
	cd hello-%{version}
	./configure

@build
	cd hello-%{version}
	make

@install
	cd hello-%{version}
	make DESTDIR="%{pkg}" install

# Optionnal section to watch for upstream updates!
@watch
	url: https://ftp.gnu.org/gnu/hello/
	lasttar: hello-

Dependencies

pkgxx's People

Contributors

blankoworld avatar kaneroot avatar lukc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

pkgxx's Issues

Is wget needed?

Thursday I met a problem while Alpine Linux have busybox wget command.

Is wget needed as a dependencies? If yes is it possible to add it in the README.md?

Thanks in advance.

Enhancement: get pkgxx.conf variable using pkgxx command

IMO it would be nice to access pkgxx configuration via pkgxx command line.

For an exemple:

pkgxx --get distribution

will return Alpine or Debian.

Same thing for packages-directory from conf or any other variables from the /etc/pkgxx.conf file.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.