2022-12-30 15:04:28 +01:00
|
|
|
{ lib
|
2024-02-27 18:23:37 +01:00
|
|
|
, stdenv
|
2022-12-30 15:04:28 +01:00
|
|
|
, fetchurl
|
|
|
|
, cmake
|
|
|
|
, pkg-config
|
2023-07-29 12:57:50 +02:00
|
|
|
, qttools
|
2023-06-29 10:53:59 +02:00
|
|
|
, wrapQtAppsHook
|
2022-12-30 15:04:28 +01:00
|
|
|
, hicolor-icon-theme
|
|
|
|
, openbabel
|
|
|
|
, desktop-file-utils
|
|
|
|
}:
|
|
|
|
|
2024-02-27 18:23:37 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2022-12-30 15:04:28 +01:00
|
|
|
pname = "molsketch";
|
2024-02-27 18:23:37 +01:00
|
|
|
version = "0.8.1";
|
2022-12-30 15:04:28 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://sourceforge/molsketch/Molsketch-${version}-src.tar.gz";
|
2024-02-27 18:23:37 +01:00
|
|
|
hash = "sha256-6wFvl3Aktv8RgEdI2ENsKallKlYy/f8Tsm5C0FB/igI=";
|
2022-12-30 15:04:28 +01:00
|
|
|
};
|
|
|
|
|
2024-02-14 11:22:49 +01:00
|
|
|
patches = [
|
|
|
|
./openbabel.patch
|
|
|
|
];
|
|
|
|
|
2023-06-29 10:53:59 +02:00
|
|
|
# uses C++17 APIs like std::transform_reduce
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace molsketch/CMakeLists.txt \
|
|
|
|
--replace "CXX_STANDARD 14" "CXX_STANDARD 17"
|
|
|
|
substituteInPlace libmolsketch/CMakeLists.txt \
|
|
|
|
--replace "CXX_STANDARD 14" "CXX_STANDARD 17"
|
|
|
|
substituteInPlace obabeliface/CMakeLists.txt \
|
|
|
|
--replace "CXX_STANDARD 14" "CXX_STANDARD 17"
|
|
|
|
'';
|
|
|
|
|
2022-12-30 15:04:28 +01:00
|
|
|
preConfigure = ''
|
|
|
|
cmakeFlags="$cmakeFlags -DMSK_PREFIX=$out"
|
|
|
|
'';
|
|
|
|
|
2023-06-29 10:53:59 +02:00
|
|
|
postFixup = ''
|
2024-02-14 12:03:35 +01:00
|
|
|
ln -s $out/lib/molsketch/* $out/lib/.
|
2023-06-29 10:53:59 +02:00
|
|
|
'';
|
|
|
|
|
2023-07-29 12:57:50 +02:00
|
|
|
nativeBuildInputs = [ cmake pkg-config qttools wrapQtAppsHook ];
|
2022-12-30 15:04:28 +01:00
|
|
|
buildInputs = [
|
|
|
|
hicolor-icon-theme
|
|
|
|
openbabel
|
|
|
|
desktop-file-utils
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "2D molecule editor";
|
|
|
|
homepage = "https://sourceforge.net/projects/molsketch/";
|
|
|
|
license = licenses.gpl2Plus;
|
2023-11-17 11:03:27 +01:00
|
|
|
maintainers = [ maintainers.moni ];
|
2023-11-27 02:17:53 +01:00
|
|
|
mainProgram = "molsketch";
|
2024-02-27 18:23:37 +01:00
|
|
|
platforms = platforms.unix;
|
2022-12-30 15:04:28 +01:00
|
|
|
};
|
|
|
|
}
|