kicad-testing: init at 7.0-2024-01-07

update update.sh to include it in versions.nix

sort the package inputs a bit
This commit is contained in:
Evils
2024-01-08 07:57:03 +01:00
parent 46ae0210ce
commit e0fe5cf69f
5 changed files with 90 additions and 28 deletions
@@ -43,6 +43,7 @@
, valgrind
, stable
, testing
, baseName
, kicadSrc
, kicadVersion
@@ -56,6 +57,8 @@
assert lib.assertMsg (!(sanitizeAddress && sanitizeThreads))
"'sanitizeAddress' and 'sanitizeThreads' are mutually exclusive, use one.";
assert testing -> !stable
-> throw "testing implies stable and cannot be used with stable = false";
let
inherit (lib) optional optionals optionalString;
@@ -74,9 +77,9 @@ stdenv.mkDerivation rec {
];
# tagged releases don't have "unknown"
# kicad nightlies use git describe --dirty
# kicad testing and nightlies use git describe --dirty
# nix removes .git, so its approximated here
postPatch = lib.optionalString (!stable) ''
postPatch = lib.optionalString (!stable || testing) ''
substituteInPlace cmake/KiCadVersion.cmake \
--replace "unknown" "${builtins.substring 0 10 src.rev}"
@@ -92,7 +95,7 @@ stdenv.mkDerivation rec {
]
++ optionals (stable) [
# https://gitlab.com/kicad/code/kicad/-/issues/12491
# should be resolved in the next release
# should be resolved in the next major? release
"-DCMAKE_CTEST_ARGUMENTS='--exclude-regex;qa_eeschema'"
]
++ optional (stable && !withNgspice) "-DKICAD_SPICE=OFF"
@@ -2,22 +2,26 @@
, runCommand
, newScope
, fetchFromGitLab
, gnome
, dconf
, wxGTK32
, gtk3
, makeWrapper
, gsettings-desktop-schemas
, hicolor-icon-theme
, symlinkJoin
, callPackage
, callPackages
, gnome
, dconf
, gtk3
, wxGTK32
, librsvg
, cups
, gsettings-desktop-schemas
, hicolor-icon-theme
, unzip
, jq
, pname ? "kicad"
, stable ? true
, testing ? false
, withNgspice ? !stdenv.isDarwin
, libngspice
, withScripting ? true
@@ -29,7 +33,6 @@
, with3d ? true
, withI18n ? true
, srcs ? { }
, symlinkJoin
}:
# `addons`: https://dev-docs.kicad.org/en/addons/
@@ -75,7 +78,9 @@
# }
let
baseName = if (stable) then "kicad" else "kicad-unstable";
baseName = if (testing) then "kicad-testing"
else if (stable) then "kicad"
else "kicad-unstable";
versionsImport = import ./versions.nix;
# versions.nix does not provide us with version, src and rev. We
@@ -154,7 +159,7 @@ stdenv.mkDerivation rec {
passthru.libraries = callPackages ./libraries.nix { inherit libSrc; };
passthru.callPackage = newScope { inherit addonPath python3; };
base = callPackage ./base.nix {
inherit stable baseName;
inherit stable testing baseName;
inherit kicadSrc kicadVersion;
inherit wxGTK python wxPython;
inherit withNgspice withScripting withI18n;
@@ -272,7 +277,8 @@ stdenv.mkDerivation rec {
meta = rec {
description = (if (stable)
then "Open Source Electronics Design Automation suite"
else "Open Source EDA suite, development build")
else if (testing) then "Open Source EDA suite, latest on stable branch"
else "Open Source EDA suite, latest on master branch")
+ (lib.optionalString (!with3d) ", without 3D models");
homepage = "https://www.kicad.org/";
longDescription = ''
@@ -25,32 +25,44 @@ export TMPDIR=/tmp
# if there is, default to commiting?
# won't work when running in parallel?
# remove items left in /nix/store?
# reuse hashes of already checked revs (to avoid redownloading testing's packages3d)
# get the latest tag that isn't an RC or *.99
latest_tags="$(git ls-remote --tags --sort -version:refname https://gitlab.com/kicad/code/kicad.git)"
# using a scratch variable to ensure command failures get caught (SC2312)
scratch="$(grep -o 'refs/tags/[0-9]*\.[0-9]*\.[0-9]*$' <<< "${latest_tags}")"
scratch="$(grep -ve '\.99' -e '\.9\.9' <<< "${scratch}")"
scratch="$(head -n 1 <<< "${scratch}")"
scratch="$(sed -n '1p' <<< "${scratch}")"
latest_tag="$(cut -d '/' -f 3 <<< "${scratch}")"
all_versions=( "${latest_tag}" master )
# get the latest branch name for testing
branches="$(git ls-remote --heads --sort -version:refname https://gitlab.com/kicad/code/kicad.git)"
scratch="$(grep -o 'refs/heads/[0-9]*\.[0-9]*$' <<< "${branches}")"
scratch="$(sed -n '1p' <<< "${scratch}")"
testing_branch="$(cut -d '/' -f 3 <<< "${scratch}")"
# "latest_tag" and "master" directly refer to what we want
# "testing" uses "testing_branch" found above
all_versions=( "${latest_tag}" testing master )
prefetch="nix-prefetch-url --unpack --quiet"
clean=""
check_stable=""
check_unstable=1
check_testing=1
commit=""
for arg in "$@"; do
case "${arg}" in
help|-h|--help) echo "Read me!" >&2; exit 1; ;;
kicad|release|tag|stable|*small|5*|6*) check_stable=1; check_unstable="" ;;
all|both|full) check_stable=1; check_unstable=1 ;;
kicad|release|tag|stable|*small|5*|6*|7*|8*) check_stable=1; check_testing=""; check_unstable="" ;;
testing) check_testing=1; check_unstable="" ;;
master|*unstable) check_unstable=1; check_testing="" ;;
latest|now|today) check_unstable=1; check_testing=1 ;;
all|both|full) check_stable=1; check_testing=1; check_unstable=1 ;;
clean|fix|*fuck) check_stable=1; check_testing=1; check_unstable=1; clean=1 ;;
commit) commit=1 ;;
clean|fix|*fuck) check_stable=1; check_unstable=1; clean=1 ;;
master|*unstable|latest|now|today) check_unstable=1 ;;
*) ;;
esac
done
@@ -65,11 +77,7 @@ tmp="${here}/,versions.nix.${RANDOM}"
libs=( symbols templates footprints packages3d )
get_rev() {
if [[ ${version} == "master" ]]; then
git ls-remote --heads "$@"
else
git ls-remote --tags "$@"
fi
git ls-remote "$@"
}
gitlab="https://gitlab.com/kicad"
@@ -84,7 +92,7 @@ printf "Latest tag is\t%s\n" "${latest_tag}" >&2
if [[ ! -f ${file} ]]; then
echo "No existing file, generating from scratch" >&2
check_stable=1; check_unstable=1; clean=1
check_stable=1; check_testing=1; check_unstable=1; clean=1
fi
printf "Writing %s\n" "${tmp}" >&2
@@ -100,12 +108,27 @@ for version in "${all_versions[@]}"; do
if [[ ${version} == "master" ]]; then
pname="kicad-unstable"
today="${now}"
elif [[ ${version} == "testing" ]]; then
pname="kicad-testing"
today="${testing_branch}-${now}"
else
pname="kicad"
today="${version}"
fi
src_version=${version};
lib_version=${version};
# testing is the stable branch on the main repo
# but the libraries don't have such a branch
# only the latest release tag and a master branch
if [[ ${version} == "testing" ]]; then
src_version=${testing_branch};
lib_version=${latest_tag};
fi
# skip a version if we don't want to check it
if [[ (${version} != "master" && -n ${check_stable}) \
if [[ (${version} != "master" && ${version} != "testing" && -n ${check_stable}) \
|| (${version} == "testing" && -n ${check_testing}) \
|| (${version} == "master" && -n ${check_unstable}) ]]; then
printf "\nChecking %s\n" "${pname}" >&2
@@ -116,7 +139,7 @@ for version in "${all_versions[@]}"; do
printf "%6ssrc = {\n" ""
echo "Checking src" >&2
scratch="$(get_rev "${gitlab}"/code/kicad.git "${version}")"
scratch="$(get_rev "${gitlab}"/code/kicad.git "${src_version}")"
src_rev="$(cut -f1 <<< "${scratch}")"
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)"
@@ -141,7 +164,7 @@ for version in "${all_versions[@]}"; do
for lib in "${libs[@]}"; do
echo "Checking ${lib}" >&2
url="${gitlab}/libraries/kicad-${lib}.git"
scratch="$(get_rev "${url}" "${version}")"
scratch="$(get_rev "${url}" "${lib_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)"
@@ -23,6 +23,28 @@
};
};
};
"kicad-testing" = {
kicadVersion = {
version = "7.0-2024-01-07";
src = {
rev = "ace6439758f8d211001235f36f02a60488337e41";
sha256 = "0z4p2srz9rld7mq6k2y5fipz8mgsdhh2506wam4388nklzzkrccr";
};
};
libVersion = {
version = "7.0-2024-01-07";
libSources = {
symbols.rev = "eedf6c9ddac2816023e817d4dc91032f9d7390b9";
symbols.sha256 = "0nlgmxf9z1vf4g350dfkxql1dawgmw275wqxkgszsfxmhdfpmi9v";
templates.rev = "9ce98cc45f3778e05c404edebf0f98de5c247ffe";
templates.sha256 = "0mykfwwik7472i4r0isc5szj3dnmvd0538p0vlmzh4rcgj3pj3vm";
footprints.rev = "7061fc9847ecc1b838e60dc6826db534028494f6";
footprints.sha256 = "1az6fzh1lma71mj12bc4bblnmzjayrxhkb8w9rjvlhvvgv33cdmy";
packages3d.rev = "d7345b34daaa23acf0d4506ed937fb424b5b18cd";
packages3d.sha256 = "0xzyi4mgyifwc6dppdzh6jq294mkj0a71cwkqw2ymz1kfbksw626";
};
};
};
"kicad-unstable" = {
kicadVersion = {
version = "2023-08-15";
+8
View File
@@ -39733,6 +39733,14 @@ with pkgs;
kicad = callPackage ../applications/science/electronics/kicad { };
# this is the same but without the (sizable) 3D models library
kicad-small = kicad.override { pname = "kicad-small"; with3d = false; };
# this is the stable branch at whatever point update.sh last updated versions.nix
kicad-testing = kicad.override { pname = "kicad-testing"; testing = true; };
# and a small version of that
kicad-testing-small = kicad.override {
pname = "kicad-testing-small";
testing = true;
with3d = false;
};
# this is the master branch at whatever point update.sh last updated versions.nix
kicad-unstable = kicad.override { pname = "kicad-unstable"; stable = false; };
# and a small version of that