2021-06-28 23:13:55 +00:00
|
|
|
{ mkDerivation
|
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
2021-10-28 06:52:43 +00:00
|
|
|
, fetchpatch
|
2021-06-28 23:13:55 +00:00
|
|
|
, qmake
|
|
|
|
, pkg-config
|
|
|
|
, qtbase
|
|
|
|
, qtsvg
|
|
|
|
, qttools
|
|
|
|
, qtserialport
|
|
|
|
, boost
|
|
|
|
, 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
|
2021-10-28 06:52:43 +00:00
|
|
|
partsSha = "640fa25650211afccd369f960375ade8ec3e8653";
|
|
|
|
|
|
|
|
parts = fetchFromGitHub {
|
|
|
|
owner = "fritzing";
|
|
|
|
repo = "fritzing-parts";
|
|
|
|
rev = partsSha;
|
|
|
|
sha256 = "sha256-4S65eX4LCnXCFQAOxmdvr8d0nAgTWcJooE2SpLYpcXI=";
|
|
|
|
};
|
2020-10-16 20:44:37 +00:00
|
|
|
in
|
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
mkDerivation rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "fritzing";
|
2021-10-28 06:52:43 +00:00
|
|
|
version = "unstable-2021-09-22";
|
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";
|
2021-10-28 06:52:43 +00:00
|
|
|
rev = "f0af53a9077f7cdecef31d231b85d8307de415d4";
|
|
|
|
sha256 = "sha256-fF38DrBoeZ0aKwVMNyYMPWa5rFPbIVXRARZT+eRat5Q=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-10-28 06:52:43 +00:00
|
|
|
buildInputs = [ qtbase qtsvg qtserialport boost libgit2 quazip ];
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ qmake pkg-config qttools ];
|
2020-10-16 20:44:37 +00:00
|
|
|
|
2021-10-28 06:52:43 +00:00
|
|
|
patches = [
|
|
|
|
# Add support for QuaZip 1.x
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/fritzing/fritzing-app/commit/ef83ebd9113266bb31b3604e3e9d0332bb48c999.patch";
|
|
|
|
sha256 = "sha256-J43E6iBRIVbsuuo82gPk3Q7tyLhNkuuyYwtH8hUfcPU=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
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
|
|
|
'';
|
|
|
|
|
2021-10-28 06:52:43 +00:00
|
|
|
qmakeFlags = [
|
|
|
|
"phoenix.pro"
|
|
|
|
"DEFINES=QUAZIP_INSTALLED"
|
|
|
|
"DEFINES+=QUAZIP_1X"
|
|
|
|
];
|
|
|
|
|
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 ];
|
2021-10-28 06:52:43 +00:00
|
|
|
maintainers = with maintainers; [ robberer musfay ];
|
2021-06-28 23:13:55 +00:00
|
|
|
platforms = platforms.linux;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|