From 5bd069a82080c02ebc4daba347e6f5cf1c8b296e Mon Sep 17 00:00:00 2001 From: Andreas Wendleder Date: Sat, 28 Mar 2026 13:19:32 +0100 Subject: [PATCH] klayout: 0.30.5 -> 0.30.7 --- pkgs/applications/misc/klayout/default.nix | 49 +++++++++++++++++----- 1 file changed, 38 insertions(+), 11 deletions(-) diff --git a/pkgs/applications/misc/klayout/default.nix b/pkgs/applications/misc/klayout/default.nix index 6165feaf8b1b..66e579f3010a 100644 --- a/pkgs/applications/misc/klayout/default.nix +++ b/pkgs/applications/misc/klayout/default.nix @@ -3,34 +3,45 @@ stdenv, fetchFromGitHub, installShellFiles, + nix-update-script, python3, + python3Packages, ruby, wrapQtAppsHook, qtbase, qtmultimedia, + qtsvg, qttools, qtxmlpatterns, + qmake, which, perl, libgit2, + libpng, + expat, + curl, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "klayout"; - version = "0.30.5"; + version = "0.30.7"; src = fetchFromGitHub { owner = "KLayout"; repo = "klayout"; - rev = "v${version}"; - hash = "sha256-WigRictn6CxOPId2YitlEm43vEw+dSRWdoareD9HtMc="; + rev = "v${finalAttrs.version}"; + hash = "sha256-W8ry1+wxVOUxg4hXMd0OpcaWcVr6wUBC3eGgDney2Xc="; }; + strictDeps = true; + postPatch = '' substituteInPlace src/klayout.pri --replace "-Wno-reserved-user-defined-literal" "" patchShebangs . ''; + dontUseQmakeConfigure = true; + nativeBuildInputs = [ (python3.withPackages (ps: [ ps.tomli ])) installShellFiles @@ -38,28 +49,37 @@ stdenv.mkDerivation rec { ruby which wrapQtAppsHook + qmake + qtbase + qtmultimedia + qtsvg + qttools + qtxmlpatterns ]; buildInputs = [ qtbase qtmultimedia + qtsvg qttools qtxmlpatterns libgit2 + libpng + expat + curl ]; buildPhase = '' runHook preBuild mkdir -p $out/lib - # -qt5: Using Qt5 as per your previous configuration. - # -rpath: Ensures the klayout binary can find its internal libraries (tl, db, etc.) - # in the nix store without needing LD_LIBRARY_PATH. ./build.sh \ - -qt5 \ -prefix $out/lib \ -option "-j$NIX_BUILD_CORES" \ - -rpath $out/lib + -rpath $out/lib \ + -libpng \ + -libcurl \ + -libexpat runHook postBuild ''; @@ -95,13 +115,20 @@ stdenv.mkDerivation rec { # Fix for: "gsiDeclQMessageLogger.cc: error: format not a string literal" hardeningDisable = [ "format" ]; + passthru = { + updateScript = nix-update-script { }; + tests = { + pythonPackage = python3Packages.klayout; + }; + }; + meta = { description = "High performance layout viewer and editor with support for GDS and OASIS"; mainProgram = "klayout"; license = with lib.licenses; [ gpl2Plus ]; homepage = "https://www.klayout.de/"; - changelog = "https://www.klayout.de/development.html#${version}"; + changelog = "https://www.klayout.de/development.html#${finalAttrs.version}"; platforms = lib.platforms.linux ++ lib.platforms.darwin; maintainers = [ ]; }; -} +})