Commit 476009ef authored by Eric Helgeson's avatar Eric Helgeson
Browse files

pioasm: 2.1.1 -> 2.2.0

- Use cmake's built-in install targets instead of manually installing
  only the binary. This installs cmake config files (pioasmConfig.cmake,
  pioasmConfigVersion.cmake, pioasmTargets.cmake) to lib/cmake/pioasm/,
  enabling find_package(pioasm CONFIG) to work. Without these files,
  projects using pico-sdk fall back to rebuilding pioasm from source
  via ExternalProject_Add for every build target.
- Remove gcc-15 patch (included upstream)
- Add updateScript and changelog
parent 4fa27748
Loading
Loading
Loading
Loading
+9 −21
Original line number Diff line number Diff line
@@ -2,33 +2,22 @@
  lib,
  stdenv,
  fetchFromGitHub,
  fetchpatch,
  cmake,
  ninja,
  nix-update-script,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "pioasm";
  version = "2.1.1";
  version = "2.2.0";

  src = fetchFromGitHub {
    owner = "raspberrypi";
    repo = "pico-sdk";
    rev = finalAttrs.version;
    hash = "sha256-epO7yw6/21/ess3vMCkXvXEqAn6/4613zmH/hbaBbUw=";
    tag = finalAttrs.version;
    hash = "sha256-hQdEZD84/cnLSzP5Xr9vbOGROQz4BjeVOnvbyhe6rfM=";
  };

  patches = [
    # Pull upstream fix for gcc-15:
    #   https://github.com/raspberrypi/pico-sdk/pull/2468
    (fetchpatch {
      name = "gcc-15.patch";
      url = "https://github.com/raspberrypi/pico-sdk/commit/66540fe88e86a9f324422b7451a3b5dff4c0449f.patch";
      hash = "sha256-KwTED7/IWorgRTw1XMU2ILJhf6DAioGuVIunlC1QdNE=";
      stripLen = 2;
    })
  ];

  sourceRoot = "${finalAttrs.src.name}/tools/pioasm";

  nativeBuildInputs = [
@@ -36,17 +25,16 @@ stdenv.mkDerivation (finalAttrs: {
    ninja
  ];

  installPhase = ''
    runHook preInstall

    install -D pioasm $out/bin/pioasm
  cmakeFlags = [
    (lib.cmakeFeature "PIOASM_VERSION_STRING" finalAttrs.version)
  ];

    runHook postInstall
  '';
  passthru.updateScript = nix-update-script { };

  meta = {
    description = "Assemble PIO programs for Raspberry Pi Pico";
    homepage = "https://github.com/raspberrypi/pico-sdk";
    changelog = "https://github.com/raspberrypi/pico-sdk/releases/tag/${finalAttrs.version}";
    license = lib.licenses.bsd3;
    maintainers = with lib.maintainers; [ emilytrau ];
    platforms = lib.platforms.unix;