iigs
2024-03-27 32d98a3796b058e946d5d41ed5637129c312a8e9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL)". You may
# only use this file in accordance with the terms 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 2013 Adam Stevko. All rights reserved.
# Copyright 2014 Alexander Pyhalov. All rights reserved.
# Copyright 2023 Klaus Ziegler
#
# Note: to chack all dependencies, don't use gmake build/publish
# you'll have to use gmake prep
#
 
include ../../../make-rules/shared-macros.mk
 
COMPONENT_NAME=        slim_source
COMPONENT_SRC=        $(COMPONENT_NAME)
 
COMPONENT_REVISION=$(shell cd $(COMPONENT_SRC); git rev-list HEAD --count)
 
GIT=git
GIT_REPO=https://github.com/OpenIndiana/slim_source.git
GIT_BRANCH=oi/hipster
GIT_CHANGESET=HEAD
NIGHTLY_OPTIONS=-AWndmp +t
DMAKE=/usr/bin/dmake
ONNV_BUILDNUM=$(BRANCHID)
 
PKG_REPO=$(SOURCE_DIR)/packages/$(MACH)/nightly-nd/repo.redist
 
CLEAN_PATHS += $(BUILD_DIR)
CLOBBER_PATHS += $(SOURCE_DIR)
 
COMPONENT_PREP_GIT=no
include $(WS_MAKE_RULES)/prep.mk
 
$(SOURCE_DIR):
    $(GIT) clone -b $(GIT_BRANCH) $(GIT_REPO) $(SOURCE_DIR)
 
$(SOURCE_DIR)/.downloaded: $(SOURCE_DIR)
    @cd $(SOURCE_DIR); $(GIT) checkout $(GIT_BRANCH); $(GIT) pull \
      $(GIT_REPO); $(GIT) log -1 --format=%H > .downloaded
 
update:    $(SOURCE_DIR)
    cd $(SOURCE_DIR); $(GIT) pull $(GIT_REPO); \
      [ "$$($(GIT) log -1 --format=%H)" == "$$(cat .downloaded)" ] || \
      $(GIT) log -1 --format=%H > .downloaded
 
download:: $(SOURCE_DIR)/.downloaded
 
$(BUILD_DIR)/$(MACH)/.built: $(SOURCE_DIR)/.downloaded Makefile
    $(MKDIR) $(@D) && \
        cd $(SOURCE_DIR) && \
    cp usr/src/tools/env/nightly $(BUILD_DIR)/$(MACH)/nightly && \
    chmod u+wx $(BUILD_DIR)/$(MACH)/nightly && \
    NIGHTLY="$(BUILD_DIR)/$(MACH)/nightly" && \
        cat usr/src/tools/env/developer.sh | \
          (sed \
            -e 's|^export NIGHTLY_OPTIONS=.*|export NIGHTLY_OPTIONS=\"$(NIGHTLY_OPTIONS)\"|' \
            -e 's|^export GATE=.*|export GATE=\"$$(git log -1 --format=illumos-%h)\"|' \
            -e 's|^export CODEMGR_WS=.*|export CODEMGR_WS=\"$$PWD\"|'; \
          echo export VERIFY_ELFSIGN=n; \
          echo export LC_ALL=en_US.UTF-8; \
          echo export CW_NO_SHADOW=1; \
          echo export SPRO_ROOT=; \
          echo export ON_CLOSED_BINS=/tmp; \
          echo export CC=$(CC); \
          echo export MAKE=$(DMAKE); \
          echo export ONNV_BUILDNUM=$(ONNV_BUILDNUM); \
          echo export MULTI_PROTO=yes; \
          echo export PKGVERS_BRANCH=$(ONNV_BUILDNUM)) > \
          developer.sh && \
        time $${NIGHTLY} developer.sh &&\
    $(TOUCH) $@
 
build install: $(BUILD_DIR)/$(MACH)/.built
 
