push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,83 @@
{
atk,
buildFHSEnv,
cairo,
dpkg,
gdk-pixbuf,
glib,
gtk2-x11,
makeWrapper,
pango,
lib,
stdenv,
xorg,
}:
{
src,
toolName,
version,
...
}@attrs:
let
wrapBinary = libPaths: binaryName: ''
wrapProgram "$out/bin/${binaryName}" \
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath libPaths}"
'';
pkg = stdenv.mkDerivation rec {
inherit (attrs) version src;
name = "${toolName}-${version}";
meta =
with lib;
{
homepage = "http://bitscope.com/software/";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
license = licenses.unfree;
platforms = [ "x86_64-linux" ];
maintainers = with maintainers; [
vidbina
];
}
// (attrs.meta or { });
nativeBuildInputs = [
makeWrapper
dpkg
];
libs =
attrs.libs or [
atk
cairo
gdk-pixbuf
glib
gtk2-x11
pango
xorg.libX11
];
dontBuild = true;
unpackPhase =
attrs.unpackPhase or ''
dpkg-deb -x ${attrs.src} ./
'';
installPhase =
attrs.installPhase or ''
mkdir -p "$out/bin"
cp -a usr/* "$out/"
${(wrapBinary libs) attrs.toolName}
'';
};
in
buildFHSEnv {
pname = attrs.toolName;
inherit (attrs) version;
runScript = "${pkg.outPath}/bin/${attrs.toolName}";
}
// {
inherit (pkg) meta name;
}

View File

@@ -0,0 +1,164 @@
{
callPackage,
fetchurl,
}:
let
mkBitscope = callPackage (import ./common.nix) { };
in
{
chart =
let
toolName = "bitscope-chart";
version = "2.0.FK22M";
in
mkBitscope {
inherit toolName version;
meta = {
description = "Multi-channel waveform data acquisition and chart recording application";
homepage = "http://bitscope.com/software/chart/";
};
src = fetchurl {
url = "http://bitscope.com/download/files/${toolName}_${version}_amd64.deb";
sha256 = "08mc82pjamyyyhh15sagsv0sc7yx5v5n54bg60fpj7v41wdwrzxw";
};
};
console =
let
toolName = "bitscope-console";
version = "1.0.FK29A";
in
mkBitscope {
# NOTE: this is meant as a demo by BitScope
inherit toolName version;
meta = {
description = "Demonstrative communications program designed to make it easy to talk to any model BitScope";
};
src = fetchurl {
url = "http://bitscope.com/download/files/${toolName}_${version}_amd64.deb";
sha256 = "00b4gxwz7w6pmfrcz14326b24kl44hp0gzzqcqxwi5vws3f0y49d";
};
};
display =
let
toolName = "bitscope-display";
version = "1.0.EC17A";
in
mkBitscope {
inherit toolName version;
meta = {
description = "Display diagnostic application for BitScope";
homepage = "http://bitscope.com/software/display/";
};
src = fetchurl {
url = "http://bitscope.com/download/files/${toolName}_${version}_amd64.deb";
sha256 = "05xr5mnka1v3ibcasg74kmj6nlv1nmn3lca1wv77whkq85cmz0s1";
};
};
dso =
let
toolName = "bitscope-dso";
version = "2.8.FE22H";
in
mkBitscope {
inherit toolName version;
meta = {
description = "Test and measurement software for BitScope";
homepage = "http://bitscope.com/software/dso/";
};
src = fetchurl {
url = "http://bitscope.com/download/files/${toolName}_${version}_amd64.deb";
sha256 = "0fc6crfkprj78dxxhvhbn1dx1db5chm0cpwlqpqv8sz6whp12mcj";
};
};
logic =
let
toolName = "bitscope-logic";
version = "1.2.FC20C";
in
mkBitscope {
inherit toolName version;
meta = {
description = "Mixed signal logic timing and serial protocol analysis software for BitScope";
homepage = "http://bitscope.com/software/logic/";
};
src = fetchurl {
url = "http://bitscope.com/download/files/${toolName}_${version}_amd64.deb";
sha256 = "0lkb7z9gfkiyxdwh4dq1zxfls8gzdw0na1vrrbgnxfg3klv4xns3";
};
};
meter =
let
toolName = "bitscope-meter";
version = "2.0.FK22G";
in
mkBitscope {
inherit toolName version;
meta = {
description = "Automated oscilloscope, voltmeter and frequency meter for BitScope";
homepage = "http://bitscope.com/software/logic/";
};
src = fetchurl {
url = "http://bitscope.com/download/files/${toolName}_${version}_amd64.deb";
sha256 = "0nirbci6ymhk4h4bck2s4wbsl5r9yndk2jvvv72zwkg21248mnbp";
};
};
proto =
let
toolName = "bitscope-proto";
version = "0.9.FG13B";
in
mkBitscope {
inherit toolName version;
# NOTE: this is meant as a demo by BitScope
# NOTE: clicking on logo produces error
# TApplication.HandleException Executable not found: "http://bitscope.com/blog/DK/?p=DK15A"
meta = {
description = "Demonstrative prototype oscilloscope built using the BitScope Library";
homepage = "http://bitscope.com/blog/DK/?p=DK15A";
};
src = fetchurl {
url = "http://bitscope.com/download/files/${toolName}_${version}_amd64.deb";
sha256 = "1ybjfbh3narn29ll4nci4b7rnxy0hj3wdfm4v8c6pjr8pfvv9spy";
};
};
server =
let
toolName = "bitscope-server";
version = "1.0.FK26A";
in
mkBitscope {
inherit toolName version;
meta = {
description = "Remote access server solution for any BitScope";
homepage = "http://bitscope.com/software/server/";
};
src = fetchurl {
url = "http://bitscope.com/download/files/${toolName}_${version}_amd64.deb";
sha256 = "1079n7msq6ks0n4aasx40rd4q99w8j9hcsaci71nd2im2jvjpw9a";
};
};
}

View File

@@ -0,0 +1,39 @@
{
mkDerivation,
lib,
fetchFromGitHub,
cmake,
qtbase,
qttools,
qtsvg,
qwt6_1,
}:
mkDerivation rec {
pname = "caneda";
version = "0.4.0";
src = fetchFromGitHub {
owner = "Caneda";
repo = "Caneda";
rev = version;
sha256 = "sha256-oE0cdOwufc7CHEFr3YU8stjg1hBGs4bemhXpNTCTpDQ=";
};
nativeBuildInputs = [ cmake ];
buildInputs = [
qtbase
qttools
qtsvg
qwt6_1
];
meta = {
description = "Open source EDA software focused on easy of use and portability";
mainProgram = "caneda";
homepage = "http://caneda.org";
license = lib.licenses.gpl2Plus;
maintainers = [ ];
platforms = with lib.platforms; linux;
};
}

View File

@@ -0,0 +1,78 @@
{
lib,
stdenv,
fetchFromGitHub,
fetchpatch,
cmake,
boost183,
qtbase,
qtimageformats,
qttools,
wrapQtAppsHook,
}:
let
boost_static = boost183.override { enableStatic = true; };
in
stdenv.mkDerivation rec {
pname = "degate";
version = "2.0.0";
src = fetchFromGitHub {
owner = "DegateCommunity";
repo = "Degate";
tag = "v${version}";
hash = "sha256-INoA3Z6ya03ZMn6E+nOCkXZLoxoo2WgPDw9v5miI09A=";
};
patches = [
# bump bundled catch2 to avoid incompatibility with modern glibc
(fetchpatch {
name = "catch2-2.13.9.patch";
url = "https://github.com/DegateCommunity/Degate/commit/06346dde4312cbb867854899eacf58679d6ac7e2.patch";
includes = [ "tests/catch2/catch.hpp" ];
hash = "sha256-SbSA813QI8RRVy1lvAOGMGAC2KUQKjwYR2imqX40pvU=";
})
];
postPatch = ''
sed -i -E '/(_OUTPUT_DIRECTORY|DESTINATION)/s|\bout/||g' CMakeLists.txt
'';
nativeBuildInputs = [
cmake
qttools
wrapQtAppsHook
];
buildInputs = [
boost_static
qtbase
];
doCheck = true;
checkPhase = ''
runHook preCheck
(
cd tests/out/bin
# provide qtimageformats plugin to allow tests to read tiff files
export QT_PLUGIN_PATH="${qtimageformats}/${qtbase.qtPluginPrefix}"
./DegateTests
)
runHook postCheck
'';
meta = with lib; {
description = "Modern and open-source cross-platform software for chips reverse engineering";
mainProgram = "Degate";
homepage = "https://degate.readthedocs.io/";
license = licenses.gpl3;
platforms = platforms.unix;
maintainers = with maintainers; [ ris ];
};
}

View File

@@ -0,0 +1,70 @@
{
stdenv,
lib,
fetchFromGitHub,
pkg-config,
cmake,
wrapQtAppsHook,
libzip,
boost,
fftw,
libusb1,
qtbase,
qtsvg,
qtwayland,
python3,
desktopToDarwinBundle,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "dsview";
version = "1.3.2";
src = fetchFromGitHub {
owner = "DreamSourceLab";
repo = "DSView";
rev = "v${finalAttrs.version}";
sha256 = "sha256-d/TfCuJzAM0WObOiBhgfsTirlvdROrlCm+oL1cqUrIs=";
};
patches = [
# Fix absolute install paths
./install.patch
];
# /build/source/libsigrok4DSL/strutil.c:343:19: error: implicit declaration of function 'strcasecmp'; did you mean 'g_strcasecmp'? []
env.NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration";
nativeBuildInputs = [
cmake
pkg-config
wrapQtAppsHook
]
++ lib.optional stdenv.hostPlatform.isDarwin desktopToDarwinBundle;
buildInputs = [
boost
fftw
qtbase
qtsvg
libusb1
libzip
python3
]
++ lib.optional stdenv.hostPlatform.isLinux qtwayland;
doInstallCheck = true;
meta = {
description = "GUI program for supporting various instruments from DreamSourceLab, including logic analyzer, oscilloscope, etc";
mainProgram = "DSView";
homepage = "https://www.dreamsourcelab.com/";
license = lib.licenses.gpl3Plus;
platforms = lib.platforms.unix;
maintainers = with lib.maintainers; [
bachp
carlossless
];
};
})

View File

@@ -0,0 +1,23 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index eb9be42..220817c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -662,16 +662,8 @@ install(FILES DSView/icons/logo.svg DESTINATION share/icons/hicolor/scalable/app
install(FILES DSView/icons/logo.svg DESTINATION share/pixmaps RENAME dsview.svg)
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
- install(FILES DSView/DSView.desktop DESTINATION /usr/share/applications RENAME dsview.desktop)
-
- if(IS_DIRECTORY /usr/lib/udev/rules.d)
- install(FILES DSView/DreamSourceLab.rules DESTINATION /usr/lib/udev/rules.d RENAME 60-dreamsourcelab.rules)
- elseif(IS_DIRECTORY /lib/udev/rules.d)
- install(FILES DSView/DreamSourceLab.rules DESTINATION /lib/udev/rules.d RENAME 60-dreamsourcelab.rules)
- elseif(IS_DIRECTORY /etc/udev/rules.d)
- install(FILES DSView/DreamSourceLab.rules DESTINATION /etc/udev/rules.d RENAME 60-dreamsourcelab.rules)
- endif()
-
+ install(FILES DSView/DreamSourceLab.rules DESTINATION etc/udev/rules.d RENAME 60-dreamsourcelab.rules)
endif()
+install(FILES DSView/DSView.desktop DESTINATION share/applications RENAME dsview.desktop)
install(FILES NEWS25 DESTINATION share/DSView RENAME NEWS25)

View File

@@ -0,0 +1,136 @@
{
lib,
stdenv,
mkDerivation,
fetchurl,
makeDesktopItem,
libXrender,
libXrandr,
libXcursor,
libX11,
libXext,
libXi,
libxcb,
libGL,
glib,
nss,
nspr,
expat,
alsa-lib,
qtbase,
qtdeclarative,
qtsvg,
qtlocation,
qtwebchannel,
qtwebengine,
}:
let
libPath = lib.makeLibraryPath [
libXrender
libXrandr
libXcursor
libX11
libXext
libXi
libxcb
libGL
glib
nss
nspr
expat
alsa-lib
qtbase
qtdeclarative
qtsvg
qtlocation
qtwebchannel
qtwebengine
];
in
mkDerivation rec {
pname = "eagle";
version = "9.6.2";
src = fetchurl {
url = "https://eagle-updates.circuits.io/downloads/${
builtins.replaceStrings [ "." ] [ "_" ] version
}/Autodesk_EAGLE_${version}_English_Linux_64bit.tar.gz";
sha256 = "18syygnskl286kn8aqfzzdsyzq59d2w19y1h1ynyxsnrvkyv71h0";
};
desktopItem = makeDesktopItem {
name = "eagle";
exec = "eagle";
icon = "eagle";
comment = "Schematic capture and PCB layout";
desktopName = "Eagle";
genericName = "Schematic editor";
categories = [ "Development" ];
};
buildInputs = [
libXrender
libXrandr
libXcursor
libX11
libXext
libXi
libxcb
libGL
glib
nss
nspr
expat
alsa-lib
qtbase
qtdeclarative
qtsvg
qtlocation
qtwebchannel
qtwebengine
];
installPhase = ''
# Extract eagle tarball
mkdir "$out"
tar -xzf "$src" -C "$out"
# Install manpage
mkdir -p "$out"/share/man/man1
ln -s "$out"/eagle-${version}/doc/eagle.1 "$out"/share/man/man1/eagle.1
patchelf \
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
--set-rpath "${libPath}:$out/eagle-${version}/lib:${lib.getLib stdenv.cc.cc}/lib" \
"$out"/eagle-${version}/eagle
mkdir -p "$out"/bin
ln -s "$out"/eagle-${version}/eagle "$out"/bin/eagle
# Remove bundled libraries that are available in nixpkgs
# TODO: There still may be unused bundled libraries
rm "$out"/eagle-${version}/lib/libQt5*.so.5
rm "$out"/eagle-${version}/lib/{libxcb-*.so.*,libX*.so.*,libxshmfence.so.1}
rm "$out"/eagle-${version}/lib/{libEGL.so.1,libglapi.so.0,libgbm.so.1}
# No longer needed (we don't use the bundled Qt libraries)
rm -r "$out"/eagle-${version}/libexec
rm -r "$out"/eagle-${version}/plugins
# Make desktop item
mkdir -p "$out"/share/applications
cp "$desktopItem"/share/applications/* "$out"/share/applications/
mkdir -p "$out"/share/pixmaps
ln -s "$out/eagle-${version}/bin/eagle-logo.png" "$out"/share/pixmaps/eagle.png
'';
meta = with lib; {
description = "Schematic editor and PCB layout tool from Autodesk (formerly CadSoft)";
homepage = "https://www.autodesk.com/products/eagle/overview";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
license = licenses.unfree;
platforms = [ "x86_64-linux" ];
maintainers = [ ];
};
}

View File

@@ -0,0 +1,134 @@
/*
* LD_PRELOAD trick to make Eagle (schematic editor and PCB layout tool from
* CadSoft) work from a read-only installation directory.
*
* When Eagle starts, it looks for the license file in <eagle>/bin/eagle.key
* (where <eagle> is the install path). If eagle.key is not found, Eagle checks
* for write access to <eagle>/bin/, shows a license dialog to the user and
* then attempts to write a license file to <eagle>/bin/.
*
* This will of course fail when Eagle is installed in the read-only Nix store.
* Hence this library that redirects accesses to the those paths in the
* following way:
*
* <eagle>/bin => $HOME
* <eagle>/bin/eagle.key => $HOME/.eagle.key
*
* Also, if copying an example project to ~/eagle/ (in the Eagle GUI), Eagle
* chmod's the destination with read-only permission bits (presumably because
* the source is read-only) and fails to complete the copy operation.
* Therefore, the mode argument in calls to chmod() is OR'ed with the S_IWUSR
* bit (write by owner).
*
* Usage:
* gcc -shared -fPIC -DEAGLE_PATH="$out/eagle-${version}" eagle_fixer.c -o eagle_fixer.so -ldl
* LD_PRELOAD=$PWD/eagle_fixer.so ./result/bin/eagle
*
* To see the paths that are modified at runtime, set the environment variable
* EAGLE_FIXER_DEBUG to 1.
*/
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <dlfcn.h>
#include <limits.h>
#include <sys/stat.h>
#ifndef EAGLE_PATH
#error Missing EAGLE_PATH, path to the eagle-${version} installation directory.
#endif
typedef FILE *(*fopen_func_t)(const char *path, const char *mode);
typedef int (*access_func_t)(const char *pathname, int mode);
typedef int (*chmod_func_t)(const char *path, mode_t mode);
/*
* Map <eagle>/bin to $HOME and <eagle>/bin/eagle.key to $HOME/.eagle.key
*
* Path is truncated if bigger than PATH_MAX. It's not threadsafe, but that's
* OK.
*/
static const char *redirect(const char *pathname)
{
static char buffer[PATH_MAX];
const char *homepath;
const char *new_path;
static int have_warned;
homepath = getenv("HOME");
if (!homepath) {
homepath = "/";
if (!have_warned && getenv("EAGLE_FIXER_DEBUG")) {
fprintf(stderr, "eagle_fixer: HOME is unset, using \"/\" (root) instead.\n");
have_warned = 1;
}
}
new_path = pathname;
if (strcmp(EAGLE_PATH "/bin", pathname) == 0) {
/* redirect to $HOME */
new_path = homepath;
} else if (strcmp(EAGLE_PATH "/bin/eagle.key", pathname) == 0) {
/* redirect to $HOME/.eagle.key */
snprintf(buffer, PATH_MAX, "%s/.eagle.key", homepath);
buffer[PATH_MAX-1] = '\0';
new_path = buffer;
}
return new_path;
}
FILE *fopen(const char *pathname, const char *mode)
{
FILE *fp;
const char *path;
fopen_func_t orig_fopen;
orig_fopen = (fopen_func_t)dlsym(RTLD_NEXT, "fopen");
path = redirect(pathname);
fp = orig_fopen(path, mode);
if (path != pathname && getenv("EAGLE_FIXER_DEBUG")) {
fprintf(stderr, "eagle_fixer: fopen(\"%s\", \"%s\") => \"%s\": fp=%p\n", pathname, mode, path, fp);
}
return fp;
}
int access(const char *pathname, int mode)
{
int ret;
const char *path;
access_func_t orig_access;
orig_access = (access_func_t)dlsym(RTLD_NEXT, "access");
path = redirect(pathname);
ret = orig_access(path, mode);
if (path != pathname && getenv("EAGLE_FIXER_DEBUG")) {
fprintf(stderr, "eagle_fixer: access(\"%s\", %d) => \"%s\": ret=%d\n", pathname, mode, path, ret);
}
return ret;
}
int chmod(const char *pathname, mode_t mode)
{
int ret;
mode_t new_mode;
chmod_func_t orig_chmod;
orig_chmod = (chmod_func_t)dlsym(RTLD_NEXT, "chmod");
new_mode = mode | S_IWUSR;
ret = orig_chmod(pathname, new_mode);
if (getenv("EAGLE_FIXER_DEBUG")) {
fprintf(stderr, "eagle_fixer: chmod(\"%s\", %o) => %o: ret=%d\n", pathname, mode, new_mode, ret);
}
return ret;
}

View File

@@ -0,0 +1,143 @@
{
stdenv,
lib,
fetchFromGitHub,
wrapQtAppsHook,
qmake,
pkg-config,
qtbase,
qtsvg,
qttools,
qtserialport,
qtwayland,
qt5compat,
boost,
libngspice,
libgit2,
quazip,
clipper,
}:
let
# SHA256 of the fritzing-parts HEAD on the master branch,
# which contains the latest stable parts definitions
partsSha = "76235099ed556e52003de63522fdd74e61d53a36";
parts = fetchFromGitHub {
owner = "fritzing";
repo = "fritzing-parts";
rev = partsSha;
hash = "sha256-1QVcPbRBOSYnNFsp7B2OyPXYuPaINRv9yEqGZFd662Y=";
};
# Header-only library
svgpp = fetchFromGitHub {
owner = "svgpp";
repo = "svgpp";
tag = "v1.3.1";
hash = "sha256-nW0ns06XWfUi22nOKZzFKgAOHVIlQqChW8HxUDOFMh4=";
};
in
stdenv.mkDerivation {
pname = "fritzing";
version = "1.0.4";
src = fetchFromGitHub {
owner = "fritzing";
repo = "fritzing-app";
rev = "a8c6ef7cf66f7a42b9b233d6137f1b70a9573a25";
hash = "sha256-a/bWAUeDPj3g8BECOlXuqyCi4JgGLLs1605m380Drt0=";
};
patches = [
# Fix build with Qt >= 6.9
./fix-stricter-types.patch
];
nativeBuildInputs = [
qmake
pkg-config
qttools
wrapQtAppsHook
];
buildInputs = [
qtbase
qtsvg
qtserialport
qt5compat
boost
libgit2
quazip
libngspice
clipper
]
++ lib.optionals stdenv.hostPlatform.isLinux [
qtwayland
];
postPatch = ''
# Use packaged quazip, libgit and ngspice
sed -i "/pri\/quazipdetect.pri/d" phoenix.pro
sed -i "/pri\/spicedetect.pri/d" phoenix.pro
substituteInPlace pri/libgit2detect.pri \
--replace-fail 'LIBGIT_STATIC = true' 'LIBGIT_STATIC = false'
#TODO: Do not hardcode SHA.
substituteInPlace src/fapplication.cpp \
--replace-fail 'PartsChecker::getSha(dir.absolutePath());' '"${partsSha}";'
substituteInPlace phoenix.pro \
--replace-fail "6.5.10" "${qtbase.version}"
substituteInPlace src/simulation/ngspice_simulator.cpp \
--replace-fail 'path + "/" + libName' '"${libngspice}/lib/libngspice.so"'
mkdir parts
cp -a ${parts}/* parts/
'';
env = {
NIX_CFLAGS_COMPILE = lib.concatStringsSep " " [
"-I${lib.getDev quazip}/include/QuaZip-Qt${lib.versions.major qtbase.version}-${quazip.version}"
"-I${svgpp}/include"
"-I${clipper}/include/polyclipping"
];
NIX_LDFLAGS = "-lquazip1-qt${lib.versions.major qtbase.version}";
};
qmakeFlags = [
"phoenix.pro"
];
postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
mkdir $out/Applications
mv $out/bin/Fritzing.app $out/Applications/Fritzing.app
cp FritzingInfo.plist $out/Applications/Fritzing.app/Contents/Info.plist
makeWrapper $out/Applications/Fritzing.app/Contents/MacOS/Fritzing $out/bin/Fritzing
'';
postFixup = ''
# generate the parts.db file
QT_QPA_PLATFORM=offscreen "$out/bin/Fritzing" \
-db "$out/share/fritzing/parts/parts.db" \
-pp "$out/share/fritzing/parts" \
-folder "$out/share/fritzing"
'';
meta = {
description = "Open source prototyping tool for Arduino-based projects";
homepage = "https://fritzing.org";
license = with lib.licenses; [
gpl3
cc-by-sa-30
];
maintainers = with lib.maintainers; [
robberer
muscaln
];
platforms = lib.platforms.unix;
mainProgram = "Fritzing";
};
}

View File

@@ -0,0 +1,57 @@
diff --git a/src/items/paletteitembase.cpp b/src/items/paletteitembase.cpp
index 49db343e..8760ba55 100644
--- a/src/items/paletteitembase.cpp
+++ b/src/items/paletteitembase.cpp
@@ -626,7 +626,7 @@ QString PaletteItemBase::retrieveSvg(ViewLayer::ViewLayerID viewLayerID, QHash<Q
//DebugDialog::debug(QString("path: %1").arg(path));
- QString svg = svgHash.value(path + xmlName + QString(QChar(m_viewLayerPlacement)), "");
+ QString svg = svgHash.value(path + xmlName + QString(QChar(static_cast<ushort>(m_viewLayerPlacement))), "");
if (!svg.isEmpty()) return svg;
SvgFileSplitter splitter;
@@ -657,7 +657,7 @@ QString PaletteItemBase::retrieveSvg(ViewLayer::ViewLayerID viewLayerID, QHash<Q
return "";
}
svg = splitter.elementString(xmlName);
- svgHash.insert(path + xmlName + QString(QChar(m_viewLayerPlacement)), svg);
+ svgHash.insert(path + xmlName + QString(QChar(static_cast<ushort>(m_viewLayerPlacement))), svg);
return svg;
}
diff --git a/src/items/resistor.cpp b/src/items/resistor.cpp
index e2a23fd8..3fb4c669 100644
--- a/src/items/resistor.cpp
+++ b/src/items/resistor.cpp
@@ -260,7 +260,7 @@ bool Resistor::collectExtraInfo(QWidget * parent, const QString & family, const
validator->setSymbol(OhmSymbol);
validator->setConverter(TextUtils::convertFromPowerPrefix);
validator->setBounds(MIN_RESISTANCE, MAX_RESISTANCE);
- validator->setRegularExpression(QRegularExpression(QString("((\\d{1,10})|(\\d{1,10}\\.)|(\\d{1,10}\\.\\d{1,5}))[\\x%1umkMG]{0,1}[\\x03A9]{0,1}").arg(TextUtils::MicroSymbolCode, 4, 16, QChar('0'))));
+ validator->setRegularExpression(QRegularExpression(QString("((\\d{1,10})|(\\d{1,10}\\.)|(\\d{1,10}\\.\\d{1,5}))[\\x%1umkMG]{0,1}[\\x03A9]{0,1}").arg(static_cast<int>(TextUtils::MicroSymbolCode), 4, 16, QChar('0'))));
focusOutComboBox->setValidator(validator);
connect(focusOutComboBox->validator(), SIGNAL(sendState(QValidator::State)), this, SLOT(textModified(QValidator::State)));
connect(focusOutComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(resistanceEntry(int)));
diff --git a/src/utils/textutils.cpp b/src/utils/textutils.cpp
index a1a28d51..3d3aa8e0 100644
--- a/src/utils/textutils.cpp
+++ b/src/utils/textutils.cpp
@@ -79,7 +79,7 @@ const QString TextUtils::AdobeIllustratorIdentifier = "Generator: Adobe Illustra
QList<QString> PowerPrefixes;
QList<double> PowerPrefixValues;
-const QString TextUtils::PowerPrefixesString = QString("pnmkMGTu\\x%1").arg(MicroSymbolCode, 4, 16, QChar('0'));
+const QString TextUtils::PowerPrefixesString = QString("pnmkMGTu\\x%1").arg(static_cast<int>(MicroSymbolCode), 4, 16, QChar('0'));
typedef QHash<QString /*brokenFont*/, QString /*replacementFont*/> FixedFontsHash;
@@ -763,7 +763,7 @@ QString TextUtils::convertExtendedChars(const QString & str)
result.append(c);
}
else {
- result.append(QString("&#x%1;").arg(c.unicode(), 0, 16));
+ result.append("&#x" + QString::number(c.unicode(), 16) + ";");
}
}

