Skip to content
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions pkgs/applications/science/electronics/horizon-eda/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{ stdenv, fetchFromGitHub, pkgconfig, sqlite, libyamlcpp, libuuid, gnome3, epoxy, librsvg, zeromq, cppzmq, glm, libgit2, curl, boost, python3, opencascade, libzip, podofo, wrapGAppsHook }:

stdenv.mkDerivation rec {
name = "horizon-eda-${version}";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use pname = "horizon-eda"; instead as name = "${pname}-${version}"; is already implied.

version = "20190716";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If a package is not a release but a commit from a repository, then the version part of the name must be the date of that (fetched) commit. The date must be in "YYYY-MM-DD" format. Also append "unstable" to the name - e.g., "pkgname-unstable-2014-09-23".


src = fetchFromGitHub {
owner = "carrotIndustries";
repo = "horizon";
rev = "85c171a3dc29d6cab41f5effd230d1769e519b4d";
sha256 = "012vi91bxzbvabg6v2ldl916jg24i6pc9lpnniwq3c2pzpvlvndg";
};

patchPhase = ''
echo "const char *gitversion = \"${src.rev}\";" > src/gitversion.cpp
'';

buildInputs = [ pkgconfig sqlite libyamlcpp libuuid gnome3.gtkmm epoxy librsvg zeromq cppzmq glm libgit2 curl boost python3 libzip podofo opencascade ];

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see comment by @joachifm about pkgconfig belonging to nativeBuildInputs instead.


nativeBuildInputs = [ wrapGAppsHook ];

NIX_CFLAGS_COMPILE = "-I${opencascade}/include/oce";

installPhase = ''
mkdir -p $out/bin

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Golfing: I believe this reduces to install -Dt $out/bin horizon-{eda,imp}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We now have an install target that also installs icons, desktop entry and such.

cp build/horizon-eda $out/bin/
cp build/horizon-imp $out/bin/
'';

preFixup = ''
wrapProgram "$out/bin/horizon-eda" "''${gappsWrapperArgs[@]}"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this actually required?

'';

enableParallelBuilding = true;

meta = with stdenv.lib; {
description = "A free EDA software to develop printed circuit boards";
homepage = https://github.com/carrotIndustries/horizon;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please quote.

maintainers = with maintainers; [ luz ];
license = licenses.gpl3;
platforms = platforms.linux;
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22989,6 +22989,8 @@ in

fped = callPackage ../applications/science/electronics/fped { };

horizon-eda = callPackage ../applications/science/electronics/horizon-eda { };

kicad = callPackage ../applications/science/electronics/kicad {
wxGTK = wxGTK30;
boost = boost160;
Expand Down