naja: 0.2.1 -> 0.2.2 (#430692)

This commit is contained in:
Cosima Neidahl
2025-08-04 16:41:41 +02:00
committed by GitHub
+26 -17
View File
@@ -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 { };