-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In order to define pinned packages without reading remote services it's possible to use the `builtin-noop` generator and defines the versions directly on *vars* attribute. The `versions` attributes is mandatory in this case and must be an array of strings.
- Loading branch information
Showing
6 changed files
with
213 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
x11libs: | ||
generator: builtin-noop | ||
template: | ||
engine: helm | ||
|
||
defaults: | ||
category: x11-libs | ||
packages: | ||
- libX11: | ||
vars: | ||
desc: "X.Org X11 library" | ||
versions: | ||
- "1.8.1" | ||
|
||
assets: | ||
- name: "libX11-{{ .Values.version}}.tar.xz" | ||
prefix: https://www.x.org/releases/individual/lib/ | ||
|
||
- metatools: | ||
category: sys-apps | ||
vars: | ||
github_user: macaroni-os | ||
github_repo: funtoo-metatools | ||
homepage: https://github.com/macaroni-os/funtoo-metatools | ||
license: Apache-2.0 | ||
desc: "M.A.R.K. metatools -- autogeneration framework." | ||
versions: | ||
- 1.3.8_pre20240818 | ||
snapshot: 3ca77d7dac6b9256e161d0bce47c7f7eb85e6e96 | ||
|
||
assets: | ||
- name: "{{ .Values.pn }}-{{ .Values.version }}-{{ substr 0 7 .Values.snapshot }}.zip" | ||
url: "https://github.com/{{ .Values.github_user }}/{{ .Values.github_repo }}/archive/{{ .Values.snapshot }}.zip" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Distributed under the terms of the GNU General Public License v2 | ||
|
||
EAPI=7 | ||
|
||
PYTHON_COMPAT=( python3+ ) | ||
inherit distutils-r1 | ||
|
||
DESCRIPTION="{{- .Values.desc }}" | ||
HOMEPAGE="{{- .Values.homepage }}" | ||
|
||
RESTRICT="network-sandbox" | ||
DEPEND=">=dev-python/subpop-2.0.0[${PYTHON_USEDEP}]" | ||
RDEPEND=" | ||
app-arch/unzip | ||
>=dev-util/meson-1.2.0 | ||
dev-python/beautifulsoup[${PYTHON_USEDEP}] | ||
dev-python/dict-toolbox[${PYTHON_USEDEP}] | ||
>=dev-python/httpx-0.24.0[${PYTHON_USEDEP}] | ||
>=dev-python/jinja-3[${PYTHON_USEDEP}] | ||
dev-python/packaging[${PYTHON_USEDEP}] | ||
dev-python/packaging-legacy[${PYTHON_USEDEP}] | ||
dev-python/psutil[${PYTHON_USEDEP}] | ||
dev-python/pymongo[${PYTHON_USEDEP}] | ||
dev-python/pyyaml[${PYTHON_USEDEP}] | ||
dev-python/pyzmq[${PYTHON_USEDEP}] | ||
dev-python/rich[${PYTHON_USEDEP}] | ||
dev-python/toml[${PYTHON_USEDEP}] | ||
dev-python/xmltodict[${PYTHON_USEDEP}] | ||
dev-python/colorama[${PYTHON_USEDEP}]" | ||
IUSE="" | ||
SLOT="0" | ||
LICENSE="{{- .Values.license }}" | ||
KEYWORDS="*" | ||
SRC_URI="{{- .Values.src_uri }}" | ||
S="${WORKDIR}/funtoo-metatools-{{ .Values.snapshot }}" | ||
|
||
src_configure() { | ||
# Create setup.py | ||
sed -e "s/##VERSION##/${PV/_*/}/g" \ | ||
setup.py.in > setup.py | ||
|
||
unset PYTHONPATH | ||
default | ||
} | ||
|
||
# vim: syn=ebuild noet ts=4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
/* | ||
Copyright © 2024-2025 Macaroni OS Linux | ||
See AUTHORS and LICENSE for the license details and contributors. | ||
*/ | ||
|
||
package generators | ||
|
||
import ( | ||
"fmt" | ||
"strings" | ||
|
||
"github.com/macaroni-os/mark-devkit/pkg/helpers" | ||
"github.com/macaroni-os/mark-devkit/pkg/logger" | ||
"github.com/macaroni-os/mark-devkit/pkg/specs" | ||
) | ||
|
||
type NoopGenerator struct{} | ||
|
||
func NewNoopGenerator() *NoopGenerator { | ||
return &NoopGenerator{} | ||
} | ||
|
||
func (g *NoopGenerator) GetType() string { | ||
return specs.GeneratorBuiltinNoop | ||
} | ||
|
||
func (g *NoopGenerator) SetVersion(atom *specs.AutogenAtom, version string, | ||
mapref *map[string]interface{}) error { | ||
|
||
log := logger.GetDefaultLogger() | ||
values := *mapref | ||
|
||
delete(values, "versions") | ||
|
||
artefacts := []*specs.AutogenArtefact{} | ||
|
||
if atom.HasAssets() { | ||
for _, asset := range atom.Assets { | ||
name, err := helpers.RenderContentWithTemplates( | ||
asset.Name, | ||
"", "", "asset.name", values, []string{}, | ||
) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
if asset.Prefix == "" && asset.Url == "" { | ||
return fmt.Errorf( | ||
"Asset %s for atom %s without prefix and url not admitted with noop", | ||
asset.Name, atom.Name) | ||
} | ||
|
||
var srcUri string | ||
|
||
if asset.Prefix != "" { | ||
srcUri, err = helpers.RenderContentWithTemplates( | ||
asset.Prefix, | ||
"", "", "asset.name", values, []string{}, | ||
) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
if !strings.HasSuffix(srcUri, "/") { | ||
srcUri += "/" | ||
} | ||
srcUri += name | ||
|
||
} else { | ||
srcUri, err = helpers.RenderContentWithTemplates( | ||
asset.Url, | ||
"", "", "asset.name", values, []string{}, | ||
) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
} | ||
|
||
if log.Config.GetGeneral().Debug { | ||
log.Debug(fmt.Sprintf("[%s] For asset %s using url %s", | ||
atom.Name, name, srcUri)) | ||
} | ||
|
||
artefacts = append(artefacts, &specs.AutogenArtefact{ | ||
SrcUri: []string{srcUri}, | ||
Use: asset.Use, | ||
Name: name, | ||
}) | ||
} | ||
|
||
} | ||
|
||
values["artefacts"] = artefacts | ||
|
||
return nil | ||
} | ||
|
||
func (g *NoopGenerator) Process(atom *specs.AutogenAtom, | ||
def *specs.AutogenAtom) (*map[string]interface{}, error) { | ||
ans := make(map[string]interface{}, 0) | ||
|
||
return &ans, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters