51 stdenv.mkDerivation (finalAttrs: {
55 src = fetchFromGitHub {
58 rev = "Release_${finalAttrs.version}";
59 hash = "sha256-VuMClQ5k1mTMF5yWstTi9YTF4tEN68acH5OPhjdzIwM=";
62 postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
63 sed -i '/fixup_bundle/d; /NO_DEFAULT_PATH/d' CMakeLists.txt
72 ++ lib.optionals stdenv.hostPlatform.isLinux [
75 ++ lib.optionals stdenv.hostPlatform.isDarwin [
88 ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) [
118 ++ lib.optionals stdenv.hostPlatform.isLinux [
126 ++ lib.optionals (lib.meta.availableOn stdenv.hostPlatform elfutils) [
129 ++ lib.optionals stdenv.hostPlatform.isDarwin [
135 "-DOCPN_BUNDLE_DOCS=true"
137 ++ lib.optionals stdenv.hostPlatform.isLinux [
138 # Override OpenCPN platform detection.
139 "-DOCPN_TARGET_TUPLE=unknown;unknown;${stdenv.hostPlatform.linuxArch}"
142 env.NIX_CFLAGS_COMPILE = toString (
143 lib.optionals (!stdenv.hostPlatform.isx86) [
148 postInstall = lib.optionals stdenv.hostPlatform.isDarwin ''
149 mkdir -p $out/Applications
150 mv $out/bin/OpenCPN.app $out/Applications
151 makeWrapper $out/Applications/OpenCPN.app/Contents/MacOS/OpenCPN $out/bin/opencpn
157 description = "Concise ChartPlotter/Navigator";
158 maintainers = with maintainers; [
162 platforms = platforms.unix;
163 license = licenses.gpl2Plus;
164 homepage = "https://opencpn.org/";