Unverified Commit d0781217 authored by Weijia Wang's avatar Weijia Wang Committed by GitHub
Browse files

Merge pull request #221151 from wegank/bossa-wxgtk

bossa: migrate to wxGTK32
parents 576648a7 e9bb5bdb
Loading
Loading
Loading
Loading
+28 −5
Original line number Diff line number Diff line
{ lib, stdenv, fetchFromGitHub, wxGTK, libX11, readline }:
{ lib
, stdenv
, fetchFromGitHub
, wxGTK32
, libX11
, readline
, darwin
}:

let
  # BOSSA needs a "bin2c" program to embed images.
@@ -24,11 +31,27 @@ stdenv.mkDerivation rec {
    sha256 = "sha256-8M3MU/+Y1L6SaQ1yoC9Z27A/gGruZdopLnL1z7h7YJw=";
  };

  postPatch = ''
    substituteInPlace Makefile \
      --replace "-arch x86_64" ""
  '';

  nativeBuildInputs = [ bin2c ];
  buildInputs = [ wxGTK libX11 readline ];
  buildInputs = [
    wxGTK32
    libX11
    readline
  ] ++ lib.optionals stdenv.isDarwin [
    darwin.apple_sdk.frameworks.Cocoa
  ];

  makeFlags = [
    "WXVERSION=3.2"
    # Explicitly specify targets so they don't get stripped.
  makeFlags = [ "bin/bossac" "bin/bossash" "bin/bossa" ];
    "bin/bossac"
    "bin/bossash"
    "bin/bossa"
  ];
  env.NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations";

  installPhase = ''
@@ -47,6 +70,6 @@ stdenv.mkDerivation rec {
    '';
    homepage = "http://www.shumatech.com/web/products/bossa";
    license = licenses.bsd3;
    platforms = platforms.linux;
    platforms = platforms.unix;
  };
}
+3 −2
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@
, bintools-unwrapped
, libffi
, libusb1
, wxGTK30
, wxGTK32
, python3
, gcc-arm-embedded
, klipper
@@ -28,7 +28,7 @@
    avrdude
    stm32flash
    pkg-config
    wxGTK30 # Required for bossac
    wxGTK32 # Required for bossac
  ];

  preBuild = "cp ${firmwareConfig} ./.config";
@@ -40,6 +40,7 @@
  makeFlags = [
    "V=1"
    "KCONFIG_CONFIG=${firmwareConfig}"
    "WXVERSION=3.2"
  ];

  installPhase = ''
+1 −3
Original line number Diff line number Diff line
@@ -17558,9 +17558,7 @@ with pkgs;
  bloop = callPackage ../development/tools/build-managers/bloop { };
  bossa = callPackage ../development/embedded/bossa {
    wxGTK = wxGTK30;
  };
  bossa = callPackage ../development/embedded/bossa { };
  bossa-arduino = callPackage ../development/embedded/bossa/arduino.nix { };