View File

@@ -0,0 +1,58 @@
{
lib,
stdenv,
fetchurl,
fetchpatch,
autoreconfHook,
groff,
pkg-config,
guile,
gtk2,
flex,
gawk,
perl,
}:
stdenv.mkDerivation rec {
pname = "geda";
version = "1.10.2";
src = fetchurl {
url = "http://ftp.geda-project.org/geda-gaf/stable/v${lib.versions.majorMinor version}/${version}/geda-gaf-${version}.tar.gz";
hash = "sha256-6GKrJBUoU4+jvuJzkmH1aAERArYMXjmi8DWGY8BCyKQ=";
};
patches = [
(fetchpatch {
name = "geda-1.10.2-drop-xorn.patch";
url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/sci-electronics/geda/files/geda-1.10.2-drop-xorn.patch?id=5589cc7bc6c4f18f75c40725a550b8d76e7f5ca1";
hash = "sha256-jPQaHjEDwCEfZqDGku+xyIMl5WlWlVcpPv1W6Xf8Grs=";
})
];
configureFlags = [
"--disable-update-xdg-database"
"--without-libfam"
];
nativeBuildInputs = [
autoreconfHook
groff
pkg-config
];
buildInputs = [
guile
gtk2
flex
gawk
perl
];
meta = with lib; {
description = "Full GPL'd suite of Electronic Design Automation tools";
homepage = "https://geda.sourceforge.net/";
maintainers = with maintainers; [ pjones ];
platforms = platforms.linux;
license = licenses.gpl2;
};
}

