Opened 4 years ago

Closed 2 years ago

#61526 closed enhancement (fixed)

libzzip @0.13.71 can be built with Python 3

Reported by: ballapete (Peter "Pete" Dyballa) Owned by: mojca (Mojca Miklavec)
Priority: Normal Milestone:
Component: ports Version: 2.6.4
Keywords: bigsur Cc:
Port: libzzip

Description

Since I want to live without Python 2.7 from MacPorts (the macOS one should suffice) I started to change libzzip – which only needs Python 2 to create the documentation. By using Python's 2to3 some Python files were adapted to Python 3 – and the documentation built! It's also usable.

Could be the translation is not perfect, because when building the documentation around 10,000 lines à la

Unescaped left brace in regex is passed through in regex; marked by <-- HERE in m/<([^<>]*)\${ <-- HERE src_dir:[?]([^{<>}]*)}([^<>]*)>/ at (eval 325) line 292, <STYLESHEET> line 19691.

are emitted (this is certainly from Perl). So next TeX Live release could be a bit more up-to-date.

The attached patch files either translate the needed Python files or correct a minor fault in one Makefile.

Attachments (2)

Python2-3_patches.diff (16.8 KB) - added by ballapete (Peter "Pete" Dyballa) 4 years ago.
Translates the used Python 2 files to Python 3
Makefile.in.diff (326 bytes) - added by ballapete (Peter "Pete" Dyballa) 4 years ago.
Corrects minor problem in Makefile

Download all attachments as: .zip

Change History (11)

Changed 4 years ago by ballapete (Peter "Pete" Dyballa)

Attachment: Python2-3_patches.diff added

Translates the used Python 2 files to Python 3

Changed 4 years ago by ballapete (Peter "Pete" Dyballa)

Attachment: Makefile.in.diff added

Corrects minor problem in Makefile

comment:1 Changed 4 years ago by ballapete (Peter "Pete" Dyballa)

On High Sierra the same amount of Perl complaints appears – when building with Python 2.7. Here it also works to build with Python 3. (This Perl output also appears when building GCC7 on PPC Tiger.)

comment:2 Changed 4 years ago by ballapete (Peter "Pete" Dyballa)

  texlive-common @2020_0 (active) platform='darwin 20' archs='noarch' date='2020-11-17T13:02:48+0100'
  texlive-bin @2020.54632_2+x11 (active) platform='darwin 20' archs='x86_64' date='2020-11-17T13:12:53+0100'
  texlive-basic @54624_1+doc (active) platform='darwin 20' archs='noarch' date='2020-11-17T13:14:09+0100'
  texlive-latex @54498_0+doc (active) platform='darwin 20' archs='noarch' date='2020-11-17T13:15:54+0100'

are meanwhile installed from source. Looks good, so far!

It might be useful to offer two variants of this port: one with Python 2 and another one with Python 3.

comment:3 Changed 4 years ago by jmroot (Joshua Root)

Cc: mojca@… removed
Owner: set to mojca
Status: newassigned

comment:4 Changed 4 years ago by ballapete (Peter "Pete" Dyballa)

Summary: libzzip @0.13.71 ach be built with Python 3libzzip @0.13.71 can be built with Python 3

comment:5 Changed 4 years ago by mojca (Mojca Miklavec)

This port needs an update. The update requires CMake, so it doesn't make much sense to fiddle with the old configure.

The problem I'm facing now is that the build runs test as part of the build process and now expects the test binaries to have a working /opt/local/lib/libzzip.13.dylib before the build is even complete.

comment:6 Changed 4 years ago by kencu (Ken)

to fix that, you set "build with install runpath" to off.

I'll see if I can find a recent example; I often have to do that when I enable testing for cmake ports.

comment:7 Changed 4 years ago by mojca (Mojca Miklavec)

If anyone wants to play with it a bit further ...

# -*- 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

PortSystem          1.0
PortGroup           cmake 1.1
PortGroup           github 1.0

github.setup        gdraheim zziplib 0.13.72 v
name                libzzip
categories          archivers devel
platforms           darwin
license             LGPL
maintainers         {@mojca mojca} openmaintainer
description         library providing read access on ZIP-archives

long_description    The ZZIPlib provides read access on ZIP-archives. The \
                    library uses only the patent-free compression-algorithms \
                    supported by Zlib. It provides functions that transparently \
                    access files being either real files or zipped files, \
                    both with the same filepath.

checksums           rmd160  20b12141e49c6332d8fd8b610d1fa4a868d9072b \
                    sha256  61a14917400dbef5eafb482ddc862f3edad86c888a73f445f82e1ab856d24b46 \
                    size    1162325

depends_build-append \
                    port:pkgconfig \
                    port:python39

depends_lib         port:zlib

# html documentation fails to build with a parallel build
# building the tests breaks the build
use_parallel_build  no
configure.args-append \
                    -DZZIPSDL=OFF \
                    -DZZIPTEST=OFF \
                    -DZZIPDOCS=ON \
                    -DZZIP_HTMLSITE=ON \
                    -DZZIP_HTMPAGES=ON \
                    -DPYTHON_EXECUTABLE:FILEPATH=${prefix}/bin/python3.9

# I don't see any need for this any longer?
#post-configure {
    #set builddir [glob -dir ${worksrcpath} "*apple-darwin*"]
    #reinplace -E {s|-arch [a-z0-9_]+||g} \
        ${builddir}/zzip/zziplib-uninstalled.pc \
        ${builddir}/zzip/zziplib.pc
#}

# this should be automated at some point; there's also a discrepancy between `libzzip` and `zziplib`: needs a fix
post-destroot {
    set docdir ${prefix}/share/doc/${name}
    xinstall -d ${destroot}${docdir}/html

    xinstall -m 0644 -W ${worksrcpath} COPYING.LIB ChangeLog README TODO \
        ${destroot}${docdir}

    xinstall -m 0644 {*}[glob -directory ${worksrcpath}/docs "*.{css,htm}"] \
        ${destroot}${docdir}/html

    # We replace every soelim stub with a soft link, as ".so" groff directives
    # don't work with gzip'd manpages.

## (no clue what this does)
#    foreach {f} [glob -directory ${destroot}${prefix}/share/man/man3 *.3] {
#        set channel [open ${f}]
#
#        if {[regexp {^\.so (.+)$} [read -nonewline ${channel}] _ target]} {
#            # This manpage is a soelim stub.
#            ln -sf [file tail ${target}] ${f}
#        }
#
#        close ${channel}
#    }
}

variant sdl description {Enable SDL support} {
    depends_lib-append      port:libsdl

    configure.args-replace  -DZZIPSDL=OFF -DZZIPSDL=ON

    post-destroot {
        xinstall -m 0644 ${worksrcpath}/docs/README.SDL ${destroot}${docdir}
    }
}

# I didn't manage to run the tests yes
#test.run        yes
#test.target     check

comment:8 Changed 2 years ago by ballapete (Peter "Pete" Dyballa)

Right now libzzip @0.13.72_0 is installed and it makes uses of Python 3:

pete 239 /\ port deps libzzip
Full Name: libzzip @0.13.72_0
Build Dependencies:   cmake, pkgconfig, python310, apple-gcc42
Library Dependencies: zlib
Test Dependencies:    unzip, zip

So this ticket can be closed.

comment:9 Changed 2 years ago by kencu (Ken)

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.