diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-03-30 15:41:37 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-03-30 15:41:37 -0400 |
| commit | 38d6189d4335bbcdc38f0c31cf769082b96f22fa (patch) | |
| tree | 430c133eafe0284d0bc10e7571b42bbf02b34aca /examples | |
| parent | 494e4ef006cd66ee1d91ea23de9da085bec1e8db (diff) | |
Further support for .dylib files on mac by changing syntax for library
imports to `use -lfoo` instead of `use foo.so`
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/commands/commands.tm | 2 | ||||
| -rw-r--r-- | examples/game/raylib.tm | 2 | ||||
| -rw-r--r-- | examples/http/http.tm | 2 | ||||
| -rw-r--r-- | examples/tomo-install/tomo-install.tm | 12 |
4 files changed, 13 insertions, 5 deletions
diff --git a/examples/commands/commands.tm b/examples/commands/commands.tm index be18b776..70a2303b 100644 --- a/examples/commands/commands.tm +++ b/examples/commands/commands.tm @@ -1,7 +1,7 @@ # Functions for running system commands use ./commands.c -use libunistring.so +use -lunistring extern run_command:func(exe:Text, args:[Text], env:{Text,Text}, input:[Byte]?, output:&[Byte]?, error:&[Byte]? -> Int32) extern command_by_line:func(exe:Text, args:[Text], env:{Text,Text} -> func(->Text?)?) diff --git a/examples/game/raylib.tm b/examples/game/raylib.tm index faa6f227..fc0affb9 100644 --- a/examples/game/raylib.tm +++ b/examples/game/raylib.tm @@ -1,5 +1,5 @@ # Raylib wrapper for some functions and structs -use libraylib.so +use -lraylib use <raylib.h> use <raymath.h> diff --git a/examples/http/http.tm b/examples/http/http.tm index 2555986f..12203faf 100644 --- a/examples/http/http.tm +++ b/examples/http/http.tm @@ -1,6 +1,6 @@ # A simple HTTP library built using CURL -use libcurl.so +use -lcurl use <curl/curl.h> struct HTTPResponse(code:Int, body:Text) diff --git a/examples/tomo-install/tomo-install.tm b/examples/tomo-install/tomo-install.tm index 0205c380..0a6c608d 100644 --- a/examples/tomo-install/tomo-install.tm +++ b/examples/tomo-install/tomo-install.tm @@ -61,14 +61,22 @@ func main(paths:[Path]): curl @curl_flags @url | tar xz -C ~/.local/share/tomo/installed --strip-components=1 --one-top-level=@hash echo @original_url > ~/.local/share/tomo/installed/@hash/source.url tomo -L ~/.local/share/tomo/installed/@hash - ln -f -s ../installed/@hash/lib@hash.so ~/.local/share/tomo/lib/lib@hash.so + if [ "`uname -s`" = "Darwin" ]; then + ln -f -s ../installed/@hash/lib@hash.dylib ~/.local/share/tomo/lib/lib@hash.dylib + else + ln -f -s ../installed/@hash/lib@hash.so ~/.local/share/tomo/lib/lib@hash.so + fi `:get_output()!) if alias: say($Shell( set -exuo pipefail ln -f -s @hash ~/.local/share/tomo/installed/@alias - ln -f -s lib@hash.so ~/.local/share/tomo/lib/lib@alias.so + if [ "`uname -s`" = "Darwin" ]; then + ln -f -s lib@hash.dylib ~/.local/share/tomo/lib/lib@alias.dylib + else + ln -f -s lib@hash.so ~/.local/share/tomo/lib/lib@alias.so + fi ):get_output()!) say("$\[1]Installed $url!$\[]") |