View File

@@ -0,0 +1,57 @@
{
lib,
stdenv,
autoconf,
automake,
autoreconfHook,
cairo,
fetchFromGitHub,
gettext,
gtk2-x11,
libtool,
pkg-config,
}:
stdenv.mkDerivation rec {
pname = "gerbv";
version = "2.10.0";
src = fetchFromGitHub {
owner = "gerbv";
repo = "gerbv";
tag = "v${version}";
hash = "sha256-sr48RGLYcMKuyH9p+5BhnR6QpKBvNOqqtRryw3+pbBk=";
};
postPatch = ''
sed -i '/AC_INIT/s/m4_esyscmd.*/${version}])/' configure.ac
'';
nativeBuildInputs = [
autoconf
automake
autoreconfHook
pkg-config
];
buildInputs = [
cairo
gettext
gtk2-x11
libtool
];
configureFlags = [
"--disable-update-desktop-database"
];
meta = {
description = "Gerber (RS-274X) viewer";
mainProgram = "gerbv";
homepage = "https://gerbv.github.io/";
changelog = "https://github.com/gerbv/gerbv/releases/tag/v${version}";
license = lib.licenses.gpl2Plus;
maintainers = with lib.maintainers; [ mog ];
platforms = lib.platforms.unix;
};
}

