From 237a9866c52e7942934670ddb6d159e5ba64c5da Mon Sep 17 00:00:00 2001 From: Nicolas Hiillos Date: Tue, 22 Aug 2023 16:14:19 +0300 Subject: [PATCH] Mostly fix build --- flake.nix | 86 ++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 57 insertions(+), 29 deletions(-) diff --git a/flake.nix b/flake.nix index bd9b85b..474bd36 100644 --- a/flake.nix +++ b/flake.nix @@ -29,38 +29,40 @@ #propagatedBuildInputs = [ flask ]; src = yapps-src; }; - pangocffi = pkgs.python3Packages.buildPythonApplication { - pname = "pangocffi"; - version = "1.0"; + #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 + # 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; + # flake8 + # pytest + # coverage + # sphinx + # sphinx_rtd_theme + # tox + # twine + # ]; + # src = pangocffi-src; - setuptoolsCheckPhase = '' - echo "SKIPPING setuptoolsCheckPhase" - ''; - }; + # setuptoolsCheckPhase = '' + # echo "SKIPPING setuptoolsCheckPhase" + # ''; + #}; #boostPython = pkgs.boost174.override { python = pkgs.python3; enablePython = true; }; - boostPython = pkgs.boost174.override { 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 @@ -76,17 +78,33 @@ #''; preAutoreconf = '' cd src + substituteInPlace configure.ac --replace "LOCALEDIR='/usr/share/locale'" "LOCALEDIR='${placeholder "out"}/locale'" ''; configureFlags = [ + "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" ]; + preInstall = '' + substituteInPlace Makefile --replace 'chown' '#chown' + ''; + + installFlags = [ + "INSTALL=install" + #"DESTDIR=${placeholder "out"}" + "SETUID=install" + ]; + nativeBuildInputs = with pkgs; [ autoreconfHook pkg-config @@ -94,7 +112,14 @@ gobject-introspection ]; #nativeBuildInputs = [ pkgs.pkg-config ]; + postInstall = '' + ls $out/bin + substituteInPlace $out/bin/linuxcnc --replace 'wish' '${pkgs.tk}/bin/wish' + ''; buildInputs = with pkgs; [ + (python3.withPackages + (ps: with ps; [ boostPython ])) + libtirpc udev libmodbus @@ -117,7 +142,7 @@ tcl tclx - tk.dev + tk tkimg bwidget @@ -133,7 +158,10 @@ ps sysvtools util-linux + gettext + asciidoc + libepoxy #tclreadline #pkgs.python3Packages.pygobject3.dev #pkgs.python3Packages.gst-python