mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-11 04:02:55 +03:00
Merge pull request #152149 from evils/kicad
KiCad: 5.1.12 -> 6.0.0; and a bunch of cleanup
This commit is contained in:
commit
33d85a8e24
@ -35,7 +35,6 @@
|
|||||||
, swig
|
, swig
|
||||||
, python
|
, python
|
||||||
, wxPython
|
, wxPython
|
||||||
, opencascade
|
|
||||||
, opencascade-occt
|
, opencascade-occt
|
||||||
, libngspice
|
, libngspice
|
||||||
, valgrind
|
, valgrind
|
||||||
@ -44,22 +43,16 @@
|
|||||||
, baseName
|
, baseName
|
||||||
, kicadSrc
|
, kicadSrc
|
||||||
, kicadVersion
|
, kicadVersion
|
||||||
, i18n
|
|
||||||
, withOCE
|
|
||||||
, withOCC
|
, withOCC
|
||||||
, withNgspice
|
, withNgspice
|
||||||
, withScripting
|
, withScripting
|
||||||
|
, withI18n
|
||||||
|
, withPCM
|
||||||
, debug
|
, debug
|
||||||
, sanitizeAddress
|
, sanitizeAddress
|
||||||
, sanitizeThreads
|
, sanitizeThreads
|
||||||
, withI18n
|
|
||||||
}:
|
}:
|
||||||
|
|
||||||
assert lib.asserts.assertMsg (!(withOCE && stdenv.isAarch64)) "OCE fails a test on Aarch64";
|
|
||||||
assert lib.asserts.assertMsg (!(withOCC && withOCE))
|
|
||||||
"Only one of OCC and OCE may be enabled";
|
|
||||||
assert lib.assertMsg (!(stable && (sanitizeAddress || sanitizeThreads)))
|
|
||||||
"Only kicad-unstable(-small) supports address/thread sanitation";
|
|
||||||
assert lib.assertMsg (!(sanitizeAddress && sanitizeThreads))
|
assert lib.assertMsg (!(sanitizeAddress && sanitizeThreads))
|
||||||
"'sanitizeAddress' and 'sanitizeThreads' are mutually exclusive, use one.";
|
"'sanitizeAddress' and 'sanitizeThreads' are mutually exclusive, use one.";
|
||||||
|
|
||||||
@ -75,6 +68,7 @@ stdenv.mkDerivation rec {
|
|||||||
# tagged releases don't have "unknown"
|
# tagged releases don't have "unknown"
|
||||||
# kicad nightlies use git describe --dirty
|
# kicad nightlies use git describe --dirty
|
||||||
# nix removes .git, so its approximated here
|
# nix removes .git, so its approximated here
|
||||||
|
# "6.99.0" doesn't have "-unknown", yet; so leaving this in case it returns
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
substituteInPlace CMakeModules/KiCadVersion.cmake \
|
substituteInPlace CMakeModules/KiCadVersion.cmake \
|
||||||
--replace "unknown" "${builtins.substring 0 10 src.rev}" \
|
--replace "unknown" "${builtins.substring 0 10 src.rev}" \
|
||||||
@ -82,23 +76,14 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
makeFlags = optionals (debug) [ "CFLAGS+=-Og" "CFLAGS+=-ggdb" ];
|
makeFlags = optionals (debug) [ "CFLAGS+=-Og" "CFLAGS+=-ggdb" ];
|
||||||
|
|
||||||
cmakeFlags = optionals (stable && withScripting) [
|
cmakeFlags = optionals (withScripting) [
|
||||||
"-DKICAD_SCRIPTING=ON"
|
"-DKICAD_SCRIPTING_WXPYTHON=ON"
|
||||||
"-DKICAD_SCRIPTING_MODULES=ON"
|
|
||||||
"-DKICAD_SCRIPTING_PYTHON3=ON"
|
|
||||||
"-DKICAD_SCRIPTING_WXPYTHON_PHOENIX=ON"
|
|
||||||
]
|
]
|
||||||
++ optionals (!withScripting) [
|
++ optionals (!withScripting) [
|
||||||
"-DKICAD_SCRIPTING=OFF"
|
|
||||||
"-DKICAD_SCRIPTING_WXPYTHON=OFF"
|
"-DKICAD_SCRIPTING_WXPYTHON=OFF"
|
||||||
]
|
]
|
||||||
++ optional (withNgspice) "-DKICAD_SPICE=ON"
|
++ optional (!withNgspice) "-DKICAD_SPICE=OFF"
|
||||||
++ optional (!withOCE) "-DKICAD_USE_OCE=OFF"
|
|
||||||
++ optional (!withOCC) "-DKICAD_USE_OCC=OFF"
|
++ optional (!withOCC) "-DKICAD_USE_OCC=OFF"
|
||||||
++ optionals (withOCE) [
|
|
||||||
"-DKICAD_USE_OCE=ON"
|
|
||||||
"-DOCE_DIR=${opencascade}"
|
|
||||||
]
|
|
||||||
++ optionals (withOCC) [
|
++ optionals (withOCC) [
|
||||||
"-DKICAD_USE_OCC=ON"
|
"-DKICAD_USE_OCC=ON"
|
||||||
"-DOCC_INCLUDE_DIR=${opencascade-occt}/include/opencascade"
|
"-DOCC_INCLUDE_DIR=${opencascade-occt}/include/opencascade"
|
||||||
@ -108,11 +93,20 @@ stdenv.mkDerivation rec {
|
|||||||
"-DKICAD_STDLIB_DEBUG=ON"
|
"-DKICAD_STDLIB_DEBUG=ON"
|
||||||
"-DKICAD_USE_VALGRIND=ON"
|
"-DKICAD_USE_VALGRIND=ON"
|
||||||
]
|
]
|
||||||
|
++ optionals (!doInstallCheck) [
|
||||||
|
"-DKICAD_BUILD_QA_TESTS=OFF"
|
||||||
|
]
|
||||||
++ optionals (sanitizeAddress) [
|
++ optionals (sanitizeAddress) [
|
||||||
"-DKICAD_SANITIZE_ADDRESS=ON"
|
"-DKICAD_SANITIZE_ADDRESS=ON"
|
||||||
]
|
]
|
||||||
++ optionals (sanitizeThreads) [
|
++ optionals (sanitizeThreads) [
|
||||||
"-DKICAD_SANITIZE_THREADS=ON"
|
"-DKICAD_SANITIZE_THREADS=ON"
|
||||||
|
]
|
||||||
|
++ optionals (withI18n) [
|
||||||
|
"-DKICAD_BUILD_I18N=ON"
|
||||||
|
]
|
||||||
|
++ optionals (!withPCM) [
|
||||||
|
"-DKICAD_PCM=OFF"
|
||||||
];
|
];
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
@ -154,34 +148,27 @@ stdenv.mkDerivation rec {
|
|||||||
curl
|
curl
|
||||||
openssl
|
openssl
|
||||||
boost
|
boost
|
||||||
|
swig
|
||||||
|
python
|
||||||
]
|
]
|
||||||
# unstable requires swig and python
|
|
||||||
# wxPython still optional
|
|
||||||
++ optionals (withScripting || (!stable)) [ swig python ]
|
|
||||||
++ optional (withScripting) wxPython
|
++ optional (withScripting) wxPython
|
||||||
++ optional (withNgspice) libngspice
|
++ optional (withNgspice) libngspice
|
||||||
++ optional (withOCE) opencascade
|
|
||||||
++ optional (withOCC) opencascade-occt
|
++ optional (withOCC) opencascade-occt
|
||||||
++ optional (debug) valgrind
|
++ optional (debug) valgrind
|
||||||
;
|
;
|
||||||
|
|
||||||
# debug builds fail all but the python test
|
# debug builds fail all but the python test
|
||||||
# 5.1.x fails the eeschema test
|
#doInstallCheck = !debug;
|
||||||
doInstallCheck = !debug && !stable;
|
# temporarily disabled until upstream issue 9888 is resolved
|
||||||
|
doInstallCheck = false;
|
||||||
installCheckTarget = "test";
|
installCheckTarget = "test";
|
||||||
|
|
||||||
dontStrip = debug;
|
dontStrip = debug;
|
||||||
|
|
||||||
postInstall = optionalString (withI18n) ''
|
|
||||||
mkdir -p $out/share
|
|
||||||
lndir ${i18n}/share $out/share
|
|
||||||
'';
|
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
description = "Just the built source without the libraries";
|
description = "Just the built source without the libraries";
|
||||||
longDescription = ''
|
longDescription = ''
|
||||||
Just the build products, optionally with the i18n linked in
|
Just the build products, the libraries are passed via an env var in the wrapper, default.nix
|
||||||
the libraries are passed via an env var in the wrapper, default.nix
|
|
||||||
'';
|
'';
|
||||||
homepage = "https://www.kicad.org/";
|
homepage = "https://www.kicad.org/";
|
||||||
license = lib.licenses.agpl3;
|
license = lib.licenses.agpl3;
|
||||||
|
@ -2,8 +2,7 @@
|
|||||||
, fetchFromGitLab
|
, fetchFromGitLab
|
||||||
, gnome
|
, gnome
|
||||||
, dconf
|
, dconf
|
||||||
, wxGTK30
|
, wxGTK31-gtk3
|
||||||
, wxGTK31
|
|
||||||
, makeWrapper
|
, makeWrapper
|
||||||
, gsettings-desktop-schemas
|
, gsettings-desktop-schemas
|
||||||
, hicolor-icon-theme
|
, hicolor-icon-theme
|
||||||
@ -14,42 +13,36 @@
|
|||||||
|
|
||||||
, pname ? "kicad"
|
, pname ? "kicad"
|
||||||
, stable ? true
|
, stable ? true
|
||||||
, oceSupport ? false
|
|
||||||
, withOCE ? false
|
|
||||||
, withOCCT ? false
|
|
||||||
, withOCC ? true
|
, withOCC ? true
|
||||||
, ngspiceSupport ? false
|
|
||||||
, withNgspice ? true
|
, withNgspice ? true
|
||||||
, libngspice
|
, libngspice
|
||||||
, scriptingSupport ? false
|
|
||||||
, withScripting ? true
|
, withScripting ? true
|
||||||
, python3
|
, python3
|
||||||
, debug ? false
|
, debug ? false
|
||||||
, sanitizeAddress ? false
|
, sanitizeAddress ? false
|
||||||
, sanitizeThreads ? false
|
, sanitizeThreads ? false
|
||||||
, with3d ? true
|
, with3d ? true
|
||||||
, withI18n ? true
|
, withI18n ? false
|
||||||
|
, withPCM ? true # Plugin and Content Manager
|
||||||
, srcs ? { }
|
, srcs ? { }
|
||||||
}:
|
}:
|
||||||
|
|
||||||
# The `srcs` parameter can be used to override the kicad source code
|
# The `srcs` parameter can be used to override the kicad source code
|
||||||
# and all libraries (including i18n), which are otherwise inaccessible
|
# and all libraries, which are otherwise inaccessible
|
||||||
# to overlays since most of the kicad build expression has been
|
# to overlays since most of the kicad build expression has been
|
||||||
# refactored into base.nix, most of the library build expressions have
|
# refactored into base.nix, most of the library build expressions have
|
||||||
# been refactored into libraries.nix, and most the i18n build
|
# been refactored into libraries.nix. Overrides are only applied when
|
||||||
# expression has been refactored into i18n.nix. Overrides are only
|
# building `kicad-unstable`. The `srcs` parameter has
|
||||||
# applied when building `kicad-unstable`. The `srcs` parameter has no
|
# no effect for stable `kicad`. `srcs` takes an attribute set in which
|
||||||
# effect for stable `kicad`. `srcs` takes an attribute set in which
|
|
||||||
# any of the following attributes are meaningful (though none are
|
# any of the following attributes are meaningful (though none are
|
||||||
# mandatory): "kicad", "kicadVersion", "i18n", "symbols", "templates",
|
# mandatory): "kicad", "kicadVersion", "symbols", "templates",
|
||||||
# "footprints", "packages3d", and "libVersion". "kicadVersion" and
|
# "footprints", "packages3d", and "libVersion". "kicadVersion" and
|
||||||
# "libVersion" should be set to a string with the desired value for
|
# "libVersion" should be set to a string with the desired value for
|
||||||
# the version attribute in kicad's `mkDerivation` and the version
|
# the version attribute in kicad's `mkDerivation` and the version
|
||||||
# attribute in any of the library's or i18n's `mkDerivation`,
|
# attribute in any of the library's `mkDerivation`, respectively.
|
||||||
# respectively. "kicad", "i18n", "symbols", "templates", "footprints",
|
# "kicad", "symbols", "templates", "footprints", and "packages3d"
|
||||||
# and "packages3d" should be set to an appropriate fetcher (e.g.,
|
# should be set to an appropriate fetcher (e.g. `fetchFromGitLab`).
|
||||||
# `fetchFromGitLab`). So, for example, a possible overlay for kicad
|
# So, for example, a possible overlay for kicad is:
|
||||||
# is:
|
|
||||||
#
|
#
|
||||||
# final: prev:
|
# final: prev:
|
||||||
|
|
||||||
@ -68,15 +61,6 @@
|
|||||||
# });
|
# });
|
||||||
# }
|
# }
|
||||||
|
|
||||||
assert withNgspice -> libngspice != null;
|
|
||||||
assert lib.assertMsg (!ngspiceSupport)
|
|
||||||
"`nspiceSupport` was renamed to `withNgspice` for the sake of consistency with other kicad nix arguments.";
|
|
||||||
assert lib.assertMsg (!oceSupport)
|
|
||||||
"`oceSupport` was renamed to `withOCE` for the sake of consistency with other kicad nix arguments.";
|
|
||||||
assert lib.assertMsg (!scriptingSupport)
|
|
||||||
"`scriptingSupport` was renamed to `withScripting` for the sake of consistency with other kicad nix arguments.";
|
|
||||||
assert lib.assertMsg (!withOCCT)
|
|
||||||
"`withOCCT` was renamed to `withOCC` for the sake of consistency with upstream cmake options.";
|
|
||||||
let
|
let
|
||||||
baseName = if (stable) then "kicad" else "kicad-unstable";
|
baseName = if (stable) then "kicad" else "kicad-unstable";
|
||||||
versionsImport = import ./versions.nix;
|
versionsImport = import ./versions.nix;
|
||||||
@ -91,14 +75,6 @@ let
|
|||||||
sha256 = versionsImport.${baseName}.kicadVersion.src.sha256;
|
sha256 = versionsImport.${baseName}.kicadVersion.src.sha256;
|
||||||
};
|
};
|
||||||
|
|
||||||
i18nSrcFetch = fetchFromGitLab {
|
|
||||||
group = "kicad";
|
|
||||||
owner = "code";
|
|
||||||
repo = "kicad-i18n";
|
|
||||||
rev = versionsImport.${baseName}.libVersion.libSources.i18n.rev;
|
|
||||||
sha256 = versionsImport.${baseName}.libVersion.libSources.i18n.sha256;
|
|
||||||
};
|
|
||||||
|
|
||||||
libSrcFetch = name: fetchFromGitLab {
|
libSrcFetch = name: fetchFromGitLab {
|
||||||
group = "kicad";
|
group = "kicad";
|
||||||
owner = "libraries";
|
owner = "libraries";
|
||||||
@ -121,36 +97,15 @@ let
|
|||||||
if srcOverridep "kicadVersion" then srcs.kicadVersion
|
if srcOverridep "kicadVersion" then srcs.kicadVersion
|
||||||
else versionsImport.${baseName}.kicadVersion.version;
|
else versionsImport.${baseName}.kicadVersion.version;
|
||||||
|
|
||||||
i18nSrc = if srcOverridep "i18n" then srcs.i18n else i18nSrcFetch;
|
|
||||||
i18nVersion =
|
|
||||||
if srcOverridep "i18nVersion" then srcs.i18nVersion
|
|
||||||
else versionsImport.${baseName}.libVersion.version;
|
|
||||||
|
|
||||||
libSrc = name: if srcOverridep name then srcs.${name} else libSrcFetch name;
|
libSrc = name: if srcOverridep name then srcs.${name} else libSrcFetch name;
|
||||||
# TODO does it make sense to only have one version for all libs?
|
# TODO does it make sense to only have one version for all libs?
|
||||||
libVersion =
|
libVersion =
|
||||||
if srcOverridep "libVersion" then srcs.libVersion
|
if srcOverridep "libVersion" then srcs.libVersion
|
||||||
else versionsImport.${baseName}.libVersion.version;
|
else versionsImport.${baseName}.libVersion.version;
|
||||||
|
|
||||||
wxGTK =
|
wxGTK = wxGTK31-gtk3;
|
||||||
if (stable)
|
|
||||||
# wxGTK3x may default to withGtk2 = false, see #73145
|
|
||||||
then
|
|
||||||
wxGTK30.override
|
|
||||||
{
|
|
||||||
withGtk2 = false;
|
|
||||||
}
|
|
||||||
# wxGTK31 currently introduces an issue with opening the python interpreter in pcbnew
|
|
||||||
# but brings high DPI support?
|
|
||||||
else
|
|
||||||
wxGTK31.override {
|
|
||||||
withGtk2 = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
python = python3;
|
python = python3;
|
||||||
wxPython = if (stable)
|
wxPython = python.pkgs.wxPython_4_1;
|
||||||
then python.pkgs.wxPython_4_0
|
|
||||||
else python.pkgs.wxPython_4_1;
|
|
||||||
|
|
||||||
inherit (lib) concatStringsSep flatten optionalString optionals;
|
inherit (lib) concatStringsSep flatten optionalString optionals;
|
||||||
in
|
in
|
||||||
@ -158,13 +113,11 @@ 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; };
|
passthru.libraries = callPackages ./libraries.nix { inherit libSrc; };
|
||||||
passthru.i18n = callPackage ./i18n.nix { src = i18nSrc; };
|
|
||||||
base = callPackage ./base.nix {
|
base = callPackage ./base.nix {
|
||||||
inherit stable baseName;
|
inherit stable baseName;
|
||||||
inherit kicadSrc kicadVersion;
|
inherit kicadSrc kicadVersion;
|
||||||
inherit (passthru) i18n;
|
|
||||||
inherit wxGTK python wxPython;
|
inherit wxGTK python wxPython;
|
||||||
inherit withI18n withOCC withOCE withNgspice withScripting;
|
inherit withOCC withNgspice withScripting withI18n withPCM;
|
||||||
inherit debug sanitizeAddress sanitizeThreads;
|
inherit debug sanitizeAddress sanitizeThreads;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -197,27 +150,14 @@ stdenv.mkDerivation rec {
|
|||||||
"--prefix GIO_EXTRA_MODULES : ${dconf}/lib/gio/modules"
|
"--prefix GIO_EXTRA_MODULES : ${dconf}/lib/gio/modules"
|
||||||
# required to open a bug report link in firefox-wayland
|
# required to open a bug report link in firefox-wayland
|
||||||
"--set-default MOZ_DBUS_REMOTE 1"
|
"--set-default MOZ_DBUS_REMOTE 1"
|
||||||
]
|
|
||||||
++ optionals (stable)
|
|
||||||
[
|
|
||||||
"--set-default KISYSMOD ${footprints}/share/kicad/modules"
|
|
||||||
"--set-default KICAD_SYMBOL_DIR ${symbols}/share/kicad/library"
|
|
||||||
"--set-default KICAD_TEMPLATE_DIR ${templates}/share/kicad/template"
|
|
||||||
"--prefix KICAD_TEMPLATE_DIR : ${symbols}/share/kicad/template"
|
|
||||||
"--prefix KICAD_TEMPLATE_DIR : ${footprints}/share/kicad/template"
|
|
||||||
]
|
|
||||||
++ optionals (stable && with3d) [ "--set-default KISYS3DMOD ${packages3d}/share/kicad/modules/packages3d" ]
|
|
||||||
++ optionals (!stable)
|
|
||||||
[
|
|
||||||
"--set-default KICAD6_FOOTPRINT_DIR ${footprints}/share/kicad/footprints"
|
"--set-default KICAD6_FOOTPRINT_DIR ${footprints}/share/kicad/footprints"
|
||||||
"--set-default KICAD6_SYMBOL_DIR ${symbols}/share/kicad/symbols"
|
"--set-default KICAD6_SYMBOL_DIR ${symbols}/share/kicad/symbols"
|
||||||
"--set-default KICAD6_TEMPLATE_DIR ${templates}/share/kicad/template"
|
"--set-default KICAD6_TEMPLATE_DIR ${templates}/share/kicad/template"
|
||||||
"--prefix KICAD6_TEMPLATE_DIR : ${symbols}/share/kicad/template"
|
"--prefix KICAD6_TEMPLATE_DIR : ${symbols}/share/kicad/template"
|
||||||
"--prefix KICAD6_TEMPLATE_DIR : ${footprints}/share/kicad/template"
|
"--prefix KICAD6_TEMPLATE_DIR : ${footprints}/share/kicad/template"
|
||||||
]
|
]
|
||||||
++ optionals (!stable && with3d)
|
++ optionals (with3d)
|
||||||
[
|
[
|
||||||
"--set-default KISYS3DMOD ${packages3d}/share/kicad/3dmodels"
|
|
||||||
"--set-default KICAD6_3DMODEL_DIR ${packages3d}/share/kicad/3dmodels"
|
"--set-default KICAD6_3DMODEL_DIR ${packages3d}/share/kicad/3dmodels"
|
||||||
]
|
]
|
||||||
++ optionals (withNgspice) [ "--prefix LD_LIBRARY_PATH : ${libngspice}/lib" ]
|
++ optionals (withNgspice) [ "--prefix LD_LIBRARY_PATH : ${libngspice}/lib" ]
|
||||||
@ -259,9 +199,6 @@ stdenv.mkDerivation rec {
|
|||||||
ln -s ${base}/share/applications $out/share/applications
|
ln -s ${base}/share/applications $out/share/applications
|
||||||
ln -s ${base}/share/icons $out/share/icons
|
ln -s ${base}/share/icons $out/share/icons
|
||||||
ln -s ${base}/share/mime $out/share/mime
|
ln -s ${base}/share/mime $out/share/mime
|
||||||
'' + optionalString (stable) ''
|
|
||||||
ln -s ${base}/share/appdata $out/share/appdata
|
|
||||||
'' + optionalString (!stable) ''
|
|
||||||
ln -s ${base}/share/metainfo $out/share/metainfo
|
ln -s ${base}/share/metainfo $out/share/metainfo
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
@ -1,18 +0,0 @@
|
|||||||
{ lib, stdenv
|
|
||||||
, cmake
|
|
||||||
, gettext
|
|
||||||
, src
|
|
||||||
}:
|
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
|
||||||
inherit src;
|
|
||||||
|
|
||||||
pname = "kicad-i18n";
|
|
||||||
version = builtins.substring 0 10 src.rev;
|
|
||||||
|
|
||||||
nativeBuildInputs = [ cmake gettext ];
|
|
||||||
meta = with lib; {
|
|
||||||
license = licenses.gpl2; # https://github.com/KiCad/kicad-i18n/issues/3
|
|
||||||
platforms = platforms.all;
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,7 +1,9 @@
|
|||||||
#!/usr/bin/env nix-shell
|
#!/usr/bin/env nix-shell
|
||||||
#!nix-shell -i bash -p coreutils git nix curl
|
#!nix-shell -i bash -p coreutils git nix curl
|
||||||
|
# shellcheck shell=bash enable=all
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
shopt -s inherit_errexit
|
||||||
|
|
||||||
# this script will generate versions.nix in the right location
|
# this script will generate versions.nix in the right location
|
||||||
# this should contain the versions' revs and hashes
|
# this should contain the versions' revs and hashes
|
||||||
@ -25,10 +27,12 @@ export TMPDIR=/tmp
|
|||||||
# remove items left in /nix/store?
|
# remove items left in /nix/store?
|
||||||
|
|
||||||
# get the latest tag that isn't an RC or *.99
|
# get the latest tag that isn't an RC or *.99
|
||||||
latest_tag="$(git ls-remote --tags --sort -version:refname \
|
latest_tags="$(git ls-remote --tags --sort -version:refname https://gitlab.com/kicad/code/kicad.git)"
|
||||||
https://gitlab.com/kicad/code/kicad.git \
|
# using a scratch variable to ensure command failures get caught (SC2312)
|
||||||
| grep -o 'refs/tags/[0-9]*\.[0-9]*\.[0-9]*$' \
|
scratch="$(grep -o 'refs/tags/[0-9]*\.[0-9]*\.[0-9]*$' <<< "${latest_tags}")"
|
||||||
| grep -v ".99" | head -n 1 | cut -d '/' -f 3)"
|
scratch="$(grep -ve '\.99' -e '\.9\.9' <<< "${scratch}")"
|
||||||
|
scratch="$(head -n 1 <<< "${scratch}")"
|
||||||
|
latest_tag="$(cut -d '/' -f 3 <<< "${scratch}")"
|
||||||
|
|
||||||
all_versions=( "${latest_tag}" master )
|
all_versions=( "${latest_tag}" master )
|
||||||
|
|
||||||
@ -60,15 +64,15 @@ tmp="${here}/,versions.nix.${RANDOM}"
|
|||||||
|
|
||||||
libs=( symbols templates footprints packages3d )
|
libs=( symbols templates footprints packages3d )
|
||||||
|
|
||||||
get_rev="git ls-remote --heads --tags"
|
get_rev() {
|
||||||
|
git ls-remote --heads --tags "$@"
|
||||||
|
}
|
||||||
|
|
||||||
gitlab="https://gitlab.com/kicad"
|
gitlab="https://gitlab.com/kicad"
|
||||||
# append commit hash or tag
|
# append commit hash or tag
|
||||||
gitlab_pre="https://gitlab.com/api/v4/projects/kicad%2Fcode%2Fkicad/repository/archive.tar.gz?sha="
|
src_pre="https://gitlab.com/api/v4/projects/kicad%2Fcode%2Fkicad/repository/archive.tar.gz?sha="
|
||||||
|
lib_pre="https://gitlab.com/api/v4/projects/kicad%2Flibraries%2Fkicad-"
|
||||||
# not a lib, but separate and already moved to gitlab
|
lib_mid="/repository/archive.tar.gz?sha="
|
||||||
i18n="${gitlab}/code/kicad-i18n.git"
|
|
||||||
i18n_pre="https://gitlab.com/api/v4/projects/kicad%2Fcode%2Fkicad-i18n/repository/archive.tar.gz?sha="
|
|
||||||
|
|
||||||
count=0
|
count=0
|
||||||
|
|
||||||
@ -108,16 +112,19 @@ for version in "${all_versions[@]}"; do
|
|||||||
printf "%6ssrc = {\n" ""
|
printf "%6ssrc = {\n" ""
|
||||||
|
|
||||||
echo "Checking src" >&2
|
echo "Checking src" >&2
|
||||||
src_rev="$(${get_rev} "${gitlab}"/code/kicad.git "${version}" | cut -f1)"
|
scratch="$(get_rev "${gitlab}"/code/kicad.git "${version}")"
|
||||||
|
src_rev="$(cut -f1 <<< "${scratch}")"
|
||||||
has_rev="$(grep -sm 1 "\"${pname}\"" -A 4 "${file}" | grep -sm 1 "${src_rev}" || true)"
|
has_rev="$(grep -sm 1 "\"${pname}\"" -A 4 "${file}" | grep -sm 1 "${src_rev}" || true)"
|
||||||
has_hash="$(grep -sm 1 "\"${pname}\"" -A 5 "${file}" | grep -sm 1 "sha256" || true)"
|
has_hash="$(grep -sm 1 "\"${pname}\"" -A 5 "${file}" | grep -sm 1 "sha256" || true)"
|
||||||
|
|
||||||
if [[ -n ${has_rev} && -n ${has_hash} && -z ${clean} ]]; then
|
if [[ -n ${has_rev} && -n ${has_hash} && -z ${clean} ]]; then
|
||||||
echo "Reusing old ${pname}.src.sha256, already latest .rev" >&2
|
echo "Reusing old ${pname}.src.sha256, already latest .rev" >&2
|
||||||
grep -sm 1 "\"${pname}\"" -A 5 "${file}" | grep -sm 1 "rev" -A 1
|
scratch=$(grep -sm 1 "\"${pname}\"" -A 5 "${file}")
|
||||||
|
grep -sm 1 "rev" -A 1 <<< "${scratch}"
|
||||||
else
|
else
|
||||||
|
prefetched="$(${prefetch} "${src_pre}${src_rev}")"
|
||||||
printf "%8srev =\t\t\t\"%s\";\n" "" "${src_rev}"
|
printf "%8srev =\t\t\t\"%s\";\n" "" "${src_rev}"
|
||||||
printf "%8ssha256 =\t\t\"%s\";\n" \
|
printf "%8ssha256 =\t\t\"%s\";\n" "" "${prefetched}"
|
||||||
"" "$(${prefetch} "${gitlab_pre}${src_rev}")"
|
|
||||||
count=$((count+1))
|
count=$((count+1))
|
||||||
fi
|
fi
|
||||||
printf "%6s};\n" ""
|
printf "%6s};\n" ""
|
||||||
@ -127,37 +134,26 @@ for version in "${all_versions[@]}"; do
|
|||||||
printf "%6sversion =\t\t\t\"%s\";\n" "" "${today}"
|
printf "%6sversion =\t\t\t\"%s\";\n" "" "${today}"
|
||||||
printf "%6slibSources = {\n" ""
|
printf "%6slibSources = {\n" ""
|
||||||
|
|
||||||
echo "Checking i18n" >&2
|
|
||||||
i18n_rev="$(${get_rev} "${i18n}" "${version}" | cut -f1)"
|
|
||||||
has_rev="$(grep -sm 1 "\"${pname}\"" -A 11 "${file}" | grep -sm 1 "${i18n_rev}" || true)"
|
|
||||||
has_hash="$(grep -sm 1 "\"${pname}\"" -A 12 "${file}" | grep -sm 1 "i18n.sha256" || true)"
|
|
||||||
if [[ -n ${has_rev} && -n ${has_hash} && -z ${clean} ]]; then
|
|
||||||
echo "Reusing old kicad-i18n-${today}.src.sha256, already latest .rev" >&2
|
|
||||||
grep -sm 1 "\"${pname}\"" -A 12 "${file}" | grep -sm 1 "i18n" -A 1
|
|
||||||
else
|
|
||||||
printf "%8si18n.rev =\t\t\"%s\";\n" "" "${i18n_rev}"
|
|
||||||
printf "%8si18n.sha256 =\t\t\"%s\";\n" "" \
|
|
||||||
"$(${prefetch} "${i18n_pre}${i18n_rev}")"
|
|
||||||
count=$((count+1))
|
|
||||||
fi
|
|
||||||
|
|
||||||
for lib in "${libs[@]}"; do
|
for lib in "${libs[@]}"; do
|
||||||
echo "Checking ${lib}" >&2
|
echo "Checking ${lib}" >&2
|
||||||
url="${gitlab}/libraries/kicad-${lib}.git"
|
url="${gitlab}/libraries/kicad-${lib}.git"
|
||||||
lib_rev="$(${get_rev} "${url}" "${version}" | cut -f1 | tail -n1)"
|
scratch="$(get_rev "${url}" "${version}")"
|
||||||
|
scratch="$(cut -f1 <<< "${scratch}")"
|
||||||
|
lib_rev="$(tail -n1 <<< "${scratch}")"
|
||||||
has_rev="$(grep -sm 1 "\"${pname}\"" -A 19 "${file}" | grep -sm 1 "${lib_rev}" || true)"
|
has_rev="$(grep -sm 1 "\"${pname}\"" -A 19 "${file}" | grep -sm 1 "${lib_rev}" || true)"
|
||||||
has_hash="$(grep -sm 1 "\"${pname}\"" -A 20 "${file}" | grep -sm 1 "${lib}.sha256" || true)"
|
has_hash="$(grep -sm 1 "\"${pname}\"" -A 20 "${file}" | grep -sm 1 "${lib}.sha256" || true)"
|
||||||
if [[ -n ${has_rev} && -n ${has_hash} && -z ${clean} ]]; then
|
if [[ -n ${has_rev} && -n ${has_hash} && -z ${clean} ]]; then
|
||||||
echo "Reusing old kicad-${lib}-${today}.src.sha256, already latest .rev" >&2
|
echo "Reusing old kicad-${lib}-${today}.src.sha256, already latest .rev" >&2
|
||||||
grep -sm 1 "\"${pname}\"" -A 20 "${file}" | grep -sm 1 "${lib}" -A 1
|
scratch="$(grep -sm 1 "\"${pname}\"" -A 20 "${file}")"
|
||||||
|
grep -sm 1 "${lib}" -A 1 <<< "${scratch}"
|
||||||
else
|
else
|
||||||
|
prefetched="$(${prefetch} "${lib_pre}${lib}${lib_mid}${lib_rev}")"
|
||||||
printf "%8s%s.rev =\t" "" "${lib}"
|
printf "%8s%s.rev =\t" "" "${lib}"
|
||||||
case "${lib}" in
|
case "${lib}" in
|
||||||
symbols|templates) printf "\t" ;; *) ;;
|
symbols|templates) printf "\t" ;; *) ;;
|
||||||
esac
|
esac
|
||||||
printf "\"%s\";\n" "${lib_rev}"
|
printf "\"%s\";\n" "${lib_rev}"
|
||||||
printf "%8s%s.sha256 =\t\"%s\";\n" "" \
|
printf "%8s%s.sha256 =\t\"%s\";\n" "" "${lib}" "${prefetched}"
|
||||||
"${lib}" "$(${prefetch} "https://gitlab.com/api/v4/projects/kicad%2Flibraries%2Fkicad-${lib}/repository/archive.tar.gz?sha=${lib_rev}")"
|
|
||||||
count=$((count+1))
|
count=$((count+1))
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@ -166,7 +162,7 @@ for version in "${all_versions[@]}"; do
|
|||||||
printf "%2s};\n" ""
|
printf "%2s};\n" ""
|
||||||
else
|
else
|
||||||
printf "\nReusing old %s\n" "${pname}" >&2
|
printf "\nReusing old %s\n" "${pname}" >&2
|
||||||
grep -sm 1 "\"${pname}\"" -A 23 "${file}"
|
grep -sm 1 "\"${pname}\"" -A 21 "${file}"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
printf "}\n"
|
printf "}\n"
|
||||||
|
@ -3,47 +3,43 @@
|
|||||||
{
|
{
|
||||||
"kicad" = {
|
"kicad" = {
|
||||||
kicadVersion = {
|
kicadVersion = {
|
||||||
version = "5.1.12";
|
version = "6.0.0";
|
||||||
src = {
|
src = {
|
||||||
rev = "84ad8e8a86f13c0697f5cbed8c17977b6545ddc9";
|
rev = "d3dd2cf0fa975548d027db88d19b8a88866866d8";
|
||||||
sha256 = "0kgikchqxds3mp71nkg307mr4c1dgv8akbmksz4w9x8jg4i1mfqq";
|
sha256 = "1jrfwyi4zs0rpcpsj01z6687a433nnr56cxbnz12jfg2yafpxk23";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
libVersion = {
|
libVersion = {
|
||||||
version = "5.1.12";
|
version = "6.0.0";
|
||||||
libSources = {
|
libSources = {
|
||||||
i18n.rev = "0ad3d7e469e31c8868ad83f90e22a9c18f16aa1f";
|
symbols.rev = "275f22eb9eecd5b6deabdefd82c9a826254d9f23";
|
||||||
i18n.sha256 = "0y51l0r62cnxkvpc21732p3cx7pjvaqjih8193502hlv9kv1j9p6";
|
symbols.sha256 = "0wjk464l60xknvgc9d870901lqnx296dw7amlh3wg0wf78izarfr";
|
||||||
symbols.rev = "97c0bfdd2f5ebe952bc90c60f080a8e41da60615";
|
templates.rev = "3a422b5b0928f3fd31579769d4dee2b009a85a11";
|
||||||
symbols.sha256 = "1zdajim409570xzis53kmrbdcf7000v2vmc90f49h214lrx2zhr2";
|
templates.sha256 = "0vbjy1v5923942ma0rqcp1dhylhxk1m4vyfxjxw13sizkrpmlwr1";
|
||||||
templates.rev = "eca0f632eb76c8f49de4d5a590c83543090d0b7d";
|
footprints.rev = "3ea7895b0817abecaa34276346749a711b0c69f6";
|
||||||
templates.sha256 = "1fbhn1l3j2rwc29aida9b408wif55i23bp9ddcs7dvf83smjm05g";
|
footprints.sha256 = "0jv2plwzhhkfx7a2zankkjkbfzjxv43ab8rqpxzqfq2fnx83q6r5";
|
||||||
footprints.rev = "b65732f8ebd7ab894fd638f3f2bf4a4e9b24f653";
|
packages3d.rev = "e607286d4a48ddf654585b37b45d74416a9a70c7";
|
||||||
footprints.sha256 = "0qpii55dgv2gxqg1qq0dngdnbb9din790qi5qv0l6qqrzx843h5s";
|
packages3d.sha256 = "0vwcbzq42hzjl4f0zjaswmiff1x59hv64g5n00mx1gl0gwngnyla";
|
||||||
packages3d.rev = "0ddd588650fede09766b704feb15d30bcb6e144f";
|
|
||||||
packages3d.sha256 = "12w7m5nbk9kcnlnlg4sk1sd7xgb9i2kxfi0jcbd0phs89qyl7wjr";
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
"kicad-unstable" = {
|
"kicad-unstable" = {
|
||||||
kicadVersion = {
|
kicadVersion = {
|
||||||
version = "6.0.0-rc1";
|
version = "2021-12-23";
|
||||||
src = {
|
src = {
|
||||||
rev = "9fb05440b3ef3073613ecdeba6112aeb6b26c4df";
|
rev = "21eb92821866d558acd9e737b643b300a8b18202";
|
||||||
sha256 = "1j0hd6bpmd80dyvy9mz4n4rr8f849bdwdd4vs8vfbsswf0gxj734";
|
sha256 = "01hg0byp60xzgz0xxfwvyq1hbvbllsys6lx9yfj27d3qjc3bdk42";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
libVersion = {
|
libVersion = {
|
||||||
version = "6.0.0-rc1";
|
version = "2021-12-25";
|
||||||
libSources = {
|
libSources = {
|
||||||
i18n.rev = "e89d9a89bec59199c1ade56ee2556591412ab7b0";
|
symbols.rev = "125a2e736504e776e4c6fb7f5131efad75edf245";
|
||||||
i18n.sha256 = "04zaqyhj3qr4ymyd3k5vjpcna64j8klpsygcgjcv29s3rdi8glfl";
|
symbols.sha256 = "0wjk464l60xknvgc9d870901lqnx296dw7amlh3wg0wf78izarfr";
|
||||||
symbols.rev = "27b627393a7f2733e965ed82a5533a757789cbb2";
|
|
||||||
symbols.sha256 = "0p1qay6h6ibkhcz1b8xszsihi432ddi8jgnan2xr5rl4539c4ydp";
|
|
||||||
templates.rev = "8c9ff3dadb9c75cf2932f11c09a46c0c9d84784b";
|
templates.rev = "8c9ff3dadb9c75cf2932f11c09a46c0c9d84784b";
|
||||||
templates.sha256 = "0vbjy1v5923942ma0rqcp1dhylhxk1m4vyfxjxw13sizkrpmlwr1";
|
templates.sha256 = "0vbjy1v5923942ma0rqcp1dhylhxk1m4vyfxjxw13sizkrpmlwr1";
|
||||||
footprints.rev = "4ce2242095912e491f1690210d9cb2328363b268";
|
footprints.rev = "ac8de318d8ef7b3eb64c78c6c2650b7b085f3271";
|
||||||
footprints.sha256 = "1zx13rrpiamxyv7y27mr5xsdz0d09hpwfgc2j496p3q41q2crlq0";
|
footprints.sha256 = "0jv2plwzhhkfx7a2zankkjkbfzjxv43ab8rqpxzqfq2fnx83q6r5";
|
||||||
packages3d.rev = "1080b6e565e56bae9be46db2278a1542092d7a2d";
|
packages3d.rev = "1080b6e565e56bae9be46db2278a1542092d7a2d";
|
||||||
packages3d.sha256 = "0vwcbzq42hzjl4f0zjaswmiff1x59hv64g5n00mx1gl0gwngnyla";
|
packages3d.sha256 = "0vwcbzq42hzjl4f0zjaswmiff1x59hv64g5n00mx1gl0gwngnyla";
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user