-
Notifications
You must be signed in to change notification settings - Fork 189
Draft: Forge global makefile changes #24029
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
Toasterson
wants to merge
24
commits into
OpenIndiana:oi/hipster
Choose a base branch
from
Toasterson:forge-global-makefile-changes
base: oi/hipster
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
985bdc3
Repology: Add initial metadata generation
Toasterson 0f5ea36
Fixup repology make rules
Toasterson 7f8bc90
Add more defintions to package defintions from Makefiles
Toasterson e4fc19b
Fix commands start with edit
Toasterson 3698397
Fixup add dependency command
Toasterson 4caca6b
Fix add dependency command
Toasterson efa4e09
Fix commands
Toasterson 7ce520d
Add patches command
Toasterson be3db49
Add defining of build options and flags
Toasterson 5a2d331
Fix if statement
Toasterson a9d8d8f
Better shell excaping
Toasterson 9aacbc0
Updating for loop for better option capture
Toasterson c52ba12
Replace `repology.mk` with `forge.mk` for improved maintainability
Toasterson 76b8b70
Remove backward compatibility for misspelled target in `forge.mk`
Toasterson 012c09d
Ensure Cargo-installed tools are included in PATH in `forge.mk`
Toasterson 3613639
Remove redundant flag in `add dependency` command
Toasterson 60868a7
Remove redundant `--` flag in license command in `forge.mk`
Toasterson c520c9e
Remove redundant maintainer command in `forge.mk`
Toasterson 8e04bce
Remove redundant maintainer command in `forge.mk`
Toasterson 8996eec
Fix quoting for configure options in `forge.mk`
Toasterson b855721
Update `userland-gate.kdl` to 2025 branch and refine metadata transfo…
Toasterson a80fccf
Add `--gate` flag for configure builds in `forge.mk`
Toasterson 4c1e2bd
Improve forge.mk error handling
Toasterson 3bcbb54
Add Supporting targets to global makefiles
Toasterson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,64 @@ | ||
| # | ||
| # This file and its contents are supplied under the terms of the | ||
| # Common Development and Distribution License ("CDDL"), version 1.0. | ||
| # You may only use this file in accordance with the terms of version | ||
| # 1.0 of the CDDL. | ||
| # | ||
| # A full copy of the text of the CDDL should have accompanied this | ||
| # source. A copy of the CDDL is also available via the Internet at | ||
| # http://www.illumos.org/license/CDDL. | ||
| # | ||
| # | ||
| # Copyright 2023 Till Wegmueller | ||
| # | ||
|
|
||
| # Allow overriding via environment and default to relying on PATH | ||
| PKGDEV ?= pkgdev | ||
|
|
||
| # Ensure Cargo-installed tools (e.g., pkgdev) are on PATH | ||
| PATH := $(PATH):$(HOME)/.cargo/bin | ||
| export PATH | ||
|
|
||
| .PHONY: generate-package-kdl | ||
|
|
||
| # Generate package.kdl using pkgdev with component metadata | ||
| generate-package-kdl: | ||
| @compname="$(COMPONENT_NAME)"; \ | ||
| [ -z "$$compname" ] && compname="$$(/usr/bin/basename "$$PWD")"; \ | ||
| if [ -f "package.kdl" ]; then \ | ||
| echo "Skipping package.kdl generation for $$compname: package.kdl already exists"; \ | ||
| exit 0; \ | ||
| fi; \ | ||
| missing=""; \ | ||
| [ -z "$(COMPONENT_NAME)" ] && missing="$$missing COMPONENT_NAME"; \ | ||
| [ -z "$(COMPONENT_FMRI)" ] && missing="$$missing COMPONENT_FMRI"; \ | ||
| [ -z "$(COMPONENT_SUMMARY)" ] && missing="$$missing COMPONENT_SUMMARY"; \ | ||
| [ -z "$(COMPONENT_CLASSIFICATION)" ] && missing="$$missing COMPONENT_CLASSIFICATION"; \ | ||
| [ -z "$(COMPONENT_LICENSE)" ] && missing="$$missing COMPONENT_LICENSE"; \ | ||
| [ -z "$(COMPONENT_LICENSE_FILE)" ] && missing="$$missing COMPONENT_LICENSE_FILE"; \ | ||
| [ -z "$(COMPONENT_VERSION)" ] && missing="$$missing COMPONENT_VERSION"; \ | ||
| [ -z "$(COMPONENT_PROJECT_URL)" ] && missing="$$missing COMPONENT_PROJECT_URL"; \ | ||
| [ -z "$(COMPONENT_ARCHIVE_URL)" ] && missing="$$missing COMPONENT_ARCHIVE_URL"; \ | ||
| [ -z "$(COMPONENT_ARCHIVE_HASH)" ] && missing="$$missing COMPONENT_ARCHIVE_HASH"; \ | ||
| if [ -n "$$missing" ]; then \ | ||
| echo "Skipping package.kdl generation for $$compname: missing variables:$$missing"; \ | ||
| if [ -n "$(WS_TOP)" ]; then echo "$$compname" >> "$(WS_TOP)/components.missing-metadata"; fi; \ | ||
| exit 0; \ | ||
| else \ | ||
| echo "generating package.kdl for $$compname"; \ | ||
| $(PKGDEV) create $(COMPONENT_FMRI); \ | ||
| for package in $(REQUIRED_PACKAGES) ; do \ | ||
| $(PKGDEV) edit add dependency --dev --kind require $$package ; \ | ||
| done; \ | ||
| $(PKGDEV) edit set project-name "$(COMPONENT_NAME)"; \ | ||
| $(PKGDEV) edit set summary "$(COMPONENT_SUMMARY)"; \ | ||
| $(PKGDEV) edit set classification "$(COMPONENT_CLASSIFICATION)"; \ | ||
| $(PKGDEV) edit set license "$(COMPONENT_LICENSE)" -f "$(COMPONENT_LICENSE_FILE)"; \ | ||
| $(PKGDEV) edit set version "$(COMPONENT_VERSION)"; \ | ||
| $(PKGDEV) edit set project-url "$(COMPONENT_PROJECT_URL)"; \ | ||
| $(PKGDEV) edit add source archive "$(COMPONENT_ARCHIVE_URL)" "$(COMPONENT_ARCHIVE_HASH)"; \ | ||
| if [ -d "patches" ]; then $(PKGDEV) edit add source patch patches; fi; \ | ||
| if [ "$(strip $(BUILD_STYLE))" = "configure" ]; then \ | ||
| $(PKGDEV) edit add build --gate $(WS_TOP)/userland-gate.kdl configure $(foreach var,$(CONFIGURE_OPTIONS),"$(var)"); \ | ||
| fi; \ | ||
| fi |
This file contains hidden or 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,19 @@ | ||
| name "userland" | ||
| version "0.5.11" | ||
| branch "2025.0.0" | ||
| publisher "openindiana.org" | ||
|
|
||
| metadata-transform matcher="--libexecdir" replacement="--libexecdir=${LIBEXECDIR}" | ||
| metadata-transform matcher="--bindir" replacement="--bindir=${BINDIR}" | ||
| metadata-transform matcher="--sbindir" replacement="--sbindir=${SBINDIR}" | ||
| metadata-transform matcher="--mandir" replacement="--mandir=${MANDIR}" | ||
| metadata-transform matcher="--libdir" replacement="--libdir=${LIBDIR}" | ||
| metadata-transform matcher="--with-jobs" drop=true | ||
| metadata-transform matcher="CC" drop=true | ||
| metadata-transform matcher="CXX" drop=true | ||
| metadata-transform matcher="F77" drop=true | ||
| metadata-transform matcher="FC" drop=true | ||
| metadata-transform matcher="FFLAGS" drop=true | ||
| metadata-transform matcher="CFLAGS" drop=true | ||
| metadata-transform matcher="LDFLAGS" drop=true | ||
| metadata-transform matcher="PKG_CONFIG_PATH" drop=true |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please publish forge at crates.io and then we should package it regularly. This
cargo installlooks like a nasty hack we should avoid.Thank you.