2021-06-28 23:13:55 +00:00
|
|
|
{ mkDerivation
|
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, qmake
|
|
|
|
, pkg-config
|
|
|
|
, qtbase
|
|
|
|
, qtsvg
|
|
|
|
, qttools
|
|
|
|
, qtserialport
|
|
|
|
, boost
|
|
|
|
, libgit2
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2020-10-16 20:44:37 +00:00
|
|
|
let
|
|
|
|
# build number corresponding to a release, has no further relation
|
|
|
|
# see https://github.com/fritzing/fritzing-app/releases/tag/CD-498
|
2021-06-28 23:13:55 +00:00
|
|
|
# fritzingBuild = "498";
|
|
|
|
# version 0.9.6 is properly tagged, hope it continues
|
|
|
|
|
2020-10-16 20:44:37 +00:00
|
|
|
# SHA256 of the fritzing-parts HEAD on the master branch,
|
|
|
|
# which contains the latest stable parts definitions
|
2021-06-28 23:13:55 +00:00
|
|
|
partsSha = "6f04697be286768bc9e4d64f8707e8e40cbcafcb";
|
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-06-28 23:13:55 +00:00
|
|
|
version = "0.9.6";
|
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-06-28 23:13:55 +00:00
|
|
|
rev = version;
|
|
|
|
sha256 = "083nz7vj7a334575smjry6257535h68gglh8a381xxa36dw96aqs";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
parts = fetchFromGitHub {
|
2021-06-28 23:13:55 +00:00
|
|
|
owner = pname;
|
2020-04-24 23:36:52 +00:00
|
|
|
repo = "fritzing-parts";
|
2020-10-16 20:44:37 +00:00
|
|
|
name = "fritzing-parts";
|
|
|
|
rev = partsSha;
|
2021-06-28 23:13:55 +00:00
|
|
|
sha256 = "1f4w0hz44n4iw1rc5vhcgzvlji54rf4yr8bvzkqv99hn2xf5pjgs";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2020-10-16 20:44:37 +00:00
|
|
|
buildInputs = [ qtbase qtsvg qtserialport boost libgit2 ];
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ qmake pkg-config qttools ];
|
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
|
|
|
|
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
|
|
|
'';
|
|
|
|
|
|
|
|
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" \
|
|
|
|
-pp "$out/fritzing/parts" \
|
|
|
|
-folder "$out/share/fritzing"
|
2020-10-16 20:44:37 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
qmakeFlags = [ "phoenix.pro" ];
|
|
|
|
|
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 ];
|
|
|
|
maintainers = with maintainers; [ robberer ];
|
|
|
|
platforms = platforms.linux;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|