21 # SHA256 of the fritzing-parts HEAD on the master branch,
22 # which contains the latest stable parts definitions
23 partsSha = "015626e6cafb1fc7831c2e536d97ca2275a83d32";
25 parts = fetchFromGitHub {
27 repo = "fritzing-parts";
29 hash = "sha256-5jw56cqxpT/8bf1q551WG53J6Lw5pH0HEtRUoNNMc+A=";
33 svgpp = fetchFromGitHub {
37 hash = "sha256-kJEVnMYnDF7bThDB60bGXalYgpn9c5/JCZkRSK5GoE4=";
45 src = fetchFromGitHub {
47 repo = "fritzing-app";
48 rev = "dbdbe34c843677df721c7b3fc3e32c0f737e7e95";
49 hash = "sha256-Xi5sPU2RGkqh7T+EOvwxJJKKYDhJfccyEZ8LBBTb2s4=";
52 nativeBuildInputs = [ qmake pkg-config qttools wrapQtAppsHook ];
63 ] ++ lib.optionals stdenv.hostPlatform.isLinux [
68 # Use packaged quazip, libgit and ngspice
69 sed -i "/pri\/quazipdetect.pri/d" phoenix.pro
70 sed -i "/pri\/spicedetect.pri/d" phoenix.pro
71 substituteInPlace pri/libgit2detect.pri \
72 --replace-fail 'LIBGIT_STATIC = true' 'LIBGIT_STATIC = false'
74 #TODO: Do not hardcode SHA.
75 substituteInPlace src/fapplication.cpp \
76 --replace-fail 'PartsChecker::getSha(dir.absolutePath());' '"${partsSha}";'
78 substituteInPlace phoenix.pro \
79 --replace-fail "6.5.10" "${qtbase.version}"
82 cp -a ${parts}/* parts/
85 env.NIX_CFLAGS_COMPILE = lib.concatStringsSep " " [
86 "-I${lib.getDev quazip}/include/QuaZip-Qt${lib.versions.major qtbase.version}-${quazip.version}"
88 "-I${clipper}/include/polyclipping"
90 env.NIX_LDFLAGS = "-lquazip1-qt${lib.versions.major qtbase.version}";
96 postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
97 mkdir $out/Applications
98 mv $out/bin/Fritzing.app $out/Applications/Fritzing.app
99 cp FritzingInfo.plist $out/Applications/Fritzing.app/Contents/Info.plist
100 makeWrapper $out/Applications/Fritzing.app/Contents/MacOS/Fritzing $out/bin/Fritzing
104 # generate the parts.db file
105 QT_QPA_PLATFORM=offscreen "$out/bin/Fritzing" \
106 -db "$out/share/fritzing/parts/parts.db" \
107 -pp "$out/share/fritzing/parts" \
108 -folder "$out/share/fritzing"
112 description = "Open source prototyping tool for Arduino-based projects";
113 homepage = "https://fritzing.org/";
114 license = with licenses; [ gpl3 cc-by-sa-30 ];
115 maintainers = with maintainers; [ robberer muscaln ];
116 platforms = platforms.unix;
117 mainProgram = "Fritzing";