kicad: avoid rebuild on date change

the date changes more often than most of the inputs
the date can also change on the base without other changes
  this causes a substantial rebuild for no reason
This commit is contained in:
Evils 2021-04-07 07:39:58 +02:00
parent 7dc05fed4f
commit e37d772beb
4 changed files with 7 additions and 11 deletions

View File

@ -61,7 +61,7 @@ let
in in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "kicad-base"; pname = "kicad-base";
version = kicadVersion; version = if (stable) then kicadVersion else builtins.substring 0 10 src.rev;
src = kicadSrc; src = kicadSrc;

View File

@ -155,11 +155,8 @@ in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
# Common libraries, referenced during runtime, via the wrapper. # Common libraries, referenced during runtime, via the wrapper.
passthru.libraries = callPackages ./libraries.nix { inherit libSrc libVersion; }; passthru.libraries = callPackages ./libraries.nix { inherit libSrc; };
passthru.i18n = callPackage ./i18n.nix { passthru.i18n = callPackage ./i18n.nix { src = i18nSrc; };
src = i18nSrc;
version = i18nVersion;
};
base = callPackage ./base.nix { base = callPackage ./base.nix {
inherit stable baseName; inherit stable baseName;
inherit kicadSrc kicadVersion; inherit kicadSrc kicadVersion;
@ -169,7 +166,7 @@ stdenv.mkDerivation rec {
}; };
inherit pname; inherit pname;
version = kicadVersion; version = if (stable) then kicadVersion else builtins.substring 0 10 src.src.rev;
src = base; src = base;
dontUnpack = true; dontUnpack = true;

View File

@ -2,13 +2,13 @@
, cmake , cmake
, gettext , gettext
, src , src
, version
}: }:
stdenv.mkDerivation { stdenv.mkDerivation {
inherit src version; inherit src;
pname = "kicad-i18n"; pname = "kicad-i18n";
version = builtins.substring 0 10 src.rev;
nativeBuildInputs = [ cmake gettext ]; nativeBuildInputs = [ cmake gettext ];
meta = with lib; { meta = with lib; {

View File

@ -2,13 +2,12 @@
, cmake , cmake
, gettext , gettext
, libSrc , libSrc
, libVersion
}: }:
let let
mkLib = name: mkLib = name:
stdenv.mkDerivation { stdenv.mkDerivation {
pname = "kicad-${name}"; pname = "kicad-${name}";
version = libVersion; version = builtins.substring 0 10 (libSrc name).rev;
src = libSrc name; src = libSrc name;