# -*- 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 legacysupport 1.1 PortGroup perl5 1.0 legacysupport.newest_darwin_requires_legacy 10 # RELEASE VERSION name git # NOTE: Update the DEVEL version first before updating this RELEASE version, # to verify that the intended version builds on all platforms. version 2.45.1 revision 0 description A fast version control system long_description Git is a fast, scalable, distributed open source version \ control system focusing on speed and efficiency. # DEVELOPMENT VERSION subport ${name}-devel { PortGroup github 1.0 github.setup git git 2.45.1 v github.tarball_from archive revision 0 description \ {*}${description} (Development Version) long_description \ {*}${long_description} (Development Version) } maintainers {ciserlohn @ci42} \ {gmail.com:herby.gillot @herbygillot} \ openmaintainer default_variants +doc +pcre +credential_osxkeychain +diff_highlight categories devel license GPL-2 LGPL-2.1+ installs_libs no if {${name} eq ${subport}} { # RELEASE VERSION homepage https://git-scm.com/ master_sites https://www.kernel.org/pub/software/scm/git/ \ https://cdn.kernel.org/pub/software/scm/git/ distname git-${version} use_xz yes distfiles-append \ git-${version}${extract.suffix} \ git-manpages-${version}${extract.suffix} checksums git-${version}${extract.suffix} \ rmd160 01c15b33efad6c9af6ae7945583ef72d8ced03c5 \ sha256 e64d340a8e627ae22cfb8bcc651cca0b497cf1e9fdf523735544ff4a732f12bf \ size 7490268 \ git-manpages-${version}${extract.suffix} \ rmd160 ebd5fd36a006cd52889bf0bcdfe4e699dec43ed6 \ sha256 e622d7ab1114b4f67cb9d8d4ab81f6e0fcf3d1291711569befda29172315d9f0 \ size 576560 extract.only git-${version}${extract.suffix} \ git-manpages-${version}${extract.suffix} conflicts git-devel livecheck.type regexm livecheck.regex {.*?(\d+\.\d+\.\d+).*?} } else { # DEVELOPMENT VERSION checksums ${distname}${extract.suffix} \ rmd160 0f6ae206ec910f162e74b9963a50ac45ee188f2d \ sha256 d98c8f70d58f49f7546d59b25e25f2deae6999eb036a33b0fe6f5d07c33f67c6 \ size 11129527 depends_build-append \ port:asciidoc \ port:xmlto build.target all man html conflicts git } perl5.require_variant false perl5.conflict_variants yes perl5.branches 5.28 5.30 5.32 5.34 perl5.default_branch 5.34 perl5.create_variants ${perl5.branches} depends_build-append \ port:gettext depends_lib-append port:curl \ port:zlib \ port:expat \ port:gettext-runtime \ port:libiconv depends_run-append path:bin/rsync:rsync patchfiles-append patch-Makefile.diff \ patch-git-subtree.1.diff \ patch-sha1dc-older-apple-gcc-versions.diff \ patch-gitk-git-gitk.diff patch.pre_args-replace -p0 -p1 # Reverts breakage introduced by: # https://github.com/git/git/commit/51c15ac1b6ab15d8e29651d0bd364d8f62dc6509 if {${os.platform} eq "darwin" && ${os.major} < 11} { patchfiles-append \ patch-Revert-breaking-osxkeychain.diff } # Git 2.36.0 implements a new FSEvent listener that uses # the API available in Yosemite and newer. if {${os.platform} eq "darwin" && ${os.major} < 14} { patchfiles-append patch-ignore-fsmonitor-daemon-backend.diff } # Git 2.40.0 fails to build on macOS 10.6 & 10.7 unless # USE_ENHANCED_BASIC_REGULAR_EXPRESSIONS is disabled. # See: https://trac.macports.org/ticket/67091 if {${os.platform} eq "darwin" && ${os.major} < 12} { patchfiles-append patch-disable-enhanced-basic-regex.diff } # Fix an extraction failure with some old versions of tar. # https://superuser.com/questions/1219214/permissions-cannot-be-restored-for-a-tar if {${os.platform} eq "darwin" && ${os.major} < 11} { extract.post_args-append \ -m --touch --no-overwrite-dir } use_configure no compiler.c_standard 1999 variant universal {} set CFLAGS "${configure.cflags} -std=gnu99 [get_canonical_archflags cc]" set LDFLAGS "${configure.ldflags} [get_canonical_archflags ld]" build.args CFLAGS="${CFLAGS}" \ LDFLAGS="${LDFLAGS}" \ CC=${configure.cc} \ prefix=${prefix} \ CURLDIR=${prefix} \ ICONVDIR=${prefix} \ NO_FINK=1 \ NO_DARWIN_PORTS=1 \ NO_R_TO_GCC_LINKER=1 \ NO_PERL=1 \ V=1 if {[variant_isset ${perl5.variant}]} { depends_lib-delete port:perl${perl5.major} depends_run-append \ port:perl${perl5.major} \ port:p${perl5.major}-authen-sasl \ port:p${perl5.major}-error \ port:p${perl5.major}-net-smtp-ssl \ port:p${perl5.major}-term-readkey \ port:p${perl5.major}-cgi build.args-delete \ NO_PERL=1 build.args-append \ PERL_PATH="${perl5.bin}" \ NO_PERL_CPAN_FALLBACK=1 } elseif {[variant_isset svn]} { pre-configure { return -code error "+svn does not work without +perl5_xx" } } test.run yes test.cmd make test.target test test.dir ${worksrcpath} pre-test { test.args {*}${build.args} } destroot.target install pre-destroot { destroot.args {*}${build.args} xinstall -m 0644 \ ${worksrcpath}/contrib/subtree/git-subtree.1 ${workpath}/man1 } set docdestroot ${destroot}${prefix}/share/doc/git-doc set guidir ${prefix}/share/git-gui/lib/Git\ Gui.app/Contents set system_gitconfig ${prefix}/etc/gitconfig post-destroot { foreach f {1 5 7} { xinstall -d ${destroot}${prefix}/share/man/man${f} if {${name} eq ${subport}} { # RELEASE man pages foreach m [glob -directory ${workpath} man${f}/*.${f}] { xinstall ${m} ${destroot}${prefix}/share/man/man${f} } } else { # DEVEL man pages foreach m [glob -directory ${worksrcpath} Documentation/*.${f}] { xinstall ${m} ${destroot}${prefix}/share/man/man${f} } } } if {![variant_isset svn]} { system "rm ${destroot}${prefix}/libexec/git-core/git-svn*" } xinstall -d ${docdestroot} fs-traverse badfile ${destroot} { if {[string last perllocal.pod ${badfile}] != -1} { ui_info "Removing ${badfile}" file delete ${badfile} } } set completions_path ${destroot}${prefix}/share/bash-completion/completions xinstall -d ${completions_path} xinstall -m 0644 ${worksrcpath}/contrib/completion/git-completion.bash \ ${completions_path}/git set share_path ${destroot}${prefix}/share/${name} xinstall -d ${share_path} xinstall -m 0644 ${worksrcpath}/contrib/completion/git-prompt.sh \ ${share_path}/git-prompt.sh xinstall -d ${destroot}${prefix}/libexec/git-core xinstall -m 0755 ${worksrcpath}/contrib/subtree/git-subtree.sh \ ${destroot}${prefix}/libexec/git-core/git-subtree # Tiger doesn't build the GUI, so check for its existence before mucking with it if {[file exists "${destroot}${guidir}"]} { # The executable could be "Wish" or "Wish Shell", depending on the OS version set wish_executable [exec defaults read ${destroot}${guidir}/Info CFBundleExecutable] # The system-provided Tk is now deprecated, so use the MacPorts version if available. system "echo exec wish \"'${guidir}/Resources/Scripts/AppMain.tcl'\" '\"$@\"' > \ '${destroot}${guidir}/MacOS/${wish_executable}'" } file delete -force ${share_path}/contrib copy ${worksrcpath}/contrib ${share_path} } variant pcre description {Use pcre} { build.args-append LIBPCREDIR=${prefix} USE_LIBPCRE2=1 depends_lib-append port:pcre2 } variant doc description {Install HTML and plaintext documentation} { if {${name} eq ${subport}} { # RELEASE distfiles-append git-htmldocs-${version}${extract.suffix} checksums-append git-htmldocs-${version}${extract.suffix} \ rmd160 288dd401ce1cb9c9c03e960091dd109bbc348e37 \ sha256 f7095c4478028bc04afd63cd217ea5d4fa08ab819cbb66df40a1a12648edbf40 \ size 1568812 patchfiles-append patch-git-subtree.html.diff post-extract { file mkdir ${workpath}/htmldocs system -W ${workpath}/htmldocs "${extract.cmd} ${extract.pre_args} \ '${distpath}/git-htmldocs-${version}${extract.suffix}' \ ${extract.post_args}" } pre-destroot { xinstall -m 0644 \ ${worksrcpath}/contrib/subtree/git-subtree.html \ ${workpath}/htmldocs } post-destroot { foreach f [glob ${workpath}/htmldocs/*] { file delete -force "${docdestroot}/[file tail ${f}]" file attribute ${f} -permissions ugo+r copy ${f} ${docdestroot} } fs-traverse f [list ${docdestroot}/howto ${docdestroot}/technical ${docdestroot}/RelNotes] { if {[file isdirectory ${f}]} { file attribute ${f} -permissions ugo+rx } else { file attribute ${f} -permissions ugo+r } } } } else { # DEVEL post-destroot { system -W ${worksrcpath} \ "${destroot.cmd} install-html prefix=${destroot}/${prefix}" } } } variant gitweb description {Install gitweb.cgi} { depends_run-append port:lighttpd build.target-append gitweb post-destroot { xinstall -d ${destroot}${prefix}/share/${name}/gitweb xinstall -W ${worksrcpath}/gitweb \ gitweb.cgi \ ${destroot}${prefix}/share/${name}/gitweb xinstall -m 0444 -W ${worksrcpath}/gitweb/static \ gitweb.css \ gitweb.js \ git-favicon.png \ git-logo.png \ ${destroot}${prefix}/share/${name}/gitweb xinstall -d ${docdestroot}/gitweb xinstall -m 0444 -W ${worksrcpath}/gitweb README INSTALL \ ${docdestroot}/gitweb } } variant svn description {Bi-directional subversion repository support} { depends_run-append port:subversion \ port:p${perl5.major}-libwww-perl \ port:p${perl5.major}-svn-simple } variant credential_osxkeychain description {Install git credential-osxkeychain utility from contrib} { post-build { system -W "${worksrcpath}/contrib/credential/osxkeychain" "make [join ${build.args}]" } post-destroot { xinstall -m 0755 \ "${worksrcpath}/contrib/credential/osxkeychain/git-credential-osxkeychain" \ "${destroot}${prefix}/libexec/git-core/" } pre-activate { set osxkc_config "\[credential]\n\thelper = osxkeychain" # Ensure the osxkeychain credential helper is configured in the # system-wide gitconfig. If the gitconfig file already exists, # then append the configuration to the pre-existing file only # if the file is currently missing the desired config. if { ![file exists ${system_gitconfig}] } { set f [open ${system_gitconfig} w 0644] puts ${f} ${osxkc_config} close ${f} } else { if { [catch {exec grep "helper = osxkeychain" ${system_gitconfig}} result] } { set f [open ${system_gitconfig} a] puts ${f} ${osxkc_config} close ${f} } } } notes " Configuration to enable the osxkeychain credential helper has been added to the system-wide gitconfig at ${system_gitconfig}. If you do not wish to use this credential helper, you can override this setting in your own personal git config file \(\$HOME/.gitconfig\) with e.g. \[credential] helper = some_other_credential_helper For more information, run git help credentials " } variant diff_highlight description {Install git diff-highlight utility from contrib} { post-build { system -W "${worksrcpath}/contrib/diff-highlight" "make [join ${build.args}]" } post-destroot { xinstall -m 0755 \ "${worksrcpath}/contrib/diff-highlight/diff-highlight" \ "${destroot}${prefix}/bin/" } } # Python is only needed to enable certain tools for interacting with other # version control systems, such as git-p4 (for interfacing with Perforce). # This variant enables git to use MacPorts' Python as it builds these # additional tools. variant python description {Build with Python support} { depends_lib-append port:python312 build.args-append PYTHON_PATH="${prefix}/bin/python3.12" } platform darwin 8 { # https://trac.macports.org/ticket/66480 depends_build-append port:gmake-apple build.cmd ${prefix}/bin/gmake-apple build.args-append NO_APPLE_COMMON_CRYPTO=1 build.args-append CC_LD_DYNPATH=-R }