Files
2025-02-06 02:33:37 +01:00

72 lines
3.1 KiB
Tcl

# -*- 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 github 1.0
PortGroup xcode 1.0
github.setup alexzielenski optool 0.1
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball
set optool_commit a20c514
revision 0
categories sysutils
maintainers nomaintainer
license BSD
description Editor for Mach-O binaries
long_description \
optool is a tool which interfaces with Mach-O binaries in order to insert \
or remove load commands, strip code signatures, resign, and remove ASLR.
# optool depends on these libraries
set argparser_commit 2802076
set coreparse_commit 1be510a
master_sites-append https://github.com/mysteriouspants/ArgumentParser/archive/${argparser_commit}.tar.gz?dummy=:argparser \
https://github.com/beelsebob/CoreParse/archive/${coreparse_commit}.tar.gz?dummy=:coreparse
distfiles-append argparser-${argparser_commit}.tar.gz:argparser \
coreparse-${coreparse_commit}.tar.gz:coreparse
checksums ${name}-${version}.tar.gz \
rmd160 d044c322651023bd87c1e2dc29b90d97d7207a0e \
sha256 4f6e815f86c4f7f63fe82118f5e52acb54ef61c40bd1195493715c9fde267f90 \
argparser-${argparser_commit}.tar.gz \
rmd160 dbb60b1d0194d264c477fedc19bfe894b5dbd1d3 \
sha256 cd4272e8a8cad6d8080c6ddf964b4c469337fdf61bb06cc0aed6de1daa7bd91f \
coreparse-${coreparse_commit}.tar.gz \
rmd160 a0e7cd15c6c927d2ead9f997553044c060a52023 \
sha256 3c468346405aa65f34b275fd23a94b600fbd60111ded67ec5d64ddfc462ef76e
worksrcdir ${github.author}-${github.project}-${optool_commit}
post-extract {
# Replace empty directories with the real library sources
delete ${worksrcpath}/${name}/FSArgumentParser
move [glob ${workpath}/ArgumentParser-${argparser_commit}*] ${worksrcpath}/${name}/FSArgumentParser
delete ${worksrcpath}/${name}/FSArgumentParser/CoreParse
move [glob ${workpath}/CoreParse-${coreparse_commit}*] ${worksrcpath}/${name}/FSArgumentParser/CoreParse
}
patchfiles patch-ldflags-objc.diff \
patch-argparsermacOS-12.diff \
patch-coreparse-macOS-12.diff
patch.pre_args-replace -p0 -p1
if { ${os.major} < 12 } {
# optool/defines.h:68:22: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
# typedef NS_ENUM(int, OPError)
# ^~~~~~~
post-extract {
reinplace "s|NS_ENUM(int, OPError)|enum OPError|g" ${worksrcpath}/optool/defines.h
}
}
destroot {
xinstall -m 755 ${worksrcpath}/build/Release/optool ${destroot}${prefix}/bin/
xinstall -d -m 755 ${destroot}${prefix}/share/doc/${name}
xinstall -m 644 ${worksrcpath}/README.md ${destroot}${prefix}/share/doc/${name}
xinstall -m 644 ${worksrcpath}/LICENSE ${destroot}${prefix}/share/doc/${name}
}