depot/third_party/nixpkgs/pkgs/applications/editors/molsketch/default.nix
Default email 159e378cbb Project import generated by Copybara.
GitOrigin-RevId: c04d5652cfa9742b1d519688f65d1bbccea9eb7e
2024-09-19 17:19:46 +03:00

59 lines
1.3 KiB
Nix

{ lib
, stdenv
, fetchurl
, cmake
, pkg-config
, qttools
, wrapQtAppsHook
, hicolor-icon-theme
, openbabel
, desktop-file-utils
}:
stdenv.mkDerivation rec {
pname = "molsketch";
version = "0.8.1";
src = fetchurl {
url = "mirror://sourceforge/molsketch/Molsketch-${version}-src.tar.gz";
hash = "sha256-6wFvl3Aktv8RgEdI2ENsKallKlYy/f8Tsm5C0FB/igI=";
};
patches = [
./openbabel.patch
];
# 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"
'';
cmakeFlags = [
"-DMSK_PREFIX=${placeholder "out"}"
];
postFixup = ''
ln -s $out/lib/molsketch/* $out/lib/.
'';
nativeBuildInputs = [ cmake pkg-config qttools wrapQtAppsHook ];
buildInputs = [
hicolor-icon-theme
openbabel
desktop-file-utils
];
meta = with lib; {
description = "2D molecule editor";
homepage = "https://sourceforge.net/projects/molsketch/";
license = licenses.gpl2Plus;
maintainers = [ maintainers.moni ];
mainProgram = "molsketch";
platforms = platforms.unix;
};
}