2022-10-30 15:09:59 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
2023-01-11 07:51:40 +00:00
|
|
|
, AppKit
|
|
|
|
, DarwinTools
|
2022-04-27 09:35:20 +00:00
|
|
|
, alsa-utils
|
|
|
|
, at-spi2-core
|
|
|
|
, cmake
|
|
|
|
, curl
|
|
|
|
, dbus
|
|
|
|
, fetchFromGitHub
|
2022-10-30 15:09:59 +00:00
|
|
|
, fetchpatch
|
2022-04-27 09:35:20 +00:00
|
|
|
, flac
|
|
|
|
, gtk3
|
|
|
|
, jasper
|
|
|
|
, libGLU
|
|
|
|
, libarchive
|
|
|
|
, libdatrie
|
|
|
|
, libelf
|
2022-07-14 12:49:19 +00:00
|
|
|
, libepoxy
|
2022-04-27 09:35:20 +00:00
|
|
|
, libexif
|
|
|
|
, libogg
|
|
|
|
, libopus
|
|
|
|
, libselinux
|
|
|
|
, libsepol
|
|
|
|
, libsndfile
|
|
|
|
, libthai
|
|
|
|
, libunarr
|
2022-08-12 12:06:08 +00:00
|
|
|
, libusb1
|
2022-04-27 09:35:20 +00:00
|
|
|
, libvorbis
|
|
|
|
, libxkbcommon
|
|
|
|
, lsb-release
|
|
|
|
, lz4
|
2022-10-30 15:09:59 +00:00
|
|
|
, makeWrapper
|
2022-04-27 09:35:20 +00:00
|
|
|
, pcre
|
|
|
|
, pkg-config
|
|
|
|
, portaudio
|
|
|
|
, sqlite
|
|
|
|
, tinyxml
|
|
|
|
, udev
|
|
|
|
, util-linux
|
2022-10-30 15:09:59 +00:00
|
|
|
, wxGTK32
|
2022-04-27 09:35:20 +00:00
|
|
|
, xorg
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2022-04-27 09:35:20 +00:00
|
|
|
pname = "opencpn";
|
|
|
|
version = "5.6.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "OpenCPN";
|
|
|
|
repo = "OpenCPN";
|
2022-04-27 09:35:20 +00:00
|
|
|
rev = "Release_${version}";
|
|
|
|
hash = "sha256-sNZYf/2gtjRrrGPuazVnKTgcuIQpKPazhexqlK21T4g=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-10-30 15:09:59 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/OpenCPN/OpenCPN/commit/30fa16850ba97d3df0622273947e3e3975b8e6c0.patch";
|
|
|
|
sha256 = "sha256-Sb4FE9QJA5kMJi52/x1Az6rMTS3WSURPx4QAhcv2j9E=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = lib.optionalString stdenv.isDarwin ''
|
|
|
|
sed -i '/fixup_bundle/d' CMakeLists.txt
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
pkg-config
|
|
|
|
] ++ lib.optionals stdenv.isLinux [
|
|
|
|
lsb-release
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
2023-01-11 07:51:40 +00:00
|
|
|
DarwinTools
|
2022-10-30 15:09:59 +00:00
|
|
|
makeWrapper
|
|
|
|
];
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
buildInputs = [
|
|
|
|
at-spi2-core
|
|
|
|
curl
|
|
|
|
dbus
|
|
|
|
flac
|
2023-01-11 07:51:40 +00:00
|
|
|
] ++ lib.optionals (stdenv.isDarwin && stdenv.isx86_64) [
|
|
|
|
# gtk3 propagates AppKit from the 10.12 SDK
|
|
|
|
AppKit
|
|
|
|
] ++ [
|
2022-04-27 09:35:20 +00:00
|
|
|
gtk3
|
|
|
|
jasper
|
|
|
|
libGLU
|
|
|
|
libarchive
|
|
|
|
libdatrie
|
|
|
|
libelf
|
2022-07-14 12:49:19 +00:00
|
|
|
libepoxy
|
2022-04-27 09:35:20 +00:00
|
|
|
libexif
|
|
|
|
libogg
|
|
|
|
libopus
|
|
|
|
libsndfile
|
|
|
|
libthai
|
|
|
|
libunarr
|
2022-08-12 12:06:08 +00:00
|
|
|
libusb1
|
2022-04-27 09:35:20 +00:00
|
|
|
libvorbis
|
|
|
|
libxkbcommon
|
|
|
|
lz4
|
|
|
|
pcre
|
|
|
|
portaudio
|
|
|
|
sqlite
|
|
|
|
tinyxml
|
2022-10-30 15:09:59 +00:00
|
|
|
wxGTK32
|
|
|
|
] ++ lib.optionals stdenv.isLinux [
|
|
|
|
alsa-utils
|
|
|
|
libselinux
|
|
|
|
libsepol
|
2022-04-27 09:35:20 +00:00
|
|
|
udev
|
|
|
|
util-linux
|
|
|
|
xorg.libXdmcp
|
|
|
|
xorg.libXtst
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
cmakeFlags = [ "-DOCPN_BUNDLE_DOCS=true" ];
|
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = toString (lib.optionals (!stdenv.hostPlatform.isx86) [
|
2022-10-30 15:09:59 +00:00
|
|
|
"-DSQUISH_USE_SSE=0"
|
2023-03-04 12:14:45 +00:00
|
|
|
]);
|
2022-10-30 15:09:59 +00:00
|
|
|
|
|
|
|
postInstall = lib.optionals stdenv.isDarwin ''
|
|
|
|
mkdir -p $out/Applications
|
|
|
|
mv $out/bin/OpenCPN.app $out/Applications
|
|
|
|
makeWrapper $out/Applications/OpenCPN.app/Contents/MacOS/OpenCPN $out/bin/opencpn
|
|
|
|
'';
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A concise ChartPlotter/Navigator";
|
2022-04-27 09:35:20 +00:00
|
|
|
maintainers = with maintainers; [ kragniz lovesegfault ];
|
2022-10-30 15:09:59 +00:00
|
|
|
platforms = platforms.unix;
|
|
|
|
license = licenses.gpl2Plus;
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://opencpn.org/";
|
|
|
|
};
|
|
|
|
}
|