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 openssl ] { 19 HAIKU_BUILD_FEATURE_SSL = 1 ; 20} 21 22if $(HAIKU_BUILD_FEATURE_SSL) { 23 if [ IsPackageAvailable openssl_devel ] { 24 ExtractBuildFeatureArchives openssl : 25 file: base openssl 26 runtime: lib 27 file: devel openssl_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# libsolv 514if [ IsPackageAvailable libsolv_devel ] { 515 ExtractBuildFeatureArchives libsolv : 516 file: base libsolv 517 runtime: lib 518 file: devel libsolv_devel 519 depends: base 520 libraries: 521 $(developLibDir)/libsolv.so 522 $(developLibDir)/libsolvext.so 523 headers: $(developHeadersDir) 524 # sources are required for the primary architecture only 525 primary @{ 526 file: source libsolv_source 527 sources: develop/sources/%portRevisionedName%/sources 528 }@ 529 ; 530 531 EnableBuildFeatures libsolv ; 532} else { 533 unavailableBuildFeatures += libsolv ; 534} 535 536 537# qrencode 538if [ IsPackageAvailable qrencode_kdl_devel ] { 539 ExtractBuildFeatureArchives libqrencode_kdl : 540 file: devel qrencode_kdl_devel 541 library: $(developLibDir)/libqrencode_kdl.a 542 headers: $(developHeadersDir) 543 ; 544 545 EnableBuildFeatures libqrencode_kdl ; 546} else { 547 unavailableBuildFeatures += qrencode_kdl ; 548} 549 550 551# tiff 552if [ IsPackageAvailable tiff4_devel ] { 553 ExtractBuildFeatureArchives tiff : 554 file: base tiff4 555 runtime: lib 556 file: devel tiff4_devel 557 depends: base 558 library: $(developLibDir)/libtiff.so.5 559 headers: $(developHeadersDir) $(developHeadersDir)/tiff 560 ; 561 562 EnableBuildFeatures tiff ; 563} else { 564 unavailableBuildFeatures += tiff ; 565} 566 567 568# openexr 569if [ IsPackageAvailable openexr_devel ] { 570 ExtractBuildFeatureArchives openexr : 571 file: base openexr 572 runtime: lib 573 file: devel openexr_devel 574 depends: base 575 libraries: 576 $(developLibDir)/libIlmImf.so 577 $(developLibDir)/libIlmImfUtil.so 578 $(developLibDir)/libHalf.so 579 $(developLibDir)/libIex.so 580 $(developLibDir)/libIexMath.so 581 $(developLibDir)/libIlmThread.so 582 $(developLibDir)/libImath.so 583 headers: $(developHeadersDir) $(developHeadersDir)/OpenEXR 584 ; 585 586 EnableBuildFeatures openexr ; 587} else { 588 unavailableBuildFeatures += openexr ; 589} 590 591 592# libdvdread 593if [ IsPackageAvailable libdvdread_devel ] { 594 ExtractBuildFeatureArchives libdvdread : 595 file: base libdvdread 596 runtime: lib 597 file: devel libdvdread_devel 598 depends: base 599 libraries: $(developLibDir)/libdvdread.so.4 600 headers: $(developHeadersDir) 601 ; 602 603 EnableBuildFeatures libdvdread ; 604} else { 605 unavailableBuildFeatures += libdvdread ; 606} 607 608 609# libdvdnav 610if [ IsPackageAvailable libdvdnav_devel ] { 611 ExtractBuildFeatureArchives libdvdnav : 612 file: base libdvdnav 613 runtime: lib 614 file: devel libdvdnav_devel 615 depends: base 616 libraries: $(developLibDir)/libdvdnav.so.4 617 headers: $(developHeadersDir) 618 ; 619 620 EnableBuildFeatures libdvdnav ; 621} else { 622 unavailableBuildFeatures += libdvdnav ; 623} 624 625 626# libraw 627if [ IsPackageAvailable libraw_devel ] { 628 ExtractBuildFeatureArchives libraw : 629 file: base libraw 630 runtime: lib 631 file: devel libraw_devel 632 depends: base 633 libraries: $(developLibDir)/libraw.so 634 headers: $(developHeadersDir) 635 ; 636 637 EnableBuildFeatures libraw ; 638} else { 639 unavailableBuildFeatures += libraw ; 640} 641 642 643# libwebp 644if [ IsPackageAvailable libwebp_devel ] { 645 if $(HAIKU_PACKAGING_ARCH) = x86 && $(TARGET_PACKAGING_ARCH) = x86_gcc2 { 646 ExtractBuildFeatureArchives libwebp : 647 file: base libwebp 648 runtime: lib 649 file: devel libwebp_devel 650 depends: base 651 library: $(developLibDir)/libwebp.so.6 652 headers: $(developHeadersDir) $(developHeadersDir)/webp 653 ; 654 } else { 655 ExtractBuildFeatureArchives libwebp : 656 file: base libwebp 657 runtime: lib 658 file: devel libwebp_devel 659 depends: base 660 library: $(developLibDir)/libwebp.so.7 661 headers: $(developHeadersDir) $(developHeadersDir)/webp 662 ; 663 } 664 665 EnableBuildFeatures libwebp ; 666} else { 667 unavailableBuildFeatures += libwebp ; 668} 669 670 671# libavif 672if [ IsPackageAvailable libavif1.0_devel ] { 673 ExtractBuildFeatureArchives libavif : 674 file: base libavif1.0 675 runtime: lib 676 file: devel libavif1.0_devel 677 depends: base 678 library: $(developLibDir)/libavif.so 679 headers: $(developHeadersDir) $(developHeadersDir)/avif 680 ; 681 EnableBuildFeatures libavif ; 682} else { 683 unavailableBuildFeatures += libavif ; 684} 685 686 687# live555 688if [ IsPackageAvailable live555_devel ] { 689 ExtractBuildFeatureArchives live555 : 690 file: devel live555_devel 691 libraries: 692 $(developLibDir)/libliveMedia.a 693 $(developLibDir)/libBasicUsageEnvironment.a 694 $(developLibDir)/libgroupsock.a 695 $(developLibDir)/libUsageEnvironment.a 696 697 headers: $(developHeadersDir) 698 $(developHeadersDir)/liveMedia 699 $(developHeadersDir)/BasicUsageEnvironment 700 $(developHeadersDir)/groupsock 701 $(developHeadersDir)/UsageEnvironment 702 ; 703 EnableBuildFeatures live555 ; 704} else { 705 unavailableBuildFeatures += live555 ; 706} 707 708 709# ncurses 710if [ IsPackageAvailable ncurses6_devel ] { 711 ExtractBuildFeatureArchives ncurses : 712 file: base ncurses6 713 runtime: lib 714 file: devel ncurses6_devel 715 depends: base 716 library: $(developLibDir)/libncurses.so.6 717 headers: $(developHeadersDir) 718 ; 719 720 EnableBuildFeatures ncurses ; 721} else { 722 unavailableBuildFeatures += ncurses6 ; 723} 724 725 726# expat 727if [ IsPackageAvailable expat_devel ] { 728 ExtractBuildFeatureArchives expat : 729 file: base expat 730 runtime: lib 731 file: devel expat_devel 732 depends: base 733 library: $(developLibDir)/libexpat.so.1 734 headers: $(developHeadersDir) 735 ; 736 737 EnableBuildFeatures expat ; 738} else { 739 unavailableBuildFeatures += expat ; 740} 741 742 743# zstd 744if [ IsPackageAvailable zstd_devel ] { 745 ExtractBuildFeatureArchives zstd : 746 file: base zstd 747 runtime: lib 748 file: devel zstd_devel 749 depends: base 750 library: $(developLibDir)/libzstd.so 751 headers: $(developHeadersDir) 752 # sources are required for the primary architecture only 753 primary @{ 754 file: source zstd_source 755 sources: develop/sources/%portRevisionedName%/sources 756 }@ 757 ; 758 759 EnableBuildFeatures zstd ; 760} else { 761 unavailableBuildFeatures += zstd ; 762} 763 764 765# Print a diagnostic message with build features not presently available. 766if $(unavailableBuildFeatures) { 767 Echo "build-feature packages unavailable on $(TARGET_PACKAGING_ARCH):" 768 "$(unavailableBuildFeatures)" ; 769} 770