rebuild geeqie
[oi-userland.git] / components / openindiana / slim_source / Makefile
blob67a11a5181df48b083b8a8409f366d6cb93ee790
2 # This file and its contents are supplied under the terms of the
3 # Common Development and Distribution License ("CDDL)". You may
4 # only use this file in accordance with the terms of the CDDL.
6 # A full copy of the text of the CDDL should have accompanied this
7 # source. A copy of the CDDL is also available via the Internet at
8 # http://www.illumos.org/license/CDDL.
12 # Copyright 2013 Adam Stevko. All rights reserved.
13 # Copyright 2014 Alexander Pyhalov. All rights reserved.
14 # Copyright 2023 Klaus Ziegler
16 # Note: to chack all dependencies, don't use gmake build/publish
17 # you'll have to use gmake prep
20 include ../../../make-rules/shared-macros.mk
22 COMPONENT_NAME= slim_source
23 COMPONENT_SRC= $(COMPONENT_NAME)
25 COMPONENT_REVISION=$(shell cd $(COMPONENT_SRC); git rev-list HEAD --count)
27 GIT=git
28 GIT_REPO=https://github.com/OpenIndiana/slim_source.git
29 GIT_BRANCH=oi/hipster
30 GIT_CHANGESET=HEAD
31 NIGHTLY_OPTIONS=-AWndmp +t
32 DMAKE=/usr/bin/dmake
33 ONNV_BUILDNUM=$(BRANCHID)
35 PKG_REPO=$(SOURCE_DIR)/packages/$(MACH)/nightly-nd/repo.redist
37 CLEAN_PATHS += $(BUILD_DIR)
38 CLOBBER_PATHS += $(SOURCE_DIR)
40 COMPONENT_PREP_GIT=no
41 include $(WS_MAKE_RULES)/prep.mk
43 $(SOURCE_DIR):
44 $(GIT) clone -b $(GIT_BRANCH) $(GIT_REPO) $(SOURCE_DIR)
46 $(SOURCE_DIR)/.downloaded: $(SOURCE_DIR)
47 @cd $(SOURCE_DIR); $(GIT) checkout $(GIT_BRANCH); $(GIT) pull \
48 $(GIT_REPO); $(GIT) log -1 --format=%H > .downloaded
50 update: $(SOURCE_DIR)
51 cd $(SOURCE_DIR); $(GIT) pull $(GIT_REPO); \
52 [ "$$($(GIT) log -1 --format=%H)" == "$$(cat .downloaded)" ] || \
53 $(GIT) log -1 --format=%H > .downloaded
55 download:: $(SOURCE_DIR)/.downloaded
57 $(BUILD_DIR)/$(MACH)/.built: $(SOURCE_DIR)/.downloaded Makefile
58 $(MKDIR) $(@D) && \
59 cd $(SOURCE_DIR) && \
60 cp usr/src/tools/env/nightly $(BUILD_DIR)/$(MACH)/nightly && \
61 chmod u+wx $(BUILD_DIR)/$(MACH)/nightly && \
62 NIGHTLY="$(BUILD_DIR)/$(MACH)/nightly" && \
63 cat usr/src/tools/env/developer.sh | \
64 (sed \
65 -e 's|^export NIGHTLY_OPTIONS=.*|export NIGHTLY_OPTIONS=\"$(NIGHTLY_OPTIONS)\"|' \
66 -e 's|^export GATE=.*|export GATE=\"$$(git log -1 --format=illumos-%h)\"|' \
67 -e 's|^export CODEMGR_WS=.*|export CODEMGR_WS=\"$$PWD\"|'; \
68 echo export VERIFY_ELFSIGN=n; \
69 echo export LC_ALL=en_US.UTF-8; \
70 echo export CW_NO_SHADOW=1; \
71 echo export SPRO_ROOT=; \
72 echo export ON_CLOSED_BINS=/tmp; \
73 echo export CC=$(CC); \
74 echo export MAKE=$(DMAKE); \
75 echo export ONNV_BUILDNUM=$(ONNV_BUILDNUM); \
76 echo export MULTI_PROTO=yes; \
77 echo export PKGVERS_BRANCH=$(ONNV_BUILDNUM)) > \
78 developer.sh && \
79 time $${NIGHTLY} developer.sh &&\
80 $(TOUCH) $@
82 build install: $(BUILD_DIR)/$(MACH)/.built
84 $(BUILD_DIR)/$(MACH)/publish.transforms: $(BUILD_DIR)/$(MACH)/.built
85 echo "<transform set name=pkg.fmri -> edit value pkg://[^/]+/ pkg://$(PUBLISHER)/>" > \
86 $(BUILD_DIR)/$(MACH)/publish.transforms
87 echo "<transform set name=pkg.fmri -> edit value ,.+: ,$(BUILD_VERSION):>" >> \
88 $(BUILD_DIR)/$(MACH)/publish.transforms
89 echo "<transform set name=pkg.fmri -> emit set name=pkg5.info.git-remote value=$(GIT_REPO)>" >> \
90 $(BUILD_DIR)/$(MACH)/publish.transforms
91 echo "<transform set name=pkg.fmri -> emit set name=pkg5.info.git-branch value=$(GIT_BRANCH)>" >> \
92 $(BUILD_DIR)/$(MACH)/publish.transforms
93 echo "<transform set name=pkg.fmri -> emit set name=pkg5.info.git-rev value=$(shell cd $(COMPONENT_SRC); git rev-parse HEAD)>" >> \
94 $(BUILD_DIR)/$(MACH)/publish.transforms
95 # Convert dependency on any version of Perl runtime to dependency on single unversioned runtime/perl
96 echo '<transform depend type=require-any fmri=pkg:/runtime/perl-5[0-9]+@ -> set fmri runtime/perl>' >> $(BUILD_DIR)/$(MACH)/publish.transforms
97 echo '<transform depend type=require-any fmri=runtime/perl$$ -> set type require>' >> $(BUILD_DIR)/$(MACH)/publish.transforms
100 $(BUILD_DIR)/$(MACH)/.published: $(BUILD_DIR)/$(MACH)/publish.transforms
101 if [ -d $(@D)/pkgrecv.dir ]; then $(RM) -r $(@D)/pkgrecv.dir; fi
102 $(MKDIR) $(@D)/pkgrecv.dir
104 pkgrecv -s $(PKG_REPO) -d $(@D)/pkgrecv.dir --raw \
105 $$(pkgrecv -s $(PKG_REPO) --newest)
107 for pkg in $$(echo $(@D)/pkgrecv.dir/*/*); do \
108 pkgmogrify -O $$pkg/manifest $$pkg/manifest \
109 $(BUILD_DIR)/$(MACH)/publish.transforms; \
110 pkgsend -s $(WS_REPO) publish --fmri-in-manifest \
111 -d $(BUILD_DIR)/$(MACH)/overlay -d $$pkg $$pkg/manifest; \
112 done
114 $(TOUCH) $@
116 .NOTPARALLEL:
118 publish: update $(BUILD_DIR)/$(MACH)/.published
120 print-package-names:
121 if test -d $(PKG_REPO); \
122 then pkgrepo list -H -F tsv -s $(PKG_REPO) | cut -f 2 | $(SORT) -u > pkg5.fmris; fi; \
123 cat pkg5.fmris
125 # Build dependencies
126 REQUIRED_PACKAGES += library/desktop/libglade
127 REQUIRED_PACKAGES += system/install/text-install
128 REQUIRED_PACKAGES += system/library/install/libinstzones
129 REQUIRED_PACKAGES += system/library/storage/ima/header-ima
130 REQUIRED_PACKAGES += system/zones/internal