Ticket #52431: opensc.patch

File opensc.patch, 3.7 KB (added by lbschenkel (Leonardo Brondani Schenkel), 8 years ago)
  • opensc/Portfile

    diff --git a/opensc/Portfile b/opensc/Portfile
    a b  
    2525                        does so, too.
    2626
    2727github.tarball_from     releases
    28 checksums               rmd160  f785df816560493baceb71e2197346c724fc0834 \
     28checksums               ${distname}${extract.suffix} \
     29                        rmd160  f785df816560493baceb71e2197346c724fc0834 \
    2930                        sha256  3ac8c29542bb48179e7086d35a1b8907a4e86aca3de3323c2f48bd74eaaf5729
    3031
    3132
    3233depends_build           port:docbook-xsl port:libxslt port:pkgconfig
    33 depends_lib             path:lib/libcrypto.dylib:openssl port:zlib
     34depends_lib             lib:libcrypto:openssl port:zlib
    3435
    3536default_variants        +readline
     37universal_variant       no
    3638
    3739patchfiles-append       patch-bash_completion.diff patch-libressl.diff
    3840patch.pre_args          -p1
     
    4547configure.args-append   --enable-sm
    4648configure.args-append   --with-pkcs11-provider=${prefix}/lib/opensc-pkcs11.so
    4749
     50variant doc description {Build documentation} {
     51    configure.args-replace  --disable-doc --enable-doc
     52}
     53variant readline description {Enable readline support} {
     54    depends_lib-append      port:readline
     55    configure.args-replace  --disable-readline --enable-readline
     56}
     57variant tokend description {Install TokenD module (Keychain integration)} {
     58    distfiles-append        ${tokend_file}:tokend
     59    checksums-append        ${tokend_file} \
     60                            rmd160  f4bfd2dd2e7cda62ace365315adbeaa5f71875e2 \
     61                            sha256  2aee450a4a8ed090dc9de5127d36e9e83392755a7e24cf91451bd99eb9412f29
     62    master_sites-append     https://github.com/${github.author}/OpenSC.tokend/archive/:tokend
     63    destroot.violate_mtree  yes
     64}
     65
     66if [variant_isset tokend] {
     67    set tokend_hash         96b89d1bedfd00d095fdac7e3a9628127e227a78
     68    set tokend_file         ${tokend_hash}${extract.suffix}
     69    set tokend_install_dir  /Library/Security/tokend
     70    set tokend_xcode_cmd    "${xcodebuildcmd} \
     71                             -target OpenSC \
     72                             -configuration Deployment \
     73                             -project OpenSC.tokend/Tokend.xcodeproj \
     74                             SDKROOT=${configure.sdkroot} \
     75                             MACOSX_DEPLOYMENT_TARGET=${macosx_deployment_target} \
     76                             ARCHS=${configure.build_arch} \
     77                             BUILD_VARIANTS=normal \
     78                             DSTROOT=${destroot} \
     79                             INSTALL_PATH=${tokend_install_dir}"
     80}
     81
    4882pre-configure {
    4983    reinplace -W ${worksrcpath} \
    5084        "s|No Git revision info available|OpenSC-${version} (MacPorts)|g" \
    5185        configure.ac configure
    5286}
     87post-extract {
     88    if {[variant_isset tokend]} {
     89        move ${workpath}/OpenSC.tokend-${tokend_hash} ${worksrcpath}/OpenSC.tokend
     90        ln -s ${worksrcpath}/src ${worksrcpath}/OpenSC.tokend/build/opensc-src
     91    }
     92}
     93post-build {
     94    if {[variant_isset tokend]} {
     95        system -W ${worksrcpath} "${tokend_xcode_cmd} build"
     96    }
     97}
    5398post-destroot {
    54     system "${worksrcpath}/MacOSX/libtool-bundle ${destroot}${prefix}/lib/opensc-pkcs11.so ${destroot}${prefix}/lib"
     99    system "${worksrcpath}/MacOSX/libtool-bundle \
     100        ${destroot}${prefix}/lib/opensc-pkcs11.so \
     101        ${destroot}${prefix}/lib"
     102
     103    if {[variant_isset tokend]} {
     104        system -W ${worksrcpath} "${tokend_xcode_cmd} install"
     105    }
    55106}
    56107
    57 variant doc description "Build documentation" {
    58     configure.args-replace  --disable-doc --enable-doc
    59 }
    60 variant readline description "Enable readline support" {
    61     depends_lib-append      port:readline
    62     configure.args-replace  --disable-readline --enable-readline
    63 }