22 # SHA256 of the fritzing-parts HEAD on the master branch,
23 # which contains the latest stable parts definitions
24 partsSha = "76235099ed556e52003de63522fdd74e61d53a36";
26 parts = fetchFromGitHub {
28 repo = "fritzing-parts";
30 hash = "sha256-1QVcPbRBOSYnNFsp7B2OyPXYuPaINRv9yEqGZFd662Y=";
34 svgpp = fetchFromGitHub {
38 hash = "sha256-nW0ns06XWfUi22nOKZzFKgAOHVIlQqChW8HxUDOFMh4=";
46 src = fetchFromGitHub {
48 repo = "fritzing-app";
49 rev = "a8c6ef7cf66f7a42b9b233d6137f1b70a9573a25";
50 hash = "sha256-a/bWAUeDPj3g8BECOlXuqyCi4JgGLLs1605m380Drt0=";
72 ++ lib.optionals stdenv.hostPlatform.isLinux [
77 # Use packaged quazip, libgit and ngspice
78 sed -i "/pri\/quazipdetect.pri/d" phoenix.pro
79 sed -i "/pri\/spicedetect.pri/d" phoenix.pro
80 substituteInPlace pri/libgit2detect.pri \
81 --replace-fail 'LIBGIT_STATIC = true' 'LIBGIT_STATIC = false'
83 #TODO: Do not hardcode SHA.
84 substituteInPlace src/fapplication.cpp \
85 --replace-fail 'PartsChecker::getSha(dir.absolutePath());' '"${partsSha}";'
87 substituteInPlace phoenix.pro \
88 --replace-fail "6.5.10" "${qtbase.version}"
91 cp -a ${parts}/* parts/
95 NIX_CFLAGS_COMPILE = lib.concatStringsSep " " [
96 "-I${lib.getDev quazip}/include/QuaZip-Qt${lib.versions.major qtbase.version}-${quazip.version}"
98 "-I${clipper}/include/polyclipping"
100 NIX_LDFLAGS = "-lquazip1-qt${lib.versions.major qtbase.version}";
107 postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
108 mkdir $out/Applications
109 mv $out/bin/Fritzing.app $out/Applications/Fritzing.app
110 cp FritzingInfo.plist $out/Applications/Fritzing.app/Contents/Info.plist
111 makeWrapper $out/Applications/Fritzing.app/Contents/MacOS/Fritzing $out/bin/Fritzing
115 # generate the parts.db file
116 QT_QPA_PLATFORM=offscreen "$out/bin/Fritzing" \
117 -db "$out/share/fritzing/parts/parts.db" \
118 -pp "$out/share/fritzing/parts" \
119 -folder "$out/share/fritzing"
123 description = "Open source prototyping tool for Arduino-based projects";
124 homepage = "https://fritzing.org";
125 license = with lib.licenses; [
129 maintainers = with lib.maintainers; [
133 platforms = lib.platforms.unix;
134 mainProgram = "Fritzing";