Ticket #39018: Portfile.2.diff

File Portfile.2.diff, 8.4 KB (added by cooljeanius (Eric Gallager), 10 years ago)

my latest diff to apply to dpkg portfile after applying the whitespace patch

  • (a) /opt/local/var/macports/sources/LocalPorts/sysutils/dpkg/Portfile_fixedwhitespace vs. (b) Portfile

    a b  
    44PortSystem          1.0
    55
    66name                dpkg
    7 version             1.14.29
    8 revision            4
     7version             1.16.12
     8revision            0
    99platforms           darwin freebsd
    1010categories          sysutils archivers
    1111license             GPL-2+
    12 maintainers         nomaintainer
     12maintainers         gwmail.gwu.edu:egall openmaintainer
    1313description         Debian package maintenance system
    14 long_description    ${description}
     14long_description    ${name} is the basis of the ${description}. \
     15                    Installing this port allows the usage of the \
     16                    \`port dpkg\` command.
     17
    1518homepage            http://wiki.debian.org/Teams/Dpkg
    1619
    17 master_sites        debian:d/dpkg/
    18 checksums           md5 4326172a959b5b6484b4bc126e9f628d \
    19                     sha1 15a35dd96dac6a99f24844b2eff85f8fad37ab06
     20master_sites        debian:d/${name}/
     21checksums           md5     b7e9cac52ff7882b088a3058b52081b5 \
     22                    sha1    5969bb7f30ade840a56f512571ca5ab56d434af1 \
     23                    rmd160  1912afd35b835901e661d2c0df563198de4e8420 \
     24                    sha256  af96447758ecbfda51fc57d4b3bc3d208ad6393e71b91c9b52c6687697a208da
     25
     26use_xz              yes
     27extract.asroot      yes
     28
     29depends_build-append \
     30                    port:pkgconfig \
     31                    port:autoconf-archive \
     32                    port:xorg-util-macros \
     33                    port:gnutar \
     34                    port:perl5 \
     35                    bin:git:git-core \
     36                    bin:lzma:xz
    2037
    2138# Use MacPorts versions explicitly
    22 depends_lib         port:gettext \
     39depends_lib-append  port:gettext \
    2340                    port:libiconv \
    2441                    port:perl5 \
    2542                    port:coreutils \
    2643                    port:bzip2 \
    27                     port:zlib
    28 
    29 depends_run         bin:gnutar:gnutar \
    30                     bin:lzma:xz
    31 
     44                    port:zlib \
     45                    port:ncurses \
     46                    port:gnutar \
     47                    path:lib/pkgconfig/liblzma.pc:xz
     48
     49depends_run-append  port:gnutar \
     50                    bin:lzma:xz \
     51                    bin:perl:perl5 \
     52                    port:debianutils
    3253
     54# got to do some underscore-to-hyphen twiddling...
    3355distname            ${name}_${version}
    3456worksrcdir          ${name}-${version}
    3557
    36 patchfiles          patch-lib_tarfn.c \
    37                     patch-main_remove.c \
    38                     patch-main_archives.c \
    39                     patch-scripts-Makefile \
    40                     patch-lib_dpkg.h \
    41                     ncurses.diff
    42 
    43 configure.env       PERL=${prefix}/bin/perl5
    44 configure.args      --without-sgml-doc --with-libintl-prefix=${prefix} \
    45                     --with-libiconv-prefix=${prefix} --with-admindir=${prefix}/var/db/dpkg \
     58configure.perl      ${prefix}/bin/perl5
     59configure.pkg_config ${prefix}/bin/pkg-config
     60configure.env-append TAR=${prefix}/bin/gnutar
     61configure.args-append \
     62                    --with-libintl-prefix=${prefix} \
     63                    --with-libiconv-prefix=${prefix} \
     64                    --with-admindir=${prefix}/var/db/${name} \
     65                    --with-logdir=${prefix}/var/log \
    4666                    --mandir=${prefix}/share/man \
    47                     --with-zlib --with-bz2 \
    48                     --disable-linker-optimisations
     67                    --with-zlib \
     68                    --with-bz2 \
     69                    --with-liblzma \
     70                    --disable-linker-optimisations \
     71                    --disable-silent-rules \
     72                    --disable-start-stop-daemon
     73# The start-stop-daemon patch now applies again, but now it leads to build
     74# errors, so disabling it with a configure flag again (as done above)
     75
     76# ccache is trouble
     77configure.ccache          no
     78
     79# Older versions of gcc choke with the -Wvla warning flag
     80configure.cflags-delete   -Wvla
     81configure.cppflags-delete -Wvla
     82configure.ldflags-delete  -Wvla
     83
     84post-configure {
     85    reinplace "s|-Wvla||" ${worksrcpath}/Makefile
     86    eval reinplace "s|-Wvla||" [glob ${worksrcpath}/*/Makefile]
     87    eval reinplace "s|-Wvla||" [glob ${worksrcpath}/lib/*/Makefile]
     88    reinplace "s|-Wvla||" ${worksrcpath}/lib/dpkg/test/Makefile
     89    reinplace "s|-Wmissing-declarations||" ${worksrcpath}/dselect/Makefile
     90}
     91
     92compiler.blacklist-append cc gcc-3.3 gcc-4.0 apple-gcc-4.0
    4993
    5094build.type          gnu
    5195
    52 set vardpkg ${destroot}${prefix}/var/db/dpkg
    53 destroot.keepdirs ${vardpkg} ${vardpkg}/updates ${vardpkg}/info
     96set vardpkg ${destroot}${prefix}/var/db/${name}
     97destroot.keepdirs-append \
     98                    ${vardpkg} \
     99                    ${vardpkg}/updates \
     100                    ${vardpkg}/info \
     101                    ${destroot}${prefix}/var/log \
     102                    ${destroot}${prefix}/etc/${name}
     103
     104patchfiles-append   patch-configure.ac.diff \
     105                    patch-lib_dpkg_dpkg.h.diff \
     106                    patch-lib_dpkg_tarfn.c.diff \
     107                    patch-src_remove.c.diff \
     108                    patch-src_archives.c.diff \
     109                    patch-utils_start-stop-daemon.c.diff
     110
     111patch.args-append   --backup
    54112
    55113post-patch {
    56114    set scripts ${worksrcpath}/scripts
    57     reinplace s|/etc/dpkg/|${prefix}/etc/dpkg/| \
    58             ${scripts}/dpkg-shlibdeps.pl \
    59             ${scripts}/dpkg-source.pl
    60 
    61     reinplace s|/etc/alternatives|${prefix}/etc/alternatives|g \
    62             ${scripts}/update-alternatives.pl
     115    reinplace "s|/etc/${name}/|${prefix}/etc/${name}/|" \
     116            ${scripts}/${name}-shlibdeps.pl \
     117            ${scripts}/${name}-source.pl
     118    reinplace "s|AC_ERROR|AC_MSG_ERROR|" ${worksrcpath}/m4/dpkg-build.m4
     119    file copy ${prefix}/share/aclocal/ax_check_gnu_make.m4 ${worksrcpath}/m4
     120    file copy ${prefix}/share/aclocal/xorg-macros.m4 ${worksrcpath}/m4
     121    system -W ${worksrcpath} "git init"
    63122}
    64123
     124use_autoreconf      yes
     125autoreconf.args     -fvi --warnings=all
     126
    65127pre-destroot {
    66     file mkdir ${destroot}${prefix}/share/doc/dpkg
     128    file mkdir ${destroot}${prefix}/share/doc/${name}
    67129}
    68130
    69131post-destroot {
     
    73135    system "touch ${vardpkg}/available ${vardpkg}/status"
    74136}
    75137
     138# These platform variants had previously had patches associated
     139# with them...
    76140platform darwin {
    77141    depends_build-append    bin:gnumake:gmake
    78     patchfiles-append patch-utils_start-stop-daemon.c bsd/patch-main_help.c
    79142}
    80143
    81144platform freebsd {
    82145    depends_build-append    bin:gmake:gmake
    83     patchfiles-append patch-utils_start-stop-daemon.c bsd/patch-main_help.c
    84146}
    85147
    86 livecheck.type      regex
    87 livecheck.url       http://ftp.debian.org/debian/pool/main/d/dpkg/
     148# This variant sometimes hangs while building...
     149variant docs description {Build documentation (warning: building documentation takes a long time)} {
     150    depends_build-append    port:doxygen \
     151                            path:bin/dot:graphviz \
     152                            port:fontconfig \
     153                            port:freefont-ttf
     154    set docdir ${prefix}/share/doc/${name}
     155    configure.args-append   --docdir=${docdir} \
     156                            --htmldir=${docdir}/html \
     157                            --dvidir=${docdir}/dvi \
     158                            --pdfdir=${docdir}/pdf \
     159                            --psdir=${docdir}/ps
     160    build.target-append     doc
     161    pre-build {
     162        elevateToRoot "doxygen"
     163        system -W ${worksrcpath}/doc "${prefix}/bin/doxygen -u"
     164    }
     165    post-build {
     166        system -W ${worksrcpath}/doc "${prefix}/bin/doxygen"
     167        dropPrivileges
     168        set destroot_docdir ${destroot}${prefix}/share/doc/${name}
     169        xinstall -d ${destroot_docdir}
     170        copy ${worksrcpath}/doc/doc ${destroot_docdir}
     171        copy ${worksrcpath}/doc/html ${destroot_docdir}
     172        foreach docfile {coding-style.txt triggers.txt README.feature-removal-schedule frontend.txt README.api} {
     173            xinstall -m 644 ${worksrcpath}/doc/${docfile} ${destroot_docdir}
     174        }
     175    }
     176}
     177
     178# Tests currently fail, this needs to be fixed eventually:
     179test.run            yes
     180test.target         check
     181
     182pre-test {
     183    elevateToRoot "test"
     184}
     185post-test {
     186    dropPrivileges
     187}
     188
     189# odd-numbered releases are unstable, so ignore them
     190livecheck.type      none
     191livecheck.url       http://ftp.debian.org/debian/pool/main/d/${name}/
    88192livecheck.regex     "${name}_(\\d+\\.\\d+(\\.\\d+)*)"