$(BUILD_DIR)/$(MACH)/publish.transforms: $(BUILD_DIR)/$(MACH)/.built
    echo "<transform set name=pkg.fmri -> edit value pkg://[^/]+/ pkg://$(PUBLISHER)/>" > \
      $(BUILD_DIR)/$(MACH)/publish.transforms
    echo "<transform set name=pkg.fmri -> edit value ,.+: ,$(BUILD_VERSION):>" >> \
      $(BUILD_DIR)/$(MACH)/publish.transforms
    echo "<transform set name=pkg.fmri -> emit set name=pkg5.info.git-remote value=$(GIT_REPO)>" >> \
      $(BUILD_DIR)/$(MACH)/publish.transforms
    echo "<transform set name=pkg.fmri -> emit set name=pkg5.info.git-branch value=$(GIT_BRANCH)>" >> \
      $(BUILD_DIR)/$(MACH)/publish.transforms
    echo "<transform set name=pkg.fmri -> emit set name=pkg5.info.git-rev value=$(shell cd $(COMPONENT_SRC); git rev-parse HEAD)>" >> \
      $(BUILD_DIR)/$(MACH)/publish.transforms
 
 
$(BUILD_DIR)/$(MACH)/.published: $(BUILD_DIR)/$(MACH)/publish.transforms
    if [ -d $(@D)/pkgrecv.dir ]; then $(RM) -r $(@D)/pkgrecv.dir; fi
    $(MKDIR) $(@D)/pkgrecv.dir
 
    pkgrecv -s $(PKG_REPO) -d $(@D)/pkgrecv.dir --raw \
      $$(pkgrecv -s $(PKG_REPO) --newest)
 
    for pkg in $$(echo $(@D)/pkgrecv.dir/*/*); do \
      pkgmogrify -O $$pkg/manifest $$pkg/manifest \
      $(BUILD_DIR)/$(MACH)/publish.transforms; \
      pkgsend -s $(WS_REPO) publish --fmri-in-manifest \
      -d $(BUILD_DIR)/$(MACH)/overlay -d $$pkg $$pkg/manifest; \
    done
 
    $(TOUCH) $@
 
.NOTPARALLEL:
 
publish: update $(BUILD_DIR)/$(MACH)/.published
 
print-package-names:
    if test -d $(PKG_REPO); \
    then pkgrepo list -H -F tsv -s $(PKG_REPO) | cut -f 2 | sort -u > pkg5.fmris; fi; \
    cat pkg5.fmris
 
PACKAGE_NAMES  = consolidation/install/install-incorporation
PACKAGE_NAMES += consolidation/install/install-redistributable
PACKAGE_NAMES += install/distribution-constructor
PACKAGE_NAMES += install/installadm
PACKAGE_NAMES += SUNWauto-install-common
PACKAGE_NAMES += SUNWauto-install
PACKAGE_NAMES += SUNWdistro-const
PACKAGE_NAMES += SUNWgui-install
PACKAGE_NAMES += SUNWinstall-libs
PACKAGE_NAMES += SUNWinstall-test
PACKAGE_NAMES += SUNWinstall
PACKAGE_NAMES += SUNWinstalladm-tools
PACKAGE_NAMES += SUNWslim-utils
PACKAGE_NAMES += system/install
PACKAGE_NAMES += system/install/auto-install
PACKAGE_NAMES += system/install/auto-install/auto-install-common
PACKAGE_NAMES += system/install/gui-install
PACKAGE_NAMES += system/install/media/internal
PACKAGE_NAMES += system/install/tests
PACKAGE_NAMES += system/install/text-install
PACKAGE_NAMES += system/library/install
 
# Build dependencies
REQUIRED_PACKAGES += library/desktop/libglade
REQUIRED_PACKAGES += system/install/text-install
REQUIRED_PACKAGES += system/library/install/libinstzones
REQUIRED_PACKAGES += system/library/storage/ima/header-ima
REQUIRED_PACKAGES += system/zones/internal