nixpkgs/pkgs/applications/science/electronics/fritzing/default.nix
Patrick Hilhorst f7e390e6d4 treewide: fix redirected urls (run 3)
Related:
 - 9fc5e7e473
 - 593e11fd94
 - 508ae42a0f

Since the last time I ran this script, the Repology API changed, so I had to
adapt the script used in the previous PR. The new API should be more robust, so
overall this is a positive (no more grepping the error messages for our relevant
data but just a nice json structure).

Here's the new script I used:

```sh
curl https://repology.org/api/v1/repository/nix_unstable/problems \
   | jq -r '.[] | select(.type == "homepage_permanent_https_redirect") | .data | "s@\(.url)@\(.target)@"' \
   | sort | uniq | tee script.sed
find -name '*.nix' | xargs -P4 -- sed -f script.sed -i
```

I will also add this script to `maintainers/scripts`.
2020-10-02 09:01:35 -07:00

47 lines
1.2 KiB
Nix

{ mkDerivation, stdenv, fetchpatch, fetchFromGitHub, qmake, pkgconfig
, qtbase, qtsvg, qtserialport, boost, libgit2
}:
mkDerivation rec {
pname = "fritzing";
version = "0.9.3b";
src = fetchFromGitHub {
owner = "fritzing";
repo = "fritzing-app";
rev = version;
sha256 = "0hpyc550xfhr6gmnc85nq60w00rm0ljm0y744dp0z88ikl04f4s3";
};
parts = fetchFromGitHub {
owner = "fritzing";
repo = "fritzing-parts";
rev = version;
sha256 = "1d2v8k7p176j0lczx4vx9n9gbg3vw09n2c4b6w0wj5wqmifywhc1";
};
patches = [(fetchpatch {
name = "0001-Squashed-commit-of-the-following.patch";
url = "https://aur.archlinux.org/cgit/aur.git/plain/0001-Squashed-commit-of-the-following.patch?h=fritzing";
sha256 = "1cv6myidxhy28i8m8v13ghzkvx5978p9dcd8v7885y0l1h3108mf";
})];
buildInputs = [ qtbase qtsvg qtserialport boost libgit2 ];
nativeBuildInputs = [ qmake pkgconfig ];
qmakeFlags = [ "phoenix.pro" ];
preConfigure = ''
ln -s "$parts" parts
'';
meta = {
description = "An open source prototyping tool for Arduino-based projects";
homepage = "https://fritzing.org/";
license = stdenv.lib.licenses.gpl3;
maintainers = [ stdenv.lib.maintainers.robberer ];
platforms = stdenv.lib.platforms.linux;
};
}