Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
985bdc3
Repology: Add initial metadata generation
Toasterson May 7, 2023
0f5ea36
Fixup repology make rules
Toasterson Sep 27, 2023
7f8bc90
Add more defintions to package defintions from Makefiles
Toasterson Sep 28, 2023
e4fc19b
Fix commands start with edit
Toasterson Sep 28, 2023
3698397
Fixup add dependency command
Toasterson Sep 28, 2023
4caca6b
Fix add dependency command
Toasterson Sep 28, 2023
efa4e09
Fix commands
Toasterson Sep 28, 2023
7ce520d
Add patches command
Toasterson Sep 28, 2023
be3db49
Add defining of build options and flags
Toasterson Sep 29, 2023
5a2d331
Fix if statement
Toasterson Sep 29, 2023
a9d8d8f
Better shell excaping
Toasterson Sep 29, 2023
9aacbc0
Updating for loop for better option capture
Toasterson Oct 3, 2023
c52ba12
Replace `repology.mk` with `forge.mk` for improved maintainability
Toasterson Sep 2, 2025
76b8b70
Remove backward compatibility for misspelled target in `forge.mk`
Toasterson Sep 2, 2025
012c09d
Ensure Cargo-installed tools are included in PATH in `forge.mk`
Toasterson Sep 2, 2025
3613639
Remove redundant flag in `add dependency` command
Toasterson Sep 2, 2025
60868a7
Remove redundant `--` flag in license command in `forge.mk`
Toasterson Sep 2, 2025
c520c9e
Remove redundant maintainer command in `forge.mk`
Toasterson Sep 2, 2025
8e04bce
Remove redundant maintainer command in `forge.mk`
Toasterson Sep 2, 2025
8996eec
Fix quoting for configure options in `forge.mk`
Toasterson Sep 2, 2025
b855721
Update `userland-gate.kdl` to 2025 branch and refine metadata transfo…
Toasterson Sep 2, 2025
a80fccf
Add `--gate` flag for configure builds in `forge.mk`
Toasterson Sep 2, 2025
4c1e2bd
Improve forge.mk error handling
Toasterson Oct 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions make-rules/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -240,3 +240,5 @@ COMPONENT_BUILD_CMAKE_ARGS += -j$(PARALLEL_JOBS)
COMPONENT_BUILD_GMAKE_ARGS += -j$(PARALLEL_JOBS)
COMPONENT_BUILD_SETUP_PY_ARGS += -j$(PARALLEL_JOBS)
endif

include $(WS_MAKE_RULES)/forge.mk
64 changes: 64 additions & 0 deletions make-rules/forge.mk
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

# which pkgdev
no pkgdev in /usr/sbin /usr/bin
#


# Ensure Cargo-installed tools (e.g., pkgdev) are on PATH
PATH := $(PATH):$(HOME)/.cargo/bin
export PATH
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you include this file from common.mk this will affect virtually all components. I'm sure we do not want that. Please do not change PATH here and please do not export anything here. Thank you.


.PHONY: generate-package-kdl

# Generate package.kdl using pkgdev with component metadata
generate-package-kdl:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need an unusable target? I'm sorry, but this makes no sense. Please postpone this change once we do have the pkgdev tool available.

@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
19 changes: 19 additions & 0 deletions userland-gate.kdl
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