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 for easier installation #10

Open
wants to merge 3 commits into
base: main
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
16 changes: 11 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. image:: http://kevinpt.github.io/symbolator/_static/symbolator_icon.png
.. image:: https://hdl.github.io/symbolator/_static/symbolator_icon.png

==========
Symbolator
Expand Down Expand Up @@ -40,7 +40,7 @@ Symbolator is a component diagramming tool for VHDL and Verilog. It will parse H

Produces the following:

.. image:: http://kevinpt.github.io/symbolator/_images/demo_device-demo_device.svg
.. image:: https://hdl.github.io/symbolator/_images/demo_device-demo_device.svg


Symbolator can render to PNG bitmap images or SVG, PDF, PS, and EPS vector images. SVG is the default.
Expand All @@ -52,7 +52,13 @@ Requirements

Symbolator requires Python 3.x, Pycairo, and Pango. Symbolator no longer supports Python 2.x.

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.
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 <https://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 <https://nixos.org/download.html>`_ to build and run symbolator without installing it:

```
nix run github:hdl/symbolator
```

Licensing
---------
Expand All @@ -64,11 +70,11 @@ Download
--------

You can access the Symbolator Git repository from `Github
<https://github.com/kevinpt/symbolator>`_. You can install direct from PyPI with the "pip"
<https://github.com/hdl/symbolator>`_. You can install direct from PyPI with the "pip"
command if you have it available.

Documentation
-------------

The full documentation is available online at the `main Symbolator site
<http://kevinpt.github.io/symbolator/>`_.
<https://hdl.github.io/symbolator/>`_.
42 changes: 42 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{ pkgs ? import <nixpkgs> { } }:
let
hdlparse = pkgs.python3Packages.buildPythonPackage rec {
pname = "hdlparse";
version = "1.0.4";
src = pkgs.fetchFromGitHub {
owner = "hdl";
repo = "pyHDLParser";
rev = "e1153ace8ca1e25f9fb53350c41058ef8eb8dacf";
sha256 = "sha256-XpOcQ801blKfQYLgZ4vDusZ8OkND0KmKxYUWzWKl/MM="; # TODO
};
};
in
with pkgs;
python3Packages.buildPythonPackage rec {
name = "symbolator";
version = "1.0.2";
src = ./.;
nativeBuildInputs = [ wrapGAppsHook gobject-introspection ];

propagatedBuildInputs = [
pango
hdlparse
python3Packages.pygobject3
python3Packages.pycairo
python3Packages.setuptools
python3Packages.six
python3Packages.docutils
python3Packages.sphinx
];

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 = "https://hdl.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;
}
);
}