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
|
2024-02-07 01:22:34 +00:00
|
|
|
, elfutils
|
2022-04-27 09:35:20 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, flac
|
|
|
|
, gtk3
|
2024-02-07 01:22:34 +00:00
|
|
|
, glew
|
|
|
|
, gtest
|
2022-04-27 09:35:20 +00:00
|
|
|
, jasper
|
2024-02-07 01:22:34 +00:00
|
|
|
, lame
|
2022-04-27 09:35:20 +00:00
|
|
|
, libGLU
|
|
|
|
, libarchive
|
|
|
|
, libdatrie
|
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
|
2024-02-07 01:22:34 +00:00
|
|
|
, libmpg123
|
2022-10-30 15:09:59 +00:00
|
|
|
, makeWrapper
|
2022-04-27 09:35:20 +00:00
|
|
|
, pcre
|
2024-02-07 01:22:34 +00:00
|
|
|
, pcre2
|
2022-04-27 09:35:20 +00:00
|
|
|
, pkg-config
|
|
|
|
, portaudio
|
2024-02-07 01:22:34 +00:00
|
|
|
, rapidjson
|
2022-04-27 09:35:20 +00:00
|
|
|
, 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
|
|
|
|
2024-02-07 01:22:34 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2022-04-27 09:35:20 +00:00
|
|
|
pname = "opencpn";
|
2024-02-07 01:22:34 +00:00
|
|
|
version = "5.8.4";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "OpenCPN";
|
|
|
|
repo = "OpenCPN";
|
2024-02-07 01:22:34 +00:00
|
|
|
rev = "Release_${finalAttrs.version}";
|
|
|
|
hash = "sha256-axRI3sssj2Q6IBfIeyvOa494b0EgKFP+lFL/QrGIybQ=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-10-30 15:09:59 +00:00
|
|
|
postPatch = lib.optionalString stdenv.isDarwin ''
|
2024-02-07 01:22:34 +00:00
|
|
|
sed -i '/fixup_bundle/d; /NO_DEFAULT_PATH/d' CMakeLists.txt
|
2022-10-30 15:09:59 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
pkg-config
|
2024-02-07 01:22:34 +00:00
|
|
|
gtest
|
2022-10-30 15:09:59 +00:00
|
|
|
] ++ 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) [
|
|
|
|
AppKit
|
|
|
|
] ++ [
|
2022-04-27 09:35:20 +00:00
|
|
|
gtk3
|
2024-02-07 01:22:34 +00:00
|
|
|
glew
|
2022-04-27 09:35:20 +00:00
|
|
|
jasper
|
|
|
|
libGLU
|
|
|
|
libarchive
|
|
|
|
libdatrie
|
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
|
2024-02-07 01:22:34 +00:00
|
|
|
libmpg123
|
2022-04-27 09:35:20 +00:00
|
|
|
pcre
|
2024-02-07 01:22:34 +00:00
|
|
|
pcre2
|
2022-04-27 09:35:20 +00:00
|
|
|
portaudio
|
2024-02-07 01:22:34 +00:00
|
|
|
rapidjson
|
2022-04-27 09:35:20 +00:00
|
|
|
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
|
|
|
util-linux
|
|
|
|
xorg.libXdmcp
|
|
|
|
xorg.libXtst
|
2024-04-21 15:54:59 +00:00
|
|
|
] ++ lib.optionals (lib.meta.availableOn stdenv.hostPlatform elfutils) [
|
|
|
|
elfutils
|
2024-02-07 01:22:34 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
lame
|
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; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "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/";
|
|
|
|
};
|
2024-02-07 01:22:34 +00:00
|
|
|
})
|