View File

@@ -0,0 +1,5 @@
{ kicad }:
{
kikit = kicad.callPackage ./kikit.nix { addonName = "kikit"; };
kikit-library = kicad.callPackage ./kikit.nix { addonName = "kikit-library"; };
}

View File

@@ -0,0 +1,57 @@
# For building the multiple addons that are in the kikit repo.
{
stdenv,
bc,
kikit,
zip,
python3,
addonName,
addonPath,
}:
let
# This python is only used when building the package, it's not the python
# environment that will ultimately run the code packaged here. The python env defined
# in KiCad will import the python code packaged here when KiCad starts up.
python = python3.withPackages (ps: with ps; [ click ]);
kikit-module = python3.pkgs.toPythonModule (kikit.override { inherit python3; });
# The following different addons can be built from the same source.
targetSpecs = {
"kikit" = {
makeTarget = "pcm-kikit";
resultZip = "pcm-kikit.zip";
description = "KiCad plugin and a CLI tool to automate several tasks in a standard KiCad workflow";
};
"kikit-library" = {
makeTarget = "pcm-lib";
resultZip = "pcm-kikit-lib.zip";
description = "KiKit uses these symbols and footprints to annotate your boards (e.g., to place a tab in a panel)";
};
};
targetSpec = targetSpecs.${addonName};
in
stdenv.mkDerivation {
pname = "kicadaddon-${addonName}";
inherit (kikit-module) src version;
nativeBuildInputs = [
python
bc
zip
];
propagatedBuildInputs = [ kikit-module ];
buildPhase = ''
patchShebangs scripts/setJson.py
make ${targetSpec.makeTarget}
'';
installPhase = ''
mkdir $out
mv build/${targetSpec.resultZip} $out/${addonPath}
'';
meta = kikit-module.meta // {
description = targetSpec.description;
};
}

View File

@@ -0,0 +1,214 @@
{
lib,
stdenv,
cmake,
libGLU,
libGL,
zlib,
wxGTK,
gtk3,
libX11,
gettext,
glew,
glm,
cairo,
curl,
openssl,
boost,
pkg-config,
doxygen,
graphviz,
libpthreadstubs,
libXdmcp,
unixODBC,
libgit2,
libsecret,
libgcrypt,
libgpg-error,
ninja,
writableTmpDirAsHomeHook,
util-linuxMinimal,
libselinux,
libsepol,
libthai,
libdatrie,
libxkbcommon,
libepoxy,
dbus,
at-spi2-core,
libXtst,
pcre2,
libdeflate,
swig,
python,
wxPython,
opencascade-occt_7_6,
libngspice,
valgrind,
protobuf_29,
nng,
stable,
testing,
kicadSrc,
kicadVersion,
withNgspice,
withScripting,
withI18n,
debug,
sanitizeAddress,
sanitizeThreads,
}:
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
opencascade-occt = opencascade-occt_7_6;
inherit (lib)
cmakeBool
cmakeFeature
optionals
optionalString
;
in
stdenv.mkDerivation (finalAttrs: {
pname = "kicad-base";
version = if stable then kicadVersion else builtins.substring 0 10 finalAttrs.src.rev;
src = kicadSrc;
patches = [
# upstream issue 12941 (attempted to upstream, but appreciably unacceptable)
./writable.patch
# https://gitlab.com/kicad/code/kicad/-/issues/15687
./runtime_stock_data_path.patch
];
# tagged releases don't have "unknown"
# kicad testing and nightlies use git describe --dirty
# nix removes .git, so its approximated here
postPatch = lib.optionalString (!stable || testing) ''
substituteInPlace cmake/KiCadVersion.cmake \
--replace-fail "unknown" "${builtins.substring 0 10 finalAttrs.src.rev}"
substituteInPlace cmake/CreateGitVersionHeader.cmake \
--replace-fail "0000000000000000000000000000000000000000" "${finalAttrs.src.rev}"
'';
preConfigure = optionalString debug ''
export CFLAGS="''${CFLAGS:-} -Og -ggdb"
export CXXFLAGS="''${CXXFLAGS:-} -Og -ggdb"
'';
cmakeFlags = [
(cmakeBool "KICAD_USE_EGL" true)
(cmakeFeature "OCC_INCLUDE_DIR" "${opencascade-occt}/include/opencascade")
# https://gitlab.com/kicad/code/kicad/-/issues/17133
(cmakeFeature "CMAKE_CTEST_ARGUMENTS" "--exclude-regex;qa_spice")
(cmakeBool "KICAD_USE_CMAKE_FINDPROTOBUF" false)
(cmakeBool "KICAD_SCRIPTING_WXPYTHON" withScripting)
(cmakeBool "KICAD_BUILD_I18N" withI18n)
(cmakeBool "KICAD_BUILD_QA_TESTS" (!finalAttrs.doInstallCheck))
(cmakeBool "KICAD_STDLIB_DEBUG" debug)
(cmakeBool "KICAD_USE_VALGRIND" debug)
(cmakeBool "KICAD_SANITIZE_ADDRESS" sanitizeAddress)
(cmakeBool "KICAD_SANITIZE_THREADS" sanitizeThreads)
(cmakeBool "KICAD_SPICE" (!(stable && !withNgspice)))
]
++ optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [
(cmakeFeature "CMAKE_CTEST_ARGUMENTS" "--exclude-regex;'qa_spice|qa_cli'")
];
cmakeBuildType = if debug then "Debug" else "Release";
nativeBuildInputs = [
cmake
ninja
doxygen
graphviz
pkg-config
libgit2
libsecret
libgcrypt
libgpg-error
]
# wanted by configuration on linux, doesn't seem to affect performance
# no effect on closure size
++ optionals (stdenv.hostPlatform.isLinux) [
util-linuxMinimal
libselinux
libsepol
libthai
libdatrie
libxkbcommon
libepoxy
dbus
at-spi2-core
libXtst
pcre2
];
buildInputs = [
libGLU
libGL
zlib
libX11
wxGTK
gtk3
libXdmcp
gettext
glew
glm
libpthreadstubs
cairo
curl
openssl
boost
swig
python
unixODBC
libdeflate
opencascade-occt
protobuf_29
# This would otherwise cause a linking requirement for mbedtls.
(nng.override { mbedtlsSupport = false; })
]
++ optionals withScripting [ wxPython ]
++ optionals withNgspice [ libngspice ]
++ optionals debug [ valgrind ];
# debug builds fail all but the python test
doInstallCheck = !debug;
installCheckTarget = "test";
nativeInstallCheckInputs = [
(python.withPackages (
ps: with ps; [
numpy
pytest
cairosvg
pytest-image-diff
]
))
writableTmpDirAsHomeHook
];
dontStrip = debug;
meta = {
description = "Just the built source without the libraries";
longDescription = ''
Just the build products, the libraries are passed via an env var in the wrapper, default.nix
'';
homepage = "https://www.kicad.org/";
license = lib.licenses.gpl3Plus;
platforms = lib.platforms.all;
broken = stdenv.hostPlatform.isDarwin;
};
})

