Ticket #23843: Portfile

File Portfile, 3.9 KB (added by drechsel@…, 14 years ago)
Line 
1# $Id: Portfile 58489 2009-09-29 18:52:51Z toby@macports.org $
2
3PortSystem 1.0
4PortGroup  muniversal 1.0
5
6name            ncurses
7version         5.7
8categories      devel
9platforms       darwin freebsd
10maintainers     imajes
11description     emulation of curses in System V Release 4.0
12long_description \
13    The Ncurses (new curses) library is a free software emulation of    \
14    curses in System V Release 4.0, and more. It uses Terminfo format,  \
15    supports pads and color and multiple highlights and forms           \
16    characters and function-key mapping, and has all the other          \
17    SYSV-curses enhancements over BSD Curses.
18
19homepage        http://www.gnu.org/software/ncurses/ncurses.html
20master_sites    gnu
21
22checksums               md5             cce05daf61a64501ef6cd8da1f727ec6 \
23                                sha1    8233ee56ed84ae05421e4e6d6db6c1fe72ee6797 \
24                                rmd160  a19ca026d32255f5a4d22eb006d65182041e0234
25
26# required for terminfo
27depends_run     port:ncursesw
28
29configure.cppflags
30configure.ldflags
31configure.args  --with-shared \
32                --disable-rpath \
33                --without-debug  \
34                --without-ada \
35                --enable-safe-sprintf \
36                --enable-sigwinch \
37                --without-progs \
38                --mandir=${prefix}/share/delete-me \
39                --with-manpage-format=normal
40
41platform darwin 10 {
42        configure.args-delete --enable-safe-sprintf
43}
44platform darwin 11 {
45        configure.args-delete --enable-safe-sprintf
46}
47
48post-destroot {
49    # terminfo & manpages also do come with ncursesw
50    delete ${destroot}${prefix}/lib/terminfo ${destroot}${prefix}/share
51}
52
53platform freebsd {
54    depends_build-append    lib:libncursesw:ncursesw
55    destroot.env-append     LD_LIBRARY_PATH=${prefix}/lib
56}
57
58if {[variant_isset universal]} {
59        merger_arch_compiler yes
60   
61        pre-destroot {
62        global merger_dont_diff
63        # These tests must be done in pre-destroot to ensure universal_archs_to_use has the correct values.
64        if { [llength ${universal_archs_to_use}] > 2 } {
65            lappend merger_dont_diff ${prefix}/include/${name}/curses.h
66        }
67    }
68
69    # When cross-compiling, force configure script to assume file system is the same on build and host architectures.
70    #     We can not use --enable-mixed-case=[yes,no] since HFS+ case sensitivity is not known.
71    patchfiles-append  patch-configure.diff
72
73    # Build process requires compiler and pre-processor to build binaries which run on build architecture.
74    lappend cross_configure_args  --with-build-cc='${configure.cc}'
75    lappend cross_configure_args  --with-build-cpp='${configure.cpp}'
76
77    # Unless, _XOPEN_SOURCE_EXTENDED is defined, include/curses.h will not include some system header files,
78    #     which in turn will cause problems with ncurses/curses.priv.h.
79    lappend cross_configure_args  --with-build-cppflags=-D_XOPEN_SOURCE_EXTENDED
80
81    # Configure script attempts to run a test program which allocates a chunk of memory and writes to it.
82    #     If cross-compiling, default does not assume the program would succeed (safest option).
83    lappend cross_configure_args  --enable-big-core
84
85    # For chtype, configure script chooses between int and long for smallest data type which can hold, up to version 5.7, 31 bits.
86    #     If sizeof(unsigned long)==sizeof(unsigned int), configure script chooses long.
87    # For booltype, configure script tries to find data type xxx with sizeof(bool)==sizeof(xxx).
88    if { ${os.arch}=="i386" } {
89        if { ${os.major} >= 10 } {
90            set merger_configure_args(ppc)   "${cross_configure_args} --with-chtype=long  --with-bool='unsigned int'"
91        }
92        set merger_configure_args(ppc64)   "${cross_configure_args} --with-chtype=int  --with-bool='unsigned char'"
93    } else {
94        set merger_configure_args(i386)    "${cross_configure_args} --with-chtype=long --with-bool='unsigned char'"
95        set merger_configure_args(x86_64)  "${cross_configure_args} --with-chtype=int  --with-bool='unsigned char'"
96    }
97}
98
99use_parallel_build      yes