nixpkgs/pkgs/applications/misc/opencpn/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

140 lines
2.4 KiB
Nix
Raw Normal View History

2022-10-26 20:11:00 +03:00
{ stdenv
, lib
2022-12-27 08:28:30 +03:00
, AppKit
, DarwinTools
2022-05-03 23:14:11 +03:00
, alsa-utils
, at-spi2-core
, cmake
, curl
, dbus
, fetchFromGitHub
2022-10-26 20:11:00 +03:00
, fetchpatch
2022-05-03 23:14:11 +03:00
, flac
, gtk3
, jasper
, libGLU
, libarchive
, libdatrie
, libelf
2022-06-29 22:54:36 +03:00
, libepoxy
2022-05-03 23:14:11 +03:00
, libexif
, libogg
, libopus
, libselinux
, libsepol
, libsndfile
, libthai
, libunarr
2022-07-31 06:48:06 +03:00
, libusb1
2022-05-03 23:14:11 +03:00
, libvorbis
, libxkbcommon
, lsb-release
, lz4
2022-10-26 20:11:00 +03:00
, makeWrapper
2022-05-03 23:14:11 +03:00
, pcre
, pkg-config
, portaudio
, sqlite
, tinyxml
, udev
, util-linux
2022-10-26 20:11:00 +03:00
, wxGTK32
2022-05-03 23:14:11 +03:00
, xorg
}:
2016-03-29 09:31:56 +03:00
stdenv.mkDerivation rec {
2022-05-03 23:14:11 +03:00
pname = "opencpn";
version = "5.6.2";
2016-03-29 09:31:56 +03:00
src = fetchFromGitHub {
owner = "OpenCPN";
repo = "OpenCPN";
2022-05-03 23:14:11 +03:00
rev = "Release_${version}";
hash = "sha256-sNZYf/2gtjRrrGPuazVnKTgcuIQpKPazhexqlK21T4g=";
2016-03-29 09:31:56 +03:00
};
2022-10-26 20:11:00 +03: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 [
2022-12-27 08:28:30 +03:00
DarwinTools
2022-10-26 20:11:00 +03:00
makeWrapper
];
2022-05-03 23:14:11 +03:00
buildInputs = [
at-spi2-core
curl
dbus
flac
2022-12-27 08:28:30 +03:00
] ++ lib.optionals (stdenv.isDarwin && stdenv.isx86_64) [
# gtk3 propagates AppKit from the 10.12 SDK
AppKit
] ++ [
2022-05-03 23:14:11 +03:00
gtk3
jasper
libGLU
libarchive
libdatrie
libelf
2022-06-29 22:54:36 +03:00
libepoxy
2022-05-03 23:14:11 +03:00
libexif
libogg
libopus
libsndfile
libthai
libunarr
2022-07-31 06:48:06 +03:00
libusb1
2022-05-03 23:14:11 +03:00
libvorbis
libxkbcommon
lz4
pcre
portaudio
sqlite
tinyxml
2022-10-26 20:11:00 +03:00
wxGTK32
] ++ lib.optionals stdenv.isLinux [
alsa-utils
libselinux
libsepol
2022-05-03 23:14:11 +03:00
udev
util-linux
xorg.libXdmcp
xorg.libXtst
2016-03-29 09:31:56 +03:00
];
2022-05-03 23:14:11 +03:00
cmakeFlags = [ "-DOCPN_BUNDLE_DOCS=true" ];
2022-10-26 20:11:00 +03:00
NIX_CFLAGS_COMPILE = lib.optionals (!stdenv.hostPlatform.isx86) [
"-DSQUISH_USE_SSE=0"
];
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-05-03 23:14:11 +03:00
doCheck = true;
meta = with lib; {
2016-03-29 09:31:56 +03:00
description = "A concise ChartPlotter/Navigator";
2022-05-03 23:14:11 +03:00
maintainers = with maintainers; [ kragniz lovesegfault ];
2022-10-26 20:11:00 +03:00
platforms = platforms.unix;
license = licenses.gpl2Plus;
homepage = "https://opencpn.org/";
2016-03-29 09:31:56 +03:00
};
}