HaikuBootstrap revision 4e0c3c7c
1local architecture = $(HAIKU_PACKAGING_ARCHS[1]) ;
2
3
4local haikuPackage = haiku.hpkg ;
5HaikuPackage $(haikuPackage) ;
6
7
8# wifi firmware
9local driver ;
10for driver in $(SYSTEM_ADD_ONS_DRIVERS_NET) {
11	local package = [ on $(driver) return $(HAIKU_WIFI_FIRMWARE_PACKAGE) ] ;
12	local archive = [ on $(driver) return $(HAIKU_WIFI_FIRMWARE_ARCHIVE) ] ;
13	local extract = [ on $(driver) return $(HAIKU_WIFI_FIRMWARE_DO_EXTRACT) ] ;
14	if $(archive) {
15		AddWifiFirmwareToPackage $(driver) : $(package) : $(archive)
16			: $(extract) ;
17	}
18	local packages = [ on $(driver) return $(HAIKU_WIFI_FIRMWARE_PACKAGES) ] ;
19	local archives = [ on $(driver) return $(HAIKU_WIFI_FIRMWARE_ARCHIVES) ] ;
20	local archive ;
21	for archive in $(archives) {
22		AddWifiFirmwareToPackage $(driver) : $(packages[1]) : $(archive)
23			: $(extract) ;
24		packages = $(packages[2-]) ;
25	}
26}
27
28
29# modules
30AddFilesToPackage add-ons kernel bus_managers : $(SYSTEM_ADD_ONS_BUS_MANAGERS) ;
31AddFilesToPackage add-ons kernel busses agp_gart : <agp_gart>intel@x86,x86_64 ;
32
33AddFilesToPackage add-ons kernel busses ata
34	: generic_ide_pci it8211 legacy_sata silicon_image_3112 highpoint_ide_pci ide_isa@x86 ;
35
36AddFilesToPackage add-ons kernel busses scsi : ahci virtio_scsi ;
37AddFilesToPackage add-ons kernel busses usb : <usb>uhci <usb>ohci <usb>ehci ;
38AddFilesToPackage add-ons kernel busses virtio : virtio_pci ;
39AddFilesToPackage add-ons kernel console : vga_text ;
40AddFilesToPackage add-ons kernel debugger
41	: <kdebug>demangle <kdebug>disasm@x86 #<kdebug>hangman
42	  <kdebug>invalidate_on_exit <kdebug>usb_keyboard
43	  <kdebug>run_on_exit ;
44AddFilesToPackage add-ons kernel file_systems : $(SYSTEM_ADD_ONS_FILE_SYSTEMS) ;
45AddFilesToPackage add-ons kernel generic
46	: ata_adapter@ata bios@x86,x86_64 dpc
47		locked_pool mpu401 scsi_periph <module>tty ;
48AddFilesToPackage add-ons kernel partitioning_systems
49	: amiga_rdb@m68k apple@ppc efi_gpt intel session ;
50AddFilesToPackage add-ons kernel interrupt_controllers : openpic@ppc ;
51AddFilesToPackage add-ons kernel power cpufreq : intel_pstates@x86,x86_64 ;
52AddFilesToPackage add-ons kernel power cpuidle : intel_cstates@x86,x86_64 ;
53
54if $(TARGET_ARCH) = x86 || $(TARGET_ARCH) = x86_64 {
55	AddFilesToPackage add-ons kernel cpu : generic_x86 ;
56}
57
58# drivers
59AddNewDriversToPackage disk scsi	: scsi_cd scsi_disk ;
60AddNewDriversToPackage disk virtual	: ram_disk virtio_block ;
61AddNewDriversToPackage power		: acpi_battery@x86 ;
62AddNewDriversToPackage network		: virtio_net ;
63#AddNewDriversToPackage display		: display_adapter@x86 ;
64
65# legacy drivers
66AddDriversToPackage					: console dprintf null random <driver>tty
67										zero ;
68AddDriversToPackage audio hmulti	: $(SYSTEM_ADD_ONS_DRIVERS_AUDIO) ;
69AddDriversToPackage audio old		: $(SYSTEM_ADD_ONS_DRIVERS_AUDIO_OLD) ;
70AddDriversToPackage midi			: $(SYSTEM_ADD_ONS_DRIVERS_MIDI) ;
71AddDriversToPackage bus				: usb_raw fw_raw@x86 ;
72AddDriversToPackage disk floppy		: pc_floppy@x86 ;
73AddDriversToPackage disk usb		: usb_disk ;
74AddDriversToPackage disk usb		: usb_floppy ;
75AddDriversToPackage printer usb		: usb_printer ;
76AddDriversToPackage disk virtual	: nbd ;
77AddDriversToPackage graphics		: $(SYSTEM_ADD_ONS_DRIVERS_GRAPHICS) ;
78AddDriversToPackage input			: ps2_hid usb_hid wacom ;
79AddDriversToPackage misc			: <driver>poke <driver>mem ;
80AddDriversToPackage net				: $(SYSTEM_ADD_ONS_DRIVERS_NET) ;
81AddDriversToPackage ports			: pc_serial usb_serial ;
82AddDriversToPackage power			: $(SYSTEM_ADD_ONS_DRIVERS_POWER) ;
83
84# kernel
85AddFilesToPackage : <revisioned>kernel_$(TARGET_ARCH) ;
86
87# libs
88AddLibrariesToPackage lib
89	: [ HaikuImageGetSystemLibs ] [ HaikuImageGetPrivateSystemLibs ] ;
90
91# libnetwork.so replaces quite a few libraries
92if $(HAIKU_GCC_VERSION_$(architecture)[1]) = 2 {
93	local libNetworkAliases = libsocket.so libbind.so libnet.so ;
94	local lib ;
95	for lib in $(libNetworkAliases) {
96		AddSymlinkToPackage lib : libnetwork.so : $(lib) ;
97	}
98
99	AddSymlinkToPackage lib : libbnetapi.so : libnetapi.so ;
100}
101
102
103# servers
104AddFilesToPackage servers : $(SYSTEM_SERVERS) ;
105
106# apps
107AddFilesToPackage  				: runtime_loader Deskbar Tracker ;
108AddFilesToPackage bin			: $(SYSTEM_BIN) consoled ;
109AddFilesToPackage apps			: $(SYSTEM_APPS) ;
110AddFilesToPackage preferences	: $(SYSTEM_PREFERENCES) ;
111AddFilesToPackage demos			: $(SYSTEM_DEMOS) ;
112
113SEARCH on install-wifi-firmwares.sh = [ FDirName $(HAIKU_TOP) data bin ] ;
114AddFilesToPackage bin : install-wifi-firmwares.sh ;
115
116AddSymlinkToPackage bin : trash : untrash ;
117AddSymlinkToPackage bin : less : more ;
118
119# scripts and data files
120local bootScripts = PostInstallScript SetupEnvironment
121	InstallerInitScript InstallerFinishScript ;
122SEARCH on $(bootScripts) = [ FDirName $(HAIKU_TOP) data system boot ] ;
123AddFilesToPackage boot : $(bootScripts) ;
124
125local launchScripts = <data!launch>system ;
126SEARCH on $(launchScripts) = [ FDirName $(HAIKU_TOP) data launch ] ;
127AddFilesToPackage data launch : $(launchScripts) ;
128
129local userLaunchScripts = <data!launch>user <data!launch>bootstrap ;
130SEARCH on $(userLaunchScripts) = [ FDirName $(HAIKU_TOP) data launch ] ;
131AddFilesToPackage data user_launch : $(userLaunchScripts) ;
132
133# first login scripts
134local firstLoginFiles = default_deskbar_items.sh ;
135firstLoginFiles = $(firstLoginFiles:G=first-login) ;
136SEARCH on $(firstLoginFiles)
137	= [ FDirName $(HAIKU_TOP) data system boot first_login ] ;
138AddFilesToPackage boot first_login : $(firstLoginFiles) ;
139
140local fortuneFiles = [ Glob $(HAIKU_TOP)/data/system/data/fortunes
141	: [a-zA-Z0-9]* ] ;
142fortuneFiles = $(fortuneFiles:G=data!fortunes) ;
143AddFilesToPackage data fortunes : $(fortuneFiles) ;
144
145local fontDir = [ FDirName $(HAIKU_TOP) data system data fonts ] ;
146local psFonts = [ Glob $(fontDir)/psfonts : *.afm *.pfb ] ;
147AddFilesToPackage data fonts psfonts : $(psFonts) ;
148
149# keymaps
150AddFilesToPackage data Keymaps : $(HAIKU_KEYMAP_FILES) ;
151local keymapAlias ;
152for keymapAlias in $(HAIKU_KEYMAP_ALIASES) {
153	local aliasedTo = [ on $(keymapAlias) return $(HAIKU_KEYMAP_FILE) ] ;
154	AddSymlinkToPackage data Keymaps : $(aliasedTo:BSM) : $(keymapAlias:BSM) ;
155}
156
157# keyboard layouts
158AddFilesToPackage data KeyboardLayouts
159	: $(HAIKU_KEYBOARD_LAYOUT_FILES) ;
160AddFilesToPackage data KeyboardLayouts Apple\ Aluminum
161	: $(HAIKU_APPLE_ALUMINUM_KEYBOARD_LAYOUT_FILES) ;
162AddFilesToPackage data KeyboardLayouts ThinkPad
163	: $(HAIKU_THINKPAD_KEYBOARD_LAYOUT_FILES) ;
164
165# boot module links
166AddBootModuleSymlinksToPackage
167	acpi@x86,x86_64 ata@ata pci isa@x86,x86_64 config_manager dpc
168	scsi usb
169	openpic@ppc
170	ata_adapter@ata locked_pool scsi_periph
171	ahci generic_ide_pci it8211 legacy_sata silicon_image_3112
172	highpoint_ide_pci
173	ide_isa@x86
174	<usb>uhci <usb>ohci <usb>ehci
175	scsi_cd scsi_disk usb_disk
176	virtio virtio_pci virtio_block virtio_scsi
177	efi_gpt
178	intel
179	bfs packagefs
180;
181
182# add-ons
183AddFilesToPackage add-ons accelerants	: $(SYSTEM_ADD_ONS_ACCELERANTS) ;
184AddFilesToPackage add-ons Translators	: $(SYSTEM_ADD_ONS_TRANSLATORS) ;
185AddFilesToPackage add-ons locale catalogs : $(SYSTEM_ADD_ONS_LOCALE_CATALOGS) ;
186
187AddFilesToPackage add-ons Tracker
188	: FileType Mark\ as��� Mark\ as\ Read Open\ Target\ Folder
189		Open\ Terminal ZipOMatic ;
190AddSymlinkToPackage add-ons Tracker
191	: /boot/system/preferences/Backgrounds : Background-B ;
192AddSymlinkToPackage add-ons Tracker
193	: /boot/system/apps/TextSearch : TextSearch-G ;
194AddSymlinkToPackage add-ons Tracker
195	: /boot/system/apps/DiskUsage : DiskUsage-I ;
196
197AddFilesToPackage add-ons input_server devices
198	: <input>keyboard <input>mouse <input>tablet <input>wacom ;
199AddFilesToPackage add-ons input_server filters
200	: switch_workspace ;
201
202AddFilesToPackage add-ons kernel network : <net>notifications stack ;
203AddFilesToPackage add-ons kernel network : dns_resolver ;
204AddFilesToPackage add-ons kernel network devices : $(SYSTEM_NETWORK_DEVICES) ;
205AddFilesToPackage add-ons kernel network datalink_protocols
206	: $(SYSTEM_NETWORK_DATALINK_PROTOCOLS) ;
207AddFilesToPackage add-ons kernel network ppp : $(SYSTEM_NETWORK_PPP) ;
208AddFilesToPackage add-ons kernel network protocols
209	: $(SYSTEM_NETWORK_PROTOCOLS) ;
210
211AddFilesToPackage add-ons disk_systems
212	: <disk_system>intel <disk_system>gpt <disk_system>bfs <disk_system>ntfs ;
213
214
215# the MIME DB
216CopyDirectoryToPackage data : <mimedb>mime_db : : : isTarget ;
217
218
219# Deskbar menu symlinks
220
221# "Applications" links
222DESKBAR_APPLICATIONS = ActivityMonitor CharacterMap DeskCalc
223	Devices DiskProbe DriveSetup DiskUsage Expander Installer
224	StyledEdit Terminal
225;
226local linkTarget ;
227for linkTarget in $(DESKBAR_APPLICATIONS) {
228	AddSymlinkToPackage data deskbar menu Applications
229		: ../../../../apps/$(linkTarget) : $(linkTarget) ;
230}
231
232# "Desktop applets" links
233DESKBAR_DESKTOP_APPLETS = LaunchBox NetworkStatus PowerStatus ProcessController
234	Workspaces
235;
236for linkTarget in $(DESKBAR_DESKTOP_APPLETS) {
237	AddSymlinkToPackage data deskbar menu Desktop\ applets
238		: ../../../../apps/$(linkTarget) : $(linkTarget) ;
239}
240
241# "Preferences" links
242AddDirectoryToPackage data deskbar menu Preferences ;
243DESKBAR_PREFERENCES = $(SYSTEM_PREFERENCES:B) ;
244for linkTarget in $(DESKBAR_PREFERENCES) {
245	AddSymlinkToPackage data deskbar menu Preferences
246		: ../../../../preferences/$(linkTarget)
247		: $(linkTarget) ;
248}
249
250# Deskbar menu entries file
251AddFilesToPackage data deskbar : <deskbar>menu_entries ;
252
253
254# licenses
255CopyDirectoryToPackage data
256	: [ FDirName $(HAIKU_TOP) data system data licenses ]
257	: licenses ;
258
259# netresolv support files
260CopyDirectoryToPackage data
261	: [ FDirName $(HAIKU_TOP) data system data network ]
262	: network ;
263
264# Copy documentation as per DiskUsage's license requirement.
265CopyDirectoryToPackage documentation
266	: [ FDirName $(HAIKU_TOP) docs apps diskusage ]
267	: diskusage ;
268
269
270BuildHaikuPackage $(haikuPackage) : haiku ;
271