From ca33e8f4e0af210117026d8904547677e891262a Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Tue, 14 Mar 2023 13:05:47 +0200 Subject: [PATCH 1/2] bossa: migrate to wxGTK32 --- pkgs/development/embedded/bossa/default.nix | 35 +++++++++++++++++---- pkgs/top-level/all-packages.nix | 4 +-- 2 files changed, 30 insertions(+), 9 deletions(-) diff --git a/pkgs/development/embedded/bossa/default.nix b/pkgs/development/embedded/bossa/default.nix index f53e49edaed4..58ee0642fb38 100644 --- a/pkgs/development/embedded/bossa/default.nix +++ b/pkgs/development/embedded/bossa/default.nix @@ -1,4 +1,11 @@ -{ 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="; }; - nativeBuildInputs = [ bin2c ]; - buildInputs = [ wxGTK libX11 readline ]; + postPatch = '' + substituteInPlace Makefile \ + --replace "-arch x86_64" "" + ''; - # Explicitly specify targets so they don't get stripped. - makeFlags = [ "bin/bossac" "bin/bossash" "bin/bossa" ]; + nativeBuildInputs = [ bin2c ]; + 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. + "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; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 9496e82a6d86..d29359c09596 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -17531,9 +17531,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 { }; From e9bb5bdbfda19d0c6847dcbe99ae3998ae864ac0 Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Tue, 14 Mar 2023 13:29:06 +0200 Subject: [PATCH 2/2] klipper-firmware: migrate to wxGTK32 --- pkgs/servers/klipper/klipper-firmware.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/servers/klipper/klipper-firmware.nix b/pkgs/servers/klipper/klipper-firmware.nix index 4c9e4e293542..fba5331d5b83 100644 --- a/pkgs/servers/klipper/klipper-firmware.nix +++ b/pkgs/servers/klipper/klipper-firmware.nix @@ -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 = ''