2022-08-12 12:06:08 +00:00
|
|
|
{ stdenv
|
2021-06-28 23:13:55 +00:00
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
2021-10-28 06:52:43 +00:00
|
|
|
, fetchpatch
|
2022-08-12 12:06:08 +00:00
|
|
|
, wrapQtAppsHook
|
2021-06-28 23:13:55 +00:00
|
|
|
, qmake
|
|
|
|
, pkg-config
|
|
|
|
, qtbase
|
|
|
|
, qtsvg
|
|
|
|
, qttools
|
|
|
|
, qtserialport
|
|
|
|
, boost
|
2022-08-12 12:06:08 +00:00
|
|
|
, libngspice
|
2021-06-28 23:13:55 +00:00
|
|
|
, libgit2
|
2021-10-28 06:52:43 +00:00
|
|
|
, quazip
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2020-10-16 20:44:37 +00:00
|
|
|
let
|
|
|
|
# SHA256 of the fritzing-parts HEAD on the master branch,
|
|
|
|
# which contains the latest stable parts definitions
|
2022-08-12 12:06:08 +00:00
|
|
|
partsSha = "4713511c894cb2894eae505b9307c6555afcc32c";
|
2021-10-28 06:52:43 +00:00
|
|
|
|
|
|
|
parts = fetchFromGitHub {
|
|
|
|
owner = "fritzing";
|
|
|
|
repo = "fritzing-parts";
|
|
|
|
rev = partsSha;
|
2022-08-12 12:06:08 +00:00
|
|
|
sha256 = "sha256-QiOGWc+99MJhOVrXyNOinR8rTVvW/E+wPfoB6QvbhY0=";
|
2021-10-28 06:52:43 +00:00
|
|
|
};
|
2020-10-16 20:44:37 +00:00
|
|
|
in
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "fritzing";
|
2022-08-12 12:06:08 +00:00
|
|
|
version = "unstable-2022-07-01";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2021-06-28 23:13:55 +00:00
|
|
|
owner = pname;
|
2020-04-24 23:36:52 +00:00
|
|
|
repo = "fritzing-app";
|
2022-08-12 12:06:08 +00:00
|
|
|
rev = "40d23c29b0463d5c968c3c4b34ed5ffc05c5a258";
|
|
|
|
sha256 = "sha256-smvfuxQWF/LMFFXHOKb3zUZsEet/XoiaxXOR5QMaYzw=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
buildInputs = [ qtbase qtsvg qtserialport boost libgit2 quazip libngspice ];
|
|
|
|
nativeBuildInputs = [ qmake pkg-config qttools wrapQtAppsHook ];
|
2020-10-16 20:44:37 +00:00
|
|
|
|
2021-10-28 06:52:43 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
2022-08-12 12:06:08 +00:00
|
|
|
url = "https://aur.archlinux.org/cgit/aur.git/plain/0001-Quick-Dirty-patch-to-allow-finding-quazip-qt5-on-Arc.patch?h=fritzing&id=1ae0dc88464f375a54b156e6761315bcb04bcc1f";
|
|
|
|
sha256 = "sha256-iS18EWw920gyeXDoHBRGwXvwMJurJS21H77Erl+fqog=";
|
2021-10-28 06:52:43 +00:00
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2020-10-16 20:44:37 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace phoenix.pro \
|
|
|
|
--replace 'LIBGIT_STATIC = true' 'LIBGIT_STATIC = false'
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-10-28 06:52:43 +00:00
|
|
|
#TODO: Do not hardcode SHA.
|
2020-10-16 20:44:37 +00:00
|
|
|
substituteInPlace src/fapplication.cpp \
|
|
|
|
--replace 'PartsChecker::getSha(dir.absolutePath());' '"${partsSha}";'
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
mkdir parts
|
|
|
|
cp -a ${parts}/* parts/
|
2020-10-16 20:44:37 +00:00
|
|
|
'';
|
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = "-I${lib.getDev quazip}/include/QuaZip-Qt${lib.versions.major qtbase.version}-${quazip.version}/quazip";
|
2022-08-12 12:06:08 +00:00
|
|
|
|
2021-10-28 06:52:43 +00:00
|
|
|
qmakeFlags = [
|
|
|
|
"phoenix.pro"
|
|
|
|
];
|
|
|
|
|
2020-10-16 20:44:37 +00:00
|
|
|
postFixup = ''
|
|
|
|
# generate the parts.db file
|
2021-06-28 23:13:55 +00:00
|
|
|
QT_QPA_PLATFORM=offscreen "$out/bin/Fritzing" \
|
|
|
|
-db "$out/share/fritzing/parts/parts.db" \
|
2021-10-28 06:52:43 +00:00
|
|
|
-pp "$out/share/fritzing/parts" \
|
2021-06-28 23:13:55 +00:00
|
|
|
-folder "$out/share/fritzing"
|
2020-10-16 20:44:37 +00:00
|
|
|
'';
|
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "An open source prototyping tool for Arduino-based projects";
|
2020-10-07 09:15:18 +00:00
|
|
|
homepage = "https://fritzing.org/";
|
2021-06-28 23:13:55 +00:00
|
|
|
license = with licenses; [ gpl3 cc-by-sa-30 ];
|
2022-05-18 14:49:53 +00:00
|
|
|
maintainers = with maintainers; [ robberer muscaln ];
|
2021-06-28 23:13:55 +00:00
|
|
|
platforms = platforms.linux;
|
2023-05-24 13:37:59 +00:00
|
|
|
mainProgram = "Fritzing";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|