feat: add flake
This commit is contained in:
parent
517ca1194d
commit
a4d29644f7
4 changed files with 143 additions and 1 deletions
37
README.md
37
README.md
|
@ -31,3 +31,40 @@ image inspired by the
|
|||
```
|
||||
cargo run --example clipping -- --help # run the examples/clipping
|
||||
```
|
||||
# How to Build (with flakes)
|
||||
|
||||
```shell
|
||||
nix build
|
||||
```
|
||||
or (if you haven't enabled flakes yet)
|
||||
|
||||
``` shell
|
||||
nix-shell -p nixFlake --run "nix build"
|
||||
```
|
||||
|
||||
# How to us it (with flakes)
|
||||
|
||||
``` nix
|
||||
{
|
||||
description = "example usage";
|
||||
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-21.05";
|
||||
inputs.polygon-art.url = "git+https://git.ingolf-wagner.de/palo/polygon-art.git";
|
||||
inputs.polygon-art.inputs.nixpkgs.follows = "nixpkgs";
|
||||
outputs = { self, nixpkgs, polygon-art, ... }: {
|
||||
nixosConfigurations.example = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
({ pkgs, ... }: {
|
||||
nixpkgs.overlays = [
|
||||
(_self: _super: {
|
||||
polygon-art = polygon-art.packages.${pkgs.system};
|
||||
})
|
||||
];
|
||||
environment.systemPackages = [ pkgs.polygon-art.polygon-art ];
|
||||
})
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
|
|
47
default.nix
Normal file
47
default.nix
Normal file
|
@ -0,0 +1,47 @@
|
|||
{ rustPlatform,
|
||||
fetchgit,
|
||||
lib,
|
||||
cairo,
|
||||
geos,
|
||||
clipper,
|
||||
clang,
|
||||
pkg-config,
|
||||
cmake,
|
||||
openssl,
|
||||
llvmPackages,
|
||||
... }:
|
||||
|
||||
rustPlatform.buildRustPackage {
|
||||
|
||||
pname = "polygon-art";
|
||||
|
||||
version = "1.0.0";
|
||||
|
||||
# nix-prefetch-git-rendered --rev refs/heads/develop https://git.ingolf-wagner.de/palo/polygon-art.git
|
||||
#src = fetchgit {
|
||||
# url = "https://git.ingolf-wagner.de/palo/polygon-art.git";
|
||||
# rev = "dfb6e0789ec67ee649050ad3b16d8b6a6b38955d";
|
||||
# sha256 = "0iqmikvl93pazxfd120hcr0waxav7zy6px5kmdqxifrjgdbda9xx";
|
||||
#};
|
||||
src = ./.;
|
||||
|
||||
#cargoSha256 = "05rkn8iihj4j9k179xx7wn2a07hxks050raj6fbxmj6gdx6aj170";
|
||||
cargoSha256 = "0sgk4hw77cxqbqzd258fz67r7fpjblkm7cqh14n5f1c43y8vgxa0";
|
||||
verifyCargoDeps = true;
|
||||
|
||||
# Needed so bindgen can find libclang.so
|
||||
LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib";
|
||||
|
||||
buildInputs = [ cairo geos clipper openssl ];
|
||||
|
||||
nativeBuildInputs =
|
||||
[ cmake llvmPackages.clang llvmPackages.libclang pkg-config ];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Framework with examples to generate plotter friendly SVGs";
|
||||
homepage = "https://git.ingolf-wagner.de/palo/polygon-art.git";
|
||||
license = licenses.gpl3Plus;
|
||||
maintainers = [ maintainers.mrVanDalo ];
|
||||
};
|
||||
}
|
||||
|
41
flake.lock
Normal file
41
flake.lock
Normal file
|
@ -0,0 +1,41 @@
|
|||
{
|
||||
"nodes": {
|
||||
"flake-utils": {
|
||||
"locked": {
|
||||
"lastModified": 1631561581,
|
||||
"narHash": "sha256-3VQMV5zvxaVLvqqUrNz3iJelLw30mIVSfZmAaauM3dA=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "7e5bf3925f6fbdfaf50a2a7ca0be2879c4261d19",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1632855891,
|
||||
"narHash": "sha256-crW76mt9/kbUBiKy/KiSnsQ9JEYgD3StDuYAMVkTbM0=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "73086069ebd402e85eaa39c06aef33c2b917f532",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"id": "nixpkgs",
|
||||
"type": "indirect"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
17
flake.nix
Normal file
17
flake.nix
Normal file
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
description = "Framework with examples to generate plotter friendly SVGs";
|
||||
|
||||
#inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-21.05";
|
||||
inputs.flake-utils.url = "github:numtide/flake-utils";
|
||||
|
||||
outputs = { self, nixpkgs, flake-utils , ... }:
|
||||
flake-utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
polygon-art = (pkgs.callPackage ./default.nix {});
|
||||
in {
|
||||
packages.polygon-art = polygon-art;
|
||||
defaultPackage = polygon-art;
|
||||
}
|
||||
);
|
||||
}
|
Loading…
Reference in a new issue