<pre style='margin:0'>
Renee Otten (reneeotten) pushed a commit to branch master
in repository macports-ports.

</pre>
<p><a href="https://github.com/macports/macports-ports/commit/0575c1cc1da75683f13551fde4da21f9187bf58d">https://github.com/macports/macports-ports/commit/0575c1cc1da75683f13551fde4da21f9187bf58d</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit 0575c1cc1da75683f13551fde4da21f9187bf58d
</span>Author: Steven Thomas Smith <s.t.smith@ieee.org>
AuthorDate: Sat Jan 27 11:28:37 2024 -0500

<span style='display:block; white-space:pre;color:#404040;'>    PG haskell_cabal: Add strip command to all binaries
</span><span style='display:block; white-space:pre;color:#404040;'>      * Use `strip` on created binaries
</span><span style='display:block; white-space:pre;color:#404040;'>      * Add `haskell_cabal.bindirs` option
</span>---
 _resources/port1.0/group/haskell_cabal-1.0.tcl | 113 ++++++++++++++++---------
 1 file changed, 75 insertions(+), 38 deletions(-)

<span style='display:block; white-space:pre;color:#808080;'>diff --git a/_resources/port1.0/group/haskell_cabal-1.0.tcl b/_resources/port1.0/group/haskell_cabal-1.0.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index 7385407817b..0322b386ce9 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/_resources/port1.0/group/haskell_cabal-1.0.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/_resources/port1.0/group/haskell_cabal-1.0.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -42,7 +42,10 @@ proc haskell_cabal.add_dependencies {} {
</span>             port:libiconv
     }
     depends_build-append \
<span style='display:block; white-space:pre;background:#ffe0e0;'>-        port:gsed
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        port:cctools \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        port:file \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        port:gsed \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        path:bin/openssl:openssl
</span> }
 port::register_callback haskell_cabal.add_dependencies
 
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -153,7 +156,8 @@ options haskell_cabal.bin \
</span>         haskell_cabal.global_flags \
         haskell_cabal.build_dir \
         haskell_cabal.use_prebuilt \
<span style='display:block; white-space:pre;background:#ffe0e0;'>-        haskell_cabal.datadir
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        haskell_cabal.datadir \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        haskell_cabal.bindirs
</span> 
 default haskell_cabal.bin {[haskell_cabal.getcabalbin]}
 
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -170,6 +174,8 @@ default haskell_cabal.use_prebuilt  {no}
</span> 
 default haskell_cabal.datadir       {share/${subport}}
 
