release: bundle Nim in AppImage
a146865 parent: 7f793f3 modified
.github/workflows/release.yml +9 -4 | @@ -83,10 +83,15 @@ jobs: | ||
| 83 | 83 | install -Dm755 bin/clonim "$appdir/usr/bin/clonim" |
| 84 | 84 | install -Dm644 lib/libclonim_runtime.a \ |
| 85 | 85 | "$appdir/usr/bin/libclonim_runtime.a" |
| 86 | + nim_bin=$(readlink -f "$(command -v nim)") | |
| 87 | + nim_root=$(dirname "$(dirname "$nim_bin")") | |
| 88 | + install -Dm755 "$nim_bin" "$appdir/usr/bin/nim" | |
| 89 | + cp -a "$nim_root/lib/." "$appdir/usr/lib/" | |
| 90 | + cp -a "$nim_root/config" "$appdir/usr/config" | |
| 91 | + install -Dm755 packaging/appimage/AppRun "$appdir/AppRun" | |
| 86 | 92 | install -Dm644 packaging/appimage/clonim.desktop \ |
| 87 | 93 | "$appdir/clonim.desktop" |
| 88 | 94 | install -Dm644 packaging/appimage/clonim.svg "$appdir/clonim.svg" |
| 89 | - ln -s usr/bin/clonim "$appdir/AppRun" | |
| 90 | 95 | ln -s clonim.svg "$appdir/.DirIcon" |
| 91 | 96 | |
| 92 | 97 | curl --fail --location --silent --show-error \ |
| @@ -116,9 +121,9 @@ jobs: | ||
| 116 | 121 | Linux x86_64 release of clonim. |
| 117 | 122 | |
| 118 | 123 | Download the AppImage, make it executable, and run it. It contains |
| 119 | - both the compiler and its private static runtime. Generated programs | |
| 120 | - statically link the runtime and are standalone. Nim must be installed | |
| 121 | - as the native-code backend. | |
| 124 | + the compiler, Nim 2.2.12, and clonim's private static runtime. | |
| 125 | + Generated programs statically link the runtime and are standalone. | |
| 126 | + A system C compiler and linker are required to build programs. | |
| 122 | 127 | draft: false |
| 123 | 128 | prerelease: false |
| 124 | 129 | files: dist/clonim-linux-x86_64.AppImage |
| @@ -83,10 +83,15 @@ jobs: | |||
| 83 | install -Dm755 bin/clonim "$appdir/usr/bin/clonim" | 83 | install -Dm755 bin/clonim "$appdir/usr/bin/clonim" |
| 84 | install -Dm644 lib/libclonim_runtime.a \ | 84 | install -Dm644 lib/libclonim_runtime.a \ |
| 85 | "$appdir/usr/bin/libclonim_runtime.a" | 85 | "$appdir/usr/bin/libclonim_runtime.a" |
| 86 | + nim_bin=$(readlink -f "$(command -v nim)") | ||
| 87 | + nim_root=$(dirname "$(dirname "$nim_bin")") | ||
| 88 | + install -Dm755 "$nim_bin" "$appdir/usr/bin/nim" | ||
| 89 | + cp -a "$nim_root/lib/." "$appdir/usr/lib/" | ||
| 90 | + cp -a "$nim_root/config" "$appdir/usr/config" | ||
| 91 | + install -Dm755 packaging/appimage/AppRun "$appdir/AppRun" | ||
| 86 | install -Dm644 packaging/appimage/clonim.desktop \ | 92 | install -Dm644 packaging/appimage/clonim.desktop \ |
| 87 | "$appdir/clonim.desktop" | 93 | "$appdir/clonim.desktop" |
| 88 | install -Dm644 packaging/appimage/clonim.svg "$appdir/clonim.svg" | 94 | install -Dm644 packaging/appimage/clonim.svg "$appdir/clonim.svg" |
| 89 | - ln -s usr/bin/clonim "$appdir/AppRun" | ||
| 90 | ln -s clonim.svg "$appdir/.DirIcon" | 95 | ln -s clonim.svg "$appdir/.DirIcon" |
| 91 | 96 | ||
| 92 | curl --fail --location --silent --show-error \ | 97 | curl --fail --location --silent --show-error \ |
| @@ -116,9 +121,9 @@ jobs: | |||
| 116 | Linux x86_64 release of clonim. | 121 | Linux x86_64 release of clonim. |
| 117 | 122 | ||
| 118 | Download the AppImage, make it executable, and run it. It contains | 123 | Download the AppImage, make it executable, and run it. It contains |
| 119 | - both the compiler and its private static runtime. Generated programs | 124 | + the compiler, Nim 2.2.12, and clonim's private static runtime. |
| 120 | - statically link the runtime and are standalone. Nim must be installed | 125 | + Generated programs statically link the runtime and are standalone. |
| 121 | - as the native-code backend. | 126 | + A system C compiler and linker are required to build programs. |
| 122 | draft: false | 127 | draft: false |
| 123 | prerelease: false | 128 | prerelease: false |
| 124 | files: dist/clonim-linux-x86_64.AppImage | 129 | files: dist/clonim-linux-x86_64.AppImage |
modified
README.md +3 -2 | @@ -25,8 +25,9 @@ see [benchmark history](bench/README.md) for metrics and exit codes. | ||
| 25 | 25 | |
| 26 | 26 | `just release` builds the compiler and its private static runtime. Version tags |
| 27 | 27 | matching `v*` trigger the release workflow, which packages both into a single |
| 28 | -Linux x86_64 AppImage. Generated programs statically link the runtime and are | |
| 29 | -standalone; users still need Nim installed as the native-code backend. | |
| 28 | +Linux x86_64 AppImage together with Nim 2.2.12. Generated programs statically | |
| 29 | +link the runtime and are standalone. The build machine needs a system C | |
| 30 | +compiler and linker, but does not need Nim installed separately. | |
| 30 | 31 | |
| 31 | 32 | Source-level libraries are loaded explicitly. Use |
| 32 | 33 | `(require '[clonim.core :refer [now-ms]])` to load `stdlib/clonim/core.clj`. Host-dependent operations remain small runtime primitives; for |
| @@ -25,8 +25,9 @@ see [benchmark history](bench/README.md) for metrics and exit codes. | |||
| 25 | 25 | ||
| 26 | `just release` builds the compiler and its private static runtime. Version tags | 26 | `just release` builds the compiler and its private static runtime. Version tags |
| 27 | matching `v*` trigger the release workflow, which packages both into a single | 27 | matching `v*` trigger the release workflow, which packages both into a single |
| 28 | -Linux x86_64 AppImage. Generated programs statically link the runtime and are | 28 | +Linux x86_64 AppImage together with Nim 2.2.12. Generated programs statically |
| 29 | -standalone; users still need Nim installed as the native-code backend. | 29 | +link the runtime and are standalone. The build machine needs a system C |
| 30 | +compiler and linker, but does not need Nim installed separately. | ||
| 30 | 31 | ||
| 31 | Source-level libraries are loaded explicitly. Use | 32 | Source-level libraries are loaded explicitly. Use |
| 32 | `(require '[clonim.core :refer [now-ms]])` to load `stdlib/clonim/core.clj`. Host-dependent operations remain small runtime primitives; for | 33 | `(require '[clonim.core :refer [now-ms]])` to load `stdlib/clonim/core.clj`. Host-dependent operations remain small runtime primitives; for |
added
packaging/appimage/AppRun +8 -0 | new file mode 100755 | ||
| @@ -0,0 +1,8 @@ | ||
| 1 | +#!/bin/sh | |
| 2 | +set -eu | |
| 3 | + | |
| 4 | +appdir=${APPDIR:-$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)} | |
| 5 | +PATH="$appdir/usr/bin:$PATH" | |
| 6 | +export PATH | |
| 7 | + | |
| 8 | +exec "$appdir/usr/bin/clonim" "$@" | |
| new file mode 100755 | |||
| @@ -0,0 +1,8 @@ | |||
| 1 | +#!/bin/sh | ||
| 2 | +set -eu | ||
| 3 | + | ||
| 4 | +appdir=${APPDIR:-$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)} | ||
| 5 | +PATH="$appdir/usr/bin:$PATH" | ||
| 6 | +export PATH | ||
| 7 | + | ||
| 8 | +exec "$appdir/usr/bin/clonim" "$@" | ||