nixpkgs/pkgs/applications/misc/opencpn/default.nix
Ihar Hrachyshka dd0f03a56c treewide: remove usage of deprecated apple_sdk framework stubs
They are not doing anything right now. This is in preparation for their
complete removal from the tree.

Note: several changes that affect the derivation inputs (e.g. removal of
references to stub paths in build instructions) were left out. They will
be cleaned up the next iteration and will require special care.

Note: this PR is a result of a mix of ugly regex (not AST) based
automation and some manual labor. For reference, the regex automation
part was hacked in: https://github.com/booxter/nix-clean-apple_sdk

Signed-off-by: Ihar Hrachyshka <ihar.hrachyshka@gmail.com>
2025-04-19 20:28:20 -04:00

162 lines
2.8 KiB
Nix

{
stdenv,
lib,
DarwinTools,
alsa-utils,
at-spi2-core,
cmake,
curl,
dbus,
elfutils,
fetchFromGitHub,
flac,
gitMinimal,
wrapGAppsHook3,
glew,
gtest,
jasper,
lame,
libGLU,
libarchive,
libdatrie,
libepoxy,
libexif,
libogg,
libopus,
libselinux,
libsepol,
libsndfile,
libthai,
libunarr,
libusb1,
libvorbis,
libxkbcommon,
lsb-release,
lz4,
libmpg123,
makeWrapper,
pcre,
pcre2,
pkg-config,
portaudio,
rapidjson,
sqlite,
tinyxml,
util-linux,
wxGTK32,
xorg,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "opencpn";
version = "5.10.2";
src = fetchFromGitHub {
owner = "OpenCPN";
repo = "OpenCPN";
rev = "Release_${finalAttrs.version}";
hash = "sha256-VuMClQ5k1mTMF5yWstTi9YTF4tEN68acH5OPhjdzIwM=";
};
postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
sed -i '/fixup_bundle/d; /NO_DEFAULT_PATH/d' CMakeLists.txt
'';
nativeBuildInputs =
[
cmake
pkg-config
gtest
wrapGAppsHook3
]
++ lib.optionals stdenv.hostPlatform.isLinux [
lsb-release
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
DarwinTools
makeWrapper
];
buildInputs =
[
at-spi2-core
curl
dbus
flac
gitMinimal
]
++ [
glew
jasper
libGLU
libarchive
libdatrie
libepoxy
libexif
libogg
libopus
libsndfile
libthai
libunarr
libusb1
libvorbis
libxkbcommon
lz4
libmpg123
pcre
pcre2
portaudio
rapidjson
sqlite
tinyxml
wxGTK32
]
++ lib.optionals stdenv.hostPlatform.isLinux [
alsa-utils
libselinux
libsepol
util-linux
xorg.libXdmcp
xorg.libXtst
]
++ lib.optionals (lib.meta.availableOn stdenv.hostPlatform elfutils) [
elfutils
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
lame
];
cmakeFlags =
[
"-DOCPN_BUNDLE_DOCS=true"
]
++ lib.optionals stdenv.hostPlatform.isLinux [
# Override OpenCPN platform detection.
"-DOCPN_TARGET_TUPLE=unknown;unknown;${stdenv.hostPlatform.linuxArch}"
];
env.NIX_CFLAGS_COMPILE = toString (
lib.optionals (!stdenv.hostPlatform.isx86) [
"-DSQUISH_USE_SSE=0"
]
);
postInstall = lib.optionals stdenv.hostPlatform.isDarwin ''
mkdir -p $out/Applications
mv $out/bin/OpenCPN.app $out/Applications
makeWrapper $out/Applications/OpenCPN.app/Contents/MacOS/OpenCPN $out/bin/opencpn
'';
doCheck = true;
meta = with lib; {
description = "Concise ChartPlotter/Navigator";
maintainers = with maintainers; [
kragniz
lovesegfault
];
platforms = platforms.unix;
license = licenses.gpl2Plus;
homepage = "https://opencpn.org/";
};
})