<span style='display:block; white-space:pre;background:#e0ffe0;'>+default haskell_cabal.bindirs       {${destroot}${prefix}/bin}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> post-patch {
     if {[tbool haskell_cabal.use_prebuilt]} {
         xinstall -d ${haskell_cabal.cabal_root}/bin
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -237,6 +243,7 @@ default destroot.post_args  {\
</span>                                 --builddir=${haskell_cabal.build_dir}\
                                 --installdir=${destroot}${prefix}/bin\
                                 --enable-relocatable\
<span style='display:block; white-space:pre;background:#e0ffe0;'>+                                --overwrite-policy=always\
</span>                             }
 default destroot.env        {${haskell_cabal.env}}
 
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -256,11 +263,30 @@ default livecheck.url       {https://hackage.haskell.org/package/${name}}
</span> default livecheck.regex     {"/package/[quotemeta ${name}]-\\\[^/\\\]+/[quotemeta ${name}]-(\\\[^\\\"\\\]+)[quotemeta ${extract.suffix}]"}
 
 
<span style='display:block; white-space:pre;background:#ffe0e0;'>-# binary sed hack to address unfixed cabal datadir issue:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-# replace hardwired datadir in build directory with path
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-# of the same length using repeated /'s
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-# https://github.com/haskell/cabal/issues/3586
</span> post-destroot {
<span style='display:block; white-space:pre;background:#e0ffe0;'>+    # strip binaries
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    foreach bindir ${haskell_cabal.bindirs} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        foreach binfile [glob -nocomplain ${bindir}/*] {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            if {([file isfile ${binfile}]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                && [file type ${binfile}] eq {file}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                && [file executable ${binfile}]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                && [regexp -nocase -- \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                    {application/x-.*(binary|executable)} \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                        [lindex [exec file --mime-type ${binfile}] end]])} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                system -W ${bindir} \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                        "strip ${binfile}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                if {${configure.build_arch} eq {arm64}} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                    system -W ${bindir} \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                        "codesign -f -s - ${binfile}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    # binary sed hack to address unfixed cabal datadir issue:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    # replace hardwired datadir in build directory with path
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    # of the same length using repeated /'s
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    # https://github.com/haskell/cabal/issues/3586
</span>     # find cabal data-files
     set build_datadirs [list]
     if {[file isdirectory ${haskell_cabal.cabal_root}/store]} {
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -272,40 +298,51 @@ post-destroot {
</span>         }
     }
     if {[llength ${build_datadirs}] > 0} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>-        foreach binfile [glob -nocomplain ${destroot}${prefix}/bin/*] {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-            if {!([file isfile ${binfile}] && [file type ${binfile}] eq {file})} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                continue
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-            }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-            xinstall -m 0755 \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                ${binfile} \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                ${binfile}.slash_hack
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-            foreach build_datadir ${build_datadirs} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                set extra_slashes \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                    [expr {[string length ${build_datadir}] - [string length ${prefix}/${haskell_cabal.datadir}]}]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                if {${extra_slashes} >= 0} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                    set slash_hack \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                        [string repeat / [expr {${extra_slashes} + 1}]]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                    set datadir_slash_hack \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                        [strsed ${prefix}/${haskell_cabal.datadir} "g|/${haskell_cabal.datadir}\$|${slash_hack}${haskell_cabal.datadir}|"]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                    set build_datadir_esc \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                        [strsed ${build_datadir} {g|/|\\/|}]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                    set datadir_slash_hack_esc \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                        [strsed ${datadir_slash_hack} {g|/|\\/|}]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                    system -W ${destroot}${prefix}/bin \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                        "gsed -i -e\
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                            's/${build_datadir_esc}/${datadir_slash_hack_esc}/g'\
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                            ${binfile}.slash_hack"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        foreach bindir ${haskell_cabal.bindirs} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            foreach binfile [glob -nocomplain ${bindir}/*] {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                if {!([file isfile ${binfile}]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                      && [file type ${binfile}] eq {file}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                      && [file executable ${binfile}]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                      && [regexp -nocase -- \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                          {application/x-.*(binary|executable)} \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                          [lindex [exec file --mime-type ${binfile}] end]])} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                    continue
</span>                 }
<span style='display:block; white-space:pre;background:#ffe0e0;'>-            }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-            if {[file size ${binfile}.slash_hack] == [file size ${binfile}]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                delete  ${binfile}
</span>                 xinstall -m 0755 \
<span style='display:block; white-space:pre;background:#ffe0e0;'>-                    ${binfile}.slash_hack \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                    ${binfile}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-            }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-            delete  ${binfile}.slash_hack
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-            if {${configure.build_arch} eq {arm64}} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                system "codesign -f -s - ${binfile}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                    ${binfile} \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                    ${binfile}.slash_hack
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                foreach build_datadir ${build_datadirs} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                    set extra_slashes \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                        [expr {[string length ${build_datadir}] - [string length ${prefix}/${haskell_cabal.datadir}]}]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                    if {${extra_slashes} >= 0} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                        set slash_hack \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                            [string repeat / [expr {${extra_slashes} + 1}]]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                        set datadir_slash_hack \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                            [strsed ${prefix}/${haskell_cabal.datadir} "g|/${haskell_cabal.datadir}\$|${slash_hack}${haskell_cabal.datadir}|"]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                        set build_datadir_esc \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                            [strsed ${build_datadir} {g|/|\\/|}]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                        set datadir_slash_hack_esc \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                            [strsed ${datadir_slash_hack} {g|/|\\/|}]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                        system -W ${bindir} \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                            "gsed -i -e\
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                            's/${build_datadir_esc}/${datadir_slash_hack_esc}/g'\
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                                ${binfile}.slash_hack"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                    }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                if {([file size ${binfile}.slash_hack] \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                        == [file size ${binfile}])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                    && ([exec openssl dgst -ripemd160 ${binfile}.slash_hack] \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                        ne [exec openssl dgst -ripemd160 ${binfile}])} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                    # gsed created a different file of the same size
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                    delete  ${binfile}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                    xinstall -m 0755 \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                        ${binfile}.slash_hack \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                        ${binfile}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                delete  ${binfile}.slash_hack
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                if {${configure.build_arch} eq {arm64}} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                    system "codesign -f -s - ${binfile}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                }
</span>             }
         }
     }
</pre><pre style='margin:0'>

</pre>