first
This commit is contained in:
commit
6a66b91471
2 changed files with 193 additions and 0 deletions
42
flake.lock
Normal file
42
flake.lock
Normal file
|
@ -0,0 +1,42 @@
|
|||
{
|
||||
"nodes": {
|
||||
"flake-utils": {
|
||||
"locked": {
|
||||
"lastModified": 1667395993,
|
||||
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1670772952,
|
||||
"narHash": "sha256-b7V3cGtMNcQ5c6hwRqqX+eIuNUj+O3orsb64BKPR9yc=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "dfef2e61107dc19c211ead99a5a61374ad8317f4",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"id": "nixpkgs",
|
||||
"ref": "nixos-22.11",
|
||||
"type": "indirect"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
151
flake.nix
Normal file
151
flake.nix
Normal file
|
@ -0,0 +1,151 @@
|
|||
{
|
||||
description = "PicFrame";
|
||||
|
||||
inputs = {
|
||||
nixpkgs = {
|
||||
url = "nixpkgs/nixos-22.11";
|
||||
};
|
||||
flake-utils = {
|
||||
url = "github:numtide/flake-utils";
|
||||
};
|
||||
};
|
||||
outputs = { self, nixpkgs, flake-utils, ... }@inputs:
|
||||
flake-utils.lib.eachDefaultSystem
|
||||
(system:
|
||||
let
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
};
|
||||
in
|
||||
{
|
||||
packages = {
|
||||
picframe =
|
||||
let
|
||||
pname = "picframe";
|
||||
version = "2022.12.15";
|
||||
in
|
||||
pkgs.python3.pkgs.buildPythonApplication {
|
||||
inherit pname version;
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "helgeerbe";
|
||||
repo = pname;
|
||||
rev = version;
|
||||
sha256 = "sha256-RtQGPeMmGh5b9YWkT00idWi8FGI9ycBuONeoAI6AuE4=";
|
||||
};
|
||||
propagatedBuildInputs = [
|
||||
self.packages.${system}.iptcinfo3
|
||||
self.packages.${system}.ninepatch
|
||||
self.packages.${system}.pi-heif
|
||||
self.packages.${system}.pi3d
|
||||
pkgs.python3Packages.defusedxml
|
||||
pkgs.python3Packages.numpy
|
||||
pkgs.python3Packages.paho-mqtt
|
||||
pkgs.python3Packages.pillow
|
||||
pkgs.python3Packages.pyyaml
|
||||
];
|
||||
buildInputs = [
|
||||
pkgs.python3Packages.pytest
|
||||
];
|
||||
};
|
||||
iptcinfo3 =
|
||||
let
|
||||
pname = "IPTCInfo3";
|
||||
version = "2.1.4";
|
||||
in
|
||||
pkgs.python3.pkgs.buildPythonApplication {
|
||||
inherit pname version;
|
||||
src = pkgs.python3Packages.fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "sha256-4k+e00VgJCX2rzfk+bv/b+welXCB3U+8WvkqifiZyWM=";
|
||||
};
|
||||
};
|
||||
pi-heif =
|
||||
let
|
||||
pname = "pi_heif";
|
||||
version = "0.8.0";
|
||||
in
|
||||
pkgs.python3.pkgs.buildPythonApplication {
|
||||
inherit pname version;
|
||||
src = pkgs.python3Packages.fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "sha256-IN8FPTKDD7yqrrMidJIcxkUNAmvCeCmcYSYCjh3SD6E=";
|
||||
};
|
||||
propagatedBuildInputs = [
|
||||
pkgs.python3Packages.pillow
|
||||
pkgs.python3Packages.cffi
|
||||
pkgs.libheif
|
||||
];
|
||||
};
|
||||
ninepatch =
|
||||
let
|
||||
pname = "ninepatch";
|
||||
version = "0.1.22";
|
||||
in
|
||||
pkgs.python3.pkgs.buildPythonApplication {
|
||||
inherit pname version;
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "vindolin";
|
||||
repo = pname;
|
||||
rev = "e1893ae84436c8b0b23dc4fc02f2ae6370945622";
|
||||
sha256 = "sha256-q5NuBs1Is4UHaMED7Cl2yYYKwpg5WngGcm2SY4+YYlM=";
|
||||
};
|
||||
propagatedBuildInputs = [
|
||||
pkgs.python3Packages.pillow
|
||||
];
|
||||
};
|
||||
pi3d =
|
||||
let
|
||||
pname = "pi3d";
|
||||
version = "2.49";
|
||||
in
|
||||
pkgs.python3.pkgs.buildPythonApplication {
|
||||
inherit pname version;
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "tipam";
|
||||
repo = pname;
|
||||
rev = "1f1c822dc3ac58344ad2d5468978d62e51710df4";
|
||||
sha256 = "sha256-6FMz04IBQabnuGZ9IGJOeqH/5xHH6BZN+N6f+cT2bv8=";
|
||||
|
||||
};
|
||||
propagatedBuildInputs = [
|
||||
pkgs.python3Packages.pillow
|
||||
pkgs.python3Packages.numpy
|
||||
pkgs.xorg.libX11
|
||||
pkgs.libGL
|
||||
pkgs.xorg.libXcomposite
|
||||
];
|
||||
doCheck = false;
|
||||
postPatch = ''
|
||||
substituteInPlace pyxlib/xlib.py \
|
||||
--replace \
|
||||
"find_library('X11')" \
|
||||
'"${pkgs.xorg.libX11}/lib/libX11.so"'
|
||||
substituteInPlace pyxlib/glx.py \
|
||||
--replace \
|
||||
"find_library('GL')" \
|
||||
'"${pkgs.libGL}/lib/libGL.so"' \
|
||||
--replace \
|
||||
"find_library('GLX')" \
|
||||
'"${pkgs.libGL}/lib/libGLX.so"'
|
||||
substituteInPlace pyxlib/xcomposite.py \
|
||||
--replace \
|
||||
"'libXcomposite.so.1'" \
|
||||
'"${pkgs.xorg.libXcomposite}/lib/libXcomposite.so"'
|
||||
substituteInPlace pyxlib/xfixes.py \
|
||||
--replace \
|
||||
"'libXfixes.so.3'" \
|
||||
'"${pkgs.xorg.libXfixes}/lib/libXfixes.so"'
|
||||
substituteInPlace pi3d/constants/__init__.py \
|
||||
--replace \
|
||||
"find_library('GLESv2')" \
|
||||
'"${pkgs.libGL}/lib/libGLESv2.so"' \
|
||||
--replace \
|
||||
"find_library('EGL')" \
|
||||
'"${pkgs.libGL}/lib/libEGL.so"'
|
||||
'';
|
||||
};
|
||||
};
|
||||
default = self.packages.${system}.picframe;
|
||||
}
|
||||
);
|
||||
}
|
Loading…
Reference in a new issue