211 lines
5.8 KiB
Nix
211 lines
5.8 KiB
Nix
{
|
|
inputs = {
|
|
nixpkgs.url = "nixpkgs/nixos-23.05";
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
linuxcnc-src = {
|
|
#url = "github:LinuxCNC/linuxcnc?ref=v2.8.4"; #requires python2
|
|
url = "github:LinuxCNC/linuxcnc";
|
|
flake = false;
|
|
};
|
|
|
|
yapps-src = {
|
|
url = "github:smurfix/yapps";
|
|
flake = false;
|
|
};
|
|
pangocffi-src = {
|
|
url = "github:leifgehrmann/pangocffi";
|
|
flake = false;
|
|
};
|
|
};
|
|
outputs = { self, nixpkgs, flake-utils, linuxcnc-src, mach-nix, yapps-src, pangocffi-src, ... }:
|
|
flake-utils.lib.eachSystem [
|
|
"x86_64-linux" "i686-linux" "aarch64-linux"
|
|
] (system:
|
|
let
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
yapps = pkgs.python3Packages.buildPythonApplication {
|
|
pname = "yapps";
|
|
version = "1.0";
|
|
#propagatedBuildInputs = [ flask ];
|
|
src = yapps-src;
|
|
};
|
|
#pangocffi = pkgs.python3Packages.buildPythonApplication {
|
|
# pname = "pangocffi";
|
|
# version = "1.0";
|
|
|
|
# nativeBuildInputs = [
|
|
# pkgs.pkg-config
|
|
# pkgs.libffi
|
|
# pkgs.pango.dev
|
|
# pkgs.glib
|
|
# pkgs.python3Packages.setuptools
|
|
# ];
|
|
# propagatedBuildInputs = with pkgs.python3Packages; [
|
|
# cffi
|
|
# pytest
|
|
# setuptools
|
|
|
|
# flake8
|
|
# pytest
|
|
# coverage
|
|
# sphinx
|
|
# sphinx_rtd_theme
|
|
# tox
|
|
# twine
|
|
# ];
|
|
# src = pangocffi-src;
|
|
|
|
# setuptoolsCheckPhase = ''
|
|
# echo "SKIPPING setuptoolsCheckPhase"
|
|
# '';
|
|
#};
|
|
#boostPython = pkgs.boost174.override { python = pkgs.python3; enablePython = true; };
|
|
#boostPython = pkgs.boost16x.override { enablePython = true; };
|
|
boostPython = pkgs.boost.override { python = pkgs.python3; enablePython = true; };
|
|
kernel = pkgs.linux_latest;
|
|
linuxcnc = pkgs.stdenv.mkDerivation {
|
|
|
|
# https://linuxcnc.org/docs/devel/html/code/building-linuxcnc.html
|
|
name = "linuxcnc";
|
|
|
|
src = linuxcnc-src;
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
#preConfigure = ''
|
|
# cd src
|
|
# #./autogen.sh
|
|
#'';
|
|
preAutoreconf = ''
|
|
cd src
|
|
substituteInPlace configure.ac --replace "LOCALEDIR='/usr/share/locale'" "LOCALEDIR='${placeholder "out"}/locale'"
|
|
'';
|
|
|
|
configureFlags = [
|
|
#"prefix=${placeholder "out"}"
|
|
#"bindir=${placeholder "out"}/bin"
|
|
#"KERNELDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
|
|
#"--with-linux-dir=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
|
|
#"LOCALEDIR=${placeholder "out"}"
|
|
"--with-realtime=uspace"
|
|
"--enable-non-distributable=yes"
|
|
"--with-tclConfig=${pkgs.tcl}/lib/tclConfig.sh"
|
|
"--with-tkConfig=${pkgs.tk}/lib/tkConfig.sh"
|
|
"--with-boost-python=boost_python310"
|
|
#"--with-boost-python=${boostPython.dev}/include/boost/"
|
|
#"--with-boost-python=${boostPython}/lib/libboost_python310.so"
|
|
#"PYTHON_LDFLAGS=-L${pkgs.python39Packages.python}/lib"
|
|
];
|
|
|
|
makeFlags = [
|
|
#"prefix=${placeholder "out"}"
|
|
#"prefix="
|
|
"EMC2_RTLIB_DIR=/lib/linuxcnc/modules"
|
|
"SITEPY=/lib/python"
|
|
"bindir=/bin"
|
|
"libdir=/lib"
|
|
"sysconfdir=/etc"
|
|
"moduledir=/lib/linuxcnc/modules"
|
|
"docsdir=/share/doc"
|
|
"mandir=/share/man"
|
|
"includedir=/include"
|
|
# TODO find out what is in ncfiles
|
|
#"ncfilesdir=/NC"
|
|
"ncfilesdir=/share"
|
|
"tcldir=/lib/tcltk"
|
|
"localedir=/locale"
|
|
"datadir=/share"
|
|
];
|
|
|
|
preInstall = ''
|
|
substituteInPlace Makefile --replace 'chown' '#chown'
|
|
'';
|
|
|
|
installFlags = [
|
|
#"bindir=/bin"
|
|
"INSTALL=install"
|
|
"DESTDIR=${placeholder "out"}"
|
|
"SETUID=install"
|
|
];
|
|
|
|
nativeBuildInputs = with pkgs; [
|
|
autoreconfHook
|
|
pkg-config
|
|
#wrapGAppsHook
|
|
gobject-introspection
|
|
makeWrapper
|
|
];
|
|
#nativeBuildInputs = [ pkgs.pkg-config ];
|
|
postBuild = ''
|
|
substituteInPlace ../scripts/linuxcnc --replace 'wish' '${pkgs.tk}/bin/wish'
|
|
'';
|
|
buildInputs = with pkgs; [
|
|
(python3.withPackages
|
|
(ps: with ps; [ boostPython ]))
|
|
|
|
libtirpc
|
|
udev
|
|
libmodbus
|
|
libusb
|
|
glib
|
|
gtk3.dev
|
|
gtk2.dev
|
|
psmisc
|
|
|
|
yapps
|
|
|
|
intltool
|
|
|
|
boostPython
|
|
boostPython.dev
|
|
#python3Packages.boost
|
|
#python3Packages.boost.dev
|
|
#python3Packages.eigenpy
|
|
#pkgs.python39Packages.python
|
|
|
|
tcl
|
|
tclx
|
|
tk
|
|
tkimg
|
|
bwidget
|
|
|
|
python3Packages.pygobject3
|
|
|
|
readline.dev
|
|
|
|
python3Packages.tkinter
|
|
|
|
libGLU
|
|
|
|
xorg.libXmu.dev
|
|
ps
|
|
sysvtools
|
|
util-linux
|
|
gettext
|
|
asciidoc
|
|
|
|
libepoxy
|
|
#tclreadline
|
|
#pkgs.python3Packages.pygobject3.dev
|
|
#pkgs.python3Packages.gst-python
|
|
#pangocffi
|
|
#pkgs.pango.dev
|
|
|
|
#pkgs.python3Packages.pyxdg
|
|
#pkgs.python3Packages.xcffib
|
|
#pkgs.python3Packages.cairocffi
|
|
#pkgs.python3Packages.manimpango
|
|
|
|
];
|
|
|
|
};
|
|
|
|
in
|
|
{
|
|
#packages.default = pkgs.tk;
|
|
packages.default = linuxcnc;
|
|
packages.linuxcnc = linuxcnc;
|
|
}
|
|
);
|
|
}
|