Skip to content

Instantly share code, notes, and snippets.

@jmroot
jmroot / Portfile-osxphotos
Created September 7, 2023 08:19
Incomplete Portfile for osxphotos
# -*- 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 python 1.0
name osxphotos
version 0.63.0
categories graphics
platforms {darwin any}
supported_archs noarch
@jmroot
jmroot / lintportindex.tcl
Last active March 1, 2023 03:35
basic PortIndex lint script
#!/usr/bin/env port-tclsh
# check a PortIndex for duplicate portnames and malformed portinfo
set fd [open [lindex $argv 0]]
array set counts {}
while {[gets $fd line] >= 0} {
set name [string tolower [lindex $line 0]]
incr counts($name)
if {$counts($name) > 1} {
puts stderr "Warning: $counts($name) occurrences of $name"
}
@jmroot
jmroot / all_distributable.tcl
Created December 26, 2022 13:37
Check which MacPorts ports are binary distributable
#!/usr/bin/env port-tclsh
# For every available port, outputs the port name to distributable.txt
# if binaries are considered distributable, or to not-distributable.txt
# if not (along with an explanation).
# Set this to where distributable_lib.tcl can be found
set distributable_lib_path .
package require macports
@jmroot
jmroot / all_bin_available.tcl
Last active April 6, 2024 00:07
Check which MacPorts ports have binary archives available
#!/usr/bin/env port-tclsh
# For every available port, outputs the port name to available.txt
# if a binary archive is available on packages.macports.org, or to
# unavailable.txt if not.
package require macports
mportinit
set yesfile [open ./available.txt w]
@jmroot
jmroot / compatver.sh
Created September 5, 2022 06:08
Script to test compatibility_version behaviour
#!/bin/sh
CC=${CC-clang}
echo '#include <stdio.h>
#include "lib.h"
int libcall(void) {
printf("working\\n");
return 0;
@jmroot
jmroot / Portfile.patch
Created March 15, 2022 20:25
Stunnel openssl fix
diff --git a/security/stunnel/Portfile b/security/stunnel/Portfile
index 20dd9ad0412..d077ec396cf 100644
--- a/security/stunnel/Portfile
+++ b/security/stunnel/Portfile
@@ -31,13 +31,13 @@ checksums rmd160 a6b2ab9bbb4da98eb21ffbe83486019bd1b4ae26 \
sha256 c74c4e15144a3ae34b8b890bb31c909207301490bd1e51bfaaa5ffeb0a994617 \
size 866754
-openssl.branch 1.1
-
@jmroot
jmroot / catch.tcl
Created April 17, 2021 02:19
try bug demo
package require macports
package require macports_util
proc test1 {} {
try {
error foo
} catch {{*} eCode eMessage} {
error "There was an error: $eMessage"
}
}
@jmroot
jmroot / Portfile
Created December 17, 2020 15:57
portfile variable printing example
# -*- 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
name testport
version 1.0
categories replaceme
platforms darwin
maintainers replaceme
license replaceme
@jmroot
jmroot / dummy.tex
Created July 30, 2020 09:10
whizzytex dummy input file
\documentclass{article}
\def \dummy {Testing Your Installation}
\def \dojump{\def \documentclass ##1\dump {\relax}}
\dojump
\dump
\begin{document}
\huge {\bf \dummy}\par Don't worry, feel Lucky!
\end{document}