nixpkgs/pkgs/applications/misc/klayout/default.nix
Artturin f9fdf2d402 treewide: move NIX_CFLAGS_COMPILE to the env attrset
with structuredAttrs lists will be bash arrays which cannot be exported
which will be a issue with some patches and some wrappers like cc-wrapper

this makes it clearer that NIX_CFLAGS_COMPILE must be a string as lists
in env cause a eval failure
2023-02-22 21:23:04 +02:00

66 lines
1.5 KiB
Nix

{ lib, mkDerivation, fetchFromGitHub
, python3, ruby, qtbase, qtmultimedia, qttools, qtxmlpatterns
, which, perl
}:
mkDerivation rec {
pname = "klayout";
version = "0.28.5";
src = fetchFromGitHub {
owner = "KLayout";
repo = "klayout";
rev = "v${version}";
hash = "sha256-fjKxQ3oVtnFwzLeeE6kN0jKE5PIfBZubTF54KO+k/DE=";
};
postPatch = ''
substituteInPlace src/klayout.pri --replace "-Wno-reserved-user-defined-literal" ""
patchShebangs .
'';
nativeBuildInputs = [
which
perl
python3
ruby
];
buildInputs = [
qtbase
qtmultimedia
qttools
qtxmlpatterns
];
buildPhase = ''
runHook preBuild
mkdir -p $out/lib
./build.sh -qt5 -prefix $out/lib -option -j$NIX_BUILD_CORES
runHook postBuild
'';
postBuild = ''
mkdir $out/bin
mv $out/lib/klayout $out/bin/
'';
env.NIX_CFLAGS_COMPILE = toString [ "-Wno-parentheses" ];
dontInstall = true; # Installation already happens as part of "build.sh"
# Fix: "gsiDeclQMessageLogger.cc:126:42: error: format not a string literal
# and no format arguments [-Werror=format-security]"
hardeningDisable = [ "format" ];
meta = with lib; {
description = "High performance layout viewer and editor with support for GDS and OASIS";
license = with licenses; [ gpl2Plus ];
homepage = "https://www.klayout.de/";
changelog = "https://www.klayout.de/development.html#${version}";
platforms = platforms.linux;
maintainers = with maintainers; [ knedlsepp ];
};
}