Ticket #65908: Portfile

File Portfile, 3.4 KB (added by judaew (Vadym-Valdis Yudaiev), 2 years ago)
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2
3PortSystem      1.0
4PortGroup       legacysupport 1.1
5PortGroup       makefile 1.0
6
7# utimensat
8legacysupport.newest_darwin_requires_legacy 16
9
10name            lzma
11version         22.01
12revision        1
13categories      archivers
14license         public-domain
15platforms       darwin
16maintainers     {ryandesign @ryandesign} openmaintainer
17
18description     high compression ratio archiver
19
20long_description \
21    LZMA is default and general compression method of 7z \
22    format in 7-Zip program. LZMA provides high compression \
23    ratio and very fast decompression.
24
25homepage        https://www.7-zip.org/sdk.html
26master_sites    https://www.7-zip.org/a/
27
28use_7z          yes
29distname        lzma[strsed ${version} {/\.//}]
30
31checksums       rmd160  beb1e2c42719e4156935dc573df018146406e353 \
32                sha256  35b1689169efbc7c3c147387e5495130f371b4bad8ec24f049d28e126d52d9fe \
33                size    1261282
34
35extract.mkdir   yes
36
37post-extract {
38    fs-traverse item [list ${worksrcpath}] {
39        if {[file isdirectory ${item}]} {
40            file attributes ${item} -permissions ag+rx
41        }
42    }
43}
44
45patchfiles      patch-7zip_gcc_mak.diff \
46                patch-lzma.1
47
48post-patch {
49    reinplace "s|#include <sys/sysmacros.h>|//#include <sys/sysmacros.h>|" \
50    ${worksrcpath}/CPP/7zip/Common/FileStreams.cpp \
51    ${worksrcpath}/CPP/7zip/UI/Common/UpdateCallback.cpp
52    # needed for legacysupport
53    reinplace "s|LDFLAGS = $\(\LDFLAGS_STATIC\)\|LDFLAGS += $\(\LDFLAGS_STATIC\)\|" \
54    ${worksrcpath}/C/7zip_gcc_c.mak \
55    ${worksrcpath}/CPP/7zip/7zip_gcc.mak
56    # ld: warning: option -s is obsolete and being ignored
57    # atom not found in symbolIndex on 10.6
58    reinplace "s|LFLAGS_ALL = -s|LFLAGS_ALL =|" \
59    ${worksrcpath}/C/7zip_gcc_c.mak \
60    ${worksrcpath}/CPP/7zip/7zip_gcc.mak
61
62    # reinplace "s|CC=\$(CROSS_COMPILE)clang|CC=${configure.cc} ${configure.cflags} [get_canonical_archflags cc]|g" \
63    # ${worksrcpath}/CPP/7zip/var_clang.mak
64    # reinplace "s|CXX=\$(CROSS_COMPILE)clang++|CXX=${configure.cxx} ${configure.cxxflags} [get_canonical_archflags cxx]|g" \
65    # ${worksrcpath}/CPP/7zip/var_clang.mak
66}
67
68use_configure   no
69
70installs_libs   no
71
72variant universal {}
73
74build.dir       ${worksrcpath}/CPP/7zip/Bundles/LzmaCon
75
76build.args-append -f ../../cmpl_clang.mak
77
78# if {${build_arch} eq "x86_64"} {
79#
80#     build.args-append -f ../../cmpl_mac_x64.mak
81#
82#     destroot {
83#         xinstall -m 755 \
84#                  -s ${worksrcpath}/CPP/7zip/Bundles/LzmaCon/b/m_x64/lzma \
85#                  ${destroot}${prefix}/bin/lzma_alone
86#     }
87#
88# } elseif {${build_arch} eq "arm64"} {
89#
90#     build.args-append -f ../../cmpl_mac_arm64.mak
91#
92#     destroot {
93#         xinstall -m 755 \
94#                  -s ${worksrcpath}/CPP/7zip/Bundles/LzmaCon/b/m_arm64/lzma \
95#                  ${destroot}${prefix}/bin/lzma_alone
96#     }
97# }
98
99post-destroot {
100    xinstall ${worksrcpath}/lzma.1 \
101        ${destroot}${prefix}/share/man/man1/lzma_alone.1
102
103    set docdir ${prefix}/share/doc/${name}/
104    xinstall -d ${destroot}${docdir}
105    xinstall -m 0644 -W ${worksrcpath}/DOC \
106        lzma.txt lzma-history.txt lzma-specification.txt \
107        ${destroot}${docdir}
108}
109
110notes "
111The LZMA SDK program is installed as \"lzma_alone\", to avoid conflict with LZMA Utils
112"
113
114livecheck.type  regex
115livecheck.regex {>(\d+(?:\.\d+)*)</td>}