From fa36136ceed0e2c58e0c9e21492a7e60c3a64470 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Sat, 25 Nov 2023 14:14:49 +0100 Subject: [PATCH 1/3] heatshrink: add cmake build script Wanted by prusa-slicer and libbgcode --- pkgs/tools/compression/heatshrink/default.nix | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/pkgs/tools/compression/heatshrink/default.nix b/pkgs/tools/compression/heatshrink/default.nix index 49ef7354cbc9..b5cfb92247af 100644 --- a/pkgs/tools/compression/heatshrink/default.nix +++ b/pkgs/tools/compression/heatshrink/default.nix @@ -1,6 +1,8 @@ { lib , stdenv , fetchFromGitHub +, cmake +, fetchpatch }: stdenv.mkDerivation rec { @@ -14,14 +16,17 @@ stdenv.mkDerivation rec { hash = "sha256-Nm9/+JFMDXY1N90hmNFGh755V2sXSRQ4VBN9f8TcsGk="; }; - makeFlags = [ "PREFIX=$(out)" ]; + patches = [ + # Add CMake build script, wanted by prusa-slicer and libbgcode, which are the only users of this library. + (fetchpatch { + url = "https://github.com/atomicobject/heatshrink/commit/0886e9ca76552b8e325841e2b820b4563e5d5aba.patch"; + hash = "sha256-13hy4+/RDaaKgQcdaSbACvMfElUIskvJ+owXqm40feY="; + }) + ]; - preInstall = '' - mkdir -p $out/{bin,lib,include} - ''; - - doCheck = true; - checkTarget = "test"; + nativeBuildInputs = [ + cmake + ]; doInstallCheck = true; installCheckPhase = '' From 33b855390864c109120a3f525c31a88f5f67c8cc Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Sat, 25 Nov 2023 01:34:15 +0100 Subject: [PATCH 2/3] libbgcode: init at 2023-11-16 --- pkgs/by-name/li/libbgcode/package.nix | 40 +++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 pkgs/by-name/li/libbgcode/package.nix diff --git a/pkgs/by-name/li/libbgcode/package.nix b/pkgs/by-name/li/libbgcode/package.nix new file mode 100644 index 000000000000..e4dd6099bc9d --- /dev/null +++ b/pkgs/by-name/li/libbgcode/package.nix @@ -0,0 +1,40 @@ +{ lib +, stdenv +, fetchFromGitHub +, cmake +, pkg-config +, heatshrink +, zlib +, boost +, catch2 +}: +stdenv.mkDerivation { + pname = "libbgcode"; + version = "2023-11-16"; + + src = fetchFromGitHub { + owner = "prusa3d"; + repo = "libbgcode"; + rev = "bc390aab4427589a6402b4c7f65cf4d0a8f987ec"; + hash = "sha256-TZShYeDAh+fNdmTr1Xqctji9f0vEGpNZv1ba/IY5EoY="; + }; + + nativeBuildInputs = [ + cmake + pkg-config + ]; + + buildInputs = [ + heatshrink + zlib + boost + catch2 + ]; + + meta = with lib; { + homepage = "https://github.com/prusa3d/libbgcode"; + description = "Prusa Block & Binary G-code reader / writer / converter"; + license = licenses.agpl3Only; + maintainers = with maintainers; [ lach ]; + }; +} From a9c11e323a474597c18f4fcef66919c3f54a1e3e Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Sat, 25 Nov 2023 01:34:59 +0100 Subject: [PATCH 3/3] prusa-slicer: 2.6.1 -> 2.7.0 --- .../misc/prusa-slicer/default.nix | 30 +++++++++---------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/pkgs/applications/misc/prusa-slicer/default.nix b/pkgs/applications/misc/prusa-slicer/default.nix index 0c9907764f22..8114f2ecb416 100644 --- a/pkgs/applications/misc/prusa-slicer/default.nix +++ b/pkgs/applications/misc/prusa-slicer/default.nix @@ -32,6 +32,9 @@ , tbb_2021_8 , wxGTK32 , xorg +, libbgcode +, heatshrink +, catch2 , fetchpatch , withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd, systemd , wxGTK-override ? null @@ -68,7 +71,14 @@ let in stdenv.mkDerivation (finalAttrs: { pname = "prusa-slicer"; - version = "2.6.1"; + version = "2.7.0"; + + src = fetchFromGitHub { + owner = "prusa3d"; + repo = "PrusaSlicer"; + hash = "sha256-S0z2v6knkQ+xlABB1zedEGtlxA/65X/vxLh304StfbE="; + rev = "version_${finalAttrs.version}"; + }; nativeBuildInputs = [ cmake @@ -102,6 +112,9 @@ stdenv.mkDerivation (finalAttrs: { tbb_2021_8 wxGTK-override' xorg.libX11 + libbgcode + heatshrink + catch2 ] ++ lib.optionals withSystemd [ systemd ]; @@ -143,21 +156,6 @@ stdenv.mkDerivation (finalAttrs: { --replace "#ifdef __APPLE__" "#if 0" ''; - patches = [ - # wxWidgets: CheckResizerFlags assert fix - (fetchpatch { - url = "https://github.com/prusa3d/PrusaSlicer/commit/24a5ebd65c9d25a0fd69a3716d079fd1b00eb15c.patch"; - hash = "sha256-MNGtaI7THu6HEl9dMwcO1hkrCtIkscoNh4ulA2cKtZA="; - }) - ]; - - src = fetchFromGitHub { - owner = "prusa3d"; - repo = "PrusaSlicer"; - hash = "sha256-t5lnBL7SZVfyR680ZK29YXgE3pag+uVv4+BGJZq40/A="; - rev = "version_${finalAttrs.version}"; - }; - cmakeFlags = [ "-DSLIC3R_STATIC=0" "-DSLIC3R_FHS=1"