1# This file contains setup for build features that require external packages. It 2# is included once for each configured packaging architecture (with 3# TARGET_PACKAGING_ARCH set accordingly). 4 5 6local architecture = $(TARGET_PACKAGING_ARCH) ; 7local secondaryArchSubDir = [ MultiArchIfPrimary "" : /$(architecture) ] ; 8local libDir = lib$(secondaryArchSubDir) ; 9local developLibDir = develop/lib$(secondaryArchSubDir) ; 10local developHeadersDir = develop/headers$(secondaryArchSubDir) ; 11 12local unavailableBuildFeatures ; 13 14 15# SSL 16 17# Automatically enable the SSL feature, when the OpenSSL package is enabled. 18if [ IsHaikuImagePackageAdded openssl3 ] { 19 HAIKU_BUILD_FEATURE_SSL = 1 ; 20} 21 22if $(HAIKU_BUILD_FEATURE_SSL) { 23 if [ IsPackageAvailable openssl3_devel ] { 24 ExtractBuildFeatureArchives openssl : 25 file: base openssl3 26 runtime: lib 27 file: devel openssl3_devel 28 depends: base 29 libraries: 30 $(developLibDir)/libcrypto.so 31 $(developLibDir)/libssl.so 32 headers: $(developHeadersDir) 33 ; 34 35 EnableBuildFeatures openssl ; 36 } else { 37 unavailableBuildFeatures += openssl ; 38 } 39} 40 41 42# gcc_syslibs 43 44if $(TARGET_PACKAGING_ARCH) != x86_gcc2 { 45 if [ IsPackageAvailable gcc_syslibs ] { 46 ExtractBuildFeatureArchives gcc_syslibs : 47 file: base gcc_syslibs 48 libgcc_s.so.1: $(libDir)/libgcc_s.so.1 49 libstdc++.so: $(libDir)/libstdc++.so 50 libsupc++.so: $(libDir)/libsupc++.so 51 ; 52 53 EnableBuildFeatures gcc_syslibs ; 54 } else { 55 unavailableBuildFeatures += gcc_syslibs ; 56 } 57} 58 59 60# gcc_syslibs_devel 61 62if [ IsPackageAvailable gcc_syslibs_devel ] { 63 if $(TARGET_PACKAGING_ARCH) = x86_gcc2 { 64 ExtractBuildFeatureArchives gcc_syslibs_devel : 65 file: base gcc_syslibs_devel 66 libgcc.a: $(developLibDir)/libgcc.a 67 libgcc_eh.a: 68 libgcc-kernel.a: $(developLibDir)/libgcc.a 69 libgcc_eh-kernel.a: 70 libstdc++.a: 71 libsupc++.a: 72 libsupc++-kernel.a: 73 ; 74 } else { 75 ExtractBuildFeatureArchives gcc_syslibs_devel : 76 file: base gcc_syslibs_devel 77 libgcc.a: $(developLibDir)/libgcc.a 78 libgcc_eh.a: $(developLibDir)/libgcc_eh.a 79 libgcc-kernel.a: $(developLibDir)/libgcc-kernel.a 80 libgcc_eh-kernel.a: $(developLibDir)/libgcc_eh.a 81 libgcc-boot.a: $(developLibDir)/libgcc-boot.a 82 libgcc_eh-boot.a: $(developLibDir)/libgcc_eh-boot.a 83 libstdc++.a: $(developLibDir)/libstdc++.a 84 libsupc++.a: $(developLibDir)/libsupc++.a 85 libsupc++-kernel.a: $(developLibDir)/libsupc++-kernel.a 86 libsupc++-boot.a: $(developLibDir)/libsupc++-boot.a 87 c++-headers: $(developHeadersDir)/c++ 88 gcc-headers: $(developHeadersDir)/gcc 89 ; 90 } 91 92 EnableBuildFeatures gcc_syslibs_devel ; 93} else { 94 unavailableBuildFeatures += gcc_syslibs_devel ; 95} 96 97 98# ICU 99 100if [ IsPackageAvailable icu_devel ] { 101 ExtractBuildFeatureArchives icu : 102 file: base icu 103 runtime: lib 104 file: devel icu_devel 105 depends: base 106 libraries: 107 $(developLibDir)/libicudata.so 108 $(developLibDir)/libicui18n.so 109 $(developLibDir)/libicuio.so 110 $(developLibDir)/libicuuc.so 111 headers: $(developHeadersDir) 112 ; 113 114 EnableBuildFeatures icu ; 115} else if [ IsPackageAvailable icu74_devel ] { 116 ExtractBuildFeatureArchives icu : 117 file: base icu74 118 runtime: lib 119 file: devel icu74_devel 120 depends: base 121 libraries: 122 $(developLibDir)/libicudata.so 123 $(developLibDir)/libicui18n.so 124 $(developLibDir)/libicuio.so 125 $(developLibDir)/libicuuc.so 126 headers: $(developHeadersDir) 127 ; 128 129 EnableBuildFeatures icu ; 130} else { 131 unavailableBuildFeatures += icu ; 132} 133 134 135# CLucene 136 137# TODO: Update to packages! 138if ! 1 { 139 140# Automatically install the CLucene feature, when the CLucene package is 141# enabled. 142if [ IsHaikuImagePackageAdded clucene ] { 143 HAIKU_BUILD_FEATURE_CLUCENE = 1 ; 144} 145 146 147HAIKU_CLUCENE_PACKAGE = clucene-0.9.21-x86-gcc4-haiku-2009-08-11.zip ; 148HAIKU_CLUCENE_URL = $(baseURL)/$(HAIKU_CLUCENE_PACKAGE) ; 149 150if $(HAIKU_BUILD_FEATURE_CLUCENE) { 151 if $(TARGET_ARCH) != x86 { 152 Echo "CLucene build feature not available for" 153 "$(TARGET_PACKAGING_ARCH)" ; 154 } else { 155 # Download the zip archive. 156 local zipFile = [ DownloadFile $(HAIKU_CLUCENE_PACKAGE) 157 : $(HAIKU_CLUCENE_URL) ] ; 158 159 # zip file and output directory 160 HAIKU_CLUCENE_ZIP_FILE = $(zipFile) ; 161 HAIKU_CLUCENE_DIR = [ FDirName $(HAIKU_OPTIONAL_BUILD_PACKAGES_DIR) 162 $(HAIKU_CLUCENE_PACKAGE:B) ] ; 163 164 # extract headers and libraries 165 HAIKU_CLUCENE_HEADERS_DEPENDENCY = [ ExtractArchive $(HAIKU_CLUCENE_DIR) 166 : common/include/ : $(zipFile) : extracted-clucene 167 ] ; 168 169 HAIKU_CLUCENE_LIBS = [ ExtractArchive $(HAIKU_CLUCENE_DIR) 170 : 171 common/lib/libclucene.a 172 : $(zipFile) 173 : extracted-clucene 174 ] ; 175 176 HAIKU_CLUCENE_HEADERS 177 = [ FDirName $(HAIKU_CLUCENE_DIR) common include ] ; 178 179 EnableBuildFeatures clucene ; 180 } 181} 182 183} # ! 1 184 185 186# Giflib 187if [ IsPackageAvailable giflib_devel ] { 188 ExtractBuildFeatureArchives giflib : 189 file: base giflib 190 runtime: lib 191 file: devel giflib_devel 192 depends: base 193 library: $(developLibDir)/libgif.so.7 194 headers: $(developHeadersDir) 195 ; 196 197 EnableBuildFeatures giflib ; 198} else { 199 unavailableBuildFeatures += giflib ; 200} 201 202 203# GLU (GL Utilities) 204if [ IsPackageAvailable glu_devel ] { 205 ExtractBuildFeatureArchives glu : 206 file: base glu 207 runtime: lib 208 file: devel glu_devel 209 depends: base 210 library: $(developLibDir)/libGLU.so 211 headers: $(developHeadersDir) 212 ; 213 214 EnableBuildFeatures glu ; 215} else { 216 unavailableBuildFeatures += glu ; 217} 218 219 220# GL (GL Kit, Mesa3D) 221if [ IsPackageAvailable mesa_devel ] { 222 ExtractBuildFeatureArchives mesa : 223 file: base mesa 224 runtime: lib 225 file: devel mesa_devel 226 depends: base 227 library: $(developLibDir)/libGL.so 228 headers: $(developHeadersDir)/os/opengl 229 ; 230 231 EnableBuildFeatures mesa ; 232} else { 233 unavailableBuildFeatures += mesa ; 234} 235 236 237# FFmpeg 238if [ IsPackageAvailable ffmpeg6_devel ] { 239 local ffmpegLibs = libavformat.so libavcodec.so libavfilter.so libswscale.so 240 libavutil.so libswresample.so ; 241 242 ExtractBuildFeatureArchives ffmpeg : 243 file: base ffmpeg6 244 runtime: lib 245 file: devel ffmpeg6_devel 246 depends: base 247 libraries: $(developLibDir)/$(ffmpegLibs) 248 headers: $(developHeadersDir) 249 ; 250 251 EnableBuildFeatures ffmpeg ; 252 253} else { 254 unavailableBuildFeatures += ffmpeg ; 255} 256 257 258# Fluidlite 259if [ IsPackageAvailable fluidlite_devel ] && [ IsPackageAvailable libvorbis_devel ] { 260 ExtractBuildFeatureArchives fluidlite : 261 file: devel fluidlite_devel 262 library: $(developLibDir)/libfluidlite-static.a 263 headers: $(developHeadersDir) 264 ; 265 266 EnableBuildFeatures fluidlite ; 267} else { 268 unavailableBuildFeatures += fluidlite ; 269} 270 271 272# Libvorbis 273if [ IsPackageAvailable libvorbis_devel ] { 274 ExtractBuildFeatureArchives libvorbis : 275 file: base libvorbis 276 runtime: lib 277 file: devel libvorbis_devel 278 depends: base 279 library: $(developLibDir)/libvorbisfile.so.3 280 headers: $(developHeadersDir) 281 ; 282 283 EnableBuildFeatures libvorbis ; 284} else { 285 unavailableBuildFeatures += libvorbis ; 286} 287 288 289# Freetype 290if [ IsPackageAvailable freetype_devel ] { 291 ExtractBuildFeatureArchives freetype : 292 file: base freetype 293 runtime: lib 294 file: devel freetype_devel 295 depends: base 296 library: $(developLibDir)/libfreetype.so 297 headers: $(developHeadersDir) $(developHeadersDir)/freetype2 298 ; 299 300 EnableBuildFeatures freetype ; 301} else { 302 unavailableBuildFeatures += freetype ; 303} 304 305# fontconfig 306if [ IsPackageAvailable fontconfig_devel ] { 307 ExtractBuildFeatureArchives fontconfig : 308 file: base fontconfig 309 runtime: lib 310 file: devel fontconfig_devel 311 depends: base 312 library: $(developLibDir)/libfontconfig.so 313 headers: $(developHeadersDir) $(developHeadersDir)/fontconfig 314 ; 315 316 EnableBuildFeatures fontconfig ; 317} else { 318 unavailableBuildFeatures += fontconfig ; 319} 320 321# Gutenprint 322if [ IsPackageAvailable gutenprint9_devel ] { 323 ExtractBuildFeatureArchives gutenprint : 324 file: base gutenprint9 325 runtime: lib 326 file: devel gutenprint9_devel 327 depends: base 328 library: $(developLibDir)/libgutenprint.so 329 headers: $(developHeadersDir) $(developHeadersDir)/gutenprint 330 ; 331 332 EnableBuildFeatures gutenprint ; 333} else { 334 unavailableBuildFeatures += gutenprint ; 335} 336 337 338# TagLib 339 340# TODO: Update to packages! 341if ! 1 { 342 343# Automatically install the TagLib feature, when the optional TagLib optional 344# package is enabled. 345if [ IsHaikuImagePackageAdded taglib ] { 346 HAIKU_BUILD_FEATURE_TAGLIB = 1 ; 347} 348 349HAIKU_TAGLIB_PACKAGE = taglib-1.6.3-r1a4-x86-gcc2-2012-09-03.zip ; 350HAIKU_TAGLIB_URL = $(baseURL)/$(HAIKU_TAGLIB_PACKAGE) ; 351 352if $(HAIKU_BUILD_FEATURE_TAGLIB) { 353 if $(TARGET_ARCH) != x86 { 354 Echo "TagLib build feature not available for $(TARGET_PACKAGING_ARCH)" ; 355 } else { 356 # Download the zip archive. 357 local zipFile = [ DownloadFile $(HAIKU_TAGLIB_PACKAGE) 358 : $(HAIKU_TAGLIB_URL) ] ; 359 360 # zip file and output directory 361 HAIKU_TAGLIB_ZIP_FILE = $(zipFile) ; 362 HAIKU_TAGLIB_DIR = [ FDirName $(HAIKU_OPTIONAL_BUILD_PACKAGES_DIR) 363 $(HAIKU_TAGLIB_PACKAGE:B) ] ; 364 365 # extract headers and libraries 366 HAIKU_TAGLIB_HEADERS_DEPENDENCY = [ ExtractArchive $(HAIKU_TAGLIB_DIR) 367 : common/include/ : $(zipFile) : extracted-taglib 368 ] ; 369 370 HAIKU_TAGLIB_LIBS = [ ExtractArchive $(HAIKU_TAGLIB_DIR) 371 : 372 common/lib/libtag.so 373 common/lib/libtag_c.so 374 : $(zipFile) 375 : extracted-taglib 376 ] ; 377 378 HAIKU_TAGLIB_HEADERS 379 = [ FDirName $(HAIKU_TAGLIB_DIR) common include taglib ] ; 380 381 EnableBuildFeatures taglib ; 382 } 383} 384 385} # ! 1 386 387 388# WebKit 389if [ IsPackageAvailable haikuwebkit_devel ] { 390 ExtractBuildFeatureArchives webkit : 391 file: base haikuwebkit 392 runtime: lib 393 file: devel haikuwebkit_devel 394 depends: base 395 libraries: 396 $(developLibDir)/libWebKitLegacy.so 397 headers: $(developHeadersDir) 398 ; 399 400 EnableBuildFeatures webkit ; 401} else { 402 unavailableBuildFeatures += webkit ; 403} 404 405 406# libpng 407if [ IsPackageAvailable libpng16_devel ] { 408 ExtractBuildFeatureArchives libpng : 409 file: base libpng16 410 runtime: lib 411 file: devel libpng16_devel 412 depends: base 413 library: $(developLibDir)/libpng16.so 414 headers: $(developHeadersDir) 415 ; 416 417 EnableBuildFeatures libpng ; 418} else { 419 unavailableBuildFeatures += libpng ; 420} 421 422 423# libicns 424if [ IsPackageAvailable libicns_devel ] { 425 ExtractBuildFeatureArchives libicns : 426 file: base libicns 427 runtime: lib 428 file: devel libicns_devel 429 depends: base 430 library: $(developLibDir)/libicns.so.1 431 headers: $(developHeadersDir) 432 ; 433 434 EnableBuildFeatures libicns ; 435} else { 436 unavailableBuildFeatures += libicns ; 437} 438 439 440# Jasper 441if [ IsPackageAvailable jasper_devel ] { 442 ExtractBuildFeatureArchives jasper : 443 file: base jasper 444 runtime: lib 445 file: devel jasper_devel 446 depends: base 447 library: $(developLibDir)/libjasper.so.4 448 headers: $(developHeadersDir) $(developHeadersDir)/jasper 449 ; 450 451 EnableBuildFeatures jasper ; 452} else { 453 unavailableBuildFeatures += jasper ; 454} 455 456 457# jpeg 458if [ IsPackageAvailable libjpeg_turbo_devel ] { 459 ExtractBuildFeatureArchives jpeg : 460 file: base libjpeg_turbo 461 runtime: lib 462 file: devel libjpeg_turbo_devel 463 depends: base 464 library: $(developLibDir)/libjpeg.so 465 headers: $(developHeadersDir) 466 ; 467 468 EnableBuildFeatures jpeg ; 469} else { 470 unavailableBuildFeatures += jpeg ; 471} 472 473 474# zlib 475if [ IsPackageAvailable zlib_devel ] { 476 ExtractBuildFeatureArchives zlib : 477 file: base zlib 478 runtime: lib 479 file: devel zlib_devel 480 depends: base 481 library: $(developLibDir)/libz.so 482 headers: $(developHeadersDir) 483 # sources are required for the primary architecture only 484 primary @{ 485 file: source zlib_source 486 sources: develop/sources/%portRevisionedName%/sources 487 }@ 488 ; 489 490 EnableBuildFeatures zlib ; 491} else { 492 unavailableBuildFeatures += zlib ; 493} 494 495 496# libedit 497if [ IsPackageAvailable libedit_devel ] { 498 ExtractBuildFeatureArchives libedit : 499 file: base libedit 500 runtime: lib 501 file: devel libedit_devel 502 depends: base 503 library: $(developLibDir)/libedit.so 504 headers: $(developHeadersDir) 505 ; 506 507 EnableBuildFeatures libedit ; 508} else { 509 unavailableBuildFeatures += libedit ; 510} 511 512 513# qrencode 514if [ IsPackageAvailable qrencode_kdl_devel ] { 515 ExtractBuildFeatureArchives libqrencode_kdl : 516 file: devel qrencode_kdl_devel 517 library: $(developLibDir)/libqrencode_kdl.a 518 headers: $(developHeadersDir) 519 ; 520 521 EnableBuildFeatures libqrencode_kdl ; 522} else { 523 unavailableBuildFeatures += qrencode_kdl ; 524} 525 526 527# tiff 528if [ IsPackageAvailable tiff_devel ] { 529 ExtractBuildFeatureArchives tiff : 530 file: base tiff 531 runtime: lib 532 file: devel tiff_devel 533 depends: base 534 library: $(developLibDir)/libtiff.so 535 headers: $(developHeadersDir) $(developHeadersDir)/tiff 536 ; 537 538 EnableBuildFeatures tiff ; 539} else { 540 unavailableBuildFeatures += tiff ; 541} 542 543 544# libdvdread 545if [ IsPackageAvailable libdvdread_devel ] { 546 ExtractBuildFeatureArchives libdvdread : 547 file: base libdvdread 548 runtime: lib 549 file: devel libdvdread_devel 550 depends: base 551 libraries: $(developLibDir)/libdvdread.so.4 552 headers: $(developHeadersDir) 553 ; 554 555 EnableBuildFeatures libdvdread ; 556} else { 557 unavailableBuildFeatures += libdvdread ; 558} 559 560 561# libdvdnav 562if [ IsPackageAvailable libdvdnav_devel ] { 563 ExtractBuildFeatureArchives libdvdnav : 564 file: base libdvdnav 565 runtime: lib 566 file: devel libdvdnav_devel 567 depends: base 568 libraries: $(developLibDir)/libdvdnav.so.4 569 headers: $(developHeadersDir) 570 ; 571 572 EnableBuildFeatures libdvdnav ; 573} else { 574 unavailableBuildFeatures += libdvdnav ; 575} 576 577 578# libraw 579if [ IsPackageAvailable libraw_devel ] { 580 ExtractBuildFeatureArchives libraw : 581 file: base libraw 582 runtime: lib 583 file: devel libraw_devel 584 depends: base 585 libraries: $(developLibDir)/libraw.so 586 headers: $(developHeadersDir) 587 ; 588 589 EnableBuildFeatures libraw ; 590} else { 591 unavailableBuildFeatures += libraw ; 592} 593 594 595# libwebp 596if [ IsPackageAvailable libwebp_devel ] { 597 if $(HAIKU_PACKAGING_ARCH) = x86 && $(TARGET_PACKAGING_ARCH) = x86_gcc2 { 598 ExtractBuildFeatureArchives libwebp : 599 file: base libwebp 600 runtime: lib 601 file: devel libwebp_devel 602 depends: base 603 library: $(developLibDir)/libwebp.so.6 604 headers: $(developHeadersDir) $(developHeadersDir)/webp 605 ; 606 } else { 607 ExtractBuildFeatureArchives libwebp : 608 file: base libwebp 609 runtime: lib 610 file: devel libwebp_devel 611 depends: base 612 library: $(developLibDir)/libwebp.so.7 613 headers: $(developHeadersDir) $(developHeadersDir)/webp 614 ; 615 } 616 617 EnableBuildFeatures libwebp ; 618} else { 619 unavailableBuildFeatures += libwebp ; 620} 621 622 623# libavif 624if [ IsPackageAvailable libavif1.0_devel ] { 625 ExtractBuildFeatureArchives libavif : 626 file: base libavif1.0 627 runtime: lib 628 file: devel libavif1.0_devel 629 depends: base 630 library: $(developLibDir)/libavif.so 631 headers: $(developHeadersDir) $(developHeadersDir)/avif 632 ; 633 EnableBuildFeatures libavif ; 634} else { 635 unavailableBuildFeatures += libavif ; 636} 637 638 639# live555 640if [ IsPackageAvailable live555_devel ] { 641 ExtractBuildFeatureArchives live555 : 642 file: devel live555_devel 643 libraries: 644 $(developLibDir)/libliveMedia.a 645 $(developLibDir)/libBasicUsageEnvironment.a 646 $(developLibDir)/libgroupsock.a 647 $(developLibDir)/libUsageEnvironment.a 648 649 headers: $(developHeadersDir) 650 $(developHeadersDir)/liveMedia 651 $(developHeadersDir)/BasicUsageEnvironment 652 $(developHeadersDir)/groupsock 653 $(developHeadersDir)/UsageEnvironment 654 ; 655 EnableBuildFeatures live555 ; 656} else { 657 unavailableBuildFeatures += live555 ; 658} 659 660 661# ncurses 662if [ IsPackageAvailable ncurses6_devel ] { 663 ExtractBuildFeatureArchives ncurses : 664 file: base ncurses6 665 runtime: lib 666 file: devel ncurses6_devel 667 depends: base 668 library: $(developLibDir)/libncurses.so.6 669 headers: $(developHeadersDir) 670 ; 671 672 EnableBuildFeatures ncurses ; 673} else { 674 unavailableBuildFeatures += ncurses6 ; 675} 676 677 678# expat 679if [ IsPackageAvailable expat_devel ] { 680 ExtractBuildFeatureArchives expat : 681 file: base expat 682 runtime: lib 683 file: devel expat_devel 684 depends: base 685 library: $(developLibDir)/libexpat.so.1 686 headers: $(developHeadersDir) 687 ; 688 689 EnableBuildFeatures expat ; 690} else { 691 unavailableBuildFeatures += expat ; 692} 693 694 695# zstd 696if [ IsPackageAvailable zstd_devel ] { 697 ExtractBuildFeatureArchives zstd : 698 file: base zstd 699 runtime: lib 700 file: devel zstd_devel 701 depends: base 702 library: $(developLibDir)/libzstd.so 703 headers: $(developHeadersDir) 704 # sources are required for the primary architecture only 705 primary @{ 706 file: source zstd_source 707 sources: develop/sources/%portRevisionedName%/sources 708 }@ 709 ; 710 711 EnableBuildFeatures zstd ; 712} else { 713 unavailableBuildFeatures += zstd ; 714} 715 716 717# Print a diagnostic message with build features not presently available. 718if $(unavailableBuildFeatures) { 719 Echo "build-feature packages unavailable on $(TARGET_PACKAGING_ARCH):" 720 "$(unavailableBuildFeatures)" ; 721} 722