diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 4b2409be..6fe53e9c 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -88,10 +88,7 @@ jobs: - os: ubuntu-latest nix_system: x86_64-linux docker_arch: amd64 - - os: macos-15 - nix_system: x86_64-darwin - docker_arch: na - - os: macos-15 + - os: macos-latest nix_system: aarch64-darwin docker_arch: na - os: ubuntu-24.04-arm @@ -200,10 +197,6 @@ jobs: name: "aarch64-linux" hash: (open $"./artifacts/context-assets-aarch64-linux/context-($version)-aarch64-linux.sha256" | str trim) } - { - name: "x86_64-darwin" - hash: (open $"./artifacts/context-assets-x86_64-darwin/context-($version)-x86_64-darwin.sha256" | str trim) - } { name: "x86_64-linux" hash: (open $"./artifacts/context-assets-x86_64-linux/context-($version)-x86_64-linux.sha256" | str trim) diff --git a/data/x86_64-darwin.json b/data/x86_64-darwin.json deleted file mode 100644 index 2d52223a..00000000 --- a/data/x86_64-darwin.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "url": "https://github.com/ck3mp3r/context/releases/download/v0.7.10/context-0.7.10-x86_64-darwin.tgz", - "hash": "16dkr9dxphj3kbijnn2vqh1jkn1swrnx4w2s5iiys2a1rz5hkgwi" -} \ No newline at end of file diff --git a/flake.nix b/flake.nix index 09f376af..6928a2d9 100644 --- a/flake.nix +++ b/flake.nix @@ -22,13 +22,13 @@ ... }: flake-parts.lib.mkFlake {inherit inputs;} { - systems = ["aarch64-darwin" "aarch64-linux" "x86_64-darwin" "x86_64-linux"]; + systems = ["aarch64-darwin" "aarch64-linux" "x86_64-linux"]; perSystem = {system, ...}: let overlays = [ inputs.rustnix.lib.rust.overlays.fenix ( final: _prev: { - trunk = final.callPackage ./nix/trunk.nix {}; + trunk = final.callPackage ./nix/trunk-bin.nix {}; } ) ]; diff --git a/nix/dev.nix b/nix/dev.nix index 60535299..f732e6c3 100644 --- a/nix/dev.nix +++ b/nix/dev.nix @@ -37,7 +37,7 @@ in (pkgs.cargo-llvm-cov.overrideAttrs (_: {doCheck = false;})) pkgs.cargo-nextest pkgs.trunk - (pkgs.callPackage ./wasm-bindgen-cli.nix {}) + (pkgs.callPackage ./wasm-bindgen-cli-bin.nix {}) pkgs.tailwindcss_4 pkgs.act diff --git a/nix/packaging.nix b/nix/packaging.nix index 50b47400..051cf48b 100644 --- a/nix/packaging.nix +++ b/nix/packaging.nix @@ -6,7 +6,7 @@ cargoLock, overlays, }: let - supportedTargets = ["aarch64-darwin" "aarch64-linux" "x86_64-darwin" "x86_64-linux"]; + supportedTargets = ["aarch64-darwin" "aarch64-linux" "x86_64-linux"]; # Install data for pre-built releases (will be generated during release) installData = { @@ -18,10 +18,6 @@ if builtins.pathExists ../data/aarch64-linux.json then builtins.fromJSON (builtins.readFile ../data/aarch64-linux.json) else {}; - x86_64-darwin = - if builtins.pathExists ../data/x86_64-darwin.json - then builtins.fromJSON (builtins.readFile ../data/x86_64-darwin.json) - else {}; x86_64-linux = if builtins.pathExists ../data/x86_64-linux.json then builtins.fromJSON (builtins.readFile ../data/x86_64-linux.json) @@ -48,7 +44,7 @@ nativeBuildInputs = [ pkgs.trunk - (pkgs.callPackage ./wasm-bindgen-cli.nix {}) + (pkgs.callPackage ./wasm-bindgen-cli-bin.nix {}) pkgs.tailwindcss_4 ]; diff --git a/nix/trunk-bin.nix b/nix/trunk-bin.nix new file mode 100644 index 00000000..80823a78 --- /dev/null +++ b/nix/trunk-bin.nix @@ -0,0 +1,49 @@ +{ + lib, + stdenv, + fetchurl, +}: let + pname = "trunk"; + version = "0.22.1"; + + sources = { + aarch64-darwin = { + triple = "aarch64-apple-darwin"; + sha256 = "18e381936c848700fefb9ee3f64f362419fab700200eefee323ebc0d00a8e9db"; + }; + aarch64-linux = { + triple = "aarch64-unknown-linux-musl"; + sha256 = "8c84a939aaf48bbdac2d78195c932adb319e610fb2cbf791bae07b2660cf3e46"; + }; + x86_64-linux = { + triple = "x86_64-unknown-linux-musl"; + sha256 = "a1fe5cd6b053f5a76f66b598d296022a7f06f56def6013cc16cd6897d53f5363"; + }; + }; + + source = + sources.${stdenv.hostPlatform.system} + or (throw "trunk-bin: unsupported system ${stdenv.hostPlatform.system}"); +in + stdenv.mkDerivation { + inherit pname version; + + src = fetchurl { + url = "https://github.com/trunk-rs/trunk/releases/download/v${version}/trunk-${source.triple}.tar.gz"; + inherit (source) sha256; + }; + + sourceRoot = "."; + + installPhase = '' + install -Dm755 trunk $out/bin/trunk + ''; + + meta = { + homepage = "https://github.com/trunk-rs/trunk"; + description = "Build, bundle & ship your Rust WASM application to the web"; + mainProgram = "trunk"; + maintainers = with lib.maintainers; [ctron]; + license = lib.licenses.asl20; + }; + } diff --git a/nix/trunk.nix b/nix/trunk.nix deleted file mode 100644 index 06a1913d..00000000 --- a/nix/trunk.nix +++ /dev/null @@ -1,37 +0,0 @@ -{ - lib, - rustPlatform, - fetchFromGitHub, - pkg-config, - openssl, -}: let - pname = "trunk"; - version = "0.22.1"; -in - rustPlatform.buildRustPackage { - inherit pname version; - - src = fetchFromGitHub { - owner = "trunk-rs"; - repo = "trunk"; - rev = "v${version}"; - hash = "sha256-GXwFLOjmNZL2qNgFLG18pM+jXLvR4u80SUyjH9dsnJM="; - }; - - nativeBuildInputs = [pkg-config]; - - buildInputs = [openssl]; - - # requires network - checkFlags = ["--skip=tools::tests::download_and_install_binaries"]; - - cargoHash = "sha256-k4yQrT3gxjLPL5hI+1LtU0Nrd2a0ksGSAmI2I2AUZn0="; - - meta = { - homepage = "https://github.com/trunk-rs/trunk"; - description = "Build, bundle & ship your Rust WASM application to the web"; - mainProgram = "trunk"; - maintainers = with lib.maintainers; [ctron]; - license = lib.licenses.asl20; - }; - } diff --git a/nix/wasm-bindgen-cli-bin.nix b/nix/wasm-bindgen-cli-bin.nix new file mode 100644 index 00000000..bb44a21d --- /dev/null +++ b/nix/wasm-bindgen-cli-bin.nix @@ -0,0 +1,50 @@ +{ + lib, + stdenv, + fetchurl, +}: let + pname = "wasm-bindgen-cli"; + version = "0.2.129"; + + sources = { + aarch64-darwin = { + triple = "aarch64-apple-darwin"; + sha256 = "81d4a23d56b3c3eb8187658329116d50e0b228a93b343825fb71f70179051cd1"; + }; + aarch64-linux = { + triple = "aarch64-unknown-linux-musl"; + sha256 = "2ed4351c35dd9440308bbb02767d47ea278efe851a52465300f3c94f5b6c2a87"; + }; + x86_64-linux = { + triple = "x86_64-unknown-linux-musl"; + sha256 = "82d12bb940e2d4e72e0d5605387fc1b8ca179044e012b620f0ce4e7440e8320e"; + }; + }; + + source = + sources.${stdenv.hostPlatform.system} + or (throw "wasm-bindgen-cli-bin: unsupported system ${stdenv.hostPlatform.system}"); + + tarballRoot = "wasm-bindgen-${version}-${source.triple}"; +in + stdenv.mkDerivation { + inherit pname version; + + src = fetchurl { + url = "https://github.com/rustwasm/wasm-bindgen/releases/download/${version}/wasm-bindgen-${version}-${source.triple}.tar.gz"; + inherit (source) sha256; + }; + + sourceRoot = "."; + + installPhase = '' + install -Dm755 ${tarballRoot}/wasm-bindgen $out/bin/wasm-bindgen + ''; + + meta = { + homepage = "https://wasm-bindgen.github.io/wasm-bindgen/"; + license = with lib.licenses; [asl20 mit]; + description = "Facilitating high-level interactions between wasm modules and JavaScript"; + mainProgram = "wasm-bindgen"; + }; + } diff --git a/nix/wasm-bindgen-cli.nix b/nix/wasm-bindgen-cli.nix deleted file mode 100644 index 61e28398..00000000 --- a/nix/wasm-bindgen-cli.nix +++ /dev/null @@ -1,42 +0,0 @@ -{ - lib, - rustPlatform, - fetchCrate, - nodejs_latest, - pkg-config, - openssl, - stdenv, - curl, -}: let - pname = "wasm-bindgen-cli"; - version = "0.2.129"; - src = fetchCrate { - inherit pname version; - hash = "sha256-pcecKQd7E8Opw6bkFoE569epUi7gh5qpQF1e5PJY6V8="; - }; - cargoDeps = rustPlatform.fetchCargoVendor { - inherit src; - inherit (src) pname version; - hash = "sha256-vmUrWVU7kPJJxO5qIVeAkwQyWDELO1Z4Z5gitz2kco8="; - }; -in - rustPlatform.buildRustPackage { - inherit pname version src cargoDeps; - - nativeBuildInputs = [pkg-config]; - - buildInputs = - [openssl] - ++ lib.optionals stdenv.hostPlatform.isDarwin [curl]; - - nativeCheckInputs = [nodejs_latest]; - - doCheck = false; - - meta = { - homepage = "https://wasm-bindgen.github.io/wasm-bindgen/"; - license = with lib.licenses; [asl20 mit]; - description = "Facilitating high-level interactions between wasm modules and JavaScript"; - mainProgram = "wasm-bindgen"; - }; - }