From 0d28386fad7b066d0f07498a4c61ed81ae836ec4 Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Sun, 3 Aug 2025 18:44:18 +0200 Subject: [PATCH] naja: 0.2.1 -> 0.2.2 --- pkgs/by-name/na/naja/package.nix | 43 +++++++++++++++++++------------- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/pkgs/by-name/na/naja/package.nix b/pkgs/by-name/na/naja/package.nix index d56382c003b4..2995a4089267 100644 --- a/pkgs/by-name/na/naja/package.nix +++ b/pkgs/by-name/na/naja/package.nix @@ -10,19 +10,20 @@ flex, pkg-config, python3, + sphinx, tbb_2021, buildPackages, nix-update-script, }: stdenv.mkDerivation (finalAttrs: { pname = "naja"; - version = "0.2.1"; + version = "0.2.2"; src = fetchFromGitHub { owner = "najaeda"; repo = "naja"; tag = "v${finalAttrs.version}"; - hash = "sha256-eKeb6V9u4huesQV4sq9GxIcxO2SVvMrUDeQaObCCags="; + hash = "sha256-cm9MwN60R/K2bL4FWpvusFmb2ENYEYg8NcMVgmeTj0c="; fetchSubmodules = true; }; @@ -32,18 +33,29 @@ stdenv.mkDerivation (finalAttrs: { "dev" ]; + postPatch = '' + # This is a find module, not a config module, so this doesn't make it get automatically picked up by CMake hooks, + # but it's better than dumping it at $out/cmake, and this makes it get moved to dev output + substituteInPlace cmake/CMakeLists.txt \ + --replace-fail 'DESTINATION cmake' 'DESTINATION ''${CMAKE_INSTALL_LIBDIR}/cmake' + + # Fix install location for bne library & headers + # Remove when https://github.com/najaeda/naja/pull/278 merged & in release + substituteInPlace src/bne/CMakeLists.txt \ + --replace-fail 'LIBRARY DESTINATION lib' 'LIBRARY DESTINATION ''${CMAKE_INSTALL_LIBDIR}' \ + --replace-fail 'PUBLIC_HEADER DESTINATION include' 'PUBLIC_HEADER DESTINATION ''${CMAKE_INSTALL_INCLUDEDIR}' + '' # disable building tests for cross build - postPatch = - lib.optionalString (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - substituteInPlace CMakeLists.txt \ - --replace-fail 'enable_testing()' "" \ - --replace-fail 'add_subdirectory(test)' "" - substituteInPlace thirdparty/yosys-liberty/CMakeLists.txt \ - --replace-fail 'add_subdirectory(test)' "" - '' - + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - patchShebangs --build test/test_utils/diff_files.py - ''; + + lib.optionalString (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + substituteInPlace CMakeLists.txt \ + --replace-fail 'enable_testing()' "" \ + --replace-fail 'add_subdirectory(test)' "" + substituteInPlace thirdparty/yosys-liberty/CMakeLists.txt \ + --replace-fail 'add_subdirectory(test)' "" + '' + + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + patchShebangs --build test/test_utils/diff_files.py + ''; strictDeps = true; @@ -53,6 +65,7 @@ stdenv.mkDerivation (finalAttrs: { doxygen flex pkg-config + sphinx ] ++ lib.optionals (stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ python3 # test scripts @@ -74,10 +87,6 @@ stdenv.mkDerivation (finalAttrs: { (lib.cmakeFeature "CAPNPC_CXX_EXECUTABLE" (lib.getExe' buildPackages.capnproto "capnpc-c++")) ]; - postInstall = '' - moveToOutput lib/libnaja_bne.so $lib - ''; - doCheck = true; passthru.updateScript = nix-update-script { };