3
3
PortSystem 1.0
4
4
PortGroup cmake 1.1
5
5
PortGroup github 1.0
6
- PortGroup muniversal 1.0
7
6
8
- if {${os.arch} eq " powerpc" } {
7
+ name darwin-xtools
8
+ epoch 2
9
+
10
+ categories devel
11
+ maintainers {@barracuda156 macos-powerpc.org:barracuda}
12
+
13
+ variant v2 conflicts v3 description " Darwin Xtools branch 2.x" {}
14
+ variant v3 conflicts v2 description " Darwin Xtools branch 3.x" {}
15
+
16
+ if {[variant_isset v2]} {
9
17
set xtools_version 6f6c04e8b25497851f6a5979a6e96023fffe22df
10
18
github.setup iains darwin-xtools ${xtools_version}
11
19
version 2.2.4
12
20
revision 1
13
- epoch 1
14
21
15
22
checksums ${name} -${xtools_version} .tar.gz \
16
23
rmd160 07dd50453b93f90ea4806fd8c12be3acb91c2fbd \
17
24
sha256 7568104068614b8e8b1cb72fcc01219f78f90a0d14d95c255be78e2c0a899d62 \
18
25
size 2932788
19
- } else {
26
+ } elseif {[variant_isset v3]} {
20
27
set xtools_version 6446947f3e99db52a40b30a38f36b9ae33492aea
21
28
github.setup iains darwin-xtools ${xtools_version}
22
29
version 3.3.0
23
30
revision 1
24
- epoch 0
25
31
26
32
checksums ${name} -${xtools_version} .tar.gz \
27
33
rmd160 18d99473a012f4fa48464aadd078921a25bdc322 \
28
34
sha256 9167b67e128f616cef079bbeda4b116fe0d41fe54784fff85826420daae23f5f \
29
35
size 2958759
30
- }
36
+ } else {
37
+ set xtools_version 80ad30c3bce821f52d94e844cbb1c2d095a127c6
38
+ github.setup iains darwin-xtools ${xtools_version}
39
+ version 1.1.0
40
+ revision 0
31
41
32
- set libyaml_version 0.2.5
33
- set libyaml_distfile ${libyaml_version} .tar.gz
34
- distfiles-append ${libyaml_distfile} :libyaml
35
- checksums-append ${libyaml_distfile} \
36
- rmd160 7fe42b7d7bb0dd07aedee6c775c43fd35bb5cf3e \
37
- sha256 fa240dbf262be053f3898006d502d514936c818e422afdcf33921c63bed9bf2e \
38
- size 85055
42
+ checksums ${name} -${xtools_version} .tar.gz \
43
+ rmd160 0b0c7155c63a5f962c32848cd649d98b7eef1298 \
44
+ sha256 83971978f413ee309589307ed994fd7a7f2d55e818e6435b2663e8167da260d7 \
45
+ size 2887509
46
+ }
39
47
40
48
github.tarball_from archive
41
49
42
- platforms darwin
43
- categories devel
44
- maintainers nomaintainer
45
-
46
- description Aset of modifications to ctools and ld64 that enable support for older systems with up-to-date-tools.
50
+ description Aset of modifications to ctools and ld64 that enable support \
51
+ for older systems with up-to-date-tools.
47
52
long_description {*}${description}
48
53
license {APSL-2 Apache-2}
49
54
50
55
homepage https://github.com/iains/darwin-xtools
51
56
52
- master_sites-append https://github.com/yaml/libyaml/archive/refs/tags:libyaml
53
-
54
- patchfiles-append 0001-ld64-unwinddump-include-stdlib-for-exit-3.patch \
57
+ if {[variant_isset v2] || [variant_isset v3]} {
58
+ patchfiles-append 0001-ld64-unwinddump-include-stdlib-for-exit-3.patch \
55
59
0002-ld64-archive_file-fix-compilation-without-LTO_SUPPOR.patch \
56
60
0003-cctools-cmake-as-fix-compilation-on-powerpc-apple-da.patch \
57
61
0004-cctools-otool-fix-duplicate-symbol-in-arm-i386-_disa.patch \
58
62
0005-cctools-cmake-cbtlibs-link-against-libstuff-for-vari.patch \
59
- 0006-ld64-cmake-build-libprunetrie-as-static-archive.patch \
60
- 0007-tapilite-add-TAPI-emulation-library.patch \
63
+ 0006-ld64-cmake-build-libprunetrie-as-static-archive.patch
64
+
65
+ # Tapi is not supported in branch 1.x.
66
+ variant tapi conflicts tapilite description " Use standalone Tapi library" {
67
+ depends_lib-append port:libtapi
68
+
69
+ configure.args-append \
70
+ -DXTOOLS_TAPI_PATH=${prefix}
71
+ }
72
+
73
+ variant tapilite conflicts tapi description " Build replacement library for Tapi support" {
74
+ set libyaml_version 0.2.5
75
+ set libyaml_distfile ${libyaml_version} .tar.gz
76
+ distfiles-append ${libyaml_distfile} :libyaml
77
+ master_sites-append https://github.com/yaml/libyaml/archive/refs/tags:libyaml
78
+ checksums-append ${libyaml_distfile} \
79
+ rmd160 7fe42b7d7bb0dd07aedee6c775c43fd35bb5cf3e \
80
+ sha256 fa240dbf262be053f3898006d502d514936c818e422afdcf33921c63bed9bf2e \
81
+ size 85055
82
+
83
+ post-extract {
84
+ ln -s ${workpath} /libyaml-${libyaml_version} ${worksrcpath} /libyaml
85
+ }
86
+
87
+ patchfiles-append 0007-tapilite-add-TAPI-emulation-library.patch \
61
88
0008-ld64-cmake-use-normal-cmake-trickery-to-link-against.patch \
62
89
0009-tapilite-bunch-of-fixes-and-changes.patch \
63
90
0010-tapilite-cmake-explitly-build-static-library.patch \
64
- 0011-ld64-fix-compilation-on-arm64.patch \
65
- 0012-cctools-fix-build-on-macOS-monterey.patch \
66
- 0013-libyaml-add-the-way-to-include-it.patch \
67
- 0014-cctools-removed-redundant-implementation-of-get_toc_.patch \
68
- 0015-tapilite-fix-build-by-clang.patch
69
-
70
- platform darwin powerpc {
71
- patchfiles-append 0016-Minor-fix-ups-for-ppc.patch
91
+ 0011-libyaml-add-the-way-to-include-it.patch \
92
+ 0012-tapilite-fix-build-by-clang.patch
93
+
94
+ configure.args-append \
95
+ -DXTOOLS_LIBYAML_PATH=${worksrcpath} /libyaml \
96
+ -DXTOOLS_USE_TAPILITE=ON
97
+ }
98
+
99
+ if {${os.arch} ne " powerpc" } {
100
+ patchfiles-append 0013-ld64-fix-compilation-on-arm64.patch \
101
+ 0014-cctools-fix-build-on-macOS-monterey.patch \
102
+ 0015-cctools-removed-redundant-implementation-of-get_toc_.patch
103
+ }
72
104
}
73
105
74
- post-extract {
75
- ln -s ${workpath} /libyaml-${libyaml_version} ${worksrcpath} /libyaml
106
+ if {${os.arch} eq " powerpc" } {
107
+ variant lto description " Enable LLVM LTO" {
108
+ set llvm_v 7.1.1
109
+
110
+ depends_lib-append port:llvm-powerpc
111
+
112
+ configure.args-append \
113
+ -DXTOOLS_LTO_PATH=${prefix} /libexec/llvm-${llvm_v} \
114
+ -DXTOOLS_LTO_SUPPORT=ON
115
+ }
76
116
}
77
117
78
118
# Use cmake-bootstrap
@@ -81,80 +121,58 @@ depends_skip_archcheck-append \
81
121
cmake-bootstrap
82
122
configure.cmd ${prefix} /libexec/cmake-bootstrap/bin/cmake
83
123
84
- # prevent findng or linking against any other ports
124
+ # Prevent finding or linking against any other ports
85
125
compiler.cpath
86
126
compiler.library_path
87
- configure.cppflags-delete -I${prefix} /include
88
- configure.ldflags-delete -L${prefix} /lib
127
+ configure.cppflags-delete -I${prefix} /include
128
+ configure.ldflags-delete -L${prefix} /lib
89
129
90
130
compiler.cxx_standard 2011
91
131
92
- merger_arch_flag yes
93
- merger_arch_compiler yes
94
- merger_must_run_binaries yes
95
-
96
- if {${os.platform} eq " darwin" && ${os.major} < 12} {
97
- depends_build-append port:gcc10-bootstrap
98
- depends_skip_archcheck-append \
99
- gcc10-bootstrap
100
-
101
- # Leopard is the first macOS which supports Roseta
102
- # See: https://trac.macports.org/ticket/67284
103
- if {${os.major} > 8} {
104
- pre-configure {
105
- file mkdir ${workpath} /bins
106
-
107
- set gcc [open " ${workpath} /bins/gcc" w 0755]
108
- puts ${gcc} " #!/bin/sh"
109
- puts ${gcc} " arch -arch $\{ BUILD_ARCH:-${build_arch} \} ${prefix} /libexec/gcc10-bootstrap/bin/gcc \"\$ @\" "
110
- close ${gcc}
111
-
112
- set gxx [open " ${workpath} /bins/g++" w 0755]
113
- puts ${gxx} " #!/bin/sh"
114
- puts ${gxx} " arch -arch $\{ BUILD_ARCH:-${build_arch} \} ${prefix} /libexec/gcc10-bootstrap/bin/g++ \"\$ @\" "
115
- close ${gxx}
116
- }
117
-
118
- configure.cc ${workpath} /bins/gcc
119
- configure.cxx ${workpath} /bins/g++
120
-
121
- if {[variant_exists universal] && [variant_isset universal]} {
122
- foreach arch ${universal_archs_supported} {
123
- lappend merger_configure_env(${arch} ) BUILD_ARCH=${arch}
124
- lappend merger_build_env(${arch} ) BUILD_ARCH=${arch}
125
- }
126
- }
127
- } else {
128
- configure.cc ${prefix} /libexec/gcc10-bootstrap/bin/gcc
129
- configure.cxx ${prefix} /libexec/gcc10-bootstrap/bin/g++
130
- }
131
-
132
- # prevent it from linking against gcc's libstdc++.6.dylib and libgcc_s.1.1.dylib
132
+ if {${configure.cxx_stdlib} ne " libc++" } {
133
+ # Prevent it from linking against gcc's libstdc++.6.dylib and libgcc_s.1.1.dylib
133
134
configure.ldflags-append \
134
135
-static-libstdc++ -static-libgcc
135
-
136
- configure.compiler.add_deps no
136
+ configure.args-append -DXTOOLS_CXX_HAS_STDLIB_FLAG=OFF
137
137
}
138
138
139
139
cmake.install_prefix ${prefix} /libexec/${name}
140
140
141
- cmake.build_type Release
142
141
cmake.generator {Unix Makefiles}
143
142
143
+ proc xtools_arch {arch} {
144
+ switch ${arch} {
145
+ arm64 {return aarch64}
146
+ ppc64 {return powerpc64}
147
+ ppc {return powerpc}
148
+ default {return ${arch} }
149
+ }
150
+ }
151
+
152
+ platform darwin {
153
+ set xtools_triple [xtools_arch ${build_arch} ]-apple-darwin${os.major}
154
+ configure.pre_args-append \
155
+ -DLLVM_DEFAULT_TARGET_TRIPLE=${xtools_triple}
156
+ }
157
+
158
+ configure.pre_args-replace -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON \
159
+ -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF
160
+
144
161
configure.args-append -DCCTOOLS_LD_CLASSIC=OFF \
145
- -DXTOOLS_LIBYAML_PATH=${worksrcpath} /libyaml \
146
- -DXTOOLS_USE_TAPILITE=ON
162
+ -DPACKAGE_VERSION=" macos-powerpc"
147
163
148
164
# 64bit LD requires futures patches
149
- if {${build_arch} ni [list i386 ppc]} {
165
+ if {${configure. build_arch} ni [list i386 ppc]} {
150
166
configure.args-append -DXTOOLS_HOST_IS_64B=ON
151
167
} else {
152
168
configure.args-append -DXTOOLS_HOST_IS_64B=OFF
153
169
}
154
170
155
171
post-destroot {
156
- file delete -force {*}[glob -directory ${destroot}${cmake.install_prefix} \
157
- cmake/yaml* include/yaml.h lib/libyaml*]
172
+ if {[variant_isset v2] || [variant_isset v3]} {
173
+ file delete -force {*}[glob -directory ${destroot}${cmake.install_prefix} \
174
+ cmake/yaml* include/yaml.h lib/libyaml*]
175
+ }
158
176
}
159
177
160
- github.livecheck.branch darwin-xtools-[string map {. -} ${version} ]
178
+ github.livecheck.branch darwin-xtools-[string map {. -} ${version} ]
0 commit comments