Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add nix flake #20

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
6 changes: 6 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ passes it through 2to3.

The Pango library is used compute the dimensions of a text layout. There is no standard package to get the Pango Python bindings installed. It is a part of the Gtk+ library which is accessed either through the PyGtk or PyGObject APIs, both of which are supported by Symbolator. You should make sure that one of these libraries is available before installing Symbolator. A `Windows installer <http://www.pygtk.org/downloads.html>`_ is available. For Linux distributions you should install the relevant libraries with your package manager.

If you are running linux you can use the nix package manager to build and run symbolator without installing it:

```
nix run github:kevinpt/symbolator
```

Licensing
---------

Expand Down
39 changes: 39 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{ pkgs ? import <nixpkgs> { } }:
let
hdlparse = pkgs.python2Packages.buildPythonPackage rec {
pname = "hdlparse";
version = "1.0.4";
src = pkgs.fetchFromGitHub {
owner = "kevinpt";
repo = "hdlparse";
rev = "be7cdab08a8c18815cc4504003ce9ca7fff41022";
sha256 = "sha256-KJXl9lQY6xYJkaS41F8V1jGz5jhu0oPhb/lQVj/gj18="; # TODO
};
};
in
with pkgs;
python2Packages.buildPythonPackage rec {
name = "symbolator";
version = "1.0.2";
src = ./.;
nativeBuildInputs = [ wrapGAppsHook gobject-introspection ];

propagatedBuildInputs = [
pango
hdlparse
python2Packages.pygobject3
python2Packages.pycairo
python2Packages.setuptools
];

meta = with lib; {
description = "A component diagramming tool for VHDL and Verilog";
longDescription = ''
Symbolator is a component diagramming tool for VHDL and Verilog. It will parse HDL source files, extract components or modules and render them as an image.
'';
homepage = "http://kevinpt.github.io/symbolator";
license = licenses.mit;
platforms = lib.platforms.linux;
mainProgram = "symbolator";
};
}
42 changes: 42 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
description = "Symbolator is a component diagramming tool for VHDL and Verilog.";

inputs = {
nixpkgs.url = "nixpkgs/nixos-22.11";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
rec {
name = "Symbolator";
packages.symbolator = import ./default.nix { pkgs = nixpkgs.legacyPackages.${system}; };
packages.default = packages.symbolator;
}
);
}
3 changes: 3 additions & 0 deletions nucanvas/cairo_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
import pangocairo
use_pygobject = False
except ImportError:
import gi
gi.require_version('Pango', '1.0')
gi.require_version('PangoCairo', '1.0')
from gi.repository import Pango as pango
from gi.repository import PangoCairo as pangocairo
use_pygobject = True
Expand Down