View File

@@ -0,0 +1,334 @@
{
lib,
stdenv,
runCommand,
newScope,
fetchFromGitLab,
makeWrapper,
symlinkJoin,
callPackage,
callPackages,
adwaita-icon-theme,
dconf,
gtk3,
wxGTK32,
librsvg,
cups,
gsettings-desktop-schemas,
hicolor-icon-theme,
unzip,
jq,
pname ? "kicad",
stable ? true,
testing ? false,
withNgspice ? !stdenv.hostPlatform.isDarwin,
libngspice,
withScripting ? true,
python3,
addons ? [ ],
debug ? false,
sanitizeAddress ? false,
sanitizeThreads ? false,
with3d ? true,
withI18n ? true,
srcs ? { },
}:
# `addons`: https://dev-docs.kicad.org/en/addons/
#
# ```nix
# kicad = pkgs.kicad.override {
# addons = with pkgs.kicadAddons; [ kikit kikit-library ];
# };
# ```
# The `srcs` parameter can be used to override the kicad source code
# and all libraries, which are otherwise inaccessible
# to overlays since most of the kicad build expression has been
# refactored into base.nix, most of the library build expressions have
# been refactored into libraries.nix. Overrides are only applied when
# building `kicad-unstable`. The `srcs` parameter has
# no effect for stable `kicad`. `srcs` takes an attribute set in which
# any of the following attributes are meaningful (though none are
# mandatory): "kicad", "kicadVersion", "symbols", "templates",
# "footprints", "packages3d", and "libVersion". "kicadVersion" and
# "libVersion" should be set to a string with the desired value for
# the version attribute in kicad's `mkDerivation` and the version
# attribute in any of the library's `mkDerivation`, respectively.
# "kicad", "symbols", "templates", "footprints", and "packages3d"
# should be set to an appropriate fetcher (e.g. `fetchFromGitLab`).
# So, for example, a possible overlay for kicad is:
#
# final: prev:
# {
# kicad-unstable = (prev.kicad-unstable.override {
# srcs = {
# kicadVersion = "2020-10-08";
# kicad = prev.fetchFromGitLab {
# group = "kicad";
# owner = "code";
# repo = "kicad";
# rev = "fd22fe8e374ce71d57e9f683ba996651aa69fa4e";
# sha256 = "sha256-F8qugru/jU3DgZSpQXQhRGNFSk0ybFRkpyWb7HAGBdc=";
# };
# };
# });
# }
let
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
# need to turn this into appropriate fetcher calls.
kicadSrcFetch = fetchFromGitLab {
group = "kicad";
owner = "code";
repo = "kicad";
rev = versionsImport.${baseName}.kicadVersion.src.rev;
sha256 = versionsImport.${baseName}.kicadVersion.src.sha256;
};
libSrcFetch =
name:
fetchFromGitLab {
group = "kicad";
owner = "libraries";
repo = "kicad-${name}";
rev = versionsImport.${baseName}.libVersion.libSources.${name}.rev;
sha256 = versionsImport.${baseName}.libVersion.libSources.${name}.sha256;
};
# only override `src` or `version` if building `kicad-unstable` with
# the appropriate attribute defined in `srcs`.
srcOverridep = attr: (!stable && builtins.hasAttr attr srcs);
# use default source and version (as defined in versions.nix) by
# default, or use the appropriate attribute from `srcs` if building
# unstable with `srcs` properly defined.
kicadSrc = if srcOverridep "kicad" then srcs.kicad else kicadSrcFetch;
kicadVersion =
if srcOverridep "kicadVersion" then
srcs.kicadVersion
else
versionsImport.${baseName}.kicadVersion.version;
libSrc = name: if srcOverridep name then srcs.${name} else libSrcFetch name;
# TODO does it make sense to only have one version for all libs?
libVersion =
if srcOverridep "libVersion" then
srcs.libVersion
else
versionsImport.${baseName}.libVersion.version;
wxGTK = wxGTK32;
python = python3;
wxPython = python.pkgs.wxpython;
addonPath = "addon.zip";
addonsDrvs = map (pkg: pkg.override { inherit addonPath python3; }) addons;
addonsJoined =
runCommand "addonsJoined"
{
inherit addonsDrvs;
nativeBuildInputs = [
unzip
jq
];
}
''
mkdir $out
for pkg in $addonsDrvs; do
unzip $pkg/addon.zip -d unpacked
folder_name=$(jq .identifier unpacked/metadata.json --raw-output | tr . _)
for d in unpacked/*; do
if [ -d "$d" ]; then
dest=$out/share/kicad/scripting/$(basename $d)/$folder_name
mkdir -p $(dirname $dest)
mv $d $dest
fi
done
rm -r unpacked
done
'';
inherit (lib)
concatStringsSep
flatten
optionalString
optionals
;
in
stdenv.mkDerivation rec {
# Common libraries, referenced during runtime, via the wrapper.
passthru.libraries = callPackages ./libraries.nix { inherit libSrc; };
passthru.callPackage = newScope { inherit addonPath python3; };
base = callPackage ./base.nix {
inherit stable testing;
inherit kicadSrc kicadVersion;
inherit wxGTK python wxPython;
inherit withNgspice withScripting withI18n;
inherit debug sanitizeAddress sanitizeThreads;
};
inherit pname;
version = if stable then kicadVersion else builtins.substring 0 10 src.src.rev;
src = base;
dontUnpack = true;
dontConfigure = true;
dontBuild = true;
dontFixup = true;
pythonPath =
optionals withScripting [
wxPython
python.pkgs.six
python.pkgs.requests
]
++ addonsDrvs;
nativeBuildInputs = [ makeWrapper ] ++ optionals withScripting [ python.pkgs.wrapPython ];
# KICAD7_TEMPLATE_DIR only works with a single path (it does not handle : separated paths)
# but it's used to find both the templates and the symbol/footprint library tables
# https://gitlab.com/kicad/code/kicad/-/issues/14792
template_dir = symlinkJoin {
name = "KiCad_template_dir";
paths = with passthru.libraries; [
"${templates}/share/kicad/template"
"${footprints}/share/kicad/template"
"${symbols}/share/kicad/template"
];
};
# We are emulating wrapGAppsHook3, along with other variables to the wrapper
makeWrapperArgs =
with passthru.libraries;
[
"--prefix XDG_DATA_DIRS : ${base}/share"
"--prefix XDG_DATA_DIRS : ${hicolor-icon-theme}/share"
"--prefix XDG_DATA_DIRS : ${adwaita-icon-theme}/share"
"--prefix XDG_DATA_DIRS : ${gtk3}/share/gsettings-schemas/${gtk3.name}"
"--prefix XDG_DATA_DIRS : ${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name}"
# wrapGAppsHook3 did these two as well, no idea if it matters...
"--prefix XDG_DATA_DIRS : ${cups}/share"
"--prefix GIO_EXTRA_MODULES : ${dconf}/lib/gio/modules"
# required to open a bug report link in firefox-wayland
"--set-default MOZ_DBUS_REMOTE 1"
"--set-default KICAD9_FOOTPRINT_DIR ${footprints}/share/kicad/footprints"
"--set-default KICAD9_SYMBOL_DIR ${symbols}/share/kicad/symbols"
"--set-default KICAD9_TEMPLATE_DIR ${template_dir}"
]
++ optionals (addons != [ ]) (
let
stockDataPath = symlinkJoin {
name = "kicad_stock_data_path";
paths = [
"${base}/share/kicad"
"${addonsJoined}/share/kicad"
];
};
in
[ "--set-default NIX_KICAD9_STOCK_DATA_PATH ${stockDataPath}" ]
)
++ optionals with3d [
"--set-default KICAD9_3DMODEL_DIR ${packages3d}/share/kicad/3dmodels"
]
++ optionals withNgspice [ "--prefix LD_LIBRARY_PATH : ${libngspice}/lib" ]
# infinisil's workaround for #39493
++ [ "--set GDK_PIXBUF_MODULE_FILE ${librsvg}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache" ];
# why does $makeWrapperArgs have to be added explicitly?
# $out and $program_PYTHONPATH don't exist when makeWrapperArgs gets set?
installPhase =
let
bin = if stdenv.hostPlatform.isDarwin then "*.app/Contents/MacOS" else "bin";
tools = [
"kicad"
"pcbnew"
"eeschema"
"gerbview"
"pcb_calculator"
"pl_editor"
"bitmap2component"
"kicad-cli"
];
utils = [
"dxf2idf"
"idf2vrml"
"idfcyl"
"idfrect"
];
in
(concatStringsSep "\n" (flatten [
"runHook preInstall"
(optionalString withScripting "buildPythonPath \"${base} $pythonPath\" \n")
# wrap each of the directly usable tools
(map (
tool:
"makeWrapper ${base}/${bin}/${tool} $out/bin/${tool} $makeWrapperArgs"
+ optionalString withScripting " --set PYTHONPATH \"$program_PYTHONPATH\""
) tools)
# link in the CLI utils
(map (util: "ln -s ${base}/${bin}/${util} $out/bin/${util}") utils)
"runHook postInstall"
]));
postInstall = ''
mkdir -p $out/share
ln -s ${base}/share/applications $out/share/applications
ln -s ${base}/share/icons $out/share/icons
ln -s ${base}/share/mime $out/share/mime
ln -s ${base}/share/metainfo $out/share/metainfo
'';
passthru.updateScript = {
command = [
./update.sh
"${pname}"
];
supportedFeatures = [ "commit" ];
};
meta = {
description =
(
if stable then
"Open Source Electronics Design Automation suite"
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 = ''
KiCad is an open source software suite for Electronic Design Automation.
The Programs handle Schematic Capture, and PCB Layout with Gerber output.
'';
license = lib.licenses.gpl3Plus;
maintainers = [ ];
platforms = lib.platforms.all;
broken = stdenv.hostPlatform.isDarwin;
mainProgram = "kicad";
};
}

View File

@@ -0,0 +1,47 @@
{
lib,
stdenv,
cmake,
libSrc,
stepreduce,
parallel,
zip,
}:
let
mkLib =
name:
stdenv.mkDerivation {
pname = "kicad-${name}";
version = builtins.substring 0 10 (libSrc name).rev;
src = libSrc name;
nativeBuildInputs = [
cmake
]
++ lib.optionals (name == "packages3d") [
stepreduce
parallel
zip
];
postInstall =
lib.optionalString (name == "packages3d") ''
find $out -type f -name '*.step' | parallel 'stepreduce {} {} && zip -9 {.}.stpZ {} && rm {}'
''
+ lib.optionalString (name == "footprints") ''
grep -rl '\.step' $out | xargs sed -i 's/\.step/.stpZ/g'
'';
meta = {
license = lib.licenses.cc-by-sa-40;
platforms = lib.platforms.all;
};
};
in
{
symbols = mkLib "symbols";
templates = mkLib "templates";
footprints = mkLib "footprints";
packages3d = mkLib "packages3d";
}

View File

@@ -0,0 +1,15 @@
diff --git a/common/paths.cpp b/common/paths.cpp
index a74cdd9..790cc58 100644
--- a/common/paths.cpp
+++ b/common/paths.cpp
@@ -151,6 +151,10 @@ wxString PATHS::GetStockDataPath( bool aRespectRunFromBuildDir )
{
wxString path;
+ if( wxGetEnv( wxT( "NIX_KICAD9_STOCK_DATA_PATH" ), &path ) ) {
+ return path;
+ }
+
if( aRespectRunFromBuildDir && wxGetEnv( wxT( "KICAD_RUN_FROM_BUILD_DIR" ), nullptr ) )
{
// Allow debugging from build dir by placing relevant files/folders in the build root

View File

@@ -0,0 +1,261 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p coreutils git nix curl jq nixfmt-tree
# shellcheck shell=bash enable=all
set -e
shopt -s inherit_errexit
# this script will generate versions.nix in the right location
# this should contain the versions' revs and hashes
# the stable revs are stored only for ease of skipping
# by default nix-prefetch-url uses XDG_RUNTIME_DIR as tmp
# which is /run/user/1000, which defaults to 10% of your RAM
# unless you have over 64GB of ram that'll be insufficient
# resulting in "tar: no space left on device" for packages3d
# hence:
export TMPDIR=/tmp
# if something goes unrepairably wrong, run 'update.sh all clean'
# TODO
# support parallel instances for each pname
# currently risks reusing old data
# no getting around manually checking if the build product works...
# 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)
# nixpkgs' update.nix passes in UPDATE_NIX_PNAME to indicate which package is being updated
# assigning a default value to that as shellcheck doesn't like the use of unassigned variables
: "${UPDATE_NIX_PNAME:=""}"
# update.nix can also parse JSON output of this script to formulate a commit
# this requires we collect the version string in the old versions.nix for the updated package
old_version=""
new_version=""
# 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="$(sed -n '1p' <<< "${scratch}")"
latest_tag="$(cut -d '/' -f 3 <<< "${scratch}")"
# 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_testing=1
check_unstable=1
commit=""
for arg in "$@" "${UPDATE_NIX_PNAME}"; do
case "${arg}" in
help|-h|--help) echo "Read me!" >&2; exit 1; ;;
kicad|kicad-small|release|tag|stable|5*|6*|7*|8*) check_stable=1; check_testing=""; check_unstable="" ;;
*testing|kicad-testing-small) check_testing=1; check_unstable="" ;;
*unstable|*unstable-small|master|main) 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 ;;
*) ;;
esac
done
here="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
commit_date() {
gitlab_json="$(curl -s https://gitlab.com/api/v4/projects/kicad%2Fcode%2Fkicad/repository/commits/"$1")"
commit_created="$(jq .created_at --raw-output <<< "${gitlab_json}")"
date --date="${commit_created}" --iso-8601 --utc
}
file="${here}/versions.nix"
# just in case this runs in parallel
tmp="${here}/,versions.nix.${RANDOM}"
libs=( symbols templates footprints packages3d )
get_rev() {
git ls-remote "$@"
}
gitlab="https://gitlab.com/kicad"
# append commit hash or tag
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-"
lib_mid="/repository/archive.tar.gz?sha="
# number of items updated
count=0
printf "Latest tag is %s\n" "${latest_tag}" >&2
if [[ ! -f ${file} ]]; then
echo "No existing file, generating from scratch" >&2
check_stable=1; check_testing=1; check_unstable=1; clean=1
fi
printf "Writing %s\n" "${tmp}" >&2
# not a dangling brace, grouping the output to redirect to file
{
printf "# This file was generated by update.sh\n\n"
printf "{\n"
for version in "${all_versions[@]}"; do
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
if [[ ${version} == "master" ]]; then
pname="kicad-unstable"
elif [[ ${version} == "testing" ]]; then
pname="kicad-testing"
else
pname="kicad"
fi
# skip a version if we don't want to check it
if [[ (-n ${check_stable} && ${version} != "master" && ${version} != "testing") \
|| (-n ${check_testing} && ${version} == "testing") \
|| (-n ${check_unstable} && ${version} == "master" ) ]]; then
now=$(commit_date "${src_version}")
if [[ ${version} == "master" ]]; then
pname="kicad-unstable"
new_version="${now}"
elif [[ ${version} == "testing" ]]; then
pname="kicad-testing"
new_version="${testing_branch}-${now}"
else
pname="kicad"
new_version="${version}"
fi
printf "\nChecking %s\n" "${pname}" >&2
printf "%2s\"%s\" = {\n" "" "${pname}"
printf "%4skicadVersion = {\n" ""
printf "%6sversion =\t\t\t\"%s\";\n" "" "${new_version}"
printf "%6ssrc = {\n" ""
echo "Checking src" >&2
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)"
old_version="$(grep -sm 1 "\"${pname}\"" -A 3 "${file}" | grep -sm 1 "version" | awk -F "\"" '{print $2}' || true)"
if [[ -n ${has_rev} && -n ${has_hash} && -z ${clean} ]]; then
echo "Reusing old ${pname}.src.sha256, already latest .rev at ${old_version}" >&2
scratch=$(grep -sm 1 "\"${pname}\"" -A 5 "${file}")
grep -sm 1 "rev" -A 1 <<< "${scratch}"
else
prefetched="$(${prefetch} "${src_pre}${src_rev}")"
printf "%8srev =\t\t\t\"%s\";\n" "" "${src_rev}"
printf "%8ssha256 =\t\t\"%s\";\n" "" "${prefetched}"
count=$((count+1))
fi
printf "%6s};\n" ""
printf "%4s};\n" ""
printf "%4slibVersion = {\n" ""
printf "%6sversion =\t\t\t\"%s\";\n" "" "${new_version}"
printf "%6slibSources = {\n" ""
for lib in "${libs[@]}"; do
echo "Checking ${lib}" >&2
url="${gitlab}/libraries/kicad-${lib}.git"
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)"
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
echo "Reusing old kicad-${lib}-${new_version}.src.sha256, already latest .rev" >&2
scratch="$(grep -sm 1 "\"${pname}\"" -A 20 "${file}")"
grep -sm 1 "${lib}" -A 1 <<< "${scratch}"
else
prefetched="$(${prefetch} "${lib_pre}${lib}${lib_mid}${lib_rev}")"
printf "%8s%s.rev =\t" "" "${lib}"
case "${lib}" in
symbols|templates) printf "\t" ;; *) ;;
esac
printf "\"%s\";\n" "${lib_rev}"
printf "%8s%s.sha256 =\t\"%s\";\n" "" "${lib}" "${prefetched}"
count=$((count+1))
fi
done
printf "%6s};\n" ""
printf "%4s};\n" ""
printf "%2s};\n" ""
else
printf "\nReusing old %s\n" "${pname}" >&2
grep -sm 1 "\"${pname}\"" -A 21 "${file}"
fi
done
printf "}\n"
} > "${tmp}"
if grep '""' "${tmp}"; then
echo "empty value detected, out of space?" >&2
exit "1"
fi
mv "${tmp}" "${file}"
treefmt "${file}"
printf "\nFinished\nMoved output to %s\n\n" "${file}" >&2
if [[ ${count} -gt 0 ]]; then
if [[ ${count} -gt 1 ]]; then s="s"; else s=""; fi
echo "${count} revision${s} changed" >&2
if [[ -n ${commit} ]]; then
git commit -am "$(printf "kicad: automatic update of %s item%s\n" "${count}" "${s}")"
fi
echo "Please confirm the new versions.nix works before making a PR." >&2
else
echo "No changes, those checked are up to date" >&2
fi
# using UPDATE_NIX_ATTR_PATH to detect if this is being called from update.nix
# and output JSON to describe the changes
if [[ -n ${UPDATE_NIX_ATTR_PATH} ]]; then
if [[ ${count} -eq 0 ]]; then echo "[{}]"; exit 0; fi
jq -n \
--arg attrpath "${UPDATE_NIX_PNAME}" \
--arg oldversion "${old_version}" \
--arg newversion "${new_version}" \
--arg file "${file}" \
'[{
"attrPath": $attrpath,
"oldVersion": $oldversion,
"newVersion": $newversion,
"files": [ $file ]
}]'
fi

View File

@@ -0,0 +1,70 @@
# This file was generated by update.sh
{
"kicad" = {
kicadVersion = {
version = "9.0.5";
src = {
rev = "3e59813c21b4d0a00c08978e86b5f2189ec27864";
sha256 = "0wmnkiyqv32c5nz4nvz94dld3rk5ir49nh71cycig6clvjvy11r5";
};
};
libVersion = {
version = "9.0.5";
libSources = {
symbols.rev = "884133df0afba238567e2be6c31e7d3b4a9d90be";
symbols.sha256 = "0msgq8p3zlfc3glqr1h8n0a1agk4hjdqxqdiny5b4d0hgiy6hhmx";
templates.rev = "204b42307fc78cf0b3ebec4e19eba9d710e392f4";
templates.sha256 = "0zs29zn8qjgxv0w1vyr8yxmj02m8752zagn4vcraqgik46dwg2id";
footprints.rev = "873e3e9dbad8371d664e57261efa516d42328161";
footprints.sha256 = "179y7xmz7mwsfsv4dcw2dx689xfzqk8y38d21s69yiaalyxflhh1";
packages3d.rev = "c25dce5aadce68076ac035edb0c792608f5f597c";
packages3d.sha256 = "1y7yhynrr87q80gcb8qlkyrdccz1sllsxqymrnghhxbfk4wbwwn8";
};
};
};
"kicad-testing" = {
kicadVersion = {
version = "9.0-2025-02-21";
src = {
rev = "c4c32aa7bbadd3862fb720457b71e7a19420604c";
sha256 = "01zbvg6n8kajilj3q1sp0zpaqz94bq28wrxjax1968wvwv05g0dp";
};
};
libVersion = {
version = "9.0-2025-02-21";
libSources = {
symbols.rev = "e1c3371228f97b36c6fd61b66d056184930f078e";
symbols.sha256 = "0l8da2ix917jlsj6v5zclc1cb5pvjaxwmys0gjdv55ic31hhfyyw";
templates.rev = "3ed4538b0f965d821df63a5fffc4441e723cfe7f";
templates.sha256 = "0zs29zn8qjgxv0w1vyr8yxmj02m8752zagn4vcraqgik46dwg2id";
footprints.rev = "ef91963f57028aa095f2d0c4239ba994ea822f73";
footprints.sha256 = "16zslgvjg4swgkkvnd9fmiks3wzg63364d03hixiyzcpjlgk2bbk";
packages3d.rev = "b40831fd7ea2ca8f9c7282143dbb7d2f5015cd69";
packages3d.sha256 = "0bg54lg1iw01gw06ajg34y7x4y36wm6ls3jnpjy13i18d4ik77g4";
};
};
};
"kicad-unstable" = {
kicadVersion = {
version = "2025-02-21";
src = {
rev = "878cf768d6552131494aa792dc20e6ccf67baf75";
sha256 = "0ky0a7y6gf409y8bwpngiirqin4ivbcjnk8gjdj1a6w79x559sr8";
};
};
libVersion = {
version = "2025-02-21";
libSources = {
symbols.rev = "da86acd48809fd61876223c8bf0e4e7793c52e9a";
symbols.sha256 = "1sdpg58wbyyrghjd0jqw5iw2094mjy2v9jmwn5zrj4jm6f51g1kd";
templates.rev = "3ed4538b0f965d821df63a5fffc4441e723cfe7f";
templates.sha256 = "0zs29zn8qjgxv0w1vyr8yxmj02m8752zagn4vcraqgik46dwg2id";
footprints.rev = "e515f1c3213317d436e492c8c06620ef4caca84e";
footprints.sha256 = "16zslgvjg4swgkkvnd9fmiks3wzg63364d03hixiyzcpjlgk2bbk";
packages3d.rev = "d5db5cea003fe2b4b1c9b145f5fcbd5fdb48f8ca";
packages3d.sha256 = "0bg54lg1iw01gw06ajg34y7x4y36wm6ls3jnpjy13i18d4ik77g4";
};
};
};
}

View File

@@ -0,0 +1,49 @@
commit 6a72fd032405515e468797be91b5a6ebcbbb5fd8
Author: Evils <evils.devils@protonmail.com>
Date: Wed Nov 23 19:49:13 2022 +0100
ensure new projects are writable
diff --git a/kicad/kicad_manager_frame.cpp b/kicad/kicad_manager_frame.cpp
index 7ee8090858..391514519c 100644
--- a/kicad/kicad_manager_frame.cpp
+++ b/kicad/kicad_manager_frame.cpp
@@ -638,6 +638,12 @@ void KICAD_MANAGER_FRAME::CreateNewProject( const wxFileName& aProjectFileName,
// wxFFile dtor will close the file
}
+
+ if( destFileName.IsOk() && !destFileName.IsFileWritable() )
+ {
+ destFileName.SetPermissions(0644);
+ }
+
}
}
diff --git a/kicad/project_template.cpp b/kicad/project_template.cpp
index bf951fcddb..2bef94326b 100644
--- a/kicad/project_template.cpp
+++ b/kicad/project_template.cpp
@@ -282,6 +282,21 @@ bool PROJECT_TEMPLATE::CreateProject( wxFileName& aNewProjectPath, wxString* aEr
result = false;
}
+ else if( !destFile.IsFileWritable() && !destFile.SetPermissions(0644) )
+ {
+ if( aErrorMsg )
+ {
+ if( !aErrorMsg->empty() )
+ *aErrorMsg += "\n";
+
+ wxString msg;
+
+ msg.Printf( _( "Cannot make file writable: '%s'." ), destFile.GetFullPath() );
+ *aErrorMsg += msg;
+ }
+
+ result = false;
+ }
}
return result;

View File

@@ -0,0 +1,61 @@
{
stdenv,
lib,
fetchFromGitHub,
qtbase,
qttools,
qtsvg,
qt5compat,
opencascade-occt,
libGLU,
cmake,
wrapQtAppsHook,
rustPlatform,
cargo,
rustc,
}:
stdenv.mkDerivation rec {
pname = "librepcb";
version = "1.3.0";
src = fetchFromGitHub {
owner = "librepcb";
repo = "librepcb";
rev = version;
hash = "sha256-J4y0ikZNuOguN9msmEQzgcY0/REnOEOoDkY/ga+Cfd8=";
fetchSubmodules = true;
};
nativeBuildInputs = [
cmake
qttools
qtsvg
qt5compat
wrapQtAppsHook
opencascade-occt
libGLU
rustPlatform.cargoSetupHook
cargo
rustc
];
buildInputs = [ qtbase ];
cargoDeps = rustPlatform.fetchCargoVendor {
inherit src cargoRoot;
hash = "sha256-1td3WjxbDq2lX7c0trpYRhO82ChNAG/ZABBRsekYtq4=";
};
cargoRoot = "libs/librepcb/rust-core";
meta = with lib; {
description = "Free EDA software to develop printed circuit boards";
homepage = "https://librepcb.org/";
maintainers = with maintainers; [
luz
thoughtpolice
];
license = licenses.gpl3Plus;
platforms = platforms.linux;
};
}

View File

@@ -0,0 +1,29 @@
{
pname,
fetchurl,
lib,
}:
rec {
version = "4.3.6";
inherit pname;
src = fetchurl {
url = "mirror://sourceforge/project/linux-gpib/linux-gpib%20for%203.x.x%20and%202.6.x%20kernels/${version}/linux-gpib-${version}.tar.gz";
hash = "sha256-Gze4xrvkhEgn+J5Jhrycezjp2uhlD1v6aX0WGv4J2Jg=";
};
unpackPhase = ''
tar xf $src
tar xf linux-gpib-${version}/${pname}-${version}.tar.gz
'';
sourceRoot = "${pname}-${version}";
meta = with lib; {
description = "Support package for GPIB (IEEE 488) hardware";
homepage = "https://linux-gpib.sourceforge.io/";
license = licenses.gpl2Only;
maintainers = with maintainers; [ fsagbuya ];
platforms = platforms.linux;
};
}

View File

@@ -0,0 +1,30 @@
{
lib,
stdenv,
fetchurl,
kernel,
pahole,
}:
stdenv.mkDerivation (
import ./common.nix {
inherit fetchurl lib;
pname = "linux-gpib-kernel";
}
// {
postPatch = ''
sed -i 's@/sbin/depmod -A@@g' Makefile
'';
buildInputs = [ pahole ] ++ kernel.moduleBuildDependencies;
makeFlags = [
"LINUX_SRCDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
];
installFlags = [
"INSTALL_MOD_PATH=$(out)"
];
}
)

View File

@@ -0,0 +1,36 @@
{
lib,
stdenv,
fetchurl,
autoconf,
libtool,
bison,
flex,
automake,
udevCheckHook,
}:
stdenv.mkDerivation (
import ./common.nix {
inherit fetchurl lib;
pname = "linux-gpib-user";
}
// {
nativeBuildInputs = [
autoconf
libtool
bison
flex
automake
udevCheckHook
];
configureFlags = [
"--sysconfdir=$(out)/etc"
"--prefix=$(out)"
];
doInstallCheck = true;
}
)

View File

@@ -0,0 +1,82 @@
{
lib,
stdenv,
python3,
fetchFromGitHub,
qt6,
writeShellScriptBin,
}:
let
# Matches the pyside6-uic and pyside6-rcc implementations
# https://code.qt.io/cgit/pyside/pyside-setup.git/tree/sources/pyside-tools/pyside_tool.py?id=9b310d4c0654a244147766e382834b5e8bdeb762#n90
pyside-tools-uic = writeShellScriptBin "pyside6-uic" ''
exec ${qt6.qtbase}/libexec/uic -g python "$@"
'';
pyside-tools-rcc = writeShellScriptBin "pyside6-rcc" ''
exec ${qt6.qtbase}/libexec/rcc -g python "$@"
'';
in
python3.pkgs.buildPythonApplication rec {
pname = "nanovna-saver";
version = "0.7.3";
pyproject = true;
src = fetchFromGitHub {
owner = "NanoVNA-Saver";
repo = "nanovna-saver";
tag = "v${version}";
sha256 = "sha256-Asx4drb9W2NobdgOlbgdm1aAzB69hnIWvOM915F7sgA=";
};
nativeBuildInputs = [
qt6.wrapQtAppsHook
qt6.qtbase
];
buildInputs = lib.optional stdenv.hostPlatform.isLinux qt6.qtwayland;
propagatedBuildInputs = with python3.pkgs; [
cython
scipy
pyqt6
pyserial
pyside6
numpy
setuptools
setuptools-scm
];
doCheck = false;
dontWrapGApps = true;
dontWrapQtApps = true;
postPatch = ''
substituteInPlace src/tools/ui_compile.py \
--replace-fail "pyside6-uic" "${pyside-tools-uic}/bin/pyside6-uic" \
--replace-fail "pyside6-rcc" "${pyside-tools-rcc}/bin/pyside6-rcc"
'';
preFixup = ''
makeWrapperArgs+=(
"''${gappsWrapperArgs[@]}"
"''${qtWrapperArgs[@]}"
)
'';
meta = with lib; {
homepage = "https://github.com/NanoVNA-Saver/nanovna-saver";
description = "Tool for reading, displaying and saving data from the NanoVNA";
mainProgram = "NanoVNASaver";
longDescription = ''
A multiplatform tool to save Touchstone files from the NanoVNA, sweep
frequency spans in segments to gain more than 101 data points, and
generally display and analyze the resulting data.
'';
license = licenses.gpl3Only;
maintainers = with maintainers; [
zaninime
tmarkus
];
};
}

View File

@@ -0,0 +1,54 @@
{
mkDerivation,
lib,
fetchFromGitHub,
makeWrapper,
cmake,
qtbase,
qttools,
fftw,
libusb1,
libglvnd,
}:
mkDerivation rec {
pname = "openhantek6022";
version = "3.4.0";
src = fetchFromGitHub {
owner = "OpenHantek";
repo = "OpenHantek6022";
rev = version;
sha256 = "sha256-FT+DyfD5WHBblRXWXFnyB2xwoIgoh84oB+QN32wx78c=";
};
nativeBuildInputs = [
cmake
makeWrapper
];
buildInputs = [
fftw
libusb1
libglvnd
qtbase
qttools
];
postPatch = ''
# Fix up install paths & checks
sed -i 's#if(EXISTS ".*")#if(1)#g' CMakeLists.txt
sed -i 's#/lib/udev#lib/udev#g' CMakeLists.txt
sed -i 's#/usr/share#share#g' CMakeLists.txt
'';
doInstallCheck = true;
meta = with lib; {
description = "Free software for Hantek and compatible (Voltcraft/Darkwire/Protek/Acetech) USB digital signal oscilloscopes";
mainProgram = "OpenHantek";
homepage = "https://github.com/OpenHantek/OpenHantek6022";
license = licenses.gpl3;
maintainers = with maintainers; [ baracoder ];
platforms = qtbase.meta.platforms;
};
}

View File

@@ -0,0 +1,71 @@
{
lib,
stdenv,
fetchFromGitHub,
pkg-config,
cmake,
glib,
boost,
libsigrok,
libsigrokdecode,
libserialport,
libzip,
libftdi1,
hidapi,
glibmm,
pcre,
python3,
qtsvg,
qttools,
bluez,
wrapQtAppsHook,
desktopToDarwinBundle,
}:
stdenv.mkDerivation {
pname = "pulseview";
version = "0.4.2-unstable-2025-05-15";
src = fetchFromGitHub {
owner = "sigrokproject";
repo = "pulseview";
rev = "e2fe9dfb91c7de85c410922ee9268c3f526bcc54";
hash = "sha256-b9pqtsF5J9MA7XMIgFZltrVqi64ZPObBTiaws3zSDRg=";
};
nativeBuildInputs = [
cmake
pkg-config
qttools
wrapQtAppsHook
]
++ lib.optional stdenv.hostPlatform.isDarwin desktopToDarwinBundle;
buildInputs = [
glib
boost
libsigrok
libsigrokdecode
libserialport
libzip
libftdi1
hidapi
glibmm
pcre
python3
qtsvg
]
++ lib.optionals stdenv.hostPlatform.isLinux [ bluez ];
meta = with lib; {
description = "Qt-based LA/scope/MSO GUI for sigrok (a signal analysis software suite)";
mainProgram = "pulseview";
homepage = "https://sigrok.org/";
license = licenses.gpl3Plus;
maintainers = with maintainers; [
bjornfor
vifino
];
platforms = platforms.unix